.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel osMotorInit /* 43344 80067F44 27BDFF88 */ addiu $sp, $sp, -0x78 /* 43348 80067F48 AFB00060 */ sw $s0, 0x60($sp) /* 4334C 80067F4C 00808021 */ addu $s0, $a0, $zero /* 43350 80067F50 AFB20068 */ sw $s2, 0x68($sp) /* 43354 80067F54 00A09021 */ addu $s2, $a1, $zero /* 43358 80067F58 AFB10064 */ sw $s1, 0x64($sp) /* 4335C 80067F5C 00C08821 */ addu $s1, $a2, $zero /* 43360 80067F60 02402021 */ addu $a0, $s2, $zero /* 43364 80067F64 240500FE */ addiu $a1, $zero, 0xfe /* 43368 80067F68 240200FF */ addiu $v0, $zero, 0xff /* 4336C 80067F6C AFBF0070 */ sw $ra, 0x70($sp) /* 43370 80067F70 AFB3006C */ sw $s3, 0x6c($sp) /* 43374 80067F74 AE500004 */ sw $s0, 4($s2) /* 43378 80067F78 AE510008 */ sw $s1, 8($s2) /* 4337C 80067F7C A2420065 */ sb $v0, 0x65($s2) /* 43380 80067F80 0C01A5B4 */ jal osPfsSelectBank /* 43384 80067F84 AE400000 */ sw $zero, ($s2) /* 43388 80067F88 24130002 */ addiu $s3, $zero, 2 /* 4338C 80067F8C 14530003 */ bne $v0, $s3, .L80067F9C /* 43390 80067F90 02402021 */ addu $a0, $s2, $zero /* 43394 80067F94 0C01A5B4 */ jal osPfsSelectBank /* 43398 80067F98 24050080 */ addiu $a1, $zero, 0x80 .L80067F9C: /* 4339C 80067F9C 14400074 */ bnez $v0, .L80068170 /* 433A0 80067FA0 02002021 */ addu $a0, $s0, $zero /* 433A4 80067FA4 02202821 */ addu $a1, $s1, $zero /* 433A8 80067FA8 24060400 */ addiu $a2, $zero, 0x400 /* 433AC 80067FAC 0C01A874 */ jal osContRamRead /* 433B0 80067FB0 27A70010 */ addiu $a3, $sp, 0x10 /* 433B4 80067FB4 50530001 */ beql $v0, $s3, .L80067FBC /* 433B8 80067FB8 24020004 */ addiu $v0, $zero, 4 .L80067FBC: /* 433BC 80067FBC 1440006C */ bnez $v0, .L80068170 /* 433C0 80067FC0 00000000 */ nop /* 433C4 80067FC4 93A3002F */ lbu $v1, 0x2f($sp) /* 433C8 80067FC8 240200FE */ addiu $v0, $zero, 0xfe /* 433CC 80067FCC 10620013 */ beq $v1, $v0, .L8006801C /* 433D0 80067FD0 02402021 */ addu $a0, $s2, $zero /* 433D4 80067FD4 0C01A5B4 */ jal osPfsSelectBank /* 433D8 80067FD8 24050080 */ addiu $a1, $zero, 0x80 /* 433DC 80067FDC 50530001 */ beql $v0, $s3, .L80067FE4 /* 433E0 80067FE0 24020004 */ addiu $v0, $zero, 4 .L80067FE4: /* 433E4 80067FE4 14400062 */ bnez $v0, .L80068170 /* 433E8 80067FE8 02002021 */ addu $a0, $s0, $zero /* 433EC 80067FEC 02202821 */ addu $a1, $s1, $zero /* 433F0 80067FF0 24060400 */ addiu $a2, $zero, 0x400 /* 433F4 80067FF4 0C01A874 */ jal osContRamRead /* 433F8 80067FF8 27A70010 */ addiu $a3, $sp, 0x10 /* 433FC 80067FFC 50530001 */ beql $v0, $s3, .L80068004 /* 43400 80068000 24020004 */ addiu $v0, $zero, 4 .L80068004: /* 43404 80068004 1440005A */ bnez $v0, .L80068170 /* 43408 80068008 00000000 */ nop /* 4340C 8006800C 93A3002F */ lbu $v1, 0x2f($sp) /* 43410 80068010 24020080 */ addiu $v0, $zero, 0x80 /* 43414 80068014 10620003 */ beq $v1, $v0, .L80068024 /* 43418 80068018 00000000 */ nop .L8006801C: /* 4341C 8006801C 0801A05C */ j .L80068170 /* 43420 80068020 2402000B */ addiu $v0, $zero, 0xb .L80068024: /* 43424 80068024 8E420000 */ lw $v0, ($s2) /* 43428 80068028 30420008 */ andi $v0, $v0, 8 /* 4342C 8006802C 1440004E */ bnez $v0, .L80068168 /* 43430 80068030 24020008 */ addiu $v0, $zero, 8 /* 43434 80068034 00111980 */ sll $v1, $s1, 6 /* 43438 80068038 3C02800B */ lui $v0, %hi(D_800B0B30) /* 4343C 8006803C 24420B30 */ addiu $v0, $v0, %lo(D_800B0B30) /* 43440 80068040 00628021 */ addu $s0, $v1, $v0 /* 43444 80068044 24040600 */ addiu $a0, $zero, 0x600 /* 43448 80068048 240200FF */ addiu $v0, $zero, 0xff /* 4344C 8006804C A3A20030 */ sb $v0, 0x30($sp) /* 43450 80068050 24020023 */ addiu $v0, $zero, 0x23 /* 43454 80068054 A3A20031 */ sb $v0, 0x31($sp) /* 43458 80068058 24020001 */ addiu $v0, $zero, 1 /* 4345C 8006805C A3A20032 */ sb $v0, 0x32($sp) /* 43460 80068060 24020003 */ addiu $v0, $zero, 3 /* 43464 80068064 A3A20033 */ sb $v0, 0x33($sp) /* 43468 80068068 240200C0 */ addiu $v0, $zero, 0xc0 /* 4346C 8006806C 0C01B218 */ jal osContAddressCrc /* 43470 80068070 A3A20034 */ sb $v0, 0x34($sp) /* 43474 80068074 12200008 */ beqz $s1, .L80068098 /* 43478 80068078 A3A20035 */ sb $v0, 0x35($sp) /* 4347C 8006807C 1A200006 */ blez $s1, .L80068098 /* 43480 80068080 00001821 */ addu $v1, $zero, $zero .L80068084: /* 43484 80068084 A2000000 */ sb $zero, ($s0) /* 43488 80068088 24630001 */ addiu $v1, $v1, 1 /* 4348C 8006808C 0071102A */ slt $v0, $v1, $s1 /* 43490 80068090 1440FFFC */ bnez $v0, .L80068084 /* 43494 80068094 26100001 */ addiu $s0, $s0, 1 .L80068098: /* 43498 80068098 27A60030 */ addiu $a2, $sp, 0x30 /* 4349C 8006809C 00D01025 */ or $v0, $a2, $s0 /* 434A0 800680A0 30420003 */ andi $v0, $v0, 3 /* 434A4 800680A4 10400017 */ beqz $v0, .L80068104 /* 434A8 800680A8 02003821 */ addu $a3, $s0, $zero /* 434AC 800680AC 27A80050 */ addiu $t0, $sp, 0x50 .L800680B0: /* 434B0 800680B0 88C20000 */ lwl $v0, ($a2) /* 434B4 800680B4 98C20003 */ lwr $v0, 3($a2) /* 434B8 800680B8 88C30004 */ lwl $v1, 4($a2) /* 434BC 800680BC 98C30007 */ lwr $v1, 7($a2) /* 434C0 800680C0 88C40008 */ lwl $a0, 8($a2) /* 434C4 800680C4 98C4000B */ lwr $a0, 0xb($a2) /* 434C8 800680C8 88C5000C */ lwl $a1, 0xc($a2) /* 434CC 800680CC 98C5000F */ lwr $a1, 0xf($a2) /* 434D0 800680D0 A8E20000 */ swl $v0, ($a3) /* 434D4 800680D4 B8E20003 */ swr $v0, 3($a3) /* 434D8 800680D8 A8E30004 */ swl $v1, 4($a3) /* 434DC 800680DC B8E30007 */ swr $v1, 7($a3) /* 434E0 800680E0 A8E40008 */ swl $a0, 8($a3) /* 434E4 800680E4 B8E4000B */ swr $a0, 0xb($a3) /* 434E8 800680E8 A8E5000C */ swl $a1, 0xc($a3) /* 434EC 800680EC B8E5000F */ swr $a1, 0xf($a3) /* 434F0 800680F0 24C60010 */ addiu $a2, $a2, 0x10 /* 434F4 800680F4 14C8FFEE */ bne $a2, $t0, .L800680B0 /* 434F8 800680F8 24E70010 */ addiu $a3, $a3, 0x10 /* 434FC 800680FC 0801A04D */ j .L80068134 /* 43500 80068100 00000000 */ nop .L80068104: /* 43504 80068104 27A80050 */ addiu $t0, $sp, 0x50 .L80068108: /* 43508 80068108 8CC20000 */ lw $v0, ($a2) /* 4350C 8006810C 8CC30004 */ lw $v1, 4($a2) /* 43510 80068110 8CC40008 */ lw $a0, 8($a2) /* 43514 80068114 8CC5000C */ lw $a1, 0xc($a2) /* 43518 80068118 ACE20000 */ sw $v0, ($a3) /* 4351C 8006811C ACE30004 */ sw $v1, 4($a3) /* 43520 80068120 ACE40008 */ sw $a0, 8($a3) /* 43524 80068124 ACE5000C */ sw $a1, 0xc($a3) /* 43528 80068128 24C60010 */ addiu $a2, $a2, 0x10 /* 4352C 8006812C 14C8FFF6 */ bne $a2, $t0, .L80068108 /* 43530 80068130 24E70010 */ addiu $a3, $a3, 0x10 .L80068134: /* 43534 80068134 88C20000 */ lwl $v0, ($a2) /* 43538 80068138 98C20003 */ lwr $v0, 3($a2) /* 4353C 8006813C 80C30004 */ lb $v1, 4($a2) /* 43540 80068140 80C40005 */ lb $a0, 5($a2) /* 43544 80068144 80C50006 */ lb $a1, 6($a2) /* 43548 80068148 A8E20000 */ swl $v0, ($a3) /* 4354C 8006814C B8E20003 */ swr $v0, 3($a3) /* 43550 80068150 A0E30004 */ sb $v1, 4($a3) /* 43554 80068154 A0E40005 */ sb $a0, 5($a3) /* 43558 80068158 A0E50006 */ sb $a1, 6($a3) /* 4355C 8006815C 240200FE */ addiu $v0, $zero, 0xfe /* 43560 80068160 A2020027 */ sb $v0, 0x27($s0) /* 43564 80068164 24020008 */ addiu $v0, $zero, 8 .L80068168: /* 43568 80068168 AE420000 */ sw $v0, ($s2) /* 4356C 8006816C 00001021 */ addu $v0, $zero, $zero .L80068170: /* 43570 80068170 8FBF0070 */ lw $ra, 0x70($sp) /* 43574 80068174 8FB3006C */ lw $s3, 0x6c($sp) /* 43578 80068178 8FB20068 */ lw $s2, 0x68($sp) /* 4357C 8006817C 8FB10064 */ lw $s1, 0x64($sp) /* 43580 80068180 8FB00060 */ lw $s0, 0x60($sp) /* 43584 80068184 03E00008 */ jr $ra /* 43588 80068188 27BD0078 */ addiu $sp, $sp, 0x78 /* 4358C 8006818C 00000000 */ nop