### RAW ASSEMBLY INSTRUCTIONS:

glabel au_sfx_load_sound
/* 26E74 8004BA74 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* 26E78 8004BA78 AFB40028 */  sw        $s4, 0x28($sp)
/* 26E7C 8004BA7C 0080A02D */  daddu     $s4, $a0, $zero
/* 26E80 8004BA80 AFB70034 */  sw        $s7, 0x34($sp)
/* 26E84 8004BA84 00A0B82D */  daddu     $s7, $a1, $zero
/* 26E88 8004BA88 AFBF003C */  sw        $ra, 0x3C($sp)
/* 26E8C 8004BA8C AFBE0038 */  sw        $fp, 0x38($sp)
/* 26E90 8004BA90 AFB60030 */  sw        $s6, 0x30($sp)
/* 26E94 8004BA94 AFB5002C */  sw        $s5, 0x2C($sp)
/* 26E98 8004BA98 AFB30024 */  sw        $s3, 0x24($sp)
/* 26E9C 8004BA9C AFB20020 */  sw        $s2, 0x20($sp)
/* 26EA0 8004BAA0 AFB1001C */  sw        $s1, 0x1C($sp)
/* 26EA4 8004BAA4 AFB00018 */  sw        $s0, 0x18($sp)
/* 26EA8 8004BAA8 96E20000 */  lhu       $v0, 0x0($s7)
/* 26EAC 8004BAAC 0000402D */  daddu     $t0, $zero, $zero
/* 26EB0 8004BAB0 2445FFFF */  addiu     $a1, $v0, -0x1
/* 26EB4 8004BAB4 304923FF */  andi      $t1, $v0, 0x23FF
/* 26EB8 8004BAB8 0040182D */  daddu     $v1, $v0, $zero
/* 26EBC 8004BABC 30422000 */  andi      $v0, $v0, 0x2000
/* 26EC0 8004BAC0 10400020 */  beqz      $v0, .L8004BB44
/* 26EC4 8004BAC4 30A400FF */   andi     $a0, $a1, 0xFF
/* 26EC8 8004BAC8 30A401FF */  andi      $a0, $a1, 0x1FF
/* 26ECC 8004BACC 2C820140 */  sltiu     $v0, $a0, 0x140
/* 26ED0 8004BAD0 10400178 */  beqz      $v0, .L8004C0B4
/* 26ED4 8004BAD4 00041880 */   sll      $v1, $a0, 2
/* 26ED8 8004BAD8 8E82002C */  lw        $v0, 0x2C($s4)
/* 26EDC 8004BADC 00439021 */  addu      $s2, $v0, $v1
/* 26EE0 8004BAE0 96420000 */  lhu       $v0, 0x0($s2)
/* 26EE4 8004BAE4 10400173 */  beqz      $v0, .L8004C0B4
/* 26EE8 8004BAE8 24100007 */   addiu    $s0, $zero, 0x7
/* 26EEC 8004BAEC 3124FFFF */  andi      $a0, $t1, 0xFFFF
/* 26EF0 8004BAF0 24030620 */  addiu     $v1, $zero, 0x620
.L8004BAF4:
/* 26EF4 8004BAF4 02833821 */  addu      $a3, $s4, $v1
/* 26EF8 8004BAF8 94E20096 */  lhu       $v0, 0x96($a3)
/* 26EFC 8004BAFC 1044000F */  beq       $v0, $a0, .L8004BB3C
/* 26F00 8004BB00 2610FFFF */   addiu    $s0, $s0, -0x1
/* 26F04 8004BB04 0601FFFB */  bgez      $s0, .L8004BAF4
/* 26F08 8004BB08 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BB0C:
/* 26F0C 8004BB0C 55000038 */  bnel      $t0, $zero, .L8004BBF0
/* 26F10 8004BB10 0280202D */   daddu    $a0, $s4, $zero
/* 26F14 8004BB14 24100007 */  addiu     $s0, $zero, 0x7
/* 26F18 8004BB18 24030620 */  addiu     $v1, $zero, 0x620
.L8004BB1C:
/* 26F1C 8004BB1C 02833821 */  addu      $a3, $s4, $v1
/* 26F20 8004BB20 8CE20000 */  lw        $v0, 0x0($a3)
/* 26F24 8004BB24 10400010 */  beqz      $v0, .L8004BB68
/* 26F28 8004BB28 2610FFFF */   addiu    $s0, $s0, -0x1
/* 26F2C 8004BB2C 0601FFFB */  bgez      $s0, .L8004BB1C
/* 26F30 8004BB30 2463FF54 */   addiu    $v1, $v1, -0xAC
/* 26F34 8004BB34 08012EFA */  j         .L8004BBE8
/* 26F38 8004BB38 00000000 */   nop
.L8004BB3C:
/* 26F3C 8004BB3C 08012EC3 */  j         .L8004BB0C
/* 26F40 8004BB40 24080001 */   addiu    $t0, $zero, 0x1
.L8004BB44:
/* 26F44 8004BB44 2C8200C0 */  sltiu     $v0, $a0, 0xC0
/* 26F48 8004BB48 14400031 */  bnez      $v0, .L8004BC10
/* 26F4C 8004BB4C 00000000 */   nop
/* 26F50 8004BB50 10C00007 */  beqz      $a2, .L8004BB70
/* 26F54 8004BB54 00C0902D */   daddu    $s2, $a2, $zero
/* 26F58 8004BB58 08012EE5 */  j         .L8004BB94
/* 26F5C 8004BB5C 00000000 */   nop
.L8004BB60:
/* 26F60 8004BB60 08012EF0 */  j         .L8004BBC0
/* 26F64 8004BB64 24080001 */   addiu    $t0, $zero, 0x1
.L8004BB68:
/* 26F68 8004BB68 08012EFA */  j         .L8004BBE8
/* 26F6C 8004BB6C 24080001 */   addiu    $t0, $zero, 0x1
.L8004BB70:
/* 26F70 8004BB70 2522FFFF */  addiu     $v0, $t1, -0x1
/* 26F74 8004BB74 00021203 */  sra       $v0, $v0, 8
/* 26F78 8004BB78 24420004 */  addiu     $v0, $v0, 0x4
/* 26F7C 8004BB7C 00021080 */  sll       $v0, $v0, 2
/* 26F80 8004BB80 02821021 */  addu      $v0, $s4, $v0
/* 26F84 8004BB84 2483FF40 */  addiu     $v1, $a0, -0xC0
/* 26F88 8004BB88 8C42000C */  lw        $v0, 0xC($v0)
/* 26F8C 8004BB8C 00031880 */  sll       $v1, $v1, 2
/* 26F90 8004BB90 00439021 */  addu      $s2, $v0, $v1
.L8004BB94:
/* 26F94 8004BB94 96420000 */  lhu       $v0, 0x0($s2)
/* 26F98 8004BB98 10400146 */  beqz      $v0, .L8004C0B4
/* 26F9C 8004BB9C 24100007 */   addiu    $s0, $zero, 0x7
/* 26FA0 8004BBA0 3124FFFF */  andi      $a0, $t1, 0xFFFF
/* 26FA4 8004BBA4 24030620 */  addiu     $v1, $zero, 0x620
.L8004BBA8:
/* 26FA8 8004BBA8 02833821 */  addu      $a3, $s4, $v1
/* 26FAC 8004BBAC 94E20096 */  lhu       $v0, 0x96($a3)
/* 26FB0 8004BBB0 1044FFEB */  beq       $v0, $a0, .L8004BB60
/* 26FB4 8004BBB4 2610FFFF */   addiu    $s0, $s0, -0x1
/* 26FB8 8004BBB8 0601FFFB */  bgez      $s0, .L8004BBA8
/* 26FBC 8004BBBC 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BBC0:
/* 26FC0 8004BBC0 5500000B */  bnel      $t0, $zero, .L8004BBF0
/* 26FC4 8004BBC4 0280202D */   daddu    $a0, $s4, $zero
/* 26FC8 8004BBC8 24100007 */  addiu     $s0, $zero, 0x7
/* 26FCC 8004BBCC 24030620 */  addiu     $v1, $zero, 0x620
.L8004BBD0:
/* 26FD0 8004BBD0 02833821 */  addu      $a3, $s4, $v1
/* 26FD4 8004BBD4 8CE20000 */  lw        $v0, 0x0($a3)
/* 26FD8 8004BBD8 1040FFE3 */  beqz      $v0, .L8004BB68
/* 26FDC 8004BBDC 2610FFFF */   addiu    $s0, $s0, -0x1
/* 26FE0 8004BBE0 0601FFFB */  bgez      $s0, .L8004BBD0
/* 26FE4 8004BBE4 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BBE8:
/* 26FE8 8004BBE8 11000132 */  beqz      $t0, .L8004C0B4
/* 26FEC 8004BBEC 0280202D */   daddu    $a0, $s4, $zero
.L8004BBF0:
/* 26FF0 8004BBF0 00E0282D */  daddu     $a1, $a3, $zero
/* 26FF4 8004BBF4 0240302D */  daddu     $a2, $s2, $zero
/* 26FF8 8004BBF8 02E0382D */  daddu     $a3, $s7, $zero
/* 26FFC 8004BBFC AFA00010 */  sw        $zero, 0x10($sp)
/* 27000 8004BC00 0C013039 */  jal       au_sfx_play_sound
/* 27004 8004BC04 AFA00014 */   sw       $zero, 0x14($sp)
/* 27008 8004BC08 0801302D */  j         .L8004C0B4
/* 2700C 8004BC0C 00000000 */   nop
.L8004BC10:
/* 27010 8004BC10 10C00005 */  beqz      $a2, .L8004BC28
/* 27014 8004BC14 00C0902D */   daddu    $s2, $a2, $zero
/* 27018 8004BC18 08012F10 */  j         .L8004BC40
/* 2701C 8004BC1C 00000000 */   nop
.L8004BC20:
/* 27020 8004BC20 08012F28 */  j         .L8004BCA0
/* 27024 8004BC24 24080001 */   addiu    $t0, $zero, 0x1
.L8004BC28:
/* 27028 8004BC28 00031182 */  srl       $v0, $v1, 6
/* 2702C 8004BC2C 3042000C */  andi      $v0, $v0, 0xC
/* 27030 8004BC30 02821021 */  addu      $v0, $s4, $v0
/* 27034 8004BC34 8C43000C */  lw        $v1, 0xC($v0)
/* 27038 8004BC38 00041080 */  sll       $v0, $a0, 2
/* 2703C 8004BC3C 00629021 */  addu      $s2, $v1, $v0
.L8004BC40:
/* 27040 8004BC40 96420000 */  lhu       $v0, 0x0($s2)
/* 27044 8004BC44 1040011B */  beqz      $v0, .L8004C0B4
/* 27048 8004BC48 00000000 */   nop
/* 2704C 8004BC4C 96440002 */  lhu       $a0, 0x2($s2)
/* 27050 8004BC50 30820300 */  andi      $v0, $a0, 0x300
/* 27054 8004BC54 0002AA02 */  srl       $s5, $v0, 8
/* 27058 8004BC58 30820060 */  andi      $v0, $a0, 0x60
/* 2705C 8004BC5C 00028142 */  srl       $s0, $v0, 5
/* 27060 8004BC60 30820080 */  andi      $v0, $a0, 0x80
/* 27064 8004BC64 1600007F */  bnez      $s0, .L8004BE64
/* 27068 8004BC68 000299C2 */   srl      $s3, $v0, 7
/* 2706C 8004BC6C 96E20002 */  lhu       $v0, 0x2($s7)
/* 27070 8004BC70 1040000B */  beqz      $v0, .L8004BCA0
/* 27074 8004BC74 00000000 */   nop
/* 27078 8004BC78 0000802D */  daddu     $s0, $zero, $zero
/* 2707C 8004BC7C 0040282D */  daddu     $a1, $v0, $zero
/* 27080 8004BC80 2403016C */  addiu     $v1, $zero, 0x16C
.L8004BC84:
/* 27084 8004BC84 02833821 */  addu      $a3, $s4, $v1
/* 27088 8004BC88 94E20096 */  lhu       $v0, 0x96($a3)
/* 2708C 8004BC8C 1045FFE4 */  beq       $v0, $a1, .L8004BC20
/* 27090 8004BC90 26100001 */   addiu    $s0, $s0, 0x1
/* 27094 8004BC94 2A020008 */  slti      $v0, $s0, 0x8
/* 27098 8004BC98 1440FFFA */  bnez      $v0, .L8004BC84
/* 2709C 8004BC9C 246300AC */   addiu    $v1, $v1, 0xAC
.L8004BCA0:
/* 270A0 8004BCA0 1660001C */  bnez      $s3, .L8004BD14
/* 270A4 8004BCA4 00000000 */   nop
/* 270A8 8004BCA8 55000064 */  bnel      $t0, $zero, .L8004BE3C
/* 270AC 8004BCAC 0280202D */   daddu    $a0, $s4, $zero
/* 270B0 8004BCB0 30900007 */  andi      $s0, $a0, 0x7
/* 270B4 8004BCB4 00101040 */  sll       $v0, $s0, 1
/* 270B8 8004BCB8 00501021 */  addu      $v0, $v0, $s0
/* 270BC 8004BCBC 00021080 */  sll       $v0, $v0, 2
/* 270C0 8004BCC0 00501023 */  subu      $v0, $v0, $s0
/* 270C4 8004BCC4 00021080 */  sll       $v0, $v0, 2
/* 270C8 8004BCC8 00501023 */  subu      $v0, $v0, $s0
/* 270CC 8004BCCC 00021080 */  sll       $v0, $v0, 2
/* 270D0 8004BCD0 2442016C */  addiu     $v0, $v0, 0x16C
/* 270D4 8004BCD4 02823821 */  addu      $a3, $s4, $v0
/* 270D8 8004BCD8 8CE20000 */  lw        $v0, 0x0($a3)
/* 270DC 8004BCDC 10400057 */  beqz      $v0, .L8004BE3C
/* 270E0 8004BCE0 0280202D */   daddu    $a0, $s4, $zero
/* 270E4 8004BCE4 90E20098 */  lbu       $v0, 0x98($a3)
/* 270E8 8004BCE8 02A2102B */  sltu      $v0, $s5, $v0
/* 270EC 8004BCEC 10400054 */  beqz      $v0, .L8004BE40
/* 270F0 8004BCF0 00E0282D */   daddu    $a1, $a3, $zero
/* 270F4 8004BCF4 0801302D */  j         .L8004C0B4
/* 270F8 8004BCF8 00000000 */   nop
.L8004BCFC:
/* 270FC 8004BCFC 08012F58 */  j         .L8004BD60
/* 27100 8004BD00 24080001 */   addiu    $t0, $zero, 0x1
.L8004BD04:
/* 27104 8004BD04 08012F6A */  j         .L8004BDA8
/* 27108 8004BD08 24080001 */   addiu    $t0, $zero, 0x1
.L8004BD0C:
/* 2710C 8004BD0C 08012F7D */  j         .L8004BDF4
/* 27110 8004BD10 24080001 */   addiu    $t0, $zero, 0x1
.L8004BD14:
/* 27114 8004BD14 55000049 */  bnel      $t0, $zero, .L8004BE3C
/* 27118 8004BD18 0280202D */   daddu    $a0, $s4, $zero
/* 2711C 8004BD1C 30900007 */  andi      $s0, $a0, 0x7
/* 27120 8004BD20 0600000F */  bltz      $s0, .L8004BD60
/* 27124 8004BD24 00101040 */   sll      $v0, $s0, 1
/* 27128 8004BD28 3125FFFF */  andi      $a1, $t1, 0xFFFF
/* 2712C 8004BD2C 00501021 */  addu      $v0, $v0, $s0
/* 27130 8004BD30 00021080 */  sll       $v0, $v0, 2
/* 27134 8004BD34 00501023 */  subu      $v0, $v0, $s0
/* 27138 8004BD38 00021080 */  sll       $v0, $v0, 2
/* 2713C 8004BD3C 00501023 */  subu      $v0, $v0, $s0
/* 27140 8004BD40 00021080 */  sll       $v0, $v0, 2
/* 27144 8004BD44 2443016C */  addiu     $v1, $v0, 0x16C
.L8004BD48:
/* 27148 8004BD48 02833821 */  addu      $a3, $s4, $v1
/* 2714C 8004BD4C 94E20096 */  lhu       $v0, 0x96($a3)
/* 27150 8004BD50 1045FFEA */  beq       $v0, $a1, .L8004BCFC
/* 27154 8004BD54 2610FFFF */   addiu    $s0, $s0, -0x1
/* 27158 8004BD58 0601FFFB */  bgez      $s0, .L8004BD48
/* 2715C 8004BD5C 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BD60:
/* 27160 8004BD60 55000036 */  bnel      $t0, $zero, .L8004BE3C
/* 27164 8004BD64 0280202D */   daddu    $a0, $s4, $zero
/* 27168 8004BD68 30900007 */  andi      $s0, $a0, 0x7
/* 2716C 8004BD6C 0600000E */  bltz      $s0, .L8004BDA8
/* 27170 8004BD70 00101040 */   sll      $v0, $s0, 1
/* 27174 8004BD74 00501021 */  addu      $v0, $v0, $s0
/* 27178 8004BD78 00021080 */  sll       $v0, $v0, 2
/* 2717C 8004BD7C 00501023 */  subu      $v0, $v0, $s0
/* 27180 8004BD80 00021080 */  sll       $v0, $v0, 2
/* 27184 8004BD84 00501023 */  subu      $v0, $v0, $s0
/* 27188 8004BD88 00021080 */  sll       $v0, $v0, 2
/* 2718C 8004BD8C 2443016C */  addiu     $v1, $v0, 0x16C
.L8004BD90:
/* 27190 8004BD90 02833821 */  addu      $a3, $s4, $v1
/* 27194 8004BD94 8CE20000 */  lw        $v0, 0x0($a3)
/* 27198 8004BD98 1040FFDA */  beqz      $v0, .L8004BD04
/* 2719C 8004BD9C 2610FFFF */   addiu    $s0, $s0, -0x1
/* 271A0 8004BDA0 0601FFFB */  bgez      $s0, .L8004BD90
/* 271A4 8004BDA4 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BDA8:
/* 271A8 8004BDA8 55000024 */  bnel      $t0, $zero, .L8004BE3C
/* 271AC 8004BDAC 0280202D */   daddu    $a0, $s4, $zero
/* 271B0 8004BDB0 30900007 */  andi      $s0, $a0, 0x7
/* 271B4 8004BDB4 0600000F */  bltz      $s0, .L8004BDF4
/* 271B8 8004BDB8 00101040 */   sll      $v0, $s0, 1
/* 271BC 8004BDBC 00501021 */  addu      $v0, $v0, $s0
/* 271C0 8004BDC0 00021080 */  sll       $v0, $v0, 2
/* 271C4 8004BDC4 00501023 */  subu      $v0, $v0, $s0
/* 271C8 8004BDC8 00021080 */  sll       $v0, $v0, 2
/* 271CC 8004BDCC 00501023 */  subu      $v0, $v0, $s0
/* 271D0 8004BDD0 00021080 */  sll       $v0, $v0, 2
/* 271D4 8004BDD4 2443016C */  addiu     $v1, $v0, 0x16C
.L8004BDD8:
/* 271D8 8004BDD8 02833821 */  addu      $a3, $s4, $v1
/* 271DC 8004BDDC 90E20098 */  lbu       $v0, 0x98($a3)
/* 271E0 8004BDE0 0055102B */  sltu      $v0, $v0, $s5
/* 271E4 8004BDE4 1440FFC9 */  bnez      $v0, .L8004BD0C
/* 271E8 8004BDE8 2610FFFF */   addiu    $s0, $s0, -0x1
/* 271EC 8004BDEC 0601FFFA */  bgez      $s0, .L8004BDD8
/* 271F0 8004BDF0 2463FF54 */   addiu    $v1, $v1, -0xAC
.L8004BDF4:
/* 271F4 8004BDF4 55000011 */  bnel      $t0, $zero, .L8004BE3C
/* 271F8 8004BDF8 0280202D */   daddu    $a0, $s4, $zero
/* 271FC 8004BDFC 30900007 */  andi      $s0, $a0, 0x7
/* 27200 8004BE00 00101040 */  sll       $v0, $s0, 1
/* 27204 8004BE04 00501021 */  addu      $v0, $v0, $s0
/* 27208 8004BE08 00021080 */  sll       $v0, $v0, 2
/* 2720C 8004BE0C 00501023 */  subu      $v0, $v0, $s0
/* 27210 8004BE10 00021080 */  sll       $v0, $v0, 2
/* 27214 8004BE14 00501023 */  subu      $v0, $v0, $s0
/* 27218 8004BE18 00021080 */  sll       $v0, $v0, 2
/* 2721C 8004BE1C 2442016C */  addiu     $v0, $v0, 0x16C
/* 27220 8004BE20 02823821 */  addu      $a3, $s4, $v0
/* 27224 8004BE24 90E20098 */  lbu       $v0, 0x98($a3)
/* 27228 8004BE28 02A2102B */  sltu      $v0, $s5, $v0
/* 2722C 8004BE2C 50400001 */  beql      $v0, $zero, .L8004BE34
/* 27230 8004BE30 24080001 */   addiu    $t0, $zero, 0x1
.L8004BE34:
/* 27234 8004BE34 1100009F */  beqz      $t0, .L8004C0B4
/* 27238 8004BE38 0280202D */   daddu    $a0, $s4, $zero
.L8004BE3C:
/* 2723C 8004BE3C 00E0282D */  daddu     $a1, $a3, $zero
.L8004BE40:
/* 27240 8004BE40 96420000 */  lhu       $v0, 0x0($s2)
/* 27244 8004BE44 8C860008 */  lw        $a2, 0x8($a0)
/* 27248 8004BE48 02E0382D */  daddu     $a3, $s7, $zero
/* 2724C 8004BE4C AFB50010 */  sw        $s5, 0x10($sp)
/* 27250 8004BE50 AFA00014 */  sw        $zero, 0x14($sp)
/* 27254 8004BE54 0C013039 */  jal       au_sfx_play_sound
/* 27258 8004BE58 00463021 */   addu     $a2, $v0, $a2
/* 2725C 8004BE5C 0801302D */  j         .L8004C0B4
/* 27260 8004BE60 00000000 */   nop
.L8004BE64:
/* 27264 8004BE64 96420000 */  lhu       $v0, 0x0($s2)
/* 27268 8004BE68 8E830008 */  lw        $v1, 0x8($s4)
/* 2726C 8004BE6C 00439021 */  addu      $s2, $v0, $v1
/* 27270 8004BE70 30821800 */  andi      $v0, $a0, 0x1800
/* 27274 8004BE74 0002B2C2 */  srl       $s6, $v0, 11
/* 27278 8004BE78 12C00005 */  beqz      $s6, .L8004BE90
/* 2727C 8004BE7C 0280202D */   daddu    $a0, $s4, $zero
/* 27280 8004BE80 0C0130C0 */  jal       au_sfx_stop_by_exlusive_id
/* 27284 8004BE84 02C0282D */   daddu    $a1, $s6, $zero
/* 27288 8004BE88 08012FA8 */  j         .L8004BEA0
/* 2728C 8004BE8C 2603FFFF */   addiu    $v1, $s0, -0x1
.L8004BE90:
/* 27290 8004BE90 96E50000 */  lhu       $a1, 0x0($s7)
/* 27294 8004BE94 0C0130A9 */  jal       au_sfx_stop_by_id
/* 27298 8004BE98 0280202D */   daddu    $a0, $s4, $zero
/* 2729C 8004BE9C 2603FFFF */  addiu     $v1, $s0, -0x1
.L8004BEA0:
/* 272A0 8004BEA0 24020002 */  addiu     $v0, $zero, 0x2
/* 272A4 8004BEA4 1260005D */  beqz      $s3, .L8004C01C
/* 272A8 8004BEA8 00628804 */   sllv     $s1, $v0, $v1
/* 272AC 8004BEAC 24100007 */  addiu     $s0, $zero, 0x7
/* 272B0 8004BEB0 3C1E8008 */  lui       $fp, %hi(D_80078464)
/* 272B4 8004BEB4 27DE8464 */  addiu     $fp, $fp, %lo(D_80078464)
/* 272B8 8004BEB8 24130620 */  addiu     $s3, $zero, 0x620
.L8004BEBC:
/* 272BC 8004BEBC 96420000 */  lhu       $v0, 0x0($s2)
/* 272C0 8004BEC0 10400010 */  beqz      $v0, .L8004BF04
/* 272C4 8004BEC4 02933821 */   addu     $a3, $s4, $s3
/* 272C8 8004BEC8 8CE20000 */  lw        $v0, 0x0($a3)
/* 272CC 8004BECC 545E0011 */  bnel      $v0, $fp, .L8004BF14
/* 272D0 8004BED0 2610FFFF */   addiu    $s0, $s0, -0x1
/* 272D4 8004BED4 0280202D */  daddu     $a0, $s4, $zero
/* 272D8 8004BED8 00E0282D */  daddu     $a1, $a3, $zero
/* 272DC 8004BEDC 02E0382D */  daddu     $a3, $s7, $zero
/* 272E0 8004BEE0 96420000 */  lhu       $v0, 0x0($s2)
/* 272E4 8004BEE4 8E860008 */  lw        $a2, 0x8($s4)
/* 272E8 8004BEE8 2631FFFF */  addiu     $s1, $s1, -0x1
/* 272EC 8004BEEC AFB50010 */  sw        $s5, 0x10($sp)
/* 272F0 8004BEF0 AFB60014 */  sw        $s6, 0x14($sp)
/* 272F4 8004BEF4 0C013039 */  jal       au_sfx_play_sound
/* 272F8 8004BEF8 00463021 */   addu     $a2, $v0, $a2
/* 272FC 8004BEFC 08012FC2 */  j         .L8004BF08
/* 27300 8004BF00 00000000 */   nop
.L8004BF04:
/* 27304 8004BF04 2631FFFF */  addiu     $s1, $s1, -0x1
.L8004BF08:
/* 27308 8004BF08 1A200004 */  blez      $s1, .L8004BF1C
/* 2730C 8004BF0C 2610FFFF */   addiu    $s0, $s0, -0x1
/* 27310 8004BF10 26520004 */  addiu     $s2, $s2, 0x4
.L8004BF14:
/* 27314 8004BF14 0601FFE9 */  bgez      $s0, .L8004BEBC
/* 27318 8004BF18 2673FF54 */   addiu    $s3, $s3, -0xAC
.L8004BF1C:
/* 2731C 8004BF1C 12200065 */  beqz      $s1, .L8004C0B4
/* 27320 8004BF20 24100007 */   addiu    $s0, $zero, 0x7
/* 27324 8004BF24 24130620 */  addiu     $s3, $zero, 0x620
.L8004BF28:
/* 27328 8004BF28 96420000 */  lhu       $v0, 0x0($s2)
/* 2732C 8004BF2C 10400013 */  beqz      $v0, .L8004BF7C
/* 27330 8004BF30 02933821 */   addu     $a3, $s4, $s3
/* 27334 8004BF34 8CE20000 */  lw        $v0, 0x0($a3)
/* 27338 8004BF38 5440000E */  bnel      $v0, $zero, .L8004BF74
/* 2733C 8004BF3C 2673FF54 */   addiu    $s3, $s3, -0xAC
/* 27340 8004BF40 0280202D */  daddu     $a0, $s4, $zero
/* 27344 8004BF44 00E0282D */  daddu     $a1, $a3, $zero
/* 27348 8004BF48 02E0382D */  daddu     $a3, $s7, $zero
/* 2734C 8004BF4C 96420000 */  lhu       $v0, 0x0($s2)
/* 27350 8004BF50 8E860008 */  lw        $a2, 0x8($s4)
/* 27354 8004BF54 2631FFFF */  addiu     $s1, $s1, -0x1
/* 27358 8004BF58 AFB50010 */  sw        $s5, 0x10($sp)
/* 2735C 8004BF5C AFB60014 */  sw        $s6, 0x14($sp)
/* 27360 8004BF60 0C013039 */  jal       au_sfx_play_sound
/* 27364 8004BF64 00463021 */   addu     $a2, $v0, $a2
/* 27368 8004BF68 1A20000A */  blez      $s1, .L8004BF94
/* 2736C 8004BF6C 2673FF54 */   addiu    $s3, $s3, -0xAC
/* 27370 8004BF70 26520004 */  addiu     $s2, $s2, 0x4
.L8004BF74:
/* 27374 8004BF74 08012FE3 */  j         .L8004BF8C
/* 27378 8004BF78 2610FFFF */   addiu    $s0, $s0, -0x1
.L8004BF7C:
/* 2737C 8004BF7C 2631FFFF */  addiu     $s1, $s1, -0x1
/* 27380 8004BF80 1A200004 */  blez      $s1, .L8004BF94
/* 27384 8004BF84 00000000 */   nop
/* 27388 8004BF88 26520004 */  addiu     $s2, $s2, 0x4
.L8004BF8C:
/* 2738C 8004BF8C 0601FFE6 */  bgez      $s0, .L8004BF28
/* 27390 8004BF90 00000000 */   nop
.L8004BF94:
/* 27394 8004BF94 12200047 */  beqz      $s1, .L8004C0B4
/* 27398 8004BF98 24100007 */   addiu    $s0, $zero, 0x7
/* 2739C 8004BF9C 24130620 */  addiu     $s3, $zero, 0x620
.L8004BFA0:
/* 273A0 8004BFA0 96420000 */  lhu       $v0, 0x0($s2)
/* 273A4 8004BFA4 10400015 */  beqz      $v0, .L8004BFFC
/* 273A8 8004BFA8 02933821 */   addu     $a3, $s4, $s3
/* 273AC 8004BFAC 90E20099 */  lbu       $v0, 0x99($a3)
/* 273B0 8004BFB0 0056102B */  sltu      $v0, $v0, $s6
/* 273B4 8004BFB4 50400015 */  beql      $v0, $zero, .L8004C00C
/* 273B8 8004BFB8 2610FFFF */   addiu    $s0, $s0, -0x1
/* 273BC 8004BFBC 90E20098 */  lbu       $v0, 0x98($a3)
/* 273C0 8004BFC0 02A2102B */  sltu      $v0, $s5, $v0
/* 273C4 8004BFC4 54400011 */  bnel      $v0, $zero, .L8004C00C
/* 273C8 8004BFC8 2610FFFF */   addiu    $s0, $s0, -0x1
/* 273CC 8004BFCC 0280202D */  daddu     $a0, $s4, $zero
/* 273D0 8004BFD0 00E0282D */  daddu     $a1, $a3, $zero
/* 273D4 8004BFD4 02E0382D */  daddu     $a3, $s7, $zero
/* 273D8 8004BFD8 96420000 */  lhu       $v0, 0x0($s2)
/* 273DC 8004BFDC 8E860008 */  lw        $a2, 0x8($s4)
/* 273E0 8004BFE0 2631FFFF */  addiu     $s1, $s1, -0x1
/* 273E4 8004BFE4 AFB50010 */  sw        $s5, 0x10($sp)
/* 273E8 8004BFE8 AFB60014 */  sw        $s6, 0x14($sp)
/* 273EC 8004BFEC 0C013039 */  jal       au_sfx_play_sound
/* 273F0 8004BFF0 00463021 */   addu     $a2, $v0, $a2
/* 273F4 8004BFF4 08013000 */  j         .L8004C000
/* 273F8 8004BFF8 00000000 */   nop
.L8004BFFC:
/* 273FC 8004BFFC 2631FFFF */  addiu     $s1, $s1, -0x1
.L8004C000:
/* 27400 8004C000 1A20002C */  blez      $s1, .L8004C0B4
/* 27404 8004C004 26520004 */   addiu    $s2, $s2, 0x4
/* 27408 8004C008 2610FFFF */  addiu     $s0, $s0, -0x1
.L8004C00C:
/* 2740C 8004C00C 0601FFE4 */  bgez      $s0, .L8004BFA0
/* 27410 8004C010 2673FF54 */   addiu    $s3, $s3, -0xAC
/* 27414 8004C014 0801302D */  j         .L8004C0B4
/* 27418 8004C018 00000000 */   nop
.L8004C01C:
/* 2741C 8004C01C 1A200025 */  blez      $s1, .L8004C0B4
/* 27420 8004C020 0000982D */   daddu    $s3, $zero, $zero
.L8004C024:
/* 27424 8004C024 96420000 */  lhu       $v0, 0x0($s2)
/* 27428 8004C028 5040001F */  beql      $v0, $zero, .L8004C0A8
/* 2742C 8004C02C 26730001 */   addiu    $s3, $s3, 0x1
/* 27430 8004C030 96440002 */  lhu       $a0, 0x2($s2)
/* 27434 8004C034 30900007 */  andi      $s0, $a0, 0x7
/* 27438 8004C038 00101040 */  sll       $v0, $s0, 1
/* 2743C 8004C03C 00501021 */  addu      $v0, $v0, $s0
/* 27440 8004C040 00021080 */  sll       $v0, $v0, 2
/* 27444 8004C044 00501023 */  subu      $v0, $v0, $s0
/* 27448 8004C048 00021080 */  sll       $v0, $v0, 2
/* 2744C 8004C04C 00501023 */  subu      $v0, $v0, $s0
/* 27450 8004C050 00021080 */  sll       $v0, $v0, 2
/* 27454 8004C054 2442016C */  addiu     $v0, $v0, 0x16C
/* 27458 8004C058 02823821 */  addu      $a3, $s4, $v0
/* 2745C 8004C05C 30820300 */  andi      $v0, $a0, 0x300
/* 27460 8004C060 8CE30000 */  lw        $v1, 0x0($a3)
/* 27464 8004C064 10600005 */  beqz      $v1, .L8004C07C
/* 27468 8004C068 0002AA02 */   srl      $s5, $v0, 8
/* 2746C 8004C06C 90E20098 */  lbu       $v0, 0x98($a3)
/* 27470 8004C070 02A2102B */  sltu      $v0, $s5, $v0
/* 27474 8004C074 5440000B */  bnel      $v0, $zero, .L8004C0A4
/* 27478 8004C078 26520004 */   addiu    $s2, $s2, 0x4
.L8004C07C:
/* 2747C 8004C07C 0280202D */  daddu     $a0, $s4, $zero
/* 27480 8004C080 00E0282D */  daddu     $a1, $a3, $zero
/* 27484 8004C084 96420000 */  lhu       $v0, 0x0($s2)
/* 27488 8004C088 8E860008 */  lw        $a2, 0x8($s4)
/* 2748C 8004C08C 02E0382D */  daddu     $a3, $s7, $zero
/* 27490 8004C090 AFB50010 */  sw        $s5, 0x10($sp)
/* 27494 8004C094 AFB60014 */  sw        $s6, 0x14($sp)
/* 27498 8004C098 0C013039 */  jal       au_sfx_play_sound
/* 2749C 8004C09C 00463021 */   addu     $a2, $v0, $a2
/* 274A0 8004C0A0 26520004 */  addiu     $s2, $s2, 0x4
.L8004C0A4:
/* 274A4 8004C0A4 26730001 */  addiu     $s3, $s3, 0x1
.L8004C0A8:
/* 274A8 8004C0A8 0271102A */  slt       $v0, $s3, $s1
/* 274AC 8004C0AC 1440FFDD */  bnez      $v0, .L8004C024
/* 274B0 8004C0B0 00000000 */   nop
.L8004C0B4:
/* 274B4 8004C0B4 8FBF003C */  lw        $ra, 0x3C($sp)
/* 274B8 8004C0B8 8FBE0038 */  lw        $fp, 0x38($sp)
/* 274BC 8004C0BC 8FB70034 */  lw        $s7, 0x34($sp)
/* 274C0 8004C0C0 8FB60030 */  lw        $s6, 0x30($sp)
/* 274C4 8004C0C4 8FB5002C */  lw        $s5, 0x2C($sp)
/* 274C8 8004C0C8 8FB40028 */  lw        $s4, 0x28($sp)
/* 274CC 8004C0CC 8FB30024 */  lw        $s3, 0x24($sp)
/* 274D0 8004C0D0 8FB20020 */  lw        $s2, 0x20($sp)
/* 274D4 8004C0D4 8FB1001C */  lw        $s1, 0x1C($sp)
/* 274D8 8004C0D8 8FB00018 */  lw        $s0, 0x18($sp)
/* 274DC 8004C0DC 03E00008 */  jr        $ra
/* 274E0 8004C0E0 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManagerCustomCmdList* customSEF) {
    SoundPlayer* player;
    s32 playerIndex;
    u16* cmdList;
    s32 trackCount;
    s32 cond = FALSE;
    u32 exclusiveID;
    s32 sectionIndex;
    u16 soundInfo;
    u32 priority, polyphonyMode, useSpecificPlayerMode;
    s32 v1;
    s32* normalSounds;

    #define NEXT_CMD trackCount--; if (trackCount <= 0 ) { break; } cmdList += 2;

    u32 soundIndex = (entry->soundID - 1) & 0xFF;
    u16 soundIDLower = entry->soundID & SOUND_ID_LOWER;
    u16 soundID = entry->soundID;

    if (soundID & 0x2000) {
        // sound from extra section
        soundIndex = (entry->soundID - 1) & 0x1FF;
        if (soundIndex < 0x140) {
            cmdList = (u16*)&manager->extraSounds[soundIndex];
            if (*cmdList != 0) {
                // check if any player is playing this sound
                for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                    player = &manager->players[playerIndex];
                    if (player->currentSoundID == soundIDLower) {
                        cond = TRUE;
                        break;
                    }
                }

                if (!cond) {
                    //find free player
                    for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                        player = &manager->players[playerIndex];
                        if (player->sefDataReadPos == NULL) {
                            cond = TRUE;
                            break;
                        }
                    }
                }

                if (cond) {
                    au_sfx_play_sound(manager, player, (s8*)cmdList, entry, 0, 0);
                }
            }
        }
    } else {
        if (soundIndex >= 0xC0) {
            if (customSEF != NULL) {
                cmdList = (u16*)customSEF;
            } else {
                sectionIndex = ((soundIDLower - 1) >> 8) + 4;
                normalSounds = manager->normalSounds[sectionIndex];
                v1 = soundIndex - 0xC0;
                cmdList = (u16*)&manager->normalSounds[sectionIndex][v1];
            }

            if (*cmdList != 0) {
                // check if any player is playing this sound
                for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                    player = &manager->players[playerIndex];
                    if (player->currentSoundID == soundIDLower) {
                        cond = TRUE;
                        break;
                    }
                }

                if (!cond) {
                    //find free player
                    for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                        player = &manager->players[playerIndex];
                        if (player->sefDataReadPos == NULL) {
                            cond = TRUE;
                            break;
                        }
                    }
                }

                if (cond) {
                    au_sfx_play_sound(manager, player, (u8*)cmdList, entry, 0, 0);
                }
            }
        } else {
            if (customSEF != NULL) {
                cmdList = (u16*)customSEF;
            } else {
                sectionIndex = ((soundID) >> 8) & 3;
                cmdList = (u16*)&manager->normalSounds[sectionIndex][soundIndex];
            }

            if (*cmdList != 0) {
                soundInfo = cmdList[1];

                priority = (soundInfo & 0x300) >> 8; // bits 8, 9
                polyphonyMode = (soundInfo & 0x60) >> 5; // bits 5, 6,
                useSpecificPlayerMode = soundInfo;
                useSpecificPlayerMode = (useSpecificPlayerMode & 0x80) >> 7; // bit 7

                if (polyphonyMode == 0) {
                    if (entry->upperSoundID != 0) {
                        for (playerIndex = 0; playerIndex < 8; playerIndex++) {
                            player = &manager->players[playerIndex];
                            if (player->currentSoundID == entry->upperSoundID) {
                                cond = TRUE;
                                break;
                            }
                        }
                    }

                    if (useSpecificPlayerMode == 0) {
                        if (!cond) {
                            playerIndex = soundInfo & 0x7;
                            player = &manager->players[playerIndex];
                            if (player->sefDataReadPos == NULL || priority >= player->priority) {
                                au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, 0);
                            }
                            return;
                        }
                    }

                    if (!cond) {
                        // lower 4 bits of soundInfo: max playerIndex
                        // check if any player is playing this sound
                        for (playerIndex = soundInfo & 0x7; playerIndex >= 0; playerIndex--) {
                            player = &manager->players[playerIndex];
                            if (player->currentSoundID == soundIDLower) {
                                cond = TRUE;
                                break;
                            }
                        }
                    }

                    if (!cond) {
                        // find free player
                        for (playerIndex = soundInfo & 0x7; playerIndex >= 0; playerIndex--) {
                            player = &manager->players[playerIndex];
                            if (player->sefDataReadPos == NULL) {
                                cond = TRUE;
                                break;
                            }
                        }
                    }

                    if (!cond) {
                        // if there is no free player try stealing one with lower priority
                        for (playerIndex = soundInfo & 0x7; playerIndex >= 0; playerIndex--) {
                            player = &manager->players[playerIndex];
                            if (player->priority < priority) {
                                cond = TRUE;
                                break;
                            }
                        }
                    }

                    if (!cond) {
                        playerIndex = soundInfo & 0x7;
                        player = &manager->players[playerIndex];
                        if (player->priority <= priority) {
                            cond = TRUE;
                        }
                    }

                    if (cond) {
                        au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, 0);
                    }
                } else {
                    cmdList = AU_FILE_RELATIVE(manager->sefData, *cmdList);
                    exclusiveID = (soundInfo & 0x1800) >> 11; // bits 11, 12
                    if (exclusiveID != 0) {
                        au_sfx_stop_by_exlusive_id(manager, exclusiveID);
                    } else {
                        au_sfx_stop_by_id(manager, entry->soundID);
                    }

                    trackCount = 2 << (polyphonyMode - 1); // 2 or 4 or 8

                    if (useSpecificPlayerMode != 0) {
                        for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                            if (*cmdList != 0) {
                                // first check the players that were stopped just now
                                player = &manager->players[playerIndex];
                                if (player->sefDataReadPos == BlankSEFData) {
                                    au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, exclusiveID);
                                    NEXT_CMD;
                                }
                            } else {
                                NEXT_CMD;
                            }

                        }

                        if (trackCount != 0) {
                            for (playerIndex = 7; playerIndex >= 0;){
                                if (*cmdList != 0) {
                                    // then check any free players
                                    player = &manager->players[playerIndex];
                                    if (player->sefDataReadPos == NULL) {
                                        au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, exclusiveID);
                                        NEXT_CMD;
                                    }
                                    playerIndex--;
                                } else {
                                    NEXT_CMD;
                                }
                            }
                        }

                        if (trackCount != 0) {
                            for (playerIndex = 7; playerIndex >= 0; playerIndex--) {
                                if (*cmdList != 0) {
                                    // then try to steal
                                    player = &manager->players[playerIndex];
                                    if (exclusiveID > player->exclusiveID && priority >= player->priority) {
                                        au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, exclusiveID);
                                        NEXT_CMD;
                                    }
                                } else {
                                    NEXT_CMD;
                                }
                            }
                        }
                    } else {
                        s32 i;
                        for (i = 0; i < trackCount; i++) {
                            if (*cmdList != 0) {
                                soundInfo = cmdList[1];
                                playerIndex = soundInfo & 7;
                                player = &manager->players[playerIndex];
                                priority = (soundInfo & 0x300) >> 8; // bits 8, 9
                                if (player->sefDataReadPos == NULL || priority >= player->priority) {
                                    au_sfx_play_sound(manager, player, AU_FILE_RELATIVE(manager->sefData, *cmdList), entry, priority, exclusiveID);
                                }
                                cmdList += 2;
                            }
                        }
                    }
                }
            }
        }
    }
    #undef NEXT_CMD
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel alAudioFrame
/* 319C0 800565C0 3C028008 */  lui       $v0, %hi(gActiveSynDriverPtr)
/* 319C4 800565C4 8C428E50 */  lw        $v0, %lo(gActiveSynDriverPtr)($v0)
/* 319C8 800565C8 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 319CC 800565CC AFB3002C */  sw        $s3, 0x2C($sp)
/* 319D0 800565D0 AFA40048 */  sw        $a0, 0x48($sp)
/* 319D4 800565D4 0080982D */  daddu     $s3, $a0, $zero
/* 319D8 800565D8 AFBF0044 */  sw        $ra, 0x44($sp)
/* 319DC 800565DC AFBE0040 */  sw        $fp, 0x40($sp)
/* 319E0 800565E0 AFB7003C */  sw        $s7, 0x3C($sp)
/* 319E4 800565E4 AFB60038 */  sw        $s6, 0x38($sp)
/* 319E8 800565E8 AFB50034 */  sw        $s5, 0x34($sp)
/* 319EC 800565EC AFB40030 */  sw        $s4, 0x30($sp)
/* 319F0 800565F0 AFB20028 */  sw        $s2, 0x28($sp)
/* 319F4 800565F4 AFB10024 */  sw        $s1, 0x24($sp)
/* 319F8 800565F8 AFB00020 */  sw        $s0, 0x20($sp)
/* 319FC 800565FC AFA5004C */  sw        $a1, 0x4C($sp)
/* 31A00 80056600 AFA70054 */  sw        $a3, 0x54($sp)
/* 31A04 80056604 14400003 */  bnez      $v0, .L80056614
/* 31A08 80056608 AFA60010 */   sw       $a2, 0x10($sp)
/* 31A0C 8005660C 08015B40 */  j         .L80056D00
/* 31A10 80056610 ACA00000 */   sw       $zero, 0x0($a1)
.L80056614:
/* 31A14 80056614 0C014D70 */  jal       snd_add_sfx_output
/* 31A18 80056618 00000000 */   nop
/* 31A1C 8005661C 3C028008 */  lui       $v0, %hi(AuSynStereoDirty)
/* 31A20 80056620 90428E5C */  lbu       $v0, %lo(AuSynStereoDirty)($v0)
/* 31A24 80056624 1040001B */  beqz      $v0, .L80056694
/* 31A28 80056628 00000000 */   nop
/* 31A2C 8005662C 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31A30 80056630 24638E54 */  addiu     $v1, $v1, %lo(gSynDriverPtr)
/* 31A34 80056634 8C620000 */  lw        $v0, 0x0($v1)
/* 31A38 80056638 8C42000C */  lw        $v0, 0xC($v0)
/* 31A3C 8005663C 18400013 */  blez      $v0, .L8005668C
/* 31A40 80056640 0000A82D */   daddu    $s5, $zero, $zero
/* 31A44 80056644 0060882D */  daddu     $s1, $v1, $zero
/* 31A48 80056648 24120001 */  addiu     $s2, $zero, 0x1
/* 31A4C 8005664C 02A0802D */  daddu     $s0, $s5, $zero
.L80056650:
/* 31A50 80056650 8E220000 */  lw        $v0, 0x0($s1)
/* 31A54 80056654 8C42001C */  lw        $v0, 0x1C($v0)
/* 31A58 80056658 00502021 */  addu      $a0, $v0, $s0
/* 31A5C 8005665C 8C820070 */  lw        $v0, 0x70($a0)
/* 31A60 80056660 14520004 */  bne       $v0, $s2, .L80056674
/* 31A64 80056664 00000000 */   nop
/* 31A68 80056668 9085004D */  lbu       $a1, 0x4D($a0)
/* 31A6C 8005666C 0C015E1D */  jal       au_syn_set_pan
/* 31A70 80056670 32A400FF */   andi     $a0, $s5, 0xFF
.L80056674:
/* 31A74 80056674 8E220000 */  lw        $v0, 0x0($s1)
/* 31A78 80056678 8C42000C */  lw        $v0, 0xC($v0)
/* 31A7C 8005667C 26B50001 */  addiu     $s5, $s5, 0x1
/* 31A80 80056680 02A2102A */  slt       $v0, $s5, $v0
/* 31A84 80056684 1440FFF2 */  bnez      $v0, .L80056650
/* 31A88 80056688 2610007C */   addiu    $s0, $s0, 0x7C
.L8005668C:
/* 31A8C 8005668C 3C018008 */  lui       $at, %hi(AuSynStereoDirty)
/* 31A90 80056690 A0208E5C */  sb        $zero, %lo(AuSynStereoDirty)($at)
.L80056694:
/* 31A94 80056694 8FA90054 */  lw        $t1, 0x54($sp)
/* 31A98 80056698 19200194 */  blez      $t1, .L80056CEC
/* 31A9C 8005669C 00000000 */   nop
/* 31AA0 800566A0 3C1E800A */  lui       $fp, %hi(AuDelayCounter)
/* 31AA4 800566A4 27DE3FE8 */  addiu     $fp, $fp, %lo(AuDelayCounter)
.L800566A8:
/* 31AA8 800566A8 0C014CF4 */  jal       au_update_clients_2
/* 31AAC 800566AC 0000A82D */   daddu    $s5, $zero, $zero
/* 31AB0 800566B0 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31AB4 800566B4 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 31AB8 800566B8 8C62000C */  lw        $v0, 0xC($v1)
/* 31ABC 800566BC 1840001E */  blez      $v0, .L80056738
/* 31AC0 800566C0 24170001 */   addiu    $s7, $zero, 0x1
/* 31AC4 800566C4 0060302D */  daddu     $a2, $v1, $zero
/* 31AC8 800566C8 02A0282D */  daddu     $a1, $s5, $zero
.L800566CC:
/* 31ACC 800566CC 8CC2001C */  lw        $v0, 0x1C($a2)
/* 31AD0 800566D0 00452021 */  addu      $a0, $v0, $a1
/* 31AD4 800566D4 90820078 */  lbu       $v0, 0x78($a0)
/* 31AD8 800566D8 240900FF */  addiu     $t1, $zero, 0xFF
/* 31ADC 800566DC 1049000E */  beq       $v0, $t1, .L80056718
/* 31AE0 800566E0 0040182D */   daddu    $v1, $v0, $zero
/* 31AE4 800566E4 8CC20010 */  lw        $v0, 0x10($a2)
/* 31AE8 800566E8 0062102A */  slt       $v0, $v1, $v0
/* 31AEC 800566EC 1040000A */  beqz      $v0, .L80056718
/* 31AF0 800566F0 00031040 */   sll      $v0, $v1, 1
/* 31AF4 800566F4 00431021 */  addu      $v0, $v0, $v1
/* 31AF8 800566F8 8CC30020 */  lw        $v1, 0x20($a2)
/* 31AFC 800566FC 000210C0 */  sll       $v0, $v0, 3
/* 31B00 80056700 0062A021 */  addu      $s4, $v1, $v0
/* 31B04 80056704 8E820014 */  lw        $v0, 0x14($s4)
/* 31B08 80056708 50400002 */  beql      $v0, $zero, .L80056714
/* 31B0C 8005670C AE840010 */   sw       $a0, 0x10($s4)
/* 31B10 80056710 AC440000 */  sw        $a0, 0x0($v0)
.L80056714:
/* 31B14 80056714 AE840014 */  sw        $a0, 0x14($s4)
.L80056718:
/* 31B18 80056718 3C028008 */  lui       $v0, %hi(gSynDriverPtr)
/* 31B1C 8005671C 8C428E54 */  lw        $v0, %lo(gSynDriverPtr)($v0)
/* 31B20 80056720 8C42000C */  lw        $v0, 0xC($v0)
/* 31B24 80056724 26B50001 */  addiu     $s5, $s5, 0x1
/* 31B28 80056728 02A2102A */  slt       $v0, $s5, $v0
/* 31B2C 8005672C 1440FFE7 */  bnez      $v0, .L800566CC
/* 31B30 80056730 24A5007C */   addiu    $a1, $a1, 0x7C
/* 31B34 80056734 24170001 */  addiu     $s7, $zero, 0x1
.L80056738:
/* 31B38 80056738 3C028008 */  lui       $v0, %hi(gSynDriverPtr)
/* 31B3C 8005673C 8C428E54 */  lw        $v0, %lo(gSynDriverPtr)($v0)
/* 31B40 80056740 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31B44 80056744 24638E54 */  addiu     $v1, $v1, %lo(gSynDriverPtr)
/* 31B48 80056748 8C420010 */  lw        $v0, 0x10($v0)
/* 31B4C 8005674C 18400110 */  blez      $v0, .L80056B90
/* 31B50 80056750 0000A82D */   daddu    $s5, $zero, $zero
/* 31B54 80056754 02A0B02D */  daddu     $s6, $s5, $zero
.L80056758:
/* 31B58 80056758 8C620000 */  lw        $v0, 0x0($v1)
/* 31B5C 8005675C 8C420020 */  lw        $v0, 0x20($v0)
/* 31B60 80056760 0056A021 */  addu      $s4, $v0, $s6
/* 31B64 80056764 8E820010 */  lw        $v0, 0x10($s4)
/* 31B68 80056768 10400101 */  beqz      $v0, .L80056B70
/* 31B6C 8005676C 3C020200 */   lui      $v0, (0x20004E0 >> 16)
/* 31B70 80056770 344204E0 */  ori       $v0, $v0, (0x20004E0 & 0xFFFF)
/* 31B74 80056774 0260182D */  daddu     $v1, $s3, $zero
/* 31B78 80056778 AC620000 */  sw        $v0, 0x0($v1)
/* 31B7C 8005677C 240205C0 */  addiu     $v0, $zero, 0x5C0
/* 31B80 80056780 AC620004 */  sw        $v0, 0x4($v1)
/* 31B84 80056784 8E820010 */  lw        $v0, 0x10($s4)
/* 31B88 80056788 1040000B */  beqz      $v0, .L800567B8
/* 31B8C 8005678C 26730008 */   addiu    $s3, $s3, 0x8
.L80056790:
/* 31B90 80056790 8E840010 */  lw        $a0, 0x10($s4)
/* 31B94 80056794 0C016014 */  jal       au_pull_voice
/* 31B98 80056798 0260282D */   daddu    $a1, $s3, $zero
/* 31B9C 8005679C 8E830010 */  lw        $v1, 0x10($s4)
/* 31BA0 800567A0 8C640000 */  lw        $a0, 0x0($v1)
/* 31BA4 800567A4 0040982D */  daddu     $s3, $v0, $zero
/* 31BA8 800567A8 AC600000 */  sw        $zero, 0x0($v1)
/* 31BAC 800567AC 1480FFF8 */  bnez      $a0, .L80056790
/* 31BB0 800567B0 AE840010 */   sw       $a0, 0x10($s4)
/* 31BB4 800567B4 AE800014 */  sw        $zero, 0x14($s4)
.L800567B8:
/* 31BB8 800567B8 9282000C */  lbu       $v0, 0xC($s4)
/* 31BBC 800567BC 1040000B */  beqz      $v0, .L800567EC
/* 31BC0 800567C0 0260282D */   daddu    $a1, $s3, $zero
/* 31BC4 800567C4 240607C0 */  addiu     $a2, $zero, 0x7C0
/* 31BC8 800567C8 8E840004 */  lw        $a0, 0x4($s4)
/* 31BCC 800567CC 0C0164C4 */  jal       au_pull_fx
/* 31BD0 800567D0 0000382D */   daddu    $a3, $zero, $zero
/* 31BD4 800567D4 0040282D */  daddu     $a1, $v0, $zero
/* 31BD8 800567D8 24060930 */  addiu     $a2, $zero, 0x930
/* 31BDC 800567DC 8E840008 */  lw        $a0, 0x8($s4)
/* 31BE0 800567E0 0C0164C4 */  jal       au_pull_fx
/* 31BE4 800567E4 0000382D */   daddu    $a3, $zero, $zero
/* 31BE8 800567E8 0040982D */  daddu     $s3, $v0, $zero
.L800567EC:
/* 31BEC 800567EC 3C02800A */  lui       $v0, %hi(AuDelayedVoiceGroup)
/* 31BF0 800567F0 90423FEC */  lbu       $v0, %lo(AuDelayedVoiceGroup)($v0)
/* 31BF4 800567F4 16A20089 */  bne       $s5, $v0, .L80056A1C
/* 31BF8 800567F8 24020001 */   addiu    $v0, $zero, 0x1
/* 31BFC 800567FC 3C03800A */  lui       $v1, %hi(AuDelayedChannel)
/* 31C00 80056800 84633FEE */  lh        $v1, %lo(AuDelayedChannel)($v1)
/* 31C04 80056804 10620006 */  beq       $v1, $v0, .L80056820
/* 31C08 80056808 2410FFFF */   addiu    $s0, $zero, -0x1
/* 31C0C 8005680C 24020002 */  addiu     $v0, $zero, 0x2
/* 31C10 80056810 10620006 */  beq       $v1, $v0, .L8005682C
/* 31C14 80056814 00101400 */   sll      $v0, $s0, 16
/* 31C18 80056818 08015A10 */  j         .L80056840
/* 31C1C 8005681C 00021403 */   sra      $v0, $v0, 16
.L80056820:
/* 31C20 80056820 241004E0 */  addiu     $s0, $zero, 0x4E0
/* 31C24 80056824 08015A0D */  j         .L80056834
/* 31C28 80056828 240907C0 */   addiu    $t1, $zero, 0x7C0
.L8005682C:
/* 31C2C 8005682C 24100650 */  addiu     $s0, $zero, 0x650
/* 31C30 80056830 24090930 */  addiu     $t1, $zero, 0x930
.L80056834:
/* 31C34 80056834 A7A9001E */  sh        $t1, 0x1E($sp)
/* 31C38 80056838 00101400 */  sll       $v0, $s0, 16
/* 31C3C 8005683C 00021403 */  sra       $v0, $v0, 16
.L80056840:
/* 31C40 80056840 2403FFFF */  addiu     $v1, $zero, -0x1
/* 31C44 80056844 10430075 */  beq       $v0, $v1, .L80056A1C
/* 31C48 80056848 0260882D */   daddu    $s1, $s3, $zero
/* 31C4C 8005684C 8FC30000 */  lw        $v1, 0x0($fp)
/* 31C50 80056850 3C02800A */  lui       $v0, %hi(AuDelayCount)
/* 31C54 80056854 8C423FF0 */  lw        $v0, %lo(AuDelayCount)($v0)
/* 31C58 80056858 14400002 */  bnez      $v0, .L80056864
/* 31C5C 8005685C 0062001A */   div      $zero, $v1, $v0
/* 31C60 80056860 0007000D */  break     7
.L80056864:
/* 31C64 80056864 2401FFFF */  addiu     $at, $zero, -0x1
/* 31C68 80056868 14410004 */  bne       $v0, $at, .L8005687C
/* 31C6C 8005686C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 31C70 80056870 14610002 */  bne       $v1, $at, .L8005687C
/* 31C74 80056874 00000000 */   nop
/* 31C78 80056878 0006000D */  break     6
.L8005687C:
/* 31C7C 8005687C 00002810 */  mfhi      $a1
/* 31C80 80056880 32100FFF */  andi      $s0, $s0, 0xFFF
/* 31C84 80056884 3C090617 */  lui       $t1, (0x6170000 >> 16)
/* 31C88 80056888 02091025 */  or        $v0, $s0, $t1
/* 31C8C 8005688C AE220000 */  sw        $v0, 0x0($s1)
/* 31C90 80056890 3C02800A */  lui       $v0, %hi(AuDelayBufferMain)
/* 31C94 80056894 8C423FE0 */  lw        $v0, %lo(AuDelayBufferMain)($v0)
/* 31C98 80056898 00052040 */  sll       $a0, $a1, 1
/* 31C9C 8005689C 00852021 */  addu      $a0, $a0, $a1
/* 31CA0 800568A0 000420C0 */  sll       $a0, $a0, 3
/* 31CA4 800568A4 00852023 */  subu      $a0, $a0, $a1
/* 31CA8 800568A8 00042100 */  sll       $a0, $a0, 4
/* 31CAC 800568AC 0C0187A4 */  jal       osVirtualToPhysical
/* 31CB0 800568B0 00442021 */   addu     $a0, $v0, $a0
/* 31CB4 800568B4 8FC30000 */  lw        $v1, 0x0($fp)
/* 31CB8 800568B8 3C04800A */  lui       $a0, %hi(AuDelayCount)
/* 31CBC 800568BC 8C843FF0 */  lw        $a0, %lo(AuDelayCount)($a0)
/* 31CC0 800568C0 24630001 */  addiu     $v1, $v1, 0x1
/* 31CC4 800568C4 14800002 */  bnez      $a0, .L800568D0
/* 31CC8 800568C8 0064001A */   div      $zero, $v1, $a0
/* 31CCC 800568CC 0007000D */  break     7
.L800568D0:
/* 31CD0 800568D0 2401FFFF */  addiu     $at, $zero, -0x1
/* 31CD4 800568D4 14810004 */  bne       $a0, $at, .L800568E8
/* 31CD8 800568D8 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 31CDC 800568DC 14610002 */  bne       $v1, $at, .L800568E8
/* 31CE0 800568E0 00000000 */   nop
/* 31CE4 800568E4 0006000D */  break     6
.L800568E8:
/* 31CE8 800568E8 00002810 */  mfhi      $a1
/* 31CEC 800568EC 26730008 */  addiu     $s3, $s3, 0x8
/* 31CF0 800568F0 AE220004 */  sw        $v0, 0x4($s1)
/* 31CF4 800568F4 0260882D */  daddu     $s1, $s3, $zero
/* 31CF8 800568F8 3C090417 */  lui       $t1, (0x4170000 >> 16)
/* 31CFC 800568FC 3C02800A */  lui       $v0, %hi(AuDelayBufferMain)
/* 31D00 80056900 8C423FE0 */  lw        $v0, %lo(AuDelayBufferMain)($v0)
/* 31D04 80056904 02098025 */  or        $s0, $s0, $t1
/* 31D08 80056908 AE300000 */  sw        $s0, 0x0($s1)
/* 31D0C 8005690C 00052040 */  sll       $a0, $a1, 1
/* 31D10 80056910 00852021 */  addu      $a0, $a0, $a1
/* 31D14 80056914 000420C0 */  sll       $a0, $a0, 3
/* 31D18 80056918 00852023 */  subu      $a0, $a0, $a1
/* 31D1C 8005691C 00042100 */  sll       $a0, $a0, 4
/* 31D20 80056920 0C0187A4 */  jal       osVirtualToPhysical
/* 31D24 80056924 00442021 */   addu     $a0, $v0, $a0
/* 31D28 80056928 8FC40000 */  lw        $a0, 0x0($fp)
/* 31D2C 8005692C 3C03800A */  lui       $v1, %hi(AuDelayCount)
/* 31D30 80056930 8C633FF0 */  lw        $v1, %lo(AuDelayCount)($v1)
/* 31D34 80056934 14600002 */  bnez      $v1, .L80056940
/* 31D38 80056938 0083001A */   div      $zero, $a0, $v1
/* 31D3C 8005693C 0007000D */  break     7
.L80056940:
/* 31D40 80056940 2401FFFF */  addiu     $at, $zero, -0x1
/* 31D44 80056944 14610004 */  bne       $v1, $at, .L80056958
/* 31D48 80056948 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 31D4C 8005694C 14810002 */  bne       $a0, $at, .L80056958
/* 31D50 80056950 00000000 */   nop
/* 31D54 80056954 0006000D */  break     6
.L80056958:
/* 31D58 80056958 00001810 */  mfhi      $v1
/* 31D5C 8005695C 26730008 */  addiu     $s3, $s3, 0x8
/* 31D60 80056960 AE220004 */  sw        $v0, 0x4($s1)
/* 31D64 80056964 97A9001E */  lhu       $t1, 0x1E($sp)
/* 31D68 80056968 0260902D */  daddu     $s2, $s3, $zero
/* 31D6C 8005696C 31300FFF */  andi      $s0, $t1, 0xFFF
/* 31D70 80056970 3C090617 */  lui       $t1, (0x6170000 >> 16)
/* 31D74 80056974 02091025 */  or        $v0, $s0, $t1
/* 31D78 80056978 AE420000 */  sw        $v0, 0x0($s2)
/* 31D7C 8005697C 3C02800A */  lui       $v0, %hi(AuDelayBufferAux)
/* 31D80 80056980 8C423FE4 */  lw        $v0, %lo(AuDelayBufferAux)($v0)
/* 31D84 80056984 00032040 */  sll       $a0, $v1, 1
/* 31D88 80056988 00832021 */  addu      $a0, $a0, $v1
/* 31D8C 8005698C 000420C0 */  sll       $a0, $a0, 3
/* 31D90 80056990 00832023 */  subu      $a0, $a0, $v1
/* 31D94 80056994 00042100 */  sll       $a0, $a0, 4
/* 31D98 80056998 0C0187A4 */  jal       osVirtualToPhysical
/* 31D9C 8005699C 00442021 */   addu     $a0, $v0, $a0
/* 31DA0 800569A0 8FC30000 */  lw        $v1, 0x0($fp)
/* 31DA4 800569A4 3C04800A */  lui       $a0, %hi(AuDelayCount)
/* 31DA8 800569A8 8C843FF0 */  lw        $a0, %lo(AuDelayCount)($a0)
/* 31DAC 800569AC 24630001 */  addiu     $v1, $v1, 0x1
/* 31DB0 800569B0 14800002 */  bnez      $a0, .L800569BC
/* 31DB4 800569B4 0064001A */   div      $zero, $v1, $a0
/* 31DB8 800569B8 0007000D */  break     7
.L800569BC:
/* 31DBC 800569BC 2401FFFF */  addiu     $at, $zero, -0x1
/* 31DC0 800569C0 14810004 */  bne       $a0, $at, .L800569D4
/* 31DC4 800569C4 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 31DC8 800569C8 14610002 */  bne       $v1, $at, .L800569D4
/* 31DCC 800569CC 00000000 */   nop
/* 31DD0 800569D0 0006000D */  break     6
.L800569D4:
/* 31DD4 800569D4 00002810 */  mfhi      $a1
/* 31DD8 800569D8 26730008 */  addiu     $s3, $s3, 0x8
/* 31DDC 800569DC 0260882D */  daddu     $s1, $s3, $zero
/* 31DE0 800569E0 26730008 */  addiu     $s3, $s3, 0x8
/* 31DE4 800569E4 3C090417 */  lui       $t1, (0x4170000 >> 16)
/* 31DE8 800569E8 AE420004 */  sw        $v0, 0x4($s2)
/* 31DEC 800569EC 3C02800A */  lui       $v0, %hi(AuDelayBufferAux)
/* 31DF0 800569F0 8C423FE4 */  lw        $v0, %lo(AuDelayBufferAux)($v0)
/* 31DF4 800569F4 02098025 */  or        $s0, $s0, $t1
/* 31DF8 800569F8 AE300000 */  sw        $s0, 0x0($s1)
/* 31DFC 800569FC 00052040 */  sll       $a0, $a1, 1
/* 31E00 80056A00 00852021 */  addu      $a0, $a0, $a1
/* 31E04 80056A04 000420C0 */  sll       $a0, $a0, 3
/* 31E08 80056A08 00852023 */  subu      $a0, $a0, $a1
/* 31E0C 80056A0C 00042100 */  sll       $a0, $a0, 4
/* 31E10 80056A10 0C0187A4 */  jal       osVirtualToPhysical
/* 31E14 80056A14 00442021 */   addu     $a0, $v0, $a0
/* 31E18 80056A18 AE220004 */  sw        $v0, 0x4($s1)
.L80056A1C:
/* 31E1C 80056A1C 12E00007 */  beqz      $s7, .L80056A3C
/* 31E20 80056A20 0260102D */   daddu    $v0, $s3, $zero
/* 31E24 80056A24 26730008 */  addiu     $s3, $s3, 0x8
/* 31E28 80056A28 3C030200 */  lui       $v1, (0x2000000 >> 16)
/* 31E2C 80056A2C AC430000 */  sw        $v1, 0x0($v0)
/* 31E30 80056A30 240302E0 */  addiu     $v1, $zero, 0x2E0
/* 31E34 80056A34 08015A98 */  j         .L80056A60
/* 31E38 80056A38 AC430004 */   sw       $v1, 0x4($v0)
.L80056A3C:
/* 31E3C 80056A3C 0260802D */  daddu     $s0, $s3, $zero
/* 31E40 80056A40 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31E44 80056A44 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 31E48 80056A48 3C02042E */  lui       $v0, (0x42E0000 >> 16)
/* 31E4C 80056A4C AE020000 */  sw        $v0, 0x0($s0)
/* 31E50 80056A50 8C640028 */  lw        $a0, 0x28($v1)
/* 31E54 80056A54 0C0187A4 */  jal       osVirtualToPhysical
/* 31E58 80056A58 26730008 */   addiu    $s3, $s3, 0x8
/* 31E5C 80056A5C AE020004 */  sw        $v0, 0x4($s0)
.L80056A60:
/* 31E60 80056A60 0260202D */  daddu     $a0, $s3, $zero
/* 31E64 80056A64 26730008 */  addiu     $s3, $s3, 0x8
/* 31E68 80056A68 0260282D */  daddu     $a1, $s3, $zero
/* 31E6C 80056A6C 26730008 */  addiu     $s3, $s3, 0x8
/* 31E70 80056A70 3C060930 */  lui       $a2, (0x9300170 >> 16)
/* 31E74 80056A74 3C0207C0 */  lui       $v0, (0x7C00000 >> 16)
/* 31E78 80056A78 3C090C00 */  lui       $t1, (0xC000000 >> 16)
/* 31E7C 80056A7C 96830000 */  lhu       $v1, 0x0($s4)
/* 31E80 80056A80 34C60170 */  ori       $a2, $a2, (0x9300170 & 0xFFFF)
/* 31E84 80056A84 AC820004 */  sw        $v0, 0x4($a0)
/* 31E88 80056A88 00691825 */  or        $v1, $v1, $t1
/* 31E8C 80056A8C AC830000 */  sw        $v1, 0x0($a0)
/* 31E90 80056A90 96820000 */  lhu       $v0, 0x0($s4)
/* 31E94 80056A94 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31E98 80056A98 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 31E9C 80056A9C 0260802D */  daddu     $s0, $s3, $zero
/* 31EA0 80056AA0 ACA60004 */  sw        $a2, 0x4($a1)
/* 31EA4 80056AA4 00491025 */  or        $v0, $v0, $t1
/* 31EA8 80056AA8 ACA20000 */  sw        $v0, 0x0($a1)
/* 31EAC 80056AAC 3C02062E */  lui       $v0, (0x62E0000 >> 16)
/* 31EB0 80056AB0 AE020000 */  sw        $v0, 0x0($s0)
/* 31EB4 80056AB4 8C640028 */  lw        $a0, 0x28($v1)
/* 31EB8 80056AB8 0C0187A4 */  jal       osVirtualToPhysical
/* 31EBC 80056ABC 26730008 */   addiu    $s3, $s3, 0x8
/* 31EC0 80056AC0 12E00009 */  beqz      $s7, .L80056AE8
/* 31EC4 80056AC4 AE020004 */   sw       $v0, 0x4($s0)
/* 31EC8 80056AC8 0260102D */  daddu     $v0, $s3, $zero
/* 31ECC 80056ACC 26730008 */  addiu     $s3, $s3, 0x8
/* 31ED0 80056AD0 0000B82D */  daddu     $s7, $zero, $zero
/* 31ED4 80056AD4 3C030200 */  lui       $v1, (0x2000000 >> 16)
/* 31ED8 80056AD8 AC430000 */  sw        $v1, 0x0($v0)
/* 31EDC 80056ADC 240302E0 */  addiu     $v1, $zero, 0x2E0
/* 31EE0 80056AE0 08015AC3 */  j         .L80056B0C
/* 31EE4 80056AE4 AC430004 */   sw       $v1, 0x4($v0)
.L80056AE8:
/* 31EE8 80056AE8 0260802D */  daddu     $s0, $s3, $zero
/* 31EEC 80056AEC 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31EF0 80056AF0 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 31EF4 80056AF4 3C02042E */  lui       $v0, (0x42E0000 >> 16)
/* 31EF8 80056AF8 AE020000 */  sw        $v0, 0x0($s0)
/* 31EFC 80056AFC 8C640024 */  lw        $a0, 0x24($v1)
/* 31F00 80056B00 0C0187A4 */  jal       osVirtualToPhysical
/* 31F04 80056B04 26730008 */   addiu    $s3, $s3, 0x8
/* 31F08 80056B08 AE020004 */  sw        $v0, 0x4($s0)
.L80056B0C:
/* 31F0C 80056B0C 0260202D */  daddu     $a0, $s3, $zero
/* 31F10 80056B10 26730008 */  addiu     $s3, $s3, 0x8
/* 31F14 80056B14 0260282D */  daddu     $a1, $s3, $zero
/* 31F18 80056B18 26730008 */  addiu     $s3, $s3, 0x8
/* 31F1C 80056B1C 3C060650 */  lui       $a2, (0x6500170 >> 16)
/* 31F20 80056B20 3C0204E0 */  lui       $v0, (0x4E00000 >> 16)
/* 31F24 80056B24 3C090C00 */  lui       $t1, (0xC000000 >> 16)
/* 31F28 80056B28 96830000 */  lhu       $v1, 0x0($s4)
/* 31F2C 80056B2C 34C60170 */  ori       $a2, $a2, (0x6500170 & 0xFFFF)
/* 31F30 80056B30 AC820004 */  sw        $v0, 0x4($a0)
/* 31F34 80056B34 00691825 */  or        $v1, $v1, $t1
/* 31F38 80056B38 AC830000 */  sw        $v1, 0x0($a0)
/* 31F3C 80056B3C 96820000 */  lhu       $v0, 0x0($s4)
/* 31F40 80056B40 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31F44 80056B44 8C638E54 */  lw        $v1, %lo(gSynDriverPtr)($v1)
/* 31F48 80056B48 0260802D */  daddu     $s0, $s3, $zero
/* 31F4C 80056B4C ACA60004 */  sw        $a2, 0x4($a1)
/* 31F50 80056B50 00491025 */  or        $v0, $v0, $t1
/* 31F54 80056B54 ACA20000 */  sw        $v0, 0x0($a1)
/* 31F58 80056B58 3C02062E */  lui       $v0, (0x62E0000 >> 16)
/* 31F5C 80056B5C AE020000 */  sw        $v0, 0x0($s0)
/* 31F60 80056B60 8C640024 */  lw        $a0, 0x24($v1)
/* 31F64 80056B64 0C0187A4 */  jal       osVirtualToPhysical
/* 31F68 80056B68 26730008 */   addiu    $s3, $s3, 0x8
/* 31F6C 80056B6C AE020004 */  sw        $v0, 0x4($s0)
.L80056B70:
/* 31F70 80056B70 3C038008 */  lui       $v1, %hi(gSynDriverPtr)
/* 31F74 80056B74 24638E54 */  addiu     $v1, $v1, %lo(gSynDriverPtr)
/* 31F78 80056B78 8C620000 */  lw        $v0, 0x0($v1)
/* 31F7C 80056B7C 8C420010 */  lw        $v0, 0x10($v0)
/* 31F80 80056B80 26B50001 */  addiu     $s5, $s5, 0x1
/* 31F84 80056B84 02A2102A */  slt       $v0, $s5, $v0
/* 31F88 80056B88 1440FEF3 */  bnez      $v0, .L80056758
/* 31F8C 80056B8C 26D60018 */   addiu    $s6, $s6, 0x18
.L80056B90:
/* 31F90 80056B90 0260182D */  daddu     $v1, $s3, $zero
/* 31F94 80056B94 26730008 */  addiu     $s3, $s3, 0x8
/* 31F98 80056B98 3C0404E0 */  lui       $a0, (0x4E002E0 >> 16)
/* 31F9C 80056B9C 348402E0 */  ori       $a0, $a0, (0x4E002E0 & 0xFFFF)
/* 31FA0 80056BA0 3C05042E */  lui       $a1, (0x42E07C0 >> 16)
/* 31FA4 80056BA4 34A507C0 */  ori       $a1, $a1, (0x42E07C0 & 0xFFFF)
/* 31FA8 80056BA8 3C020A00 */  lui       $v0, (0xA000000 >> 16)
/* 31FAC 80056BAC AC620000 */  sw        $v0, 0x0($v1)
/* 31FB0 80056BB0 3C028008 */  lui       $v0, %hi(gSynDriverPtr)
/* 31FB4 80056BB4 8C428E54 */  lw        $v0, %lo(gSynDriverPtr)($v0)
/* 31FB8 80056BB8 0260802D */  daddu     $s0, $s3, $zero
/* 31FBC 80056BBC AC640004 */  sw        $a0, 0x4($v1)
/* 31FC0 80056BC0 AE050000 */  sw        $a1, 0x0($s0)
/* 31FC4 80056BC4 8C440028 */  lw        $a0, 0x28($v0)
/* 31FC8 80056BC8 0C0187A4 */  jal       osVirtualToPhysical
/* 31FCC 80056BCC 26730008 */   addiu    $s3, $s3, 0x8
/* 31FD0 80056BD0 0260382D */  daddu     $a3, $s3, $zero
/* 31FD4 80056BD4 26730008 */  addiu     $s3, $s3, 0x8
/* 31FD8 80056BD8 3C060C00 */  lui       $a2, (0xC007FFF >> 16)
/* 31FDC 80056BDC 34C67FFF */  ori       $a2, $a2, (0xC007FFF & 0xFFFF)
/* 31FE0 80056BE0 3C0807C0 */  lui       $t0, (0x7C004E0 >> 16)
/* 31FE4 80056BE4 350804E0 */  ori       $t0, $t0, (0x7C004E0 & 0xFFFF)
/* 31FE8 80056BE8 0260182D */  daddu     $v1, $s3, $zero
/* 31FEC 80056BEC 26730008 */  addiu     $s3, $s3, 0x8
/* 31FF0 80056BF0 3C040930 */  lui       $a0, (0x9300650 >> 16)
/* 31FF4 80056BF4 3C058008 */  lui       $a1, %hi(AuUseGlobalVolume)
/* 31FF8 80056BF8 90A58E58 */  lbu       $a1, %lo(AuUseGlobalVolume)($a1)
/* 31FFC 80056BFC 34840650 */  ori       $a0, $a0, (0x9300650 & 0xFFFF)
/* 32000 80056C00 AE020004 */  sw        $v0, 0x4($s0)
/* 32004 80056C04 ACE60000 */  sw        $a2, 0x0($a3)
/* 32008 80056C08 ACE80004 */  sw        $t0, 0x4($a3)
/* 3200C 80056C0C AC660000 */  sw        $a2, 0x0($v1)
/* 32010 80056C10 10A0001D */  beqz      $a1, .L80056C88
/* 32014 80056C14 AC640004 */   sw       $a0, 0x4($v1)
/* 32018 80056C18 0260202D */  daddu     $a0, $s3, $zero
/* 3201C 80056C1C 26730008 */  addiu     $s3, $s3, 0x8
/* 32020 80056C20 3C020A00 */  lui       $v0, (0xA0004E0 >> 16)
/* 32024 80056C24 344204E0 */  ori       $v0, $v0, (0xA0004E0 & 0xFFFF)
/* 32028 80056C28 0260182D */  daddu     $v1, $s3, $zero
/* 3202C 80056C2C 26730008 */  addiu     $s3, $s3, 0x8
/* 32030 80056C30 3C070200 */  lui       $a3, (0x20004E0 >> 16)
/* 32034 80056C34 34E704E0 */  ori       $a3, $a3, (0x20004E0 & 0xFFFF)
/* 32038 80056C38 0260282D */  daddu     $a1, $s3, $zero
/* 3203C 80056C3C 26730008 */  addiu     $s3, $s3, 0x8
/* 32040 80056C40 0260302D */  daddu     $a2, $s3, $zero
/* 32044 80056C44 26730008 */  addiu     $s3, $s3, 0x8
/* 32048 80056C48 3C080170 */  lui       $t0, (0x1700650 >> 16)
/* 3204C 80056C4C 35080650 */  ori       $t0, $t0, (0x1700650 & 0xFFFF)
/* 32050 80056C50 AC820000 */  sw        $v0, 0x0($a0)
/* 32054 80056C54 240202E0 */  addiu     $v0, $zero, 0x2E0
/* 32058 80056C58 AC820004 */  sw        $v0, 0x4($a0)
/* 3205C 80056C5C AC670000 */  sw        $a3, 0x0($v1)
/* 32060 80056C60 AC620004 */  sw        $v0, 0x4($v1)
/* 32064 80056C64 3C038008 */  lui       $v1, %hi(AuGlobalVolume)
/* 32068 80056C68 94638E5A */  lhu       $v1, %lo(AuGlobalVolume)($v1)
/* 3206C 80056C6C 240204E0 */  addiu     $v0, $zero, 0x4E0
/* 32070 80056C70 ACA20004 */  sw        $v0, 0x4($a1)
/* 32074 80056C74 3C020C00 */  lui       $v0, (0xC000000 >> 16)
/* 32078 80056C78 00621825 */  or        $v1, $v1, $v0
/* 3207C 80056C7C ACA30000 */  sw        $v1, 0x0($a1)
/* 32080 80056C80 ACC30000 */  sw        $v1, 0x0($a2)
/* 32084 80056C84 ACC80004 */  sw        $t0, 0x4($a2)
.L80056C88:
/* 32088 80056C88 0260202D */  daddu     $a0, $s3, $zero
/* 3208C 80056C8C 26730008 */  addiu     $s3, $s3, 0x8
/* 32090 80056C90 0260182D */  daddu     $v1, $s3, $zero
/* 32094 80056C94 8FA90054 */  lw        $t1, 0x54($sp)
/* 32098 80056C98 3C020D00 */  lui       $v0, (0xD000000 >> 16)
/* 3209C 80056C9C 2529FF48 */  addiu     $t1, $t1, -0xB8
/* 320A0 80056CA0 AFA90054 */  sw        $t1, 0x54($sp)
/* 320A4 80056CA4 AC820000 */  sw        $v0, 0x0($a0)
/* 320A8 80056CA8 8FA90010 */  lw        $t1, 0x10($sp)
/* 320AC 80056CAC 3C048008 */  lui       $a0, %hi(gSynDriverPtr)
/* 320B0 80056CB0 8C848E54 */  lw        $a0, %lo(gSynDriverPtr)($a0)
/* 320B4 80056CB4 3C02062E */  lui       $v0, (0x62E0000 >> 16)
/* 320B8 80056CB8 AC690004 */  sw        $t1, 0x4($v1)
/* 320BC 80056CBC 252902E0 */  addiu     $t1, $t1, 0x2E0
/* 320C0 80056CC0 AFA90010 */  sw        $t1, 0x10($sp)
/* 320C4 80056CC4 AC620000 */  sw        $v0, 0x0($v1)
/* 320C8 80056CC8 8FC20000 */  lw        $v0, 0x0($fp)
/* 320CC 80056CCC 8C830000 */  lw        $v1, 0x0($a0)
/* 320D0 80056CD0 24420001 */  addiu     $v0, $v0, 0x1
/* 320D4 80056CD4 246300B8 */  addiu     $v1, $v1, 0xB8
/* 320D8 80056CD8 AFC20000 */  sw        $v0, 0x0($fp)
/* 320DC 80056CDC AC830000 */  sw        $v1, 0x0($a0)
/* 320E0 80056CE0 8FA90054 */  lw        $t1, 0x54($sp)
/* 320E4 80056CE4 1D20FE70 */  bgtz      $t1, .L800566A8
/* 320E8 80056CE8 26730008 */   addiu    $s3, $s3, 0x8
.L80056CEC:
/* 320EC 80056CEC 8FA90048 */  lw        $t1, 0x48($sp)
/* 320F0 80056CF0 02691023 */  subu      $v0, $s3, $t1
/* 320F4 80056CF4 8FA9004C */  lw        $t1, 0x4C($sp)
/* 320F8 80056CF8 000210C3 */  sra       $v0, $v0, 3
/* 320FC 80056CFC AD220000 */  sw        $v0, 0x0($t1)
.L80056D00:
/* 32100 80056D00 0260102D */  daddu     $v0, $s3, $zero
/* 32104 80056D04 8FBF0044 */  lw        $ra, 0x44($sp)
/* 32108 80056D08 8FBE0040 */  lw        $fp, 0x40($sp)
/* 3210C 80056D0C 8FB7003C */  lw        $s7, 0x3C($sp)
/* 32110 80056D10 8FB60038 */  lw        $s6, 0x38($sp)
/* 32114 80056D14 8FB50034 */  lw        $s5, 0x34($sp)
/* 32118 80056D18 8FB40030 */  lw        $s4, 0x30($sp)
/* 3211C 80056D1C 8FB3002C */  lw        $s3, 0x2C($sp)
/* 32120 80056D20 8FB20028 */  lw        $s2, 0x28($sp)
/* 32124 80056D24 8FB10024 */  lw        $s1, 0x24($sp)
/* 32128 80056D28 8FB00020 */  lw        $s0, 0x20($sp)
/* 3212C 80056D2C 03E00008 */  jr        $ra
/* 32130 80056D30 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

Acmd* alAudioFrame(Acmd* cmdList, s32* cmdLen, s16* outBuf, s32 outLen) {
    Acmd* cmdListPos;
    AuPVoice* pvoice;
    AuFxBus* fxBus;

    s16* bufPos;
    s16 auxOut;
    s16 mainOut;

    s32 i;
    s32 first = FALSE;

    cmdListPos = cmdList;
    bufPos = outBuf;
    if (gActiveSynDriverPtr == NULL) {
        *cmdLen = 0;
    } else {
        au_update_players_main();
        if (AuSynStereoDirty) {
            for (i = 0; i < gSynDriverPtr->num_pvoice; i++) {
                pvoice = &gSynDriverPtr->pvoices[i];
                if (pvoice->envMixer.motion == AL_PLAYING) {
                    au_syn_set_pan(i, pvoice->envMixer.pan);
                }
            }
            AuSynStereoDirty = FALSE;
        }
        while (outLen > 0) {
            au_update_clients_2();
            for (i = 0; i < gSynDriverPtr->num_pvoice; i++) {
                pvoice = &gSynDriverPtr->pvoices[i];

                if ((pvoice->busId != 0xFF) && (pvoice->busId < gSynDriverPtr->num_bus)) {
                    fxBus = &gSynDriverPtr->fxBus[pvoice->busId];
                    if (fxBus->tail != NULL) {
                        fxBus->tail->next = pvoice;
                    } else {
                        fxBus->head = pvoice;
                    }
                    fxBus->tail = pvoice;
                }
            }
            first = TRUE;
            for (i = 0; i < gSynDriverPtr->num_bus; i++) {
                fxBus = &gSynDriverPtr->fxBus[i];
                if (fxBus->head != NULL) {
                    // clear all main and aux outputs
                    aClearBuffer(cmdListPos++, N_AL_MAIN_L_OUT, 8 * AUDIO_SAMPLES);
                    if (fxBus->head != NULL) {
                        AuPVoice* next;
                        do {
                            cmdListPos = au_pull_voice(fxBus->head, cmdListPos);
                            next = fxBus->head->next;
                            fxBus->head->next = NULL;
                            fxBus->head = next;
                        } while (next != NULL);
                        fxBus->tail = NULL;
                    }
                    if (fxBus->currentEffectType != AU_FX_NONE) {
                        cmdListPos = au_pull_fx(fxBus->fxL, cmdListPos, N_AL_AUX_L_OUT, 0);
                        cmdListPos = au_pull_fx(fxBus->fxR, cmdListPos, N_AL_AUX_R_OUT, 0);
                    }

                    // apply channel delay
                    if (i == AuDelayedVoiceGroup) {
                        mainOut = -1;
                        switch (AuDelayedChannel) {
                            case 1:
                                mainOut = N_AL_MAIN_L_OUT;
                                auxOut = N_AL_AUX_L_OUT;
                                break;
                            case 2:
                                mainOut = N_AL_MAIN_R_OUT;
                                auxOut = N_AL_AUX_R_OUT;
                                break;
                        }
                        if (mainOut != -1) {
                            n_aSaveBuffer(cmdListPos++, 2 * AUDIO_SAMPLES, mainOut, osVirtualToPhysical(AuDelayBufferMain + (AuDelayCounter % AuDelayCount) * AUDIO_SAMPLES));
                            n_aLoadBuffer(cmdListPos++, 2 * AUDIO_SAMPLES, mainOut, osVirtualToPhysical(AuDelayBufferMain + ((AuDelayCounter + 1) % AuDelayCount) * AUDIO_SAMPLES));
                            n_aSaveBuffer(cmdListPos++, 2 * AUDIO_SAMPLES, auxOut, osVirtualToPhysical(AuDelayBufferAux + (AuDelayCounter % AuDelayCount) * AUDIO_SAMPLES));
                            n_aLoadBuffer(cmdListPos++, 2 * AUDIO_SAMPLES, auxOut, osVirtualToPhysical(AuDelayBufferAux + ((AuDelayCounter + 1) % AuDelayCount) * AUDIO_SAMPLES));
                        }
                    }

                    // mix voice groups
                    if (first) {
                        aClearBuffer(cmdListPos++, 0, 4 * AUDIO_SAMPLES);
                    } else {
                        n_aLoadBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, 0, osVirtualToPhysical(gSynDriverPtr->savedAuxOut));
                    }
                    aMix(cmdListPos++, 0, fxBus->gain, N_AL_AUX_L_OUT, 0);
                    aMix(cmdListPos++, 0, fxBus->gain, N_AL_AUX_R_OUT, 2 * AUDIO_SAMPLES);
                    n_aSaveBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, 0, osVirtualToPhysical(gSynDriverPtr->savedAuxOut));
                    if (first) {
                        aClearBuffer(cmdListPos++, 0, 4 * AUDIO_SAMPLES);
                        first = FALSE;
                    } else {
                        n_aLoadBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, 0, osVirtualToPhysical(gSynDriverPtr->savedMainOut));
                    }
                    aMix(cmdListPos++, 0, fxBus->gain, N_AL_MAIN_L_OUT, 0);
                    aMix(cmdListPos++, 0, fxBus->gain, N_AL_MAIN_R_OUT, 2 * AUDIO_SAMPLES);
                    n_aSaveBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, 0, osVirtualToPhysical(gSynDriverPtr->savedMainOut));
                }
            }

            aDMEMMove(cmdListPos++, 0, N_AL_MAIN_L_OUT, 4 * AUDIO_SAMPLES);
            n_aLoadBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, N_AL_AUX_L_OUT, osVirtualToPhysical(gSynDriverPtr->savedAuxOut));
            aMix(cmdListPos++, 0, 0x7FFF, N_AL_AUX_L_OUT, N_AL_MAIN_L_OUT);
            aMix(cmdListPos++, 0, 0x7FFF, N_AL_AUX_R_OUT, N_AL_MAIN_R_OUT);

            if (AuUseGlobalVolume) {
                u16 vol;
                aDMEMMove(cmdListPos++, N_AL_MAIN_L_OUT, 0, 4 * AUDIO_SAMPLES);
                aClearBuffer(cmdListPos++, N_AL_MAIN_L_OUT, 4 * AUDIO_SAMPLES);
                vol = AuGlobalVolume;
                aMix(cmdListPos++, 0, vol, 0, N_AL_MAIN_L_OUT);
                aMix(cmdListPos++, 0, vol, 2 * AUDIO_SAMPLES, N_AL_MAIN_R_OUT);
            }

            outLen -= AUDIO_SAMPLES;
            n_aInterleave(cmdListPos++);
            n_aSaveBuffer(cmdListPos++, 4 * AUDIO_SAMPLES, 0, bufPos);
            bufPos += 2 * AUDIO_SAMPLES;
            AuDelayCounter++;
            gSynDriverPtr->curSamples += AUDIO_SAMPLES;
        }
        *cmdLen = (cmdListPos - cmdList);
    }
    return cmdListPos;
}