### RAW ASSEMBLY INSTRUCTIONS:

glabel au_bgm_player_update_playing
/* 2A068 8004EC68 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 2A06C 8004EC6C AFB40040 */  sw        $s4, 0x40($sp)
/* 2A070 8004EC70 0080A02D */  daddu     $s4, $a0, $zero
/* 2A074 8004EC74 AFBF0054 */  sw        $ra, 0x54($sp)
/* 2A078 8004EC78 AFBE0050 */  sw        $fp, 0x50($sp)
/* 2A07C 8004EC7C AFB7004C */  sw        $s7, 0x4C($sp)
/* 2A080 8004EC80 AFB60048 */  sw        $s6, 0x48($sp)
/* 2A084 8004EC84 AFB50044 */  sw        $s5, 0x44($sp)
/* 2A088 8004EC88 AFB3003C */  sw        $s3, 0x3C($sp)
/* 2A08C 8004EC8C AFB20038 */  sw        $s2, 0x38($sp)
/* 2A090 8004EC90 AFB10034 */  sw        $s1, 0x34($sp)
/* 2A094 8004EC94 AFB00030 */  sw        $s0, 0x30($sp)
/* 2A098 8004EC98 AFA00010 */  sw        $zero, 0x10($sp)
/* 2A09C 8004EC9C 8E8200BC */  lw        $v0, 0xBC($s4)
/* 2A0A0 8004ECA0 10400011 */  beqz      $v0, .L8004ECE8
/* 2A0A4 8004ECA4 A3A00028 */   sb       $zero, 0x28($sp)
/* 2A0A8 8004ECA8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 2A0AC 8004ECAC 14400005 */  bnez      $v0, .L8004ECC4
/* 2A0B0 8004ECB0 AE8200BC */   sw       $v0, 0xBC($s4)
/* 2A0B4 8004ECB4 8E8200B8 */  lw        $v0, 0xB8($s4)
/* 2A0B8 8004ECB8 AE8000B8 */  sw        $zero, 0xB8($s4)
/* 2A0BC 8004ECBC 08013B34 */  j         .L8004ECD0
/* 2A0C0 8004ECC0 AE8000B4 */   sw       $zero, 0xB4($s4)
.L8004ECC4:
/* 2A0C4 8004ECC4 8E8200B0 */  lw        $v0, 0xB0($s4)
/* 2A0C8 8004ECC8 8E8300B4 */  lw        $v1, 0xB4($s4)
/* 2A0CC 8004ECCC 00431021 */  addu      $v0, $v0, $v1
.L8004ECD0:
/* 2A0D0 8004ECD0 AE8200B0 */  sw        $v0, 0xB0($s4)
/* 2A0D4 8004ECD4 8E8300B0 */  lw        $v1, 0xB0($s4)
/* 2A0D8 8004ECD8 00031080 */  sll       $v0, $v1, 2
/* 2A0DC 8004ECDC 00431021 */  addu      $v0, $v0, $v1
/* 2A0E0 8004ECE0 00021040 */  sll       $v0, $v0, 1
/* 2A0E4 8004ECE4 AE820008 */  sw        $v0, 0x8($s4)
.L8004ECE8:
/* 2A0E8 8004ECE8 8E8200CC */  lw        $v0, 0xCC($s4)
/* 2A0EC 8004ECEC 1040000D */  beqz      $v0, .L8004ED24
/* 2A0F0 8004ECF0 2442FFFF */   addiu    $v0, $v0, -0x1
/* 2A0F4 8004ECF4 14400005 */  bnez      $v0, .L8004ED0C
/* 2A0F8 8004ECF8 AE8200CC */   sw       $v0, 0xCC($s4)
/* 2A0FC 8004ECFC 8E8200C8 */  lw        $v0, 0xC8($s4)
/* 2A100 8004ED00 AE8000C8 */  sw        $zero, 0xC8($s4)
/* 2A104 8004ED04 08013B46 */  j         .L8004ED18
/* 2A108 8004ED08 AE8000C4 */   sw       $zero, 0xC4($s4)
.L8004ED0C:
/* 2A10C 8004ED0C 8E8200C0 */  lw        $v0, 0xC0($s4)
/* 2A110 8004ED10 8E8300C4 */  lw        $v1, 0xC4($s4)
/* 2A114 8004ED14 00431021 */  addu      $v0, $v0, $v1
.L8004ED18:
/* 2A118 8004ED18 AE8200C0 */  sw        $v0, 0xC0($s4)
/* 2A11C 8004ED1C 240B0001 */  addiu     $t3, $zero, 0x1
/* 2A120 8004ED20 AFAB0010 */  sw        $t3, 0x10($sp)
.L8004ED24:
/* 2A124 8004ED24 8E820204 */  lw        $v0, 0x204($s4)
/* 2A128 8004ED28 1040003B */  beqz      $v0, .L8004EE18
/* 2A12C 8004ED2C A280021A */   sb       $zero, 0x21A($s4)
/* 2A130 8004ED30 92820232 */  lbu       $v0, 0x232($s4)
/* 2A134 8004ED34 1040001D */  beqz      $v0, .L8004EDAC
/* 2A138 8004ED38 2411000F */   addiu    $s1, $zero, 0xF
/* 2A13C 8004ED3C 24160030 */  addiu     $s6, $zero, 0x30
.L8004ED40:
/* 2A140 8004ED40 8E820204 */  lw        $v0, 0x204($s4)
/* 2A144 8004ED44 90570000 */  lbu       $s7, 0x0($v0)
/* 2A148 8004ED48 24420001 */  addiu     $v0, $v0, 0x1
/* 2A14C 8004ED4C 12E00030 */  beqz      $s7, .L8004EE10
/* 2A150 8004ED50 AE820204 */   sw       $v0, 0x204($s4)
/* 2A154 8004ED54 0040182D */  daddu     $v1, $v0, $zero
/* 2A158 8004ED58 00171040 */  sll       $v0, $s7, 1
/* 2A15C 8004ED5C 00571021 */  addu      $v0, $v0, $s7
/* 2A160 8004ED60 00021140 */  sll       $v0, $v0, 5
/* 2A164 8004ED64 244201FC */  addiu     $v0, $v0, 0x1FC
/* 2A168 8004ED68 02828021 */  addu      $s0, $s4, $v0
/* 2A16C 8004ED6C A69600D4 */  sh        $s6, 0xD4($s4)
/* 2A170 8004ED70 90620000 */  lbu       $v0, 0x0($v1)
/* 2A174 8004ED74 24630001 */  addiu     $v1, $v1, 0x1
/* 2A178 8004ED78 AE830204 */  sw        $v1, 0x204($s4)
/* 2A17C 8004ED7C A28200D6 */  sb        $v0, 0xD6($s4)
/* 2A180 8004ED80 8E020000 */  lw        $v0, 0x0($s0)
/* 2A184 8004ED84 10400005 */  beqz      $v0, .L8004ED9C
/* 2A188 8004ED88 0220102D */   daddu    $v0, $s1, $zero
/* 2A18C 8004ED8C 0280202D */  daddu     $a0, $s4, $zero
/* 2A190 8004ED90 0C013FB4 */  jal       au_BGMCmd_F6_TrackVolumeFade
/* 2A194 8004ED94 0200282D */   daddu    $a1, $s0, $zero
/* 2A198 8004ED98 0220102D */  daddu     $v0, $s1, $zero
.L8004ED9C:
/* 2A19C 8004ED9C 1440FFE8 */  bnez      $v0, .L8004ED40
/* 2A1A0 8004EDA0 2631FFFF */   addiu    $s1, $s1, -0x1
/* 2A1A4 8004EDA4 08013B85 */  j         .L8004EE14
/* 2A1A8 8004EDA8 AE800204 */   sw       $zero, 0x204($s4)
.L8004EDAC:
/* 2A1AC 8004EDAC 24160030 */  addiu     $s6, $zero, 0x30
.L8004EDB0:
/* 2A1B0 8004EDB0 8E820204 */  lw        $v0, 0x204($s4)
/* 2A1B4 8004EDB4 90570000 */  lbu       $s7, 0x0($v0)
/* 2A1B8 8004EDB8 24420001 */  addiu     $v0, $v0, 0x1
/* 2A1BC 8004EDBC 12E00014 */  beqz      $s7, .L8004EE10
/* 2A1C0 8004EDC0 AE820204 */   sw       $v0, 0x204($s4)
/* 2A1C4 8004EDC4 00171040 */  sll       $v0, $s7, 1
/* 2A1C8 8004EDC8 00571021 */  addu      $v0, $v0, $s7
/* 2A1CC 8004EDCC 00021140 */  sll       $v0, $v0, 5
/* 2A1D0 8004EDD0 244201FC */  addiu     $v0, $v0, 0x1FC
/* 2A1D4 8004EDD4 8E830204 */  lw        $v1, 0x204($s4)
/* 2A1D8 8004EDD8 02828021 */  addu      $s0, $s4, $v0
/* 2A1DC 8004EDDC A69600D4 */  sh        $s6, 0xD4($s4)
/* 2A1E0 8004EDE0 A28000D6 */  sb        $zero, 0xD6($s4)
/* 2A1E4 8004EDE4 24630001 */  addiu     $v1, $v1, 0x1
/* 2A1E8 8004EDE8 AE830204 */  sw        $v1, 0x204($s4)
/* 2A1EC 8004EDEC 8E020000 */  lw        $v0, 0x0($s0)
/* 2A1F0 8004EDF0 10400005 */  beqz      $v0, .L8004EE08
/* 2A1F4 8004EDF4 0220102D */   daddu    $v0, $s1, $zero
/* 2A1F8 8004EDF8 0280202D */  daddu     $a0, $s4, $zero
/* 2A1FC 8004EDFC 0C013FB4 */  jal       au_BGMCmd_F6_TrackVolumeFade
/* 2A200 8004EE00 0200282D */   daddu    $a1, $s0, $zero
/* 2A204 8004EE04 0220102D */  daddu     $v0, $s1, $zero
.L8004EE08:
/* 2A208 8004EE08 1440FFE9 */  bnez      $v0, .L8004EDB0
/* 2A20C 8004EE0C 2631FFFF */   addiu    $s1, $s1, -0x1
.L8004EE10:
/* 2A210 8004EE10 AE800204 */  sw        $zero, 0x204($s4)
.L8004EE14:
/* 2A214 8004EE14 A2800232 */  sb        $zero, 0x232($s4)
.L8004EE18:
/* 2A218 8004EE18 0000B82D */  daddu     $s7, $zero, $zero
/* 2A21C 8004EE1C 00171040 */  sll       $v0, $s7, 1
.L8004EE20:
/* 2A220 8004EE20 00571021 */  addu      $v0, $v0, $s7
/* 2A224 8004EE24 00021140 */  sll       $v0, $v0, 5
/* 2A228 8004EE28 2442025C */  addiu     $v0, $v0, 0x25C
/* 2A22C 8004EE2C 02828021 */  addu      $s0, $s4, $v0
/* 2A230 8004EE30 8E020000 */  lw        $v0, 0x0($s0)
/* 2A234 8004EE34 5040034E */  beql      $v0, $zero, .L8004FB70
/* 2A238 8004EE38 26F70001 */   addiu    $s7, $s7, 0x1
/* 2A23C 8004EE3C AE000040 */  sw        $zero, 0x40($s0)
/* 2A240 8004EE40 8FAB0010 */  lw        $t3, 0x10($sp)
/* 2A244 8004EE44 15600004 */  bnez      $t3, .L8004EE58
/* 2A248 8004EE48 240B0001 */   addiu    $t3, $zero, 0x1
/* 2A24C 8004EE4C 8282021A */  lb        $v0, 0x21A($s4)
/* 2A250 8004EE50 50400002 */  beql      $v0, $zero, .L8004EE5C
/* 2A254 8004EE54 A2000041 */   sb       $zero, 0x41($s0)
.L8004EE58:
/* 2A258 8004EE58 A20B0041 */  sb        $t3, 0x41($s0)
.L8004EE5C:
/* 2A25C 8004EE5C 8E020024 */  lw        $v0, 0x24($s0)
/* 2A260 8004EE60 1040000C */  beqz      $v0, .L8004EE94
/* 2A264 8004EE64 2442FFFF */   addiu    $v0, $v0, -0x1
/* 2A268 8004EE68 14400004 */  bnez      $v0, .L8004EE7C
/* 2A26C 8004EE6C AE020024 */   sw       $v0, 0x24($s0)
/* 2A270 8004EE70 8E020020 */  lw        $v0, 0x20($s0)
/* 2A274 8004EE74 08013BA3 */  j         .L8004EE8C
/* 2A278 8004EE78 AE020018 */   sw       $v0, 0x18($s0)
.L8004EE7C:
/* 2A27C 8004EE7C 8E020018 */  lw        $v0, 0x18($s0)
/* 2A280 8004EE80 8E03001C */  lw        $v1, 0x1C($s0)
/* 2A284 8004EE84 00431021 */  addu      $v0, $v0, $v1
/* 2A288 8004EE88 AE020018 */  sw        $v0, 0x18($s0)
.L8004EE8C:
/* 2A28C 8004EE8C 240B0001 */  addiu     $t3, $zero, 0x1
/* 2A290 8004EE90 A20B0041 */  sb        $t3, 0x41($s0)
.L8004EE94:
/* 2A294 8004EE94 86020036 */  lh        $v0, 0x36($s0)
/* 2A298 8004EE98 96030036 */  lhu       $v1, 0x36($s0)
/* 2A29C 8004EE9C 1040000E */  beqz      $v0, .L8004EED8
/* 2A2A0 8004EEA0 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A2A4 8004EEA4 A6020036 */  sh        $v0, 0x36($s0)
/* 2A2A8 8004EEA8 00021400 */  sll       $v0, $v0, 16
/* 2A2AC 8004EEAC 14400004 */  bnez      $v0, .L8004EEC0
/* 2A2B0 8004EEB0 00000000 */   nop
/* 2A2B4 8004EEB4 86020034 */  lh        $v0, 0x34($s0)
/* 2A2B8 8004EEB8 08013BB3 */  j         .L8004EECC
/* 2A2BC 8004EEBC 00021400 */   sll      $v0, $v0, 16
.L8004EEC0:
/* 2A2C0 8004EEC0 8E02002C */  lw        $v0, 0x2C($s0)
/* 2A2C4 8004EEC4 8E030030 */  lw        $v1, 0x30($s0)
/* 2A2C8 8004EEC8 00431021 */  addu      $v0, $v0, $v1
.L8004EECC:
/* 2A2CC 8004EECC AE02002C */  sw        $v0, 0x2C($s0)
/* 2A2D0 8004EED0 240B0001 */  addiu     $t3, $zero, 0x1
/* 2A2D4 8004EED4 A20B0041 */  sb        $t3, 0x41($s0)
.L8004EED8:
/* 2A2D8 8004EED8 8E020028 */  lw        $v0, 0x28($s0)
/* 2A2DC 8004EEDC 2442FFFF */  addiu     $v0, $v0, -0x1
/* 2A2E0 8004EEE0 1C400250 */  bgtz      $v0, .L8004F824
/* 2A2E4 8004EEE4 AE020028 */   sw       $v0, 0x28($s0)
/* 2A2E8 8004EEE8 920B0052 */  lbu       $t3, 0x52($s0)
/* 2A2EC 8004EEEC 1440024D */  bnez      $v0, .L8004F824
/* 2A2F0 8004EEF0 A3AB001F */   sb       $t3, 0x1F($sp)
.L8004EEF4:
/* 2A2F4 8004EEF4 8E020000 */  lw        $v0, 0x0($s0)
/* 2A2F8 8004EEF8 90470000 */  lbu       $a3, 0x0($v0)
/* 2A2FC 8004EEFC 24420001 */  addiu     $v0, $v0, 0x1
/* 2A300 8004EF00 AE020000 */  sw        $v0, 0x0($s0)
/* 2A304 8004EF04 8602003E */  lh        $v0, 0x3E($s0)
/* 2A308 8004EF08 9603003E */  lhu       $v1, 0x3E($s0)
/* 2A30C 8004EF0C 10400007 */  beqz      $v0, .L8004EF2C
/* 2A310 8004EF10 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A314 8004EF14 A602003E */  sh        $v0, 0x3E($s0)
/* 2A318 8004EF18 00021400 */  sll       $v0, $v0, 16
/* 2A31C 8004EF1C 14400004 */  bnez      $v0, .L8004EF30
/* 2A320 8004EF20 00071600 */   sll      $v0, $a3, 24
/* 2A324 8004EF24 8E020004 */  lw        $v0, 0x4($s0)
/* 2A328 8004EF28 AE020000 */  sw        $v0, 0x0($s0)
.L8004EF2C:
/* 2A32C 8004EF2C 00071600 */  sll       $v0, $a3, 24
.L8004EF30:
/* 2A330 8004EF30 0440002B */  bltz      $v0, .L8004EFE0
/* 2A334 8004EF34 30E300FF */   andi     $v1, $a3, 0xFF
/* 2A338 8004EF38 14600009 */  bnez      $v1, .L8004EF60
/* 2A33C 8004EF3C 2C620078 */   sltiu    $v0, $v1, 0x78
/* 2A340 8004EF40 8E020008 */  lw        $v0, 0x8($s0)
/* 2A344 8004EF44 10400004 */  beqz      $v0, .L8004EF58
/* 2A348 8004EF48 240B0001 */   addiu    $t3, $zero, 0x1
/* 2A34C 8004EF4C AE020000 */  sw        $v0, 0x0($s0)
/* 2A350 8004EF50 08013E06 */  j         .L8004F818
/* 2A354 8004EF54 AE000008 */   sw       $zero, 0x8($s0)
.L8004EF58:
/* 2A358 8004EF58 08013E09 */  j         .L8004F824
/* 2A35C 8004EF5C A3AB0028 */   sb       $t3, 0x28($sp)
.L8004EF60:
/* 2A360 8004EF60 5440022D */  bnel      $v0, $zero, .L8004F818
/* 2A364 8004EF64 AE030028 */   sw       $v1, 0x28($s0)
/* 2A368 8004EF68 8E020000 */  lw        $v0, 0x0($s0)
/* 2A36C 8004EF6C 90430000 */  lbu       $v1, 0x0($v0)
/* 2A370 8004EF70 24420001 */  addiu     $v0, $v0, 0x1
/* 2A374 8004EF74 AE020000 */  sw        $v0, 0x0($s0)
/* 2A378 8004EF78 30E20007 */  andi      $v0, $a3, 0x7
/* 2A37C 8004EF7C 00021200 */  sll       $v0, $v0, 8
/* 2A380 8004EF80 00431021 */  addu      $v0, $v0, $v1
/* 2A384 8004EF84 24420078 */  addiu     $v0, $v0, 0x78
/* 2A388 8004EF88 AE020028 */  sw        $v0, 0x28($s0)
/* 2A38C 8004EF8C 8602003E */  lh        $v0, 0x3E($s0)
/* 2A390 8004EF90 9603003E */  lhu       $v1, 0x3E($s0)
/* 2A394 8004EF94 10400220 */  beqz      $v0, .L8004F818
/* 2A398 8004EF98 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A39C 8004EF9C A602003E */  sh        $v0, 0x3E($s0)
/* 2A3A0 8004EFA0 00021400 */  sll       $v0, $v0, 16
/* 2A3A4 8004EFA4 1440021C */  bnez      $v0, .L8004F818
/* 2A3A8 8004EFA8 00000000 */   nop
/* 2A3AC 8004EFAC 8E020004 */  lw        $v0, 0x4($s0)
/* 2A3B0 8004EFB0 08013E06 */  j         .L8004F818
/* 2A3B4 8004EFB4 AE020000 */   sw       $v0, 0x0($s0)
.L8004EFB8:
/* 2A3B8 8004EFB8 08013C47 */  j         .L8004F11C
/* 2A3BC 8004EFBC 24110001 */   addiu    $s1, $zero, 0x1
.L8004EFC0:
/* 2A3C0 8004EFC0 0C014E31 */  jal       au_reset_voice
/* 2A3C4 8004EFC4 0240202D */   daddu    $a0, $s2, $zero
/* 2A3C8 8004EFC8 08013C63 */  j         .L8004F18C
/* 2A3CC 8004EFCC 24110001 */   addiu    $s1, $zero, 0x1
.L8004EFD0:
/* 2A3D0 8004EFD0 0C014E31 */  jal       au_reset_voice
/* 2A3D4 8004EFD4 0240202D */   daddu    $a0, $s2, $zero
/* 2A3D8 8004EFD8 08013C82 */  j         .L8004F208
/* 2A3DC 8004EFDC 24110001 */   addiu    $s1, $zero, 0x1
.L8004EFE0:
/* 2A3E0 8004EFE0 2C6200D4 */  sltiu     $v0, $v1, 0xD4
/* 2A3E4 8004EFE4 104001B7 */  beqz      $v0, .L8004F6C4
/* 2A3E8 8004EFE8 00000000 */   nop
/* 2A3EC 8004EFEC 8E020000 */  lw        $v0, 0x0($s0)
/* 2A3F0 8004EFF0 905E0000 */  lbu       $fp, 0x0($v0)
/* 2A3F4 8004EFF4 24420001 */  addiu     $v0, $v0, 0x1
/* 2A3F8 8004EFF8 AE020000 */  sw        $v0, 0x0($s0)
/* 2A3FC 8004EFFC 30E2007F */  andi      $v0, $a3, 0x7F
/* 2A400 8004F000 304200FF */  andi      $v0, $v0, 0xFF
/* 2A404 8004F004 A7A20026 */  sh        $v0, 0x26($sp)
/* 2A408 8004F008 8602003E */  lh        $v0, 0x3E($s0)
/* 2A40C 8004F00C 9603003E */  lhu       $v1, 0x3E($s0)
/* 2A410 8004F010 10400007 */  beqz      $v0, .L8004F030
/* 2A414 8004F014 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A418 8004F018 A602003E */  sh        $v0, 0x3E($s0)
/* 2A41C 8004F01C 00021400 */  sll       $v0, $v0, 16
/* 2A420 8004F020 14400003 */  bnez      $v0, .L8004F030
/* 2A424 8004F024 00000000 */   nop
/* 2A428 8004F028 8E020004 */  lw        $v0, 0x4($s0)
/* 2A42C 8004F02C AE020000 */  sw        $v0, 0x0($s0)
.L8004F030:
/* 2A430 8004F030 8E020000 */  lw        $v0, 0x0($s0)
/* 2A434 8004F034 90560000 */  lbu       $s6, 0x0($v0)
/* 2A438 8004F038 24420001 */  addiu     $v0, $v0, 0x1
/* 2A43C 8004F03C AE020000 */  sw        $v0, 0x0($s0)
/* 2A440 8004F040 8602003E */  lh        $v0, 0x3E($s0)
/* 2A444 8004F044 9603003E */  lhu       $v1, 0x3E($s0)
/* 2A448 8004F048 10400007 */  beqz      $v0, .L8004F068
/* 2A44C 8004F04C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A450 8004F050 A602003E */  sh        $v0, 0x3E($s0)
/* 2A454 8004F054 00021400 */  sll       $v0, $v0, 16
/* 2A458 8004F058 14400004 */  bnez      $v0, .L8004F06C
/* 2A45C 8004F05C 2AC200C0 */   slti     $v0, $s6, 0xC0
/* 2A460 8004F060 8E020004 */  lw        $v0, 0x4($s0)
/* 2A464 8004F064 AE020000 */  sw        $v0, 0x0($s0)
.L8004F068:
/* 2A468 8004F068 2AC200C0 */  slti      $v0, $s6, 0xC0
.L8004F06C:
/* 2A46C 8004F06C 14400013 */  bnez      $v0, .L8004F0BC
/* 2A470 8004F070 00000000 */   nop
/* 2A474 8004F074 8E020000 */  lw        $v0, 0x0($s0)
/* 2A478 8004F078 90430000 */  lbu       $v1, 0x0($v0)
/* 2A47C 8004F07C 24420001 */  addiu     $v0, $v0, 0x1
/* 2A480 8004F080 AE020000 */  sw        $v0, 0x0($s0)
/* 2A484 8004F084 32C2003F */  andi      $v0, $s6, 0x3F
/* 2A488 8004F088 00021200 */  sll       $v0, $v0, 8
/* 2A48C 8004F08C 00431021 */  addu      $v0, $v0, $v1
/* 2A490 8004F090 245600C0 */  addiu     $s6, $v0, 0xC0
/* 2A494 8004F094 8602003E */  lh        $v0, 0x3E($s0)
/* 2A498 8004F098 9603003E */  lhu       $v1, 0x3E($s0)
/* 2A49C 8004F09C 10400007 */  beqz      $v0, .L8004F0BC
/* 2A4A0 8004F0A0 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2A4A4 8004F0A4 A602003E */  sh        $v0, 0x3E($s0)
/* 2A4A8 8004F0A8 00021400 */  sll       $v0, $v0, 16
/* 2A4AC 8004F0AC 14400003 */  bnez      $v0, .L8004F0BC
/* 2A4B0 8004F0B0 00000000 */   nop
/* 2A4B4 8004F0B4 8E020004 */  lw        $v0, 0x4($s0)
/* 2A4B8 8004F0B8 AE020000 */  sw        $v0, 0x0($s0)
.L8004F0BC:
/* 2A4BC 8004F0BC 9202005A */  lbu       $v0, 0x5A($s0)
/* 2A4C0 8004F0C0 14400097 */  bnez      $v0, .L8004F320
/* 2A4C4 8004F0C4 0000882D */   daddu    $s1, $zero, $zero
/* 2A4C8 8004F0C8 93B5001F */  lbu       $s5, 0x1F($sp)
/* 2A4CC 8004F0CC 92040053 */  lbu       $a0, 0x53($s0)
/* 2A4D0 8004F0D0 32A300FF */  andi      $v1, $s5, 0xFF
/* 2A4D4 8004F0D4 0064102B */  sltu      $v0, $v1, $a0
/* 2A4D8 8004F0D8 10400010 */  beqz      $v0, .L8004F11C
/* 2A4DC 8004F0DC 000310C0 */   sll      $v0, $v1, 3
/* 2A4E0 8004F0E0 8E850000 */  lw        $a1, 0x0($s4)
.L8004F0E4:
/* 2A4E4 8004F0E4 00431021 */  addu      $v0, $v0, $v1
/* 2A4E8 8004F0E8 000210C0 */  sll       $v0, $v0, 3
/* 2A4EC 8004F0EC 24421320 */  addiu     $v0, $v0, 0x1320
/* 2A4F0 8004F0F0 00A29021 */  addu      $s2, $a1, $v0
/* 2A4F4 8004F0F4 93AB001F */  lbu       $t3, 0x1F($sp)
/* 2A4F8 8004F0F8 92420045 */  lbu       $v0, 0x45($s2)
/* 2A4FC 8004F0FC 256B0001 */  addiu     $t3, $t3, 0x1
/* 2A500 8004F100 1040FFAD */  beqz      $v0, .L8004EFB8
/* 2A504 8004F104 A3AB001F */   sb       $t3, 0x1F($sp)
/* 2A508 8004F108 26B50001 */  addiu     $s5, $s5, 0x1
/* 2A50C 8004F10C 32A300FF */  andi      $v1, $s5, 0xFF
/* 2A510 8004F110 0064102B */  sltu      $v0, $v1, $a0
/* 2A514 8004F114 1440FFF3 */  bnez      $v0, .L8004F0E4
/* 2A518 8004F118 000310C0 */   sll      $v0, $v1, 3
.L8004F11C:
/* 2A51C 8004F11C 16200082 */  bnez      $s1, .L8004F328
/* 2A520 8004F120 32A200FF */   andi     $v0, $s5, 0xFF
/* 2A524 8004F124 92020054 */  lbu       $v0, 0x54($s0)
/* 2A528 8004F128 2C420005 */  sltiu     $v0, $v0, 0x5
/* 2A52C 8004F12C 14400066 */  bnez      $v0, .L8004F2C8
/* 2A530 8004F130 00000000 */   nop
/* 2A534 8004F134 92150052 */  lbu       $s5, 0x52($s0)
/* 2A538 8004F138 92030053 */  lbu       $v1, 0x53($s0)
/* 2A53C 8004F13C 32A500FF */  andi      $a1, $s5, 0xFF
/* 2A540 8004F140 00A3102B */  sltu      $v0, $a1, $v1
/* 2A544 8004F144 10400011 */  beqz      $v0, .L8004F18C
/* 2A548 8004F148 000510C0 */   sll      $v0, $a1, 3
/* 2A54C 8004F14C 0060302D */  daddu     $a2, $v1, $zero
/* 2A550 8004F150 8E840000 */  lw        $a0, 0x0($s4)
/* 2A554 8004F154 92830234 */  lbu       $v1, 0x234($s4)
.L8004F158:
/* 2A558 8004F158 00451021 */  addu      $v0, $v0, $a1
/* 2A55C 8004F15C 000210C0 */  sll       $v0, $v0, 3
/* 2A560 8004F160 24421320 */  addiu     $v0, $v0, 0x1320
/* 2A564 8004F164 00829021 */  addu      $s2, $a0, $v0
/* 2A568 8004F168 92420045 */  lbu       $v0, 0x45($s2)
/* 2A56C 8004F16C 0043102B */  sltu      $v0, $v0, $v1
/* 2A570 8004F170 1440FF93 */  bnez      $v0, .L8004EFC0
/* 2A574 8004F174 00000000 */   nop
/* 2A578 8004F178 26B50001 */  addiu     $s5, $s5, 0x1
/* 2A57C 8004F17C 32A500FF */  andi      $a1, $s5, 0xFF
/* 2A580 8004F180 00A6102B */  sltu      $v0, $a1, $a2
/* 2A584 8004F184 1440FFF4 */  bnez      $v0, .L8004F158
/* 2A588 8004F188 000510C0 */   sll      $v0, $a1, 3
.L8004F18C:
/* 2A58C 8004F18C 16200066 */  bnez      $s1, .L8004F328
/* 2A590 8004F190 32A200FF */   andi     $v0, $s5, 0xFF
/* 2A594 8004F194 92150052 */  lbu       $s5, 0x52($s0)
/* 2A598 8004F198 92030053 */  lbu       $v1, 0x53($s0)
/* 2A59C 8004F19C 32A500FF */  andi      $a1, $s5, 0xFF
/* 2A5A0 8004F1A0 00A3102B */  sltu      $v0, $a1, $v1
/* 2A5A4 8004F1A4 10400018 */  beqz      $v0, .L8004F208
/* 2A5A8 8004F1A8 000510C0 */   sll      $v0, $a1, 3
/* 2A5AC 8004F1AC 0060302D */  daddu     $a2, $v1, $zero
/* 2A5B0 8004F1B0 8E840000 */  lw        $a0, 0x0($s4)
/* 2A5B4 8004F1B4 92830234 */  lbu       $v1, 0x234($s4)
.L8004F1B8:
/* 2A5B8 8004F1B8 00451021 */  addu      $v0, $v0, $a1
/* 2A5BC 8004F1BC 000210C0 */  sll       $v0, $v0, 3
/* 2A5C0 8004F1C0 24421320 */  addiu     $v0, $v0, 0x1320
/* 2A5C4 8004F1C4 00829021 */  addu      $s2, $a0, $v0
/* 2A5C8 8004F1C8 92420045 */  lbu       $v0, 0x45($s2)
/* 2A5CC 8004F1CC 5443000A */  bnel      $v0, $v1, .L8004F1F8
/* 2A5D0 8004F1D0 26B50001 */   addiu    $s5, $s5, 0x1
/* 2A5D4 8004F1D4 00051040 */  sll       $v0, $a1, 1
/* 2A5D8 8004F1D8 00451021 */  addu      $v0, $v0, $a1
/* 2A5DC 8004F1DC 000210C0 */  sll       $v0, $v0, 3
/* 2A5E0 8004F1E0 2442085C */  addiu     $v0, $v0, 0x85C
/* 2A5E4 8004F1E4 02829821 */  addu      $s3, $s4, $v0
/* 2A5E8 8004F1E8 8E62000C */  lw        $v0, 0xC($s3)
/* 2A5EC 8004F1EC 1040FF78 */  beqz      $v0, .L8004EFD0
/* 2A5F0 8004F1F0 00000000 */   nop
/* 2A5F4 8004F1F4 26B50001 */  addiu     $s5, $s5, 0x1
.L8004F1F8:
/* 2A5F8 8004F1F8 32A500FF */  andi      $a1, $s5, 0xFF
/* 2A5FC 8004F1FC 00A6102B */  sltu      $v0, $a1, $a2
/* 2A600 8004F200 1440FFED */  bnez      $v0, .L8004F1B8
/* 2A604 8004F204 000510C0 */   sll      $v0, $a1, 3
.L8004F208:
/* 2A608 8004F208 16200047 */  bnez      $s1, .L8004F328
/* 2A60C 8004F20C 32A200FF */   andi     $v0, $s5, 0xFF
/* 2A610 8004F210 92050052 */  lbu       $a1, 0x52($s0)
/* 2A614 8004F214 92040053 */  lbu       $a0, 0x53($s0)
/* 2A618 8004F218 30A300FF */  andi      $v1, $a1, 0xFF
/* 2A61C 8004F21C 0064102B */  sltu      $v0, $v1, $a0
/* 2A620 8004F220 10400022 */  beqz      $v0, .L8004F2AC
/* 2A624 8004F224 3407FFFF */   ori      $a3, $zero, 0xFFFF
/* 2A628 8004F228 0080502D */  daddu     $t2, $a0, $zero
/* 2A62C 8004F22C 8E890000 */  lw        $t1, 0x0($s4)
/* 2A630 8004F230 92880234 */  lbu       $t0, 0x234($s4)
/* 2A634 8004F234 000310C0 */  sll       $v0, $v1, 3
.L8004F238:
/* 2A638 8004F238 00431021 */  addu      $v0, $v0, $v1
/* 2A63C 8004F23C 000210C0 */  sll       $v0, $v0, 3
/* 2A640 8004F240 24421320 */  addiu     $v0, $v0, 0x1320
/* 2A644 8004F244 01223021 */  addu      $a2, $t1, $v0
/* 2A648 8004F248 90C20045 */  lbu       $v0, 0x45($a2)
/* 2A64C 8004F24C 54480013 */  bnel      $v0, $t0, .L8004F29C
/* 2A650 8004F250 24A50001 */   addiu    $a1, $a1, 0x1
/* 2A654 8004F254 00031040 */  sll       $v0, $v1, 1
/* 2A658 8004F258 00431021 */  addu      $v0, $v0, $v1
/* 2A65C 8004F25C 000210C0 */  sll       $v0, $v0, 3
/* 2A660 8004F260 2442085C */  addiu     $v0, $v0, 0x85C
/* 2A664 8004F264 02822021 */  addu      $a0, $s4, $v0
/* 2A668 8004F268 90820017 */  lbu       $v0, 0x17($a0)
/* 2A66C 8004F26C 5440000B */  bnel      $v0, $zero, .L8004F29C
/* 2A670 8004F270 24A50001 */   addiu    $a1, $a1, 0x1
/* 2A674 8004F274 8C83000C */  lw        $v1, 0xC($a0)
/* 2A678 8004F278 0067102A */  slt       $v0, $v1, $a3
/* 2A67C 8004F27C 50400007 */  beql      $v0, $zero, .L8004F29C
/* 2A680 8004F280 24A50001 */   addiu    $a1, $a1, 0x1
/* 2A684 8004F284 0060382D */  daddu     $a3, $v1, $zero
/* 2A688 8004F288 00C0902D */  daddu     $s2, $a2, $zero
/* 2A68C 8004F28C 0080982D */  daddu     $s3, $a0, $zero
/* 2A690 8004F290 00A0A82D */  daddu     $s5, $a1, $zero
/* 2A694 8004F294 24110001 */  addiu     $s1, $zero, 0x1
/* 2A698 8004F298 24A50001 */  addiu     $a1, $a1, 0x1
.L8004F29C:
/* 2A69C 8004F29C 30A300FF */  andi      $v1, $a1, 0xFF
/* 2A6A0 8004F2A0 006A102B */  sltu      $v0, $v1, $t2
/* 2A6A4 8004F2A4 1440FFE4 */  bnez      $v0, .L8004F238
/* 2A6A8 8004F2A8 000310C0 */   sll      $v0, $v1, 3
.L8004F2AC:
/* 2A6AC 8004F2AC 1220015A */  beqz      $s1, .L8004F818
/* 2A6B0 8004F2B0 0240202D */   daddu    $a0, $s2, $zero
/* 2A6B4 8004F2B4 AE60000C */  sw        $zero, 0xC($s3)
/* 2A6B8 8004F2B8 0C014E31 */  jal       au_reset_voice
/* 2A6BC 8004F2BC 32A500FF */   andi     $a1, $s5, 0xFF
/* 2A6C0 8004F2C0 08013CC8 */  j         .L8004F320
/* 2A6C4 8004F2C4 00000000 */   nop
.L8004F2C8:
/* 2A6C8 8004F2C8 92150052 */  lbu       $s5, 0x52($s0)
/* 2A6CC 8004F2CC 8E830000 */  lw        $v1, 0x0($s4)
/* 2A6D0 8004F2D0 32A500FF */  andi      $a1, $s5, 0xFF
/* 2A6D4 8004F2D4 000510C0 */  sll       $v0, $a1, 3
/* 2A6D8 8004F2D8 00451021 */  addu      $v0, $v0, $a1
/* 2A6DC 8004F2DC 000210C0 */  sll       $v0, $v0, 3
/* 2A6E0 8004F2E0 24421320 */  addiu     $v0, $v0, 0x1320
/* 2A6E4 8004F2E4 00629021 */  addu      $s2, $v1, $v0
/* 2A6E8 8004F2E8 00051040 */  sll       $v0, $a1, 1
/* 2A6EC 8004F2EC 00451021 */  addu      $v0, $v0, $a1
/* 2A6F0 8004F2F0 000210C0 */  sll       $v0, $v0, 3
/* 2A6F4 8004F2F4 2442085C */  addiu     $v0, $v0, 0x85C
/* 2A6F8 8004F2F8 02829821 */  addu      $s3, $s4, $v0
/* 2A6FC 8004F2FC AE60000C */  sw        $zero, 0xC($s3)
/* 2A700 8004F300 92430045 */  lbu       $v1, 0x45($s2)
/* 2A704 8004F304 92820234 */  lbu       $v0, 0x234($s4)
/* 2A708 8004F308 0043102B */  sltu      $v0, $v0, $v1
/* 2A70C 8004F30C 14400004 */  bnez      $v0, .L8004F320
/* 2A710 8004F310 00000000 */   nop
/* 2A714 8004F314 0C014E31 */  jal       au_reset_voice
/* 2A718 8004F318 0240202D */   daddu    $a0, $s2, $zero
/* 2A71C 8004F31C 24110001 */  addiu     $s1, $zero, 0x1
.L8004F320:
/* 2A720 8004F320 1220013D */  beqz      $s1, .L8004F818
/* 2A724 8004F324 32A200FF */   andi     $v0, $s5, 0xFF
.L8004F328:
/* 2A728 8004F328 00021840 */  sll       $v1, $v0, 1
/* 2A72C 8004F32C 00621821 */  addu      $v1, $v1, $v0
/* 2A730 8004F330 000318C0 */  sll       $v1, $v1, 3
/* 2A734 8004F334 2463085C */  addiu     $v1, $v1, 0x85C
/* 2A738 8004F338 02839821 */  addu      $s3, $s4, $v1
/* 2A73C 8004F33C 33C200FF */  andi      $v0, $fp, 0xFF
/* 2A740 8004F340 10400004 */  beqz      $v0, .L8004F354
/* 2A744 8004F344 A2600012 */   sb       $zero, 0x12($s3)
/* 2A748 8004F348 27C20001 */  addiu     $v0, $fp, 0x1
/* 2A74C 8004F34C 08013CD6 */  j         .L8004F358
/* 2A750 8004F350 A2620016 */   sb       $v0, 0x16($s3)
.L8004F354:
/* 2A754 8004F354 A2600016 */  sb        $zero, 0x16($s3)
.L8004F358:
/* 2A758 8004F358 AE76000C */  sw        $s6, 0xC($s3)
/* 2A75C 8004F35C 92020058 */  lbu       $v0, 0x58($s0)
/* 2A760 8004F360 10400072 */  beqz      $v0, .L8004F52C
/* 2A764 8004F364 00000000 */   nop
/* 2A768 8004F368 97AB0026 */  lhu       $t3, 0x26($sp)
/* 2A76C 8004F36C 0160202D */  daddu     $a0, $t3, $zero
/* 2A770 8004F370 28820048 */  slti      $v0, $a0, 0x48
/* 2A774 8004F374 10400007 */  beqz      $v0, .L8004F394
/* 2A778 8004F378 00041040 */   sll      $v0, $a0, 1
/* 2A77C 8004F37C 8E830000 */  lw        $v1, 0x0($s4)
/* 2A780 8004F380 00441021 */  addu      $v0, $v0, $a0
/* 2A784 8004F384 8C630054 */  lw        $v1, 0x54($v1)
/* 2A788 8004F388 00021080 */  sll       $v0, $v0, 2
/* 2A78C 8004F38C 08013CE9 */  j         .L8004F3A4
/* 2A790 8004F390 00628821 */   addu     $s1, $v1, $v0
.L8004F394:
/* 2A794 8004F394 2482FFB8 */  addiu     $v0, $a0, -0x48
/* 2A798 8004F398 00021080 */  sll       $v0, $v0, 2
/* 2A79C 8004F39C 02821021 */  addu      $v0, $s4, $v0
/* 2A7A0 8004F3A0 8C510080 */  lw        $s1, 0x80($v0)
.L8004F3A4:
/* 2A7A4 8004F3A4 26470014 */  addiu     $a3, $s2, 0x14
/* 2A7A8 8004F3A8 96260000 */  lhu       $a2, 0x0($s1)
/* 2A7AC 8004F3AC 8E840000 */  lw        $a0, 0x0($s4)
/* 2A7B0 8004F3B0 00062A02 */  srl       $a1, $a2, 8
/* 2A7B4 8004F3B4 0C014EFA */  jal       au_get_instrument
/* 2A7B8 8004F3B8 30C600FF */   andi     $a2, $a2, 0xFF
/* 2A7BC 8004F3BC AE620000 */  sw        $v0, 0x0($s3)
/* 2A7C0 8004F3C0 92220008 */  lbu       $v0, 0x8($s1)
/* 2A7C4 8004F3C4 10400008 */  beqz      $v0, .L8004F3E8
/* 2A7C8 8004F3C8 00000000 */   nop
/* 2A7CC 8004F3CC 8E840050 */  lw        $a0, 0x50($s4)
/* 2A7D0 8004F3D0 92250004 */  lbu       $a1, 0x4($s1)
/* 2A7D4 8004F3D4 0C014195 */  jal       func_80050654
/* 2A7D8 8004F3D8 0040302D */   daddu    $a2, $v0, $zero
/* 2A7DC 8004F3DC 92630016 */  lbu       $v1, 0x16($s3)
/* 2A7E0 8004F3E0 08013CFC */  j         .L8004F3F0
/* 2A7E4 8004F3E4 304200FF */   andi     $v0, $v0, 0xFF
.L8004F3E8:
/* 2A7E8 8004F3E8 92630016 */  lbu       $v1, 0x16($s3)
/* 2A7EC 8004F3EC 92220004 */  lbu       $v0, 0x4($s1)
.L8004F3F0:
/* 2A7F0 8004F3F0 00620018 */  mult      $v1, $v0
/* 2A7F4 8004F3F4 00005812 */  mflo      $t3
/* 2A7F8 8004F3F8 A66B0008 */  sh        $t3, 0x8($s3)
/* 2A7FC 8004F3FC 8E8300C0 */  lw        $v1, 0xC0($s4)
/* 2A800 8004F400 8E020018 */  lw        $v0, 0x18($s0)
/* 2A804 8004F404 00031D43 */  sra       $v1, $v1, 21
/* 2A808 8004F408 00021543 */  sra       $v0, $v0, 21
/* 2A80C 8004F40C 00620018 */  mult      $v1, $v0
/* 2A810 8004F410 8E02002C */  lw        $v0, 0x2C($s0)
/* 2A814 8004F414 00001812 */  mflo      $v1
/* 2A818 8004F418 00021543 */  sra       $v0, $v0, 21
/* 2A81C 8004F41C 00000000 */  nop
/* 2A820 8004F420 00620018 */  mult      $v1, $v0
/* 2A824 8004F424 82030049 */  lb        $v1, 0x49($s0)
/* 2A828 8004F428 00002012 */  mflo      $a0
/* 2A82C 8004F42C 86620008 */  lh        $v0, 0x8($s3)
/* 2A830 8004F430 00000000 */  nop
/* 2A834 8004F434 00620018 */  mult      $v1, $v0
/* 2A838 8004F438 00001812 */  mflo      $v1
/* 2A83C 8004F43C 00041503 */  sra       $v0, $a0, 20
/* 2A840 8004F440 00000000 */  nop
/* 2A844 8004F444 00430018 */  mult      $v0, $v1
/* 2A848 8004F448 00001812 */  mflo      $v1
/* 2A84C 8004F44C 00031403 */  sra       $v0, $v1, 16
/* 2A850 8004F450 A6420040 */  sh        $v0, 0x40($s2)
/* 2A854 8004F454 92020048 */  lbu       $v0, 0x48($s0)
/* 2A858 8004F458 96230002 */  lhu       $v1, 0x2($s1)
/* 2A85C 8004F45C 96040046 */  lhu       $a0, 0x46($s0)
/* 2A860 8004F460 8E650000 */  lw        $a1, 0x0($s3)
/* 2A864 8004F464 00021600 */  sll       $v0, $v0, 24
/* 2A868 8004F468 00021603 */  sra       $v0, $v0, 24
/* 2A86C 8004F46C 00641821 */  addu      $v1, $v1, $a0
/* 2A870 8004F470 94A4001E */  lhu       $a0, 0x1E($a1)
/* 2A874 8004F474 00431021 */  addu      $v0, $v0, $v1
/* 2A878 8004F478 00441023 */  subu      $v0, $v0, $a0
/* 2A87C 8004F47C A662000A */  sh        $v0, 0xA($s3)
/* 2A880 8004F480 00021400 */  sll       $v0, $v0, 16
/* 2A884 8004F484 86030038 */  lh        $v1, 0x38($s0)
/* 2A888 8004F488 00021403 */  sra       $v0, $v0, 16
/* 2A88C 8004F48C 00431021 */  addu      $v0, $v0, $v1
/* 2A890 8004F490 8683020E */  lh        $v1, 0x20E($s4)
/* 2A894 8004F494 92240007 */  lbu       $a0, 0x7($s1)
/* 2A898 8004F498 10800007 */  beqz      $a0, .L8004F4B8
/* 2A89C 8004F49C 00432821 */   addu     $a1, $v0, $v1
/* 2A8A0 8004F4A0 8E840050 */  lw        $a0, 0x50($s4)
/* 2A8A4 8004F4A4 0C014179 */  jal       func_800505E4
/* 2A8A8 8004F4A8 92260007 */   lbu      $a2, 0x7($s1)
/* 2A8AC 8004F4AC 00021C00 */  sll       $v1, $v0, 16
/* 2A8B0 8004F4B0 00032C03 */  sra       $a1, $v1, 16
/* 2A8B4 8004F4B4 A6620014 */  sh        $v0, 0x14($s3)
.L8004F4B8:
/* 2A8B8 8004F4B8 0C014E3E */  jal       au_compute_pitch_ratio
/* 2A8BC 8004F4BC 00A0202D */   daddu    $a0, $a1, $zero
/* 2A8C0 8004F4C0 8E620000 */  lw        $v0, 0x0($s3)
/* 2A8C4 8004F4C4 C4420020 */  lwc1      $f2, 0x20($v0)
/* 2A8C8 8004F4C8 46020002 */  mul.s     $f0, $f0, $f2
/* 2A8CC 8004F4CC 00000000 */  nop
/* 2A8D0 8004F4D0 E6600004 */  swc1      $f0, 0x4($s3)
/* 2A8D4 8004F4D4 92220009 */  lbu       $v0, 0x9($s1)
/* 2A8D8 8004F4D8 10400006 */  beqz      $v0, .L8004F4F4
/* 2A8DC 8004F4DC 0040302D */   daddu    $a2, $v0, $zero
/* 2A8E0 8004F4E0 92250005 */  lbu       $a1, 0x5($s1)
/* 2A8E4 8004F4E4 0C01415A */  jal       au_bgm_get_random_pan
/* 2A8E8 8004F4E8 0280202D */   daddu    $a0, $s4, $zero
/* 2A8EC 8004F4EC 08013D3F */  j         .L8004F4FC
/* 2A8F0 8004F4F0 A242000E */   sb       $v0, 0xE($s2)
.L8004F4F4:
/* 2A8F4 8004F4F4 92220005 */  lbu       $v0, 0x5($s1)
/* 2A8F8 8004F4F8 A242000E */  sb        $v0, 0xE($s2)
.L8004F4FC:
/* 2A8FC 8004F4FC 9222000A */  lbu       $v0, 0xA($s1)
/* 2A900 8004F500 10400007 */  beqz      $v0, .L8004F520
/* 2A904 8004F504 00000000 */   nop
/* 2A908 8004F508 8E840050 */  lw        $a0, 0x50($s4)
/* 2A90C 8004F50C 92250006 */  lbu       $a1, 0x6($s1)
/* 2A910 8004F510 0C0141A3 */  jal       au_bgm_get_random_reverb
/* 2A914 8004F514 0040302D */   daddu    $a2, $v0, $zero
/* 2A918 8004F518 08013D9B */  j         .L8004F66C
/* 2A91C 8004F51C A242000F */   sb       $v0, 0xF($s2)
.L8004F520:
/* 2A920 8004F520 92220006 */  lbu       $v0, 0x6($s1)
/* 2A924 8004F524 08013D9B */  j         .L8004F66C
/* 2A928 8004F528 A242000F */   sb       $v0, 0xF($s2)
.L8004F52C:
/* 2A92C 8004F52C 8E8300C0 */  lw        $v1, 0xC0($s4)
/* 2A930 8004F530 8E020018 */  lw        $v0, 0x18($s0)
/* 2A934 8004F534 00031D43 */  sra       $v1, $v1, 21
/* 2A938 8004F538 00021543 */  sra       $v0, $v0, 21
/* 2A93C 8004F53C 00620018 */  mult      $v1, $v0
/* 2A940 8004F540 8E02002C */  lw        $v0, 0x2C($s0)
/* 2A944 8004F544 00001812 */  mflo      $v1
/* 2A948 8004F548 00021543 */  sra       $v0, $v0, 21
/* 2A94C 8004F54C 00000000 */  nop
/* 2A950 8004F550 00620018 */  mult      $v1, $v0
/* 2A954 8004F554 82030049 */  lb        $v1, 0x49($s0)
/* 2A958 8004F558 00002012 */  mflo      $a0
/* 2A95C 8004F55C 92620016 */  lbu       $v0, 0x16($s3)
/* 2A960 8004F560 00000000 */  nop
/* 2A964 8004F564 00620018 */  mult      $v1, $v0
/* 2A968 8004F568 00001812 */  mflo      $v1
/* 2A96C 8004F56C 00041503 */  sra       $v0, $a0, 20
/* 2A970 8004F570 00000000 */  nop
/* 2A974 8004F574 00430018 */  mult      $v0, $v1
/* 2A978 8004F578 00001812 */  mflo      $v1
/* 2A97C 8004F57C 00031243 */  sra       $v0, $v1, 9
/* 2A980 8004F580 A6620008 */  sh        $v0, 0x8($s3)
/* 2A984 8004F584 A6420040 */  sh        $v0, 0x40($s2)
/* 2A988 8004F588 8E06000C */  lw        $a2, 0xC($s0)
/* 2A98C 8004F58C AE660000 */  sw        $a2, 0x0($s3)
/* 2A990 8004F590 92040048 */  lbu       $a0, 0x48($s0)
/* 2A994 8004F594 97AB0026 */  lhu       $t3, 0x26($sp)
/* 2A998 8004F598 9685020C */  lhu       $a1, 0x20C($s4)
/* 2A99C 8004F59C 00042600 */  sll       $a0, $a0, 24
/* 2A9A0 8004F5A0 00042603 */  sra       $a0, $a0, 24
/* 2A9A4 8004F5A4 0160182D */  daddu     $v1, $t3, $zero
/* 2A9A8 8004F5A8 00031040 */  sll       $v0, $v1, 1
/* 2A9AC 8004F5AC 00431021 */  addu      $v0, $v0, $v1
/* 2A9B0 8004F5B0 000210C0 */  sll       $v0, $v0, 3
/* 2A9B4 8004F5B4 00431021 */  addu      $v0, $v0, $v1
/* 2A9B8 8004F5B8 96030046 */  lhu       $v1, 0x46($s0)
/* 2A9BC 8004F5BC 00021080 */  sll       $v0, $v0, 2
/* 2A9C0 8004F5C0 00621821 */  addu      $v1, $v1, $v0
/* 2A9C4 8004F5C4 00A32821 */  addu      $a1, $a1, $v1
/* 2A9C8 8004F5C8 94C2001E */  lhu       $v0, 0x1E($a2)
/* 2A9CC 8004F5CC 00852021 */  addu      $a0, $a0, $a1
/* 2A9D0 8004F5D0 00822023 */  subu      $a0, $a0, $v0
/* 2A9D4 8004F5D4 A664000A */  sh        $a0, 0xA($s3)
/* 2A9D8 8004F5D8 00042400 */  sll       $a0, $a0, 16
/* 2A9DC 8004F5DC 00042403 */  sra       $a0, $a0, 16
/* 2A9E0 8004F5E0 86020038 */  lh        $v0, 0x38($s0)
/* 2A9E4 8004F5E4 8683020E */  lh        $v1, 0x20E($s4)
/* 2A9E8 8004F5E8 00822021 */  addu      $a0, $a0, $v0
/* 2A9EC 8004F5EC 0C014E3E */  jal       au_compute_pitch_ratio
/* 2A9F0 8004F5F0 00832021 */   addu     $a0, $a0, $v1
/* 2A9F4 8004F5F4 8E02000C */  lw        $v0, 0xC($s0)
/* 2A9F8 8004F5F8 C4420020 */  lwc1      $f2, 0x20($v0)
/* 2A9FC 8004F5FC 46020002 */  mul.s     $f0, $f0, $f2
/* 2AA00 8004F600 00000000 */  nop
/* 2AA04 8004F604 E6600004 */  swc1      $f0, 0x4($s3)
/* 2AA08 8004F608 92020057 */  lbu       $v0, 0x57($s0)
/* 2AA0C 8004F60C 10400006 */  beqz      $v0, .L8004F628
/* 2AA10 8004F610 0040302D */   daddu    $a2, $v0, $zero
/* 2AA14 8004F614 9205004A */  lbu       $a1, 0x4A($s0)
/* 2AA18 8004F618 0C01415A */  jal       au_bgm_get_random_pan
/* 2AA1C 8004F61C 0280202D */   daddu    $a0, $s4, $zero
/* 2AA20 8004F620 08013D8C */  j         .L8004F630
/* 2AA24 8004F624 A242000E */   sb       $v0, 0xE($s2)
.L8004F628:
/* 2AA28 8004F628 9202004A */  lbu       $v0, 0x4A($s0)
/* 2AA2C 8004F62C A242000E */  sb        $v0, 0xE($s2)
.L8004F630:
/* 2AA30 8004F630 9202004B */  lbu       $v0, 0x4B($s0)
/* 2AA34 8004F634 A242000F */  sb        $v0, 0xF($s2)
/* 2AA38 8004F638 9202004C */  lbu       $v0, 0x4C($s0)
/* 2AA3C 8004F63C 10400007 */  beqz      $v0, .L8004F65C
/* 2AA40 8004F640 0040182D */   daddu    $v1, $v0, $zero
/* 2AA44 8004F644 000310C0 */  sll       $v0, $v1, 3
/* 2AA48 8004F648 00431021 */  addu      $v0, $v0, $v1
/* 2AA4C 8004F64C 00021040 */  sll       $v0, $v0, 1
/* 2AA50 8004F650 24420162 */  addiu     $v0, $v0, 0x162
/* 2AA54 8004F654 08013D98 */  j         .L8004F660
/* 2AA58 8004F658 02821021 */   addu     $v0, $s4, $v0
.L8004F65C:
/* 2AA5C 8004F65C 8E020010 */  lw        $v0, 0x10($s0)
.L8004F660:
/* 2AA60 8004F660 AE420014 */  sw        $v0, 0x14($s2)
/* 2AA64 8004F664 8E020014 */  lw        $v0, 0x14($s0)
/* 2AA68 8004F668 AE420018 */  sw        $v0, 0x18($s2)
.L8004F66C:
/* 2AA6C 8004F66C 8E620000 */  lw        $v0, 0x0($s3)
/* 2AA70 8004F670 AE420000 */  sw        $v0, 0x0($s2)
/* 2AA74 8004F674 C6600004 */  lwc1      $f0, 0x4($s3)
/* 2AA78 8004F678 E6400004 */  swc1      $f0, 0x4($s2)
/* 2AA7C 8004F67C 9202005B */  lbu       $v0, 0x5B($s0)
/* 2AA80 8004F680 A2420010 */  sb        $v0, 0x10($s2)
/* 2AA84 8004F684 8E62000C */  lw        $v0, 0xC($s3)
/* 2AA88 8004F688 28420002 */  slti      $v0, $v0, 0x2
/* 2AA8C 8004F68C 14400062 */  bnez      $v0, .L8004F818
/* 2AA90 8004F690 240B0001 */   addiu    $t3, $zero, 0x1
/* 2AA94 8004F694 A26B0017 */  sb        $t3, 0x17($s3)
/* 2AA98 8004F698 92020056 */  lbu       $v0, 0x56($s0)
/* 2AA9C 8004F69C A2600013 */  sb        $zero, 0x13($s3)
/* 2AAA0 8004F6A0 A2620012 */  sb        $v0, 0x12($s3)
/* 2AAA4 8004F6A4 9602003A */  lhu       $v0, 0x3A($s0)
/* 2AAA8 8004F6A8 A6620010 */  sh        $v0, 0x10($s3)
/* 2AAAC 8004F6AC 24020002 */  addiu     $v0, $zero, 0x2
/* 2AAB0 8004F6B0 A2420043 */  sb        $v0, 0x43($s2)
/* 2AAB4 8004F6B4 92820234 */  lbu       $v0, 0x234($s4)
/* 2AAB8 8004F6B8 A2420045 */  sb        $v0, 0x45($s2)
/* 2AABC 8004F6BC 08013E06 */  j         .L8004F818
/* 2AAC0 8004F6C0 A2420044 */   sb       $v0, 0x44($s2)
.L8004F6C4:
/* 2AAC4 8004F6C4 3C058008 */  lui       $a1, %hi(D_80078410)
/* 2AAC8 8004F6C8 00A32821 */  addu      $a1, $a1, $v1
/* 2AACC 8004F6CC 90A58410 */  lbu       $a1, %lo(D_80078410)($a1)
/* 2AAD0 8004F6D0 10A00047 */  beqz      $a1, .L8004F7F0
/* 2AAD4 8004F6D4 0280202D */   daddu    $a0, $s4, $zero
/* 2AAD8 8004F6D8 8E020000 */  lw        $v0, 0x0($s0)
/* 2AADC 8004F6DC 90430000 */  lbu       $v1, 0x0($v0)
/* 2AAE0 8004F6E0 24420001 */  addiu     $v0, $v0, 0x1
/* 2AAE4 8004F6E4 A28300D4 */  sb        $v1, 0xD4($s4)
/* 2AAE8 8004F6E8 AE020000 */  sw        $v0, 0x0($s0)
/* 2AAEC 8004F6EC 8602003E */  lh        $v0, 0x3E($s0)
/* 2AAF0 8004F6F0 9603003E */  lhu       $v1, 0x3E($s0)
/* 2AAF4 8004F6F4 10400007 */  beqz      $v0, .L8004F714
/* 2AAF8 8004F6F8 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2AAFC 8004F6FC A602003E */  sh        $v0, 0x3E($s0)
/* 2AB00 8004F700 00021400 */  sll       $v0, $v0, 16
/* 2AB04 8004F704 14400004 */  bnez      $v0, .L8004F718
/* 2AB08 8004F708 28A20002 */   slti     $v0, $a1, 0x2
/* 2AB0C 8004F70C 8E020004 */  lw        $v0, 0x4($s0)
/* 2AB10 8004F710 AE020000 */  sw        $v0, 0x0($s0)
.L8004F714:
/* 2AB14 8004F714 28A20002 */  slti      $v0, $a1, 0x2
.L8004F718:
/* 2AB18 8004F718 14400035 */  bnez      $v0, .L8004F7F0
/* 2AB1C 8004F71C 0280202D */   daddu    $a0, $s4, $zero
/* 2AB20 8004F720 8E020000 */  lw        $v0, 0x0($s0)
/* 2AB24 8004F724 90430000 */  lbu       $v1, 0x0($v0)
/* 2AB28 8004F728 24420001 */  addiu     $v0, $v0, 0x1
/* 2AB2C 8004F72C A28300D5 */  sb        $v1, 0xD5($s4)
/* 2AB30 8004F730 AE020000 */  sw        $v0, 0x0($s0)
/* 2AB34 8004F734 8602003E */  lh        $v0, 0x3E($s0)
/* 2AB38 8004F738 9603003E */  lhu       $v1, 0x3E($s0)
/* 2AB3C 8004F73C 10400007 */  beqz      $v0, .L8004F75C
/* 2AB40 8004F740 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2AB44 8004F744 A602003E */  sh        $v0, 0x3E($s0)
/* 2AB48 8004F748 00021400 */  sll       $v0, $v0, 16
/* 2AB4C 8004F74C 14400004 */  bnez      $v0, .L8004F760
/* 2AB50 8004F750 28A20003 */   slti     $v0, $a1, 0x3
/* 2AB54 8004F754 8E020004 */  lw        $v0, 0x4($s0)
/* 2AB58 8004F758 AE020000 */  sw        $v0, 0x0($s0)
.L8004F75C:
/* 2AB5C 8004F75C 28A20003 */  slti      $v0, $a1, 0x3
.L8004F760:
/* 2AB60 8004F760 14400023 */  bnez      $v0, .L8004F7F0
/* 2AB64 8004F764 0280202D */   daddu    $a0, $s4, $zero
/* 2AB68 8004F768 8E020000 */  lw        $v0, 0x0($s0)
/* 2AB6C 8004F76C 90430000 */  lbu       $v1, 0x0($v0)
/* 2AB70 8004F770 24420001 */  addiu     $v0, $v0, 0x1
/* 2AB74 8004F774 A28300D6 */  sb        $v1, 0xD6($s4)
/* 2AB78 8004F778 AE020000 */  sw        $v0, 0x0($s0)
/* 2AB7C 8004F77C 8602003E */  lh        $v0, 0x3E($s0)
/* 2AB80 8004F780 9603003E */  lhu       $v1, 0x3E($s0)
/* 2AB84 8004F784 10400007 */  beqz      $v0, .L8004F7A4
/* 2AB88 8004F788 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2AB8C 8004F78C A602003E */  sh        $v0, 0x3E($s0)
/* 2AB90 8004F790 00021400 */  sll       $v0, $v0, 16
/* 2AB94 8004F794 14400004 */  bnez      $v0, .L8004F7A8
/* 2AB98 8004F798 28A20004 */   slti     $v0, $a1, 0x4
/* 2AB9C 8004F79C 8E020004 */  lw        $v0, 0x4($s0)
/* 2ABA0 8004F7A0 AE020000 */  sw        $v0, 0x0($s0)
.L8004F7A4:
/* 2ABA4 8004F7A4 28A20004 */  slti      $v0, $a1, 0x4
.L8004F7A8:
/* 2ABA8 8004F7A8 14400011 */  bnez      $v0, .L8004F7F0
/* 2ABAC 8004F7AC 0280202D */   daddu    $a0, $s4, $zero
/* 2ABB0 8004F7B0 8E020000 */  lw        $v0, 0x0($s0)
/* 2ABB4 8004F7B4 90430000 */  lbu       $v1, 0x0($v0)
/* 2ABB8 8004F7B8 24420001 */  addiu     $v0, $v0, 0x1
/* 2ABBC 8004F7BC A28300D7 */  sb        $v1, 0xD7($s4)
/* 2ABC0 8004F7C0 AE020000 */  sw        $v0, 0x0($s0)
/* 2ABC4 8004F7C4 8602003E */  lh        $v0, 0x3E($s0)
/* 2ABC8 8004F7C8 9603003E */  lhu       $v1, 0x3E($s0)
/* 2ABCC 8004F7CC 10400008 */  beqz      $v0, .L8004F7F0
/* 2ABD0 8004F7D0 2462FFFF */   addiu    $v0, $v1, -0x1
/* 2ABD4 8004F7D4 A602003E */  sh        $v0, 0x3E($s0)
/* 2ABD8 8004F7D8 00021400 */  sll       $v0, $v0, 16
/* 2ABDC 8004F7DC 14400005 */  bnez      $v0, .L8004F7F4
/* 2ABE0 8004F7E0 30E200FF */   andi     $v0, $a3, 0xFF
/* 2ABE4 8004F7E4 8E020004 */  lw        $v0, 0x4($s0)
/* 2ABE8 8004F7E8 AE020000 */  sw        $v0, 0x0($s0)
/* 2ABEC 8004F7EC 0280202D */  daddu     $a0, $s4, $zero
.L8004F7F0:
/* 2ABF0 8004F7F0 30E200FF */  andi      $v0, $a3, 0xFF
.L8004F7F4:
/* 2ABF4 8004F7F4 2442FF20 */  addiu     $v0, $v0, -0xE0
/* 2ABF8 8004F7F8 00021080 */  sll       $v0, $v0, 2
/* 2ABFC 8004F7FC 3C018008 */  lui       $at, %hi(D_80078470)
/* 2AC00 8004F800 00220821 */  addu      $at, $at, $v0
/* 2AC04 8004F804 8C228470 */  lw        $v0, %lo(D_80078470)($at)
/* 2AC08 8004F808 3C01800A */  lui       $at, %hi(CurrentSeqCmdHandler)
/* 2AC0C 8004F80C AC223FD0 */  sw        $v0, %lo(CurrentSeqCmdHandler)($at)
/* 2AC10 8004F810 0040F809 */  jalr      $v0
/* 2AC14 8004F814 0200282D */   daddu    $a1, $s0, $zero
.L8004F818:
/* 2AC18 8004F818 8E020028 */  lw        $v0, 0x28($s0)
/* 2AC1C 8004F81C 1040FDB5 */  beqz      $v0, .L8004EEF4
/* 2AC20 8004F820 00000000 */   nop
.L8004F824:
/* 2AC24 8004F824 08013ED6 */  j         .L8004FB58
/* 2AC28 8004F828 92150052 */   lbu      $s5, 0x52($s0)
.L8004F82C:
/* 2AC2C 8004F82C 9202005A */  lbu       $v0, 0x5A($s0)
/* 2AC30 8004F830 544000C9 */  bnel      $v0, $zero, .L8004FB58
/* 2AC34 8004F834 26B50001 */   addiu    $s5, $s5, 0x1
/* 2AC38 8004F838 000410C0 */  sll       $v0, $a0, 3
/* 2AC3C 8004F83C 00441021 */  addu      $v0, $v0, $a0
/* 2AC40 8004F840 000210C0 */  sll       $v0, $v0, 3
/* 2AC44 8004F844 8E830000 */  lw        $v1, 0x0($s4)
/* 2AC48 8004F848 24421320 */  addiu     $v0, $v0, 0x1320
/* 2AC4C 8004F84C 00629021 */  addu      $s2, $v1, $v0
/* 2AC50 8004F850 92430045 */  lbu       $v1, 0x45($s2)
/* 2AC54 8004F854 92820234 */  lbu       $v0, 0x234($s4)
/* 2AC58 8004F858 546200BF */  bnel      $v1, $v0, .L8004FB58
/* 2AC5C 8004F85C 26B50001 */   addiu    $s5, $s5, 0x1
/* 2AC60 8004F860 00041040 */  sll       $v0, $a0, 1
/* 2AC64 8004F864 00441021 */  addu      $v0, $v0, $a0
/* 2AC68 8004F868 000210C0 */  sll       $v0, $v0, 3
/* 2AC6C 8004F86C 2442085C */  addiu     $v0, $v0, 0x85C
/* 2AC70 8004F870 02829821 */  addu      $s3, $s4, $v0
/* 2AC74 8004F874 92620017 */  lbu       $v0, 0x17($s3)
/* 2AC78 8004F878 544000B6 */  bnel      $v0, $zero, .L8004FB54
/* 2AC7C 8004F87C A2600017 */   sb       $zero, 0x17($s3)
/* 2AC80 8004F880 8E62000C */  lw        $v0, 0xC($s3)
/* 2AC84 8004F884 18400006 */  blez      $v0, .L8004F8A0
/* 2AC88 8004F888 2442FFFF */   addiu    $v0, $v0, -0x1
/* 2AC8C 8004F88C 14400004 */  bnez      $v0, .L8004F8A0
/* 2AC90 8004F890 AE62000C */   sw       $v0, 0xC($s3)
/* 2AC94 8004F894 9242003D */  lbu       $v0, 0x3D($s2)
/* 2AC98 8004F898 34420010 */  ori       $v0, $v0, 0x10
/* 2AC9C 8004F89C A242003D */  sb        $v0, 0x3D($s2)
.L8004F8A0:
/* 2ACA0 8004F8A0 92020058 */  lbu       $v0, 0x58($s0)
/* 2ACA4 8004F8A4 1040003A */  beqz      $v0, .L8004F990
/* 2ACA8 8004F8A8 00000000 */   nop
/* 2ACAC 8004F8AC 92020040 */  lbu       $v0, 0x40($s0)
/* 2ACB0 8004F8B0 14400004 */  bnez      $v0, .L8004F8C4
/* 2ACB4 8004F8B4 00000000 */   nop
/* 2ACB8 8004F8B8 8682020E */  lh        $v0, 0x20E($s4)
/* 2ACBC 8004F8BC 10400017 */  beqz      $v0, .L8004F91C
/* 2ACC0 8004F8C0 00000000 */   nop
.L8004F8C4:
/* 2ACC4 8004F8C4 8664000A */  lh        $a0, 0xA($s3)
/* 2ACC8 8004F8C8 86620014 */  lh        $v0, 0x14($s3)
/* 2ACCC 8004F8CC 00822021 */  addu      $a0, $a0, $v0
/* 2ACD0 8004F8D0 86020038 */  lh        $v0, 0x38($s0)
/* 2ACD4 8004F8D4 8683020E */  lh        $v1, 0x20E($s4)
/* 2ACD8 8004F8D8 00822021 */  addu      $a0, $a0, $v0
/* 2ACDC 8004F8DC 0C014E3E */  jal       au_compute_pitch_ratio
/* 2ACE0 8004F8E0 00832021 */   addu     $a0, $a0, $v1
/* 2ACE4 8004F8E4 8E620000 */  lw        $v0, 0x0($s3)
/* 2ACE8 8004F8E8 C4420020 */  lwc1      $f2, 0x20($v0)
/* 2ACEC 8004F8EC 46020082 */  mul.s     $f2, $f0, $f2
/* 2ACF0 8004F8F0 00000000 */  nop
/* 2ACF4 8004F8F4 E6620004 */  swc1      $f2, 0x4($s3)
/* 2ACF8 8004F8F8 C6400004 */  lwc1      $f0, 0x4($s2)
/* 2ACFC 8004F8FC 46020032 */  c.eq.s    $f0, $f2
/* 2AD00 8004F900 00000000 */  nop
/* 2AD04 8004F904 45010005 */  bc1t      .L8004F91C
/* 2AD08 8004F908 00000000 */   nop
/* 2AD0C 8004F90C 92420043 */  lbu       $v0, 0x43($s2)
/* 2AD10 8004F910 E6420004 */  swc1      $f2, 0x4($s2)
/* 2AD14 8004F914 34420008 */  ori       $v0, $v0, 0x8
/* 2AD18 8004F918 A2420043 */  sb        $v0, 0x43($s2)
.L8004F91C:
/* 2AD1C 8004F91C 92020041 */  lbu       $v0, 0x41($s0)
/* 2AD20 8004F920 5040008C */  beql      $v0, $zero, .L8004FB54
/* 2AD24 8004F924 A2600017 */   sb       $zero, 0x17($s3)
/* 2AD28 8004F928 8E8300C0 */  lw        $v1, 0xC0($s4)
/* 2AD2C 8004F92C 8E020018 */  lw        $v0, 0x18($s0)
/* 2AD30 8004F930 00031D43 */  sra       $v1, $v1, 21
/* 2AD34 8004F934 00021543 */  sra       $v0, $v0, 21
/* 2AD38 8004F938 00620018 */  mult      $v1, $v0
/* 2AD3C 8004F93C 8E02002C */  lw        $v0, 0x2C($s0)
/* 2AD40 8004F940 00001812 */  mflo      $v1
/* 2AD44 8004F944 00021543 */  sra       $v0, $v0, 21
/* 2AD48 8004F948 00000000 */  nop
/* 2AD4C 8004F94C 00620018 */  mult      $v1, $v0
/* 2AD50 8004F950 82030049 */  lb        $v1, 0x49($s0)
/* 2AD54 8004F954 00002012 */  mflo      $a0
/* 2AD58 8004F958 86620008 */  lh        $v0, 0x8($s3)
/* 2AD5C 8004F95C 00000000 */  nop
/* 2AD60 8004F960 00620018 */  mult      $v1, $v0
/* 2AD64 8004F964 00001812 */  mflo      $v1
/* 2AD68 8004F968 00041503 */  sra       $v0, $a0, 20
/* 2AD6C 8004F96C 00000000 */  nop
/* 2AD70 8004F970 00430018 */  mult      $v0, $v1
/* 2AD74 8004F974 9242003D */  lbu       $v0, 0x3D($s2)
/* 2AD78 8004F978 34420020 */  ori       $v0, $v0, 0x20
/* 2AD7C 8004F97C A242003D */  sb        $v0, 0x3D($s2)
/* 2AD80 8004F980 00001812 */  mflo      $v1
/* 2AD84 8004F984 00031403 */  sra       $v0, $v1, 16
/* 2AD88 8004F988 08013ED4 */  j         .L8004FB50
/* 2AD8C 8004F98C A6420040 */   sh       $v0, 0x40($s2)
.L8004F990:
/* 2AD90 8004F990 92620012 */  lbu       $v0, 0x12($s3)
/* 2AD94 8004F994 10400027 */  beqz      $v0, .L8004FA34
/* 2AD98 8004F998 00000000 */   nop
/* 2AD9C 8004F99C 96620010 */  lhu       $v0, 0x10($s3)
/* 2ADA0 8004F9A0 10400003 */  beqz      $v0, .L8004F9B0
/* 2ADA4 8004F9A4 2442FFFF */   addiu    $v0, $v0, -0x1
/* 2ADA8 8004F9A8 08013EA8 */  j         .L8004FAA0
/* 2ADAC 8004F9AC A6620010 */   sh       $v0, 0x10($s3)
.L8004F9B0:
/* 2ADB0 8004F9B0 92630013 */  lbu       $v1, 0x13($s3)
/* 2ADB4 8004F9B4 92020055 */  lbu       $v0, 0x55($s0)
/* 2ADB8 8004F9B8 00621821 */  addu      $v1, $v1, $v0
/* 2ADBC 8004F9BC 00031080 */  sll       $v0, $v1, 2
/* 2ADC0 8004F9C0 24440003 */  addiu     $a0, $v0, 0x3
/* 2ADC4 8004F9C4 306200FF */  andi      $v0, $v1, 0xFF
/* 2ADC8 8004F9C8 00023182 */  srl       $a2, $v0, 6
/* 2ADCC 8004F9CC A2630013 */  sb        $v1, 0x13($s3)
/* 2ADD0 8004F9D0 30C300FF */  andi      $v1, $a2, 0xFF
/* 2ADD4 8004F9D4 24020001 */  addiu     $v0, $zero, 0x1
/* 2ADD8 8004F9D8 10620004 */  beq       $v1, $v0, .L8004F9EC
/* 2ADDC 8004F9DC 0080382D */   daddu    $a3, $a0, $zero
/* 2ADE0 8004F9E0 24020003 */  addiu     $v0, $zero, 0x3
/* 2ADE4 8004F9E4 54620004 */  bnel      $v1, $v0, .L8004F9F8
/* 2ADE8 8004F9E8 30E500FF */   andi     $a1, $a3, 0xFF
.L8004F9EC:
/* 2ADEC 8004F9EC 00041027 */  nor       $v0, $zero, $a0
/* 2ADF0 8004F9F0 304200FF */  andi      $v0, $v0, 0xFF
/* 2ADF4 8004F9F4 24450001 */  addiu     $a1, $v0, 0x1
.L8004F9F8:
/* 2ADF8 8004F9F8 92020056 */  lbu       $v0, 0x56($s0)
/* 2ADFC 8004F9FC 00A20018 */  mult      $a1, $v0
/* 2AE00 8004FA00 24C2FFFE */  addiu     $v0, $a2, -0x2
/* 2AE04 8004FA04 2C420002 */  sltiu     $v0, $v0, 0x2
/* 2AE08 8004FA08 00005812 */  mflo      $t3
/* 2AE0C 8004FA0C 10400002 */  beqz      $v0, .L8004FA18
/* 2AE10 8004FA10 000B2A03 */   sra      $a1, $t3, 8
/* 2AE14 8004FA14 00052823 */  negu      $a1, $a1
.L8004FA18:
/* 2AE18 8004FA18 8664000A */  lh        $a0, 0xA($s3)
/* 2AE1C 8004FA1C 86020038 */  lh        $v0, 0x38($s0)
/* 2AE20 8004FA20 8683020E */  lh        $v1, 0x20E($s4)
/* 2AE24 8004FA24 00822021 */  addu      $a0, $a0, $v0
/* 2AE28 8004FA28 00832021 */  addu      $a0, $a0, $v1
/* 2AE2C 8004FA2C 08013E98 */  j         .L8004FA60
/* 2AE30 8004FA30 00A42021 */   addu     $a0, $a1, $a0
.L8004FA34:
/* 2AE34 8004FA34 92020040 */  lbu       $v0, 0x40($s0)
/* 2AE38 8004FA38 14400004 */  bnez      $v0, .L8004FA4C
/* 2AE3C 8004FA3C 00000000 */   nop
/* 2AE40 8004FA40 8682020E */  lh        $v0, 0x20E($s4)
/* 2AE44 8004FA44 10400016 */  beqz      $v0, .L8004FAA0
/* 2AE48 8004FA48 00000000 */   nop
.L8004FA4C:
/* 2AE4C 8004FA4C 8664000A */  lh        $a0, 0xA($s3)
/* 2AE50 8004FA50 86020038 */  lh        $v0, 0x38($s0)
/* 2AE54 8004FA54 8683020E */  lh        $v1, 0x20E($s4)
/* 2AE58 8004FA58 00822021 */  addu      $a0, $a0, $v0
/* 2AE5C 8004FA5C 00832021 */  addu      $a0, $a0, $v1
.L8004FA60:
/* 2AE60 8004FA60 0C014E3E */  jal       au_compute_pitch_ratio
/* 2AE64 8004FA64 00000000 */   nop
/* 2AE68 8004FA68 8E620000 */  lw        $v0, 0x0($s3)
/* 2AE6C 8004FA6C C4420020 */  lwc1      $f2, 0x20($v0)
/* 2AE70 8004FA70 46020082 */  mul.s     $f2, $f0, $f2
/* 2AE74 8004FA74 00000000 */  nop
/* 2AE78 8004FA78 E6620004 */  swc1      $f2, 0x4($s3)
/* 2AE7C 8004FA7C C6400004 */  lwc1      $f0, 0x4($s2)
/* 2AE80 8004FA80 46020032 */  c.eq.s    $f0, $f2
/* 2AE84 8004FA84 00000000 */  nop
/* 2AE88 8004FA88 45010005 */  bc1t      .L8004FAA0
/* 2AE8C 8004FA8C 00000000 */   nop
/* 2AE90 8004FA90 92420043 */  lbu       $v0, 0x43($s2)
/* 2AE94 8004FA94 E6420004 */  swc1      $f2, 0x4($s2)
/* 2AE98 8004FA98 34420008 */  ori       $v0, $v0, 0x8
/* 2AE9C 8004FA9C A2420043 */  sb        $v0, 0x43($s2)
.L8004FAA0:
/* 2AEA0 8004FAA0 92020041 */  lbu       $v0, 0x41($s0)
/* 2AEA4 8004FAA4 10400020 */  beqz      $v0, .L8004FB28
/* 2AEA8 8004FAA8 00000000 */   nop
/* 2AEAC 8004FAAC 8E8300C0 */  lw        $v1, 0xC0($s4)
/* 2AEB0 8004FAB0 8E020018 */  lw        $v0, 0x18($s0)
/* 2AEB4 8004FAB4 00031D43 */  sra       $v1, $v1, 21
/* 2AEB8 8004FAB8 00021543 */  sra       $v0, $v0, 21
/* 2AEBC 8004FABC 00620018 */  mult      $v1, $v0
/* 2AEC0 8004FAC0 8E02002C */  lw        $v0, 0x2C($s0)
/* 2AEC4 8004FAC4 00001812 */  mflo      $v1
/* 2AEC8 8004FAC8 00021543 */  sra       $v0, $v0, 21
/* 2AECC 8004FACC 00000000 */  nop
/* 2AED0 8004FAD0 00620018 */  mult      $v1, $v0
/* 2AED4 8004FAD4 82030049 */  lb        $v1, 0x49($s0)
/* 2AED8 8004FAD8 00002012 */  mflo      $a0
/* 2AEDC 8004FADC 92620016 */  lbu       $v0, 0x16($s3)
/* 2AEE0 8004FAE0 00000000 */  nop
/* 2AEE4 8004FAE4 00620018 */  mult      $v1, $v0
/* 2AEE8 8004FAE8 00001812 */  mflo      $v1
/* 2AEEC 8004FAEC 00041503 */  sra       $v0, $a0, 20
/* 2AEF0 8004FAF0 00000000 */  nop
/* 2AEF4 8004FAF4 00430018 */  mult      $v0, $v1
/* 2AEF8 8004FAF8 00001812 */  mflo      $v1
/* 2AEFC 8004FAFC 00031A43 */  sra       $v1, $v1, 9
/* 2AF00 8004FB00 A6630008 */  sh        $v1, 0x8($s3)
/* 2AF04 8004FB04 9242003D */  lbu       $v0, 0x3D($s2)
/* 2AF08 8004FB08 A6430040 */  sh        $v1, 0x40($s2)
/* 2AF0C 8004FB0C 34420020 */  ori       $v0, $v0, 0x20
/* 2AF10 8004FB10 A242003D */  sb        $v0, 0x3D($s2)
/* 2AF14 8004FB14 9202004A */  lbu       $v0, 0x4A($s0)
/* 2AF18 8004FB18 A242000E */  sb        $v0, 0xE($s2)
/* 2AF1C 8004FB1C 9202004B */  lbu       $v0, 0x4B($s0)
/* 2AF20 8004FB20 08013ED4 */  j         .L8004FB50
/* 2AF24 8004FB24 A242000F */   sb       $v0, 0xF($s2)
.L8004FB28:
/* 2AF28 8004FB28 96020042 */  lhu       $v0, 0x42($s0)
/* 2AF2C 8004FB2C 50400009 */  beql      $v0, $zero, .L8004FB54
/* 2AF30 8004FB30 A2600017 */   sb       $zero, 0x17($s3)
/* 2AF34 8004FB34 9202004A */  lbu       $v0, 0x4A($s0)
/* 2AF38 8004FB38 A242000E */  sb        $v0, 0xE($s2)
/* 2AF3C 8004FB3C 92420043 */  lbu       $v0, 0x43($s2)
/* 2AF40 8004FB40 9203004B */  lbu       $v1, 0x4B($s0)
/* 2AF44 8004FB44 34420010 */  ori       $v0, $v0, 0x10
/* 2AF48 8004FB48 A2420043 */  sb        $v0, 0x43($s2)
/* 2AF4C 8004FB4C A243000F */  sb        $v1, 0xF($s2)
.L8004FB50:
/* 2AF50 8004FB50 A2600017 */  sb        $zero, 0x17($s3)
.L8004FB54:
/* 2AF54 8004FB54 26B50001 */  addiu     $s5, $s5, 0x1
.L8004FB58:
/* 2AF58 8004FB58 92020053 */  lbu       $v0, 0x53($s0)
/* 2AF5C 8004FB5C 32A400FF */  andi      $a0, $s5, 0xFF
/* 2AF60 8004FB60 0082102B */  sltu      $v0, $a0, $v0
/* 2AF64 8004FB64 1440FF31 */  bnez      $v0, .L8004F82C
/* 2AF68 8004FB68 00000000 */   nop
/* 2AF6C 8004FB6C 26F70001 */  addiu     $s7, $s7, 0x1
.L8004FB70:
/* 2AF70 8004FB70 2EE20010 */  sltiu     $v0, $s7, 0x10
/* 2AF74 8004FB74 1440FCAA */  bnez      $v0, .L8004EE20
/* 2AF78 8004FB78 00171040 */   sll      $v0, $s7, 1
/* 2AF7C 8004FB7C 93A20028 */  lbu       $v0, 0x28($sp)
/* 2AF80 8004FB80 10400002 */  beqz      $v0, .L8004FB8C
/* 2AF84 8004FB84 24020002 */   addiu    $v0, $zero, 0x2
/* 2AF88 8004FB88 A2820221 */  sb        $v0, 0x221($s4)
.L8004FB8C:
/* 2AF8C 8004FB8C 8FBF0054 */  lw        $ra, 0x54($sp)
/* 2AF90 8004FB90 8FBE0050 */  lw        $fp, 0x50($sp)
/* 2AF94 8004FB94 8FB7004C */  lw        $s7, 0x4C($sp)
/* 2AF98 8004FB98 8FB60048 */  lw        $s6, 0x48($sp)
/* 2AF9C 8004FB9C 8FB50044 */  lw        $s5, 0x44($sp)
/* 2AFA0 8004FBA0 8FB40040 */  lw        $s4, 0x40($sp)
/* 2AFA4 8004FBA4 8FB3003C */  lw        $s3, 0x3C($sp)
/* 2AFA8 8004FBA8 8FB20038 */  lw        $s2, 0x38($sp)
/* 2AFAC 8004FBAC 8FB10034 */  lw        $s1, 0x34($sp)
/* 2AFB0 8004FBB0 8FB00030 */  lw        $s0, 0x30($sp)
/* 2AFB4 8004FBB4 03E00008 */  jr        $ra
/* 2AFB8 8004FBB8 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

void au_bgm_player_update_playing(BGMPlayer *player) {
    s32 bVolumeFading;
    u8 sp1F;
    s16 notePitch;
    u8 bFinished;

    AuVoice* voice;
    BGMDrumInfo* drumInfo;
    BGMPlayerTrack* track;
    SeqNote* note;
    s32 var_a0;
    s32 temp;
    s32 var_a1_5;
    s32 bAcquiredVoiceIdx;
    u8 opcode;
    u8 noteVelocity;
    s32 noteLength;
    u32 i;
    u8 voiceIdx;
    s32 temp2;
    bVolumeFading = FALSE;
    bFinished = FALSE;

    if (player->masterTempoTime != 0) {
        player->masterTempoTime--;
        if (player->masterTempoTime == 0) {
            player->masterTempo = player->masterTempoTarget;
            player->masterTempoTarget = 0;
            player->masterTempoStep = 0;
        } else {
            player->masterTempo += player->masterTempoStep;
        }
        player->nextUpdateStep = player->masterTempo * 10;
    }
    if (player->masterVolumeTime != 0) {
        player->masterVolumeTime--;
        if (player->masterVolumeTime == 0) {
            player->masterVolume = player->masterVolumeTarget;
            player->masterVolumeTarget = 0;
            player->masterVolumeStep = 0;
        } else {
            player->masterVolume += player->masterVolumeStep;
        }
        bVolumeFading = TRUE;
    }
    player->volumeChanged = FALSE;
    if (player->trackVolsConfig != NULL) {
        if (player->bFadeConfigSetsVolume) {
            // setting track volumes
            s32 lenLimit = 16;
            while (lenLimit-- != 0) {
                i = *player->trackVolsConfig++;
                if (i == 0) {
                    break;
                }
                track = &player->tracks[i - 1];
                player->seqCmdArgs.TrackVolumeFade.time = 48;
                player->seqCmdArgs.TrackVolumeFade.value = *(player->trackVolsConfig++);
                if (track->bgmReadPos != 0) {
                    au_BGMCmd_F6_TrackVolumeFade(player, track);
                }
            }
        }
        else {
            // clearing track volumes
            s32 lenLimit = 16;
            while (lenLimit-- != 0) {
                i = *player->trackVolsConfig++;
                if (i == 0) {
                    break;
                }
                track = &player->tracks[i - 1];
                player->seqCmdArgs.TrackVolumeFade.time = 48;
                player->trackVolsConfig++; // ignore arg
                player->seqCmdArgs.TrackVolumeFade.value = 0;
                if (track->bgmReadPos != 0) {
                    au_BGMCmd_F6_TrackVolumeFade(player, track);
                }
            }
        }
        player->trackVolsConfig = NULL;
        player->bFadeConfigSetsVolume = FALSE;
    }
    for (i = 0; i < ARRAY_COUNT(player->tracks); i++) {
        track = &player->tracks[i];
        if (track->bgmReadPos != NULL) {
            track->changed.all = 0;
            if (bVolumeFading || player->volumeChanged) {
                track->changed.volume = 1;
            } else {
                track->changed.volume = 0;
            }
            if (track->subTrackVolumeTime != 0) {
                track->subTrackVolumeTime--;
                if (track->subTrackVolumeTime == 0) {
                    track->subTrackVolume = track->subTrackVolumeTarget;
                } else {
                    track->subTrackVolume += track->subTrackVolumeStep;
                }
                track->changed.volume = 1;
            }
            if (track->unkVolumeTime != 0) {
                track->unkVolumeTime--;
                if (track->unkVolumeTime == 0) {
                    track->unkVolume = track->unkVolumeTarget << 0x10;
                } else {
                    track->unkVolume += track->unkVolumeStep;
                }
                track->changed.volume = 1;
            }
            track->delayTime--;
            if (track->delayTime <= 0) {
                sp1F = track->unk_52;
                while (track->delayTime == 0) {
                    opcode = *(track->bgmReadPos++);
                    POST_BGM_READ();

                    if (opcode < 0x80) {
                        if (opcode == 0) {
                            if (track->prevReadPos != 0) {
                                track->bgmReadPos = track->prevReadPos;
                                track->prevReadPos = 0;
                            } else {
                                bFinished = TRUE;
                                break;
                            }
                        } else {
                            if (opcode >= 0x78) {
                                // long delay
                                track->delayTime = (((opcode & 7) << 8) + *(track->bgmReadPos++)) + 0x78;
                                POST_BGM_READ();

                            } else {
                                // delay
                                track->delayTime = opcode;
                            }
                        }
                    } else {
                        // note
                        if (opcode < 0xD4) {
                            notePitch = (opcode & 0x7F);
                            noteVelocity = *(track->bgmReadPos++);
                            POST_BGM_READ();
                            noteLength = *(track->bgmReadPos++);
                            POST_BGM_READ();
                            if (!(noteLength < 0xC0)) {
                                noteLength = (((u8)noteLength & ~0xC0) << 8) + *(track->bgmReadPos++) + 0xC0;
                                POST_BGM_READ();
                            }
                            bAcquiredVoiceIdx = FALSE;
                            if (track->unk_5A == 0) {
                                // find first free voice
                                for (voiceIdx = sp1F; voiceIdx < track->unk_53; voiceIdx++) {
                                    voice = &player->globals->voices[voiceIdx];
                                    sp1F++;
                                    if (voice->priority == AU_PRIORITY_FREE) {
                                        bAcquiredVoiceIdx = TRUE;
                                        break;
                                    }
                                }

                                if (!bAcquiredVoiceIdx) {
                                    if (track->polyphonicIdx >= 5) { // 5 = AL_DEFAULT_PRIORITY?
                                        // try stealing a voice with lower priority
                                        for (voiceIdx = track->unk_52; voiceIdx < track->unk_53; voiceIdx++) {
                                            voice = &player->globals->voices[voiceIdx];
                                            if (voice->priority < player->priority) {
                                                au_reset_voice(voice, voiceIdx);
                                                bAcquiredVoiceIdx = TRUE;
                                                break;
                                            }
                                        }
                                        // try stealing a voice with equal priority and zero note length
                                        if (!bAcquiredVoiceIdx) {
                                            for (voiceIdx = track->unk_52; voiceIdx < track->unk_53; voiceIdx++) {
                                                voice = &player->globals->voices[voiceIdx];
                                                if (voice->priority == player->priority) {
                                                    note = &player->notes[voiceIdx];
                                                    if (note->noteLength == 0) {
                                                        au_reset_voice(voice, voiceIdx);
                                                        bAcquiredVoiceIdx = TRUE;
                                                        break;
                                                    }
                                                }
                                            }
                                        }
                                        // try stealing a voice with equal priority and lowest note length
                                        if (!bAcquiredVoiceIdx) {
                                            s32 shortestLength = 0xFFFF;
                                            u8 voice_it;
                                            AuVoice* curVoice;
                                            SeqNote* curNote;
                                            for (voice_it = track->unk_52; voice_it < track->unk_53; voice_it++) {
                                                curVoice = &player->globals->voices[voice_it];
                                                if (curVoice->priority == player->priority) {
                                                    curNote = &player->notes[voice_it];
                                                    if (curNote->unk_note_17 == 0 && curNote->noteLength < shortestLength) {
                                                        shortestLength = curNote->noteLength;
                                                        voice = curVoice;
                                                        note = curNote;
                                                        voiceIdx = voice_it;
                                                        bAcquiredVoiceIdx = TRUE;
                                                    }
                                                }
                                            }
                                            if (bAcquiredVoiceIdx) {
                                                note->noteLength = 0;
                                                au_reset_voice(voice, voiceIdx);
                                            }
                                        }

                                    } else {
                                        voiceIdx = track->unk_52;
                                        voice = &player->globals->voices[voiceIdx];
                                        note = &player->notes[voiceIdx];
                                        note->noteLength = 0;
                                        if (voice->priority <= player->priority) {
                                            au_reset_voice(voice, voiceIdx);
                                            bAcquiredVoiceIdx = TRUE;
                                        }
                                    }
                                }
                            }
                            if (bAcquiredVoiceIdx) {
                                note = &player->notes[voiceIdx];
                                note->tremoloTime = 0;
                                if (noteVelocity > 0) {
                                    note->noteVelocity = noteVelocity + 1;
                                } else {
                                    note->noteVelocity = 0;
                                }
                                note->noteLength = noteLength;
                                if (track->isDrumTrack) {
                                    if (notePitch < 72) { // = 6 * 12
                                        drumInfo = &player->globals->dataPER->drums[notePitch];
                                    } else {
                                        drumInfo = player->drums[notePitch - 72]; // = 6 * 12
                                    }
                                    note->ins = au_get_instrument(player->globals, (u16)drumInfo->bankPatch >> 8, (u16)drumInfo->bankPatch & 0xFF, &voice->envelope);
                                    if (drumInfo->randVolume != 0) {
                                        note->volume = note->noteVelocity * au_bgm_get_random_vol(player->randomValue1, drumInfo->volume, drumInfo->randVolume);
                                    } else {
                                        note->volume = note->noteVelocity * drumInfo->volume;
                                    }
                                    voice->clientVolume = ((
                                        ((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14)
                                        * (track->segTrackVolume * note->volume)) >> 0x10;
                                    note->adjustedPitch =
                                        drumInfo->keyBase
                                        + track->subTrackCoarseTune
                                        + track->subTrackFineTune
                                        - note->ins->keyBase;
                                    temp = (note->adjustedPitch + track->segTrackTune) + player->detune;
                                    if (drumInfo->randTune != 0) {
                                        note->unk_14 = au_bgm_get_random_pitch(player->randomValue1, temp, drumInfo->randTune);
                                        temp = note->unk_14;
                                    }
                                    note->pitchRatio = au_compute_pitch_ratio(temp) * note->ins->pitchRatio;
                                    if (drumInfo->randPan != 0) {
                                        voice->pan = au_bgm_get_random_pan(player, drumInfo->pan, drumInfo->randPan);
                                    } else {
                                        voice->pan = drumInfo->pan;
                                    }
                                    if (drumInfo->randReverb != 0) {
                                        voice->reverb = au_bgm_get_random_reverb(player->randomValue1, drumInfo->reverb, drumInfo->randReverb);
                                    } else {
                                        voice->reverb = drumInfo->reverb;
                                    }
                                } else {
                                    note->volume = ((
                                        ((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14)
                                        * (track->segTrackVolume * note->noteVelocity)) >> 9;
                                    voice->clientVolume = note->volume;
                                    note->ins = track->instrument;
                                    note->adjustedPitch =
                                        (notePitch * 100)
                                        + track->subTrackCoarseTune
                                        + player->masterPitchShift
                                        + track->subTrackFineTune
                                        - note->ins->keyBase;
                                    note->pitchRatio = au_compute_pitch_ratio(
                                        note->adjustedPitch
                                        + track->segTrackTune
                                        + player->detune)
                                        * track->instrument->pitchRatio;

                                    if (track->unk_57 != 0) {
                                        voice->pan = au_bgm_get_random_pan(player, track->subTrackPan, track->unk_57);
                                    } else {
                                        voice->pan = track->subTrackPan;
                                    }
                                    voice->reverb = track->subTrackReverb;

                                    if (track->unk_4C != 0) {
                                        voice->envelope.cmdListPress = (u8*) player->unk_174[track->unk_4C - 1]; //TODO ???
                                    } else {
                                        voice->envelope.cmdListPress = track->envelope.cmdListPress;
                                    }
                                    voice->envelope.cmdListRelease = track->envelope.cmdListRelease;
                                }
                                voice->instrument = note->ins;
                                voice->pitchRatio = note->pitchRatio;
                                voice->busId = track->subtrackBusId;
                                if (note->noteLength >= 2) {
                                    note->unk_note_17 = 1;
                                    note->tremoloTime = track->trackTremoloTime;
                                    note->unk_13 = 0;
                                    note->tremoloAmount = track->trackTremoloAmount;
                                    voice->syncFlags = AU_VOICE_SYNC_FLAG_ALL;
                                    voice->priority = player->priority;
                                    voice->clientPriority = voice->priority;
                                }
                            }
                        } else {
                            //TODO variable is nargs, but reusing temp is required to match
                            temp = SeqCmdArgCounts[opcode - 0xE0];
                            if (temp != 0) {
                                player->seqCmdArgs.raw[0] = *(track->bgmReadPos++);
                                POST_BGM_READ();
                            } else {
                                goto bgm_args_done;
                            }
                            if (temp > 1) {
                                player->seqCmdArgs.raw[1] = *(track->bgmReadPos++);
                                POST_BGM_READ();
                            } else {
                                goto bgm_args_done;
                            }
                            if (temp > 2) {
                                player->seqCmdArgs.raw[2] = *(track->bgmReadPos++);
                                POST_BGM_READ();
                            } else {
                                goto bgm_args_done;
                            }
                            if (temp > 3) {
                                player->seqCmdArgs.raw[3] = *(track->bgmReadPos++);
                                POST_BGM_READ();
                            }
                            bgm_args_done:
                            CurrentSeqCmdHandler = SeqCmdHandlers[opcode - 0xE0];
                            CurrentSeqCmdHandler(player, track);
                        }
                    }
                } // end while
            }

            for (voiceIdx = track->unk_52; voiceIdx < track->unk_53; voiceIdx++) {
                if (track->unk_5A == 0) {
                    voice = &player->globals->voices[voiceIdx];
                    if (voice->priority == player->priority) {
                        note = &player->notes[voiceIdx];
                        if (note->unk_note_17 == 0) {
                            if (note->noteLength > 0) {
                                note->noteLength--;
                                if (note->noteLength == 0) {
                                    voice->envelopeFlags |= AU_VOICE_ENV_FLAG_KEY_RELEASED;
                                }
                            }
                            if (track->isDrumTrack) {
                                if (track->changed.tune || (player->detune != 0)) {
                                    note->pitchRatio = au_compute_pitch_ratio(((note->adjustedPitch + note->unk_14) + track->segTrackTune) + player->detune) * note->ins->pitchRatio;
                                    if (voice->pitchRatio != note->pitchRatio) {
                                        voice->pitchRatio = note->pitchRatio;
                                        voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
                                    }
                                }
                                if (track->changed.volume) {
                                    voice->clientVolume = (
                                        ((((player->masterVolume >> 0x15)
                                        * (track->subTrackVolume >> 0x15))
                                        * (track->unkVolume >> 0x15)) >> 0x14)
                                        * (track->segTrackVolume * note->volume)) >> 0x10;
                                    voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
                                }
                            } else {
                                if (note->tremoloTime != 0) {
                                    if (note->tremoloAmount != 0) {
                                        note->tremoloAmount--;
                                    } else {
                                        u8 temp_a0_6;
                                        u8 temp_a2_4;
                                        note->unk_13 += track->trackTremoloSpeed;
                                        opcode = (note->unk_13 << 2) + 3;
                                        temp_a2_4 = note->unk_13 >> 6;

                                        if ((temp_a2_4 == 1) || (temp_a2_4 == 3)) {
                                            u8 temp2 = ~opcode;
                                            var_a1_5 = temp2 + 1;
                                        } else {
                                            var_a1_5 = opcode;
                                        }

                                        var_a1_5 = (var_a1_5 * track->trackTremoloTime) >> 8;

                                        if ((temp_a2_4 == 2) || (temp_a2_4 == 3)) {
                                            var_a1_5 = -var_a1_5;
                                        }

                                        note->pitchRatio = au_compute_pitch_ratio(var_a1_5 + ((note->adjustedPitch + track->segTrackTune) + player->detune)) * note->ins->pitchRatio;
                                        if (voice->pitchRatio != note->pitchRatio) {
                                            voice->pitchRatio = note->pitchRatio;
                                            voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
                                        }
                                    }
                                } else if (track->changed.tune || (player->detune != 0)) {

                                    note->pitchRatio = au_compute_pitch_ratio((note->adjustedPitch + track->segTrackTune) + player->detune) * note->ins->pitchRatio;
                                    if (voice->pitchRatio != note->pitchRatio) {
                                        voice->pitchRatio = note->pitchRatio;
                                        voice->syncFlags |= AU_VOICE_SYNC_FLAG_PITCH;
                                    }
                                }
                                if (track->changed.volume) {
                                    s32 tempVolume = ((player->masterVolume >> 0x15) * (track->subTrackVolume >> 0x15) * (track->unkVolume >> 0x15)) >> 0x14;
                                    note->volume = (tempVolume * (track->segTrackVolume * note->noteVelocity)) >> 9;
                                    voice->clientVolume = note->volume;
                                    voice->envelopeFlags |= AU_VOICE_ENV_FLAG_VOL_CHANGED;
                                    voice->pan = track->subTrackPan;
                                    voice->reverb = track->subTrackReverb;
                                } else if (track->changed.pan || track->changed.reverb) {
                                    voice->pan = track->subTrackPan;
                                    voice->reverb = track->subTrackReverb;
                                    voice->syncFlags |= AU_VOICE_SYNC_FLAG_PAN_FXMIX;
                                }
                            }
                        }
                        note->unk_note_17 = 0;
                    }
                }
            }
        }
    }

    if (bFinished) {
        player->masterState = BGM_PLAY_STATE_NEXT_SUBSEG;
    }
}