; Borg Disassembler v2.27 : D:\BeRoProjects\0ok\T0AST\synth\main.exe
;
;             Created by Borg Disassembler
;                   written by Cronos

              ;-----------------------------------------------------------------------
              ;Segment : 1000h     Offset : 401000h     Size : abah
              ;32-bit Code
              ;-----------------------------------------------------------------------
                                   dd     00h
                                   dd     00h
                                   dd     0ffffffffh
                                   dd     1028h
                                   dd     1032h
                                   dd     00h
                                   dd     00h
                                   dd     00h
                                   dd     00h
                                   dd     00h
              s_winmm_dll:
                                   db     "winmm.dll",00h
              ;                                   XREFS First: 1000:004019c4 Number : 1
              waveOutWrite:
                                   dd     1044h
              ;                                   XREFS First: 1000:0040195b Number : 1
              waveOutUnprepareHeader:
                                   dd     1053h
              ;                                   XREFS First: 1000:004019a4 Number : 1
              waveOutPrepareHeader:
                                   dd     106ch
              ;                                   XREFS First: 1000:004018c7 Number : 1
              waveOutOpen:
                                   dd     1083h
                                   add    [eax], al
                                   dw     00h
              s_waveOutWrite:
                                   db     "waveOutWrite",00h
                                   dw     00h
              s_waveOutUnprepareHeader:
                                   db     "waveOutUnprepareHeader",00h
                                   dw     00h
              s_waveOutPrepareHeader:
                                   db     "waveOutPrepareHeader",00h
                                   dw     00h
              s_waveOutOpen:
                                   db     "waveOutOpen",00h
              start:
                                   ret    
              ;                                   XREFS First: 1000:00401334 Number : 1
              loc_00401092:
                                   push   ebp
                                   mov    ebp, esp
                                   fld    dword ptr [ebp+0ch]
                                   fld    dword ptr [ebp+08h]
                                   fyl2x  
                                   fld1   
                                   fld    st(1)
                                   fprem  
                                   f2xm1  
                                   faddp  st(1), st(0)
                                   fscale 
                                   fstp   st(1)
                                   leave  
                                   ret    08h
              ;                                   XREFS First: 1000:004015f0 Number : 1
              loc_004010af:
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 08h
                                   mov    edx, dword ptr [401b4eh]
                                   mov    eax, 524281h
                                   mul    edx
                                   add    eax, 3133731h
                                   mov    dword ptr [401b4eh], eax
                                   and    eax, 7fffffh
                                   or     eax, 40000000h
                                   mov    [ebp-08h], eax
                                   lea    eax, [ebp-08h]
                                   fld    dword ptr [eax]
                                   fld    tbyte ptr [loc_00401a44]
                                   fsubp  st(1), st(0)
                                   fstp   dword ptr [ebp-04h]
                                   fld    dword ptr [ebp-04h]
                                   leave  
                                   ret    
              ;                                   XREFS First: 1000:004015c4 Number : 2
              loc_004010ee:
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 10h
                                   mov    [ebp-10h], esi
                                   mov    [ebp-0ch], edi
                                   lea    edi, [ebp-08h]
                                   lea    esi, [ebp+08h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   fld    dword ptr [ebp-08h]
                                   frndint 
                                   fstp   dword ptr [ebp-08h]
                                   fld    dword ptr [ebp-08h]
                                   fsubr  dword ptr [ebp+08h]
                                   fstp   dword ptr [ebp-04h]
                                   fld    dword ptr [ebp-04h]
                                   mov    esi, [ebp-10h]
                                   mov    edi, [ebp-0ch]
                                   leave  
                                   ret    04h
              ;                                   XREFS First: 1000:004011ee Number : 2
              loc_00401126:
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 08h
                                   mov    [ebp-08h], ebx
                                   mov    dword ptr [ebp-04h], 00h
                                   dec    dword ptr [ebp-04h]
              ;                                   XREFS First: 1000:0040119f Number : 1
              loc_00401139:
                                   inc    dword ptr [ebp-04h]
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-04h]
                                   mov    eax, [edx+170h][eax*4]
                                   test   eax, eax
                                   jl     loc_0040119b
                                   mov    ecx, [ebp-04h]
                                   lea    ebx, [edx+230h]
                                   add    ebx, [edx+170h][ecx*4]
                                   mov    [edx+2006b0h][ecx*4], ebx
                                   lea    ebx, [edx+230h]
                                   add    ebx, [edx+1b0h][ecx*4]
                                   mov    [edx+2006f0h][ecx*4], ebx
                                   lea    ebx, [edx+230h]
                                   add    ebx, [edx+1f0h][ecx*4]
                                   mov    [edx+200730h][ecx*4], ebx
                                   mov    dword ptr [edx+200670h][ecx*4], 00h
              ;                                   XREFS First: 1000:0040114b Number : 1
              loc_0040119b:
                                   cmp    dword ptr [ebp-04h], 0fh
                                   jl     loc_00401139
                                   mov    ebx, [ebp-08h]
                                   leave  
                                   ret    04h
              ;                                   XREFS First: 1000:0040122e Number : 2
              loc_004011ac:
                                   push   ebp
                                   mov    ebp, esp
                                   mov    eax, [ebp+08h]
                                   fld    dword ptr [eax+20h]
                                   fld    dword ptr [eax+20h]
                                   fld    dword ptr [eax+18h]
                                   fld1   
                                   fsubrp st(1), st(0)
                                   fdivp  st(1), st(0)
                                   faddp  st(1), st(0)
                                   fstp   dword ptr [eax+10h]
                                   fld    dword ptr [eax+24h]
                                   fld    dword ptr [eax+24h]
                                   fld    dword ptr [eax+18h]
                                   fld1   
                                   fsubrp st(1), st(0)
                                   fdivp  st(1), st(0)
                                   faddp  st(1), st(0)
                                   fstp   dword ptr [eax+14h]
                                   leave  
                                   ret    04h
              ;                                   XREFS First: 1000:004018a3 Number : 1
              loc_004011de:
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 0ch
                                   mov    [ebp-0ch], esi
                                   mov    [ebp-08h], edi
                                   mov    eax, [ebp+08h]
                                   push   eax
                                   call   loc_00401126
                                   mov    dword ptr [ebp-04h], 00h
                                   dec    dword ptr [ebp-04h]
              ;                                   XREFS First: 1000:00401237 Number : 1
              loc_004011fd:
                                   inc    dword ptr [ebp-04h]
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-04h]
                                   imul   eax, eax, 28h
                                   lea    edi, [edx+200408h][eax]
                                   mov    esi, 401a4eh
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-04h]
                                   imul   eax, eax, 28h
                                   lea    eax, [edx+2003f0h][eax]
                                   push   eax
                                   call   loc_004011ac
                                   cmp    dword ptr [ebp-04h], 0fh
                                   jl     loc_004011fd
                                   mov    esi, [ebp-0ch]
                                   mov    edi, [ebp-08h]
                                   leave  
                                   ret    04h
              ;                                   XREFS First: 1000:00401985 Number : 1
              loc_00401247:
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 48h
                                   mov    [ebp-48h], ebx
                                   mov    [ebp-44h], esi
                                   mov    [ebp-40h], edi
                                   mov    dword ptr [ebp-04h], 01h
                                   dec    dword ptr [ebp-04h]
              ;                                   XREFS First: 1000:00401864 Number : 1
              loc_00401260:
                                   inc    dword ptr [ebp-04h]
                                   mov    dword ptr [ebp-0ch], 10h
                                   fldz   
                                   fstp   dword ptr [ebp-18h]
                                   fldz   
                                   fstp   dword ptr [ebp-1ch]
                                   mov    dword ptr [ebp-08h], 00h
                                   dec    dword ptr [ebp-08h]
              ;                                   XREFS First: 1000:004017ee Number : 1
              loc_0040127e:
                                   inc    dword ptr [ebp-08h]
                                   mov    eax, [ebp+08h]
                                   mov    eax, [eax+200774h]
                                   test   eax, eax
                                   jnz    loc_004015a6
                                   jmp    loc_00401557
              ;                                   XREFS First: 1000:0040157c Number : 1
              loc_00401297:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   mov    dword ptr [edx+200670h][eax*4], 00h
                                   mov    esi, [edx+2006f0h][eax*4]
                                   lea    edi, [ebp-2ch]
                                   cld    
                                   mov    ecx, 01h
                                   rep movsb 
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   mov    esi, [edx+200730h][eax*4]
                                   lea    edi, [ebp-30h]
                                   cld    
                                   mov    ecx, 01h
                                   rep movsb 
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   inc    dword ptr [edx+2006b0h][eax*4]
                                   inc    dword ptr [edx+2006f0h][eax*4]
                                   inc    dword ptr [edx+200730h][eax*4]
                                   mov    esi, eax
                                   movzx  eax, byte ptr [ebp-2ch]
                                   test   eax, eax
                                   jz     loc_004013f5
                                   cmp    eax, 81h
                                   jg     loc_004013f5
                                   cmp    eax, 80h
                                   jge    loc_004013a1
                                   mov    ebx, edx
                                   sub    eax, 31h
                                   mov    [ebp-34h], eax
                                   fild   dword ptr [ebp-34h]
                                   fld    tbyte ptr [loc_00401a52]
                                   fmulp  st(1), st(0)
                                   sub    esp, 04h
                                   fstp   dword ptr [esp]
                                   add    [eax], al
                                   add    [eax], al
                                   push   dword ptr [loc_00401a5c]
                                   call   loc_00401092
                                   fld    tbyte ptr [401a60h]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [ebx+200370h][esi*4]
                                   mov    ecx, [ebp+08h]
                                   mov    ebx, [ebp-08h]
                                   lea    edi, [ecx+2003b0h][ebx*4]
                                   lea    esi, [ecx+120h][ebx*4]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   mov    ecx, [ebp+08h]
                                   mov    ebx, [ebp-08h]
                                   lea    edi, [ecx+200270h][ebx*4]
                                   lea    esi, [ecx+0a0h][ebx*4]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   mov    ecx, [ebp+08h]
                                   mov    ebx, [ebp-08h]
                                   lea    edi, [ecx+2002f0h][ebx*4]
                                   lea    esi, [ecx+0e0h][ebx*4]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   jmp    loc_004013c8
              ;                                   XREFS First: 1000:0040130b Number : 1
              loc_004013a1:
                                   movzx  eax, byte ptr [ebp-2ch]
                                   cmp    eax, 80h
                                   jnz    loc_004013c8
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   fldz   
                                   fstp   dword ptr [edx+200370h][eax*4]
                                   fld1   
                                   fstp   dword ptr [edx+2003b0h][eax*4]
              ;                                   XREFS First: 1000:0040139c Number : 2
              loc_004013c8:
                                   movzx  eax, byte ptr [ebp-30h]
                                   cmp    eax, 40h
                                   jg     loc_00401557
                                   mov    ecx, [ebp+08h]
                                   mov    edx, [ebp-08h]
                                   mov    [ebp-34h], eax
                                   fild   dword ptr [ebp-34h]
                                   fld    tbyte ptr [loc_00401a6a]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [ecx+2002b0h][edx*4]
                                   jmp    loc_00401557
              ;                                   XREFS First: 1000:004012f5 Number : 2
              loc_004013f5:
                                   movzx  eax, byte ptr [ebp-30h]
                                   mov    [ebp-34h], eax
                                   fild   dword ptr [ebp-34h]
                                   fld    tbyte ptr [401a74h]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [ebp-28h]
                                   mov    al, [ebp-2ch]
                                   cmp    al, 82h
                                   jc     loc_00401557
                                   cmp    al, 90h
                                   ja     loc_00401557
                                   movzx  eax, al
                                   jmp    dword ptr [4017e6h]
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   imul   eax, eax, 28h
                                   lea    edi, [edx+200414h][eax]
                                   lea    esi, [ebp-28h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   jmp    loc_00401557
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   imul   eax, eax, 28h
                                   lea    edi, [edx+200410h][eax]
                                   lea    esi, [ebp-28h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   jmp    loc_00401557
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   imul   eax, eax, 28h
                                   lea    edi, [edx+20040ch][eax]
                                   lea    esi, [ebp-28h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   jmp    loc_00401557
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   imul   eax, eax, 28h
                                   lea    edi, [edx+200408h][eax]
                                   lea    esi, [ebp-28h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   imul   eax, eax, 28h
                                   lea    eax, [edx+2003f0h][eax]
                                   push   eax
                                   call   loc_004011ac
                                   jmp    loc_00401557
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   lea    edi, [edx+160h][eax]
                                   lea    esi, [ebp-30h]
                                   cld    
                                   mov    ecx, 01h
                                   rep movsb 
                                   jmp    loc_00401557
                                   movzx  eax, byte ptr [ebp-30h]
                                   mov    [ebp-34h], eax
                                   fild   dword ptr [ebp-34h]
                                   fld    tbyte ptr [401a7eh]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [ebp-24h]
                                   movzx  eax, byte ptr [ebp-2ch]
                                   cmp    eax, 84h
                                   jnz    loc_00401505
                                   fld    dword ptr [ebp-24h]
                                   fchs   
                                   fstp   dword ptr [ebp-24h]
              ;                                   XREFS First: 1000:004014f7 Number : 1
              loc_00401505:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   fld    dword ptr [edx+200370h][eax*4]
                                   fld1   
                                   fadd   dword ptr [ebp-24h]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [edx+200370h][eax*4]
                                   jmp    loc_00401557
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   mov    dword ptr [edx+2006b0h][eax*4], 00h
                                   jmp    loc_00401557
                                   movzx  ecx, byte ptr [ebp-30h]
                                   shl    ecx, 08h
                                   mov    eax, 1aeaa00h
                                   mov    edx, 00h
                                   div    ecx
                                   mov    edx, [ebp+08h]
                                   mov    [edx+200770h], eax
              ;                                   XREFS First: 1000:00401292 Number : 12
              loc_00401557:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   cmp    dword ptr [edx+2006b0h][eax*4], 00h
                                   jz     loc_00401582
                                   mov    ecx, [edx+2006b0h][eax*4]
                                   movzx  ecx, byte ptr [ecx]
                                   cmp    ecx, [edx+200670h][eax*4]
                                   jle    loc_00401297
              ;                                   XREFS First: 1000:00401565 Number : 1
              loc_00401582:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   cmp    dword ptr [edx+2006b0h][eax*4], 00h
                                   jnz    loc_00401599
                                   dec    dword ptr [ebp-0ch]
              ;                                   XREFS First: 1000:00401590 Number : 1
              loc_00401599:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   inc    dword ptr [edx+200670h][eax*4]
              ;                                   XREFS First: 1000:0040128c Number : 1
              loc_004015a6:
                                   mov    edx, [ebp+08h]
                                   mov    ebx, [ebp-08h]
                                   fld    dword ptr [edx+200230h][ebx*4]
                                   fadd   dword ptr [edx+200330h][ebx*4]
                                   sub    esp, 04h
                                   fstp   dword ptr [esp]
                                   add    [eax], al
                                   add    [eax], al
                                   call   loc_004010ee
                                   fstp   dword ptr [ebp-14h]
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   movzx  eax, byte ptr [edx][eax]
                                   mov    [ebp-10h], eax
                                   test   eax, eax
                                   jl     loc_0040169e
                                   cmp    eax, 05h
                                   jg     loc_0040169e
                                   jmp    dword ptr [loc_00401a2a]
                                   call   loc_004010af
                                   fstp   dword ptr [ebp-24h]
                                   jmp    loc_004016a3
                                   mov    eax, [ebp-10h]
                                   sub    eax, 03h
                                   shl    eax, 1h
                                   mov    edx, 01h
                                   sub    edx, eax
                                   mov    [ebp-34h], edx
                                   fild   dword ptr [ebp-34h]
                                   fld    dword ptr [ebp-14h]
                                   fld    tbyte ptr [401a88h]
                                   fsubp  st(1), st(0)
                                   fld    tbyte ptr [loc_00401a92]
                                   fmulp  st(1), st(0)
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [ebp-24h]
                                   jmp    loc_004016a3
                                   fld    dword ptr [ebp-14h]
                                   fld    tbyte ptr [401a88h]
                                   fsubp  st(1), st(0)
                                   fstp   dword ptr [ebp-14h]
                                   mov    eax, [ebp-14h]
                                   shr    eax, 1fh
                                   shl    eax, 1h
                                   mov    edx, 01h
                                   sub    edx, eax
                                   mov    [ebp-34h], edx
                                   mov    [ebp-3ch], edx
                                   db     0c7h
                                   inc    ebp
                                   enter  00h, 00h
                                   add    bh, bl
                                   insd   
                                   les    ebx, ecx
                                   pop    ebp
                                   fsubr  st(1), st(0)
                                   aas    
                                   add    [eax], al
                                   add    cl, bl
                                   inc    ebp
                                   in     al, dx
                                   fld    tbyte ptr [401a88h]
                                   fsubp  st(1), st(0)
                                   fld    tbyte ptr [401a9ch]
                                   fmulp  st(1), st(0)
                                   fabs   
                                   fld1   
                                   fsubp  st(1), st(0)
                                   fstp   dword ptr [ebp-24h]
                                   jmp    loc_004016a3
              ;                                   XREFS First: 1000:00401a2a Number : 1
              loc_00401685:
                                   fld    dword ptr [ebp-14h]
                                   fld    tbyte ptr [loc_00401a92]
                                   fmulp  st(1), st(0)
                                   fldpi  
                                   fmulp  st(1), st(0)
                                   fsin   
                                   fstp   dword ptr [ebp-24h]
                                   jmp    loc_004016a3
              ;                                   XREFS First: 1000:004015db Number : 2
              loc_0040169e:
                                   fldz   
                                   fstp   dword ptr [ebp-24h]
              ;                                   XREFS First: 1000:004015f8 Number : 4
              loc_004016a3:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   fld    dword ptr [ebp-24h]
                                   fmul   dword ptr [edx+200270h][eax*4]
                                   fmul   dword ptr [edx+2002b0h][eax*4]
                                   fstp   dword ptr [ebp-24h]
                                   imul   eax, eax, 28h
                                   lea    eax, [edx+2003f0h][eax]
                                   fld    dword ptr [eax+04h]
                                   fsubr  dword ptr [eax]
                                   fmul   dword ptr [eax+10h]
                                   fld    dword ptr [ebp-24h]
                                   fsub   dword ptr [eax]
                                   faddp  st(1), st(0)
                                   fmul   dword ptr [eax+18h]
                                   fadd   dword ptr [eax]
                                   fstp   dword ptr [eax]
                                   fld    dword ptr [eax+04h]
                                   fsubr  dword ptr [eax]
                                   fmul   dword ptr [eax+18h]
                                   fadd   dword ptr [eax+04h]
                                   fstp   dword ptr [eax+04h]
                                   fld    dword ptr [eax+08h]
                                   fsubr  dword ptr [eax+04h]
                                   fld    dword ptr [eax+0ch]
                                   fsubr  dword ptr [eax+08h]
                                   fmul   dword ptr [eax+14h]
                                   faddp  st(1), st(0)
                                   fmul   dword ptr [eax+1ch]
                                   fadd   dword ptr [eax+08h]
                                   fstp   dword ptr [eax+08h]
                                   fld    dword ptr [eax+0ch]
                                   fsubr  dword ptr [eax+08h]
                                   fmul   dword ptr [eax+1ch]
                                   fadd   dword ptr [eax+0ch]
                                   fst    dword ptr [eax+0ch]
                                   fsubr  dword ptr [eax+04h]
                                   fstp   dword ptr [ebp-24h]
                                   mov    eax, [ebp-08h]
                                   mov    ecx, [edx+10h][eax]
                                   and    ecx, 7fh
                                   cmp    ecx, 10h
                                   jge    loc_0040173b
                                   fld    dword ptr [ebp-24h]
                                   fmul   dword ptr [edx+20h][eax*4]
                                   fstp   dword ptr [edx+200230h][ecx*4]
              ;                                   XREFS First: 1000:00401727 Number : 1
              loc_0040173b:
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   mov    eax, [edx+10h][eax]
                                   and    eax, 80h
                                   jz     loc_00401791
                                   mov    eax, [ebp-08h]
                                   fld    dword ptr [ebp-24h]
                                   fmul   dword ptr [edx+60h][eax*4]
                                   fstp   dword ptr [ebp-28h]
                                   movzx  eax, byte ptr [edx+160h][eax]
                                   mov    [ebp-34h], eax
                                   fild   dword ptr [ebp-34h]
                                   fld    tbyte ptr [401aa6h]
                                   fmulp  st(1), st(0)
                                   fst    dword ptr [ebp-20h]
                                   fmul   dword ptr [ebp-28h]
                                   fadd   dword ptr [ebp-18h]
                                   fstp   dword ptr [ebp-18h]
                                   fld    dword ptr [ebp-1ch]
                                   fld    dword ptr [ebp-28h]
                                   fld1   
                                   fsub   dword ptr [ebp-20h]
                                   fmulp  st(1), st(0)
                                   faddp  st(1), st(0)
                                   fstp   dword ptr [ebp-1ch]
              ;                                   XREFS First: 1000:0040174a Number : 1
              loc_00401791:
                                   mov    ebx, [ebp+08h]
                                   mov    edx, [ebp-08h]
                                   fld    dword ptr [ebx+200370h][edx*4]
                                   fadd   dword ptr [ebx+200330h][edx*4]
                                   sub    esp, 04h
                                   fstp   dword ptr [esp]
                                   add    [eax], al
                                   add    [eax], al
                                   call   loc_004010ee
                                   mov    edx, [ebp+08h]
                                   mov    eax, [ebp-08h]
                                   fstp   dword ptr [edx+200330h][eax*4]
                                   fld    dword ptr [edx+2003b0h][eax*4]
                                   fmul   dword ptr [edx+200370h][eax*4]
                                   fstp   dword ptr [edx+200370h][eax*4]
                                   fld    dword ptr [edx+2002f0h][eax*4]
                                   fmul   dword ptr [edx+200270h][eax*4]
                                   fstp   dword ptr [edx+200270h][eax*4]
                                   cmp    eax, 0fh
                                   jl     loc_0040127e
                                   mov    eax, [edx+200774h]
                                   test   eax, eax
                                   jnz    loc_0040182c
                                   mov    eax, [ebp-0ch]
                                   test   eax, eax
                                   jnz    loc_00401815
                                   mov    eax, edx
                                   push   eax
                                   call   loc_00401126
              ;                                   XREFS First: 1000:00401807 Number : 1
              loc_00401815:
                                   mov    edx, [ebp+08h]
                                   lea    edi, [edx+200774h]
                                   lea    esi, [edx+200770h]
                                   cld    
                                   mov    ecx, 04h
                                   rep movsb 
              ;                                   XREFS First: 1000:004017fc Number : 1
              loc_0040182c:
                                   mov    eax, [ebp+08h]
                                   dec    dword ptr [eax+200774h]
                                   mov    eax, [ebp+0ch]
                                   fld    dword ptr [ebp-18h]
                                   fld    tbyte ptr [loc_00401ab0]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [eax]
                                   add    dword ptr [ebp+0ch], 04h
                                   mov    eax, [ebp+0ch]
                                   fld    dword ptr [ebp-1ch]
                                   fld    tbyte ptr [loc_00401ab0]
                                   fmulp  st(1), st(0)
                                   fstp   dword ptr [eax]
                                   add    dword ptr [ebp+0ch], 04h
                                   cmp    dword ptr [ebp-04h], 1000h
                                   jl     loc_00401260
                                   mov    ebx, [ebp-48h]
                                   mov    esi, [ebp-44h]
                                   mov    edi, [ebp-40h]
                                   leave  
                                   ret    08h
                                   push   ebp
                                   mov    ebp, esp
                                   sub    esp, 04h
                                   fldcw  word ptr [401a42h]
                                   xor    eax, eax
                                   mov    ecx, 200778h
                                   mov    edi, 421b72h
                                   rep stosb 
                                   mov    ecx, [ebp+0ch]
                                   mov    edi, 421b72h
                                   mov    esi, [ebp+08h]
                                   rep movsb 
                                   push   421b72h
                                   call   loc_004011de
                                   mov    dword ptr [401b4eh], 12345678h
                                   push   00h
                                   push   00h
                                   push   00h
                                   push   4019dch
                                   push   0ffffffffh
                                   push   401abah
                                   call   dword ptr [waveOutOpen]
                                   mov    dword ptr [ebp-04h], 00h
                                   dec    dword ptr [ebp-04h]
              ;                                   XREFS First: 1000:00401913 Number : 1
              loc_004018d7:
                                   inc    dword ptr [ebp-04h]
                                   mov    eax, [ebp-04h]
                                   shl    eax, 05h
                                   mov    dword ptr [eax+401adah], 01h
                                   mov    eax, [ebp-04h]
                                   imul   eax, eax, 8008h
                                   lea    edx, dword ptr [401b52h]
                                   mov    eax, [ebp-04h]
                                   shl    eax, 05h
                                   mov    [eax+401acah], edx
                                   mov    dword ptr [eax+401aceh], 8000h
                                   cmp    dword ptr [ebp-04h], 03h
                                   jl     loc_004018d7
                                   mov    dword ptr [401b4ah], 00h
                                   leave  
                                   ret    08h
                                   push   ebp
                                   mov    ebp, esp
                                   mov    eax, dword ptr [401b4ah]
                                   shl    eax, 05h
                                   mov    eax, [eax+401adah]
                                   and    eax, 01h
                                   jz     loc_004019d8
                                   push   20h
                                   mov    eax, dword ptr [401b4ah]
                                   shl    eax, 05h
                                   lea    eax, [eax+401acah]
                                   push   eax
                                   push   dword ptr [401abah]
                                   call   dword ptr [waveOutUnprepareHeader]
                                   cmp    eax, 21h
                                   jz     loc_004019d8
                                   mov    eax, dword ptr [401b4ah]
                                   shl    eax, 05h
                                   and    dword ptr [eax+401adah], -02h
                                   mov    edx, [eax+401acah]
                                   push   edx
                                   push   421b72h
                                   call   loc_00401247
                                   push   20h
                                   mov    eax, dword ptr [401b4ah]
                                   shl    eax, 05h
                                   lea    eax, [eax+401acah]
                                   push   eax
                                   push   dword ptr [401abah]
                                   call   dword ptr [waveOutPrepareHeader]
                                   push   20h
                                   mov    eax, dword ptr [401b4ah]
                                   shl    eax, 05h
                                   lea    eax, dword ptr [401acah]
                                   push   eax
                                   push   dword ptr [401abah]
                                   call   dword ptr [waveOutWrite]
                                   mov    eax, dword ptr [401b4ah]
                                   inc    eax
                                   and    eax, 03h
                                   mov    dword ptr [401b4ah], eax
              ;                                   XREFS First: 1000:0040193b Number : 2
              loc_004019d8:
                                   leave  
                                   ret    08h
                                   add    eax, [eax]
                                   add    al, [eax]
                                   inc    esp
                                   lodsb  
                                   add    [eax], al
                                   and    [edx+05h], ah
                                   add    [eax], cl
                                   add    [eax], ah
                                   add    [eax], al
                                   add    [ebx], bh
                                   adc    eax, 15250040h
                                   inc    eax
                                   add    cl, bl
                                   adc    al, 40h
                                   add    cl, bl
                                   adc    al, 40h
                                   add    [esp+14860040h][edx], bh
                                   inc    eax
                                   add    [esi+14h], ah
                                   inc    eax
                                   add    [esi+14h], al
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [edi+15h], dl
                                   inc    eax
                                   add    [esi], ah
                                   adc    al, 40h
              ;                                   XREFS First: 1000:00401a84 Number : 1
              loc_00401a29:
                                   db     00h
              ;                                   XREFS First: 1000:004015ea Number : 1
              loc_00401a2a:
                                   dd     offset loc_00401685
                                   push   ss
                                   inc    eax
                                   add    [edi], ch
                                   push   ss
                                   inc    eax
                                   add    ch, bh
                                   adc    eax, 15fd0040h
                                   inc    eax
                                   add    al, dh
                                   adc    eax, 0f7b0040h
              ;                                   XREFS First: 1000:004010de Number : 1
              loc_00401a44:
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax], al
                                   add    al, al
                                   add    [eax+00h], al
                                   add    [edi+3fh], bh
              ;                                   XREFS First: 1000:0040131c Number : 1
              loc_00401a52:
                                   jpe    4019feh
                                   stosb  
                                   stosb  
                                   stosb  
                                   stosb  
                                   stosb  
                                   stosb  
                                   sti    
                                   aas    
              ;                                   XREFS First: 1000:0040132e Number : 1
              loc_00401a5c:
                                   add    [eax], al
                                   add    [eax+66h], al
                                   adc    [ebx+5ah][edx*2], ebx
                                   out    dx, al
                                   ja     401a0bh
                                   clc    
                                   aas    
              ;                                   XREFS First: 1000:004013e1 Number : 1
              loc_00401a6a:
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax+3ff9h], al
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax+10f73ff7h], al
                                   pop    esp
                                   push   ebx
                                   pop    edx
                                   out    dx, al
                                   ja     loc_00401a29
                                   call   401acah
                                   add    [eax], al
                                   add    [eax], al
                                   cmp    dh, 3fh
              ;                                   XREFS First: 1000:0040161d Number : 2
              loc_00401a92:
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax+4000h], al
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax-7f6cbfffh], al
                                   add    byte ptr [eax-7f7f7f80h], 0f7h
                                   aas    
              ;                                   XREFS First: 1000:0040183b Number : 2
              loc_00401ab0:
                                   add    [eax], al
                                   add    [eax], al
                                   add    [eax], al
                                   db     00h
                                   cmp    ah, 3fh
