Function at 0x402820
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xfc
imul eax, dword [ebp + 0xc], 0x2d00
add eax, 0x10
call fcn.0041dea0
sub esp, eax
lea eax, [esp + 0x23]
mov dword [ebp - 0xd8], eax
imul eax, dword [ebp + 0xc], 0x5a00
and dword [ebp - 0xd8], 0xfffffff0
add eax, 0x10
call fcn.0041dea0
mov edx, dword [ebp + 0x2c]
sub esp, eax
lea eax, [esp + 0x23]
mov edi, edx
mov dword [ebp - 0xec], eax
mov eax, dword [ebp + 0x28]
and dword [ebp - 0xec], 0xfffffff0
mov dword [ebp - 0xe8], 0
mov esi, eax
mov eax, edx
cdq
mov eax, edi
mov ecx, edx
not ecx
sar ecx, 0x1f
mov ebx, ecx
and ecx, esi
and eax, ebx
mov dword [ebp - 0xdc], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xe0], ecx
mov dword [ebp - 0xe4], 0
shl eax, 2
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp + 0xc]
shl eax, 4
mov dword [ebp - 0xf0], eax
mov eax, dword [ebp + 0xc]
add eax, eax
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x402f19
mov eax, dword [ebp + 0x1c]
mov ebx, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x1c]
mov eax, dword [eax]
cmp dword [ebp + 0x10], eax
mov esi, eax
cmovle esi, dword [ebp + 0x10]
imul ebx, esi
sub eax, esi
mov dword [ecx], eax
shl ebx, 2
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x402ea0
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0xdc]
mov edx, dword [ebp - 0xe0]
sub eax, esi
cmp ecx, 0
mov dword [ebp - 0x78], eax
mov eax, edx
jl 0x402929
jle 0x402f22
mov eax, 0x400
mov dword [ebp - 0x7c], eax
lea eax, [ebp - 0x7c]
mov edi, dword [ebp - 0xec]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x78]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x18]
add ebx, dword [ebp + 8]
mov dword [esp + 0xc], edi
mov dword [esp + 4], ebx
mov ebx, edi
mov dword [esp], eax
call fcn.00404540
mov eax, dword [ebp - 0xc8]
add esi, dword [ebp - 0x78]
sub dword [ebp + 0x10], esi
imul eax, esi
add dword [ebp + 8], eax
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0xc4], eax
mov eax, dword [ebp + 0x20]
test eax, eax
je 0x402ddf
mov eax, dword [ebp + 0x20]
mov esi, 0x422020
mov ecx, 0x18
lea edi, [ebp - 0x78]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [eax + 8]
cmp eax, 0xac44
je 0x402ebd
fld dword [0x423c08]
cmp eax, 0xbb80
mov esi, 2
fstp dword [ebp - 0xb8]
je 0x402f05
mov ecx, dword [ebp + 0x20]
mov eax, dword [ebp + 0x20]
mov ecx, dword [ecx]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0xd4], ecx
mov ecx, dword [ebp + 0x20]
cmp eax, 0x40
mov dword [ebp - 0x9c], eax
mov ecx, dword [ecx + 4]
mov dword [ebp - 0xd0], ecx
jg 0x402ed3
mov edi, dword [ebp - 0xc4]
test edi, edi
jle 0x402c1b
mov eax, dword [ebp - 0xd8]
shl esi, 5
mov dword [ebp - 0xb4], ebx
mov dword [ebp - 0xc0], 0
mov dword [ebp - 0xb0], eax
lea eax, [ebp - 0x78]
add eax, esi
mov dword [ebp - 0xbc], eax
nop
mov ecx, dword [ebp + 0xc]
test ecx, ecx
jle 0x402d89
mov esi, dword [0x422130]
xor ecx, ecx
mov ebx, dword [ebp - 0xd4]
mov edi, dword [ebp - 0xd0]
mov dword [ebp - 0xac], 1
lea esi, [esi]
mov eax, dword [ebp - 0xb4]
mov edx, 0
fld dword [eax + ecx*4]
xor eax, eax
fldz
fucomi st(1)
fxch st(1)
fmul dword [ebp - 0xb8]
setnp al
cmovne eax, edx
mov edx, dword [ebp - 0xbc]
and dword [ebp - 0xac], eax
xor eax, eax
fstp dword [ebp - 0xa0]
fld dword [edx]
add edx, 4
fmul dword [ebx + eax*4]
fld dword [edx + 0xc]
fmul dword [edi + eax*4]
add eax, 1
cmp eax, 4
fsubp st(1)
faddp st(1)
jne 0x402a86
lea eax, [edi + 4]
mov dword [esp + 8], 0xc
fstp dword [ebp - 0xa8]
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [ebp - 0xa4], ecx
call sub.msvcrt.dll_memmove
lea eax, [ebx + 4]
mov dword [esp + 8], 0xc
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_memmove
imul eax, esi, 0x5bda335
mov ecx, dword [ebp - 0xa4]
add eax, 0x3619636b
imul esi, eax, 0x5bda335
fld dword [ebp - 0xa8]
fst dword [edi]
fsubr dword [ebp - 0xa0]
add esi, 0x3619636b
cmp dword [ebp - 0x9c], 0x10
mov dword [0x422130], esi
fldz
jg 0x402b4c
fstp st(0)
xor edx, edx
mov dword [ebp - 0x94], edx
xor edx, edx
mov dword [ebp - 0x98], eax
fild qword [ebp - 0x98]
fld dword [0x423c14]
fmul st(1), st(0)
mov dword [ebp - 0x98], esi
mov dword [ebp - 0x94], edx
fild qword [ebp - 0x98]
fmulp st(1)
fsubp st(1)
fadd st(1)
fld dword [0x423c18]
fucompi st(1)
jbe 0x402d02
fld dword [0x423c1c]
fucompi st(1)
jbe 0x402d20
fstp st(0)
mov eax, 0xffff8000
mov dword [ebp - 0xa0], 0xffff8000
mov edx, dword [ebp - 0xb0]
fldz
cmp dword [ebp - 0x9c], 0x10
mov word [edx + ecx*2], ax
jg 0x402bb8
fstp st(0)
fild dword [ebp - 0xa0]
fsubrp st(1)
fld dword [0x423c10]
fucomi st(1)
jbe 0x402d80
fstp st(0)
fld dword [0x423c0c]
fucomi st(1)
fcmovbe st(0), st(1)
fstp st(1)
jmp 0x402bba
fstp st(1)
fstp dword [ebx]
add ecx, 1
add ebx, 0x10
add edi, 0x10
cmp ecx, dword [ebp + 0xc]
jne 0x402a50
mov eax, dword [ebp - 0x9c]
xor ecx, ecx
mov edx, dword [ebp - 0xac]
add eax, 1
test edx, edx
cmove eax, ecx
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp - 0xcc]
add dword [ebp - 0xc0], 1
add dword [ebp - 0xb0], eax
mov eax, dword [ebp - 0xc8]
add dword [ebp - 0xb4], eax
mov eax, dword [ebp - 0xc0]
cmp dword [ebp - 0xc4], eax
jne 0x402a20
mov ecx, dword [ebp - 0x9c]
mov eax, 0x3c0
cmp ecx, 0x3c0
cmovle eax, ecx
mov ecx, dword [ebp + 0x20]
mov dword [ecx + 0xc], eax
jmp 0x402c39
fstp st(0)
cmp dword [ebp - 0xdc], 0
jl 0x402ce7
jle 0x402ef2
mov edi, dword [ebp + 0x24]
test edi, edi
jne 0x402d95
mov edi, dword [ebp - 0xdc]
mov esi, dword [ebp - 0xe0]
mov eax, dword [ebp - 0x7c]
cmp edi, 0
mov ecx, esi
jl 0x402c7b
jg 0x402cfb
cmp esi, eax
ja 0x402cfb
mov esi, dword [ebp - 0xcc]
mov eax, dword [ebp - 0xd8]
imul ecx, esi
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.004022f0
test eax, eax
mov ebx, eax
jle 0x402f32
xor edx, edx
div esi
mov ebx, eax
mov eax, ebx
cdq
add dword [ebp - 0xe8], ebx
adc dword [ebp - 0xe4], edx
sub dword [ebp - 0xe0], ebx
sbb dword [ebp - 0xdc], edx
mov ebx, dword [ebp - 0xdc]
mov ecx, dword [ebp - 0xe0]
mov edx, ebx
sar edx, 0x1f
mov eax, edx
sub eax, ecx
sbb edx, ebx
test edx, edx
jns 0x402ce7
mov edx, dword [ebp + 0x10]
test edx, edx
jg 0x4028cf
mov eax, dword [ebp - 0xe8]
mov edx, dword [ebp - 0xe4]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, eax
jmp 0x402c7b
ja 0x402d24
fstp st(0)
mov eax, 0x7fff
mov dword [ebp - 0xa0], 0x7fff
jmp 0x402b7b
fxch st(1)
jmp 0x402d26
fxch st(1)
fstp dword [ebp - 0xa4]
fadd dword [0x423c20]
mov dword [ebp - 0xa8], ecx
fstp qword [esp]
call fcn.0041eb20
mov ecx, dword [ebp - 0xa8]
fnstcw word [ebp - 0x8a]
movzx eax, word [ebp - 0x8a]
mov ah, 0xc
mov word [ebp - 0x8c], ax
fldcw word [ebp - 0x8c]
fistp dword [ebp - 0xa0]
fldcw word [ebp - 0x8a]
movzx eax, word [ebp - 0xa0]
fld dword [ebp - 0xa4]
jmp 0x402b7b
fcmovnbe st(0), st(1)
fstp st(1)
jmp 0x402bba
add dword [ebp - 0x9c], 1
jmp 0x402bea
mov edi, dword [ebp - 0xdc]
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp - 0xe0]
cmp edi, 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x7c]
mov ecx, esi
jl 0x402db8
jg 0x402ddb
cmp esi, eax
ja 0x402ddb
mov eax, dword [ebp - 0xcc]
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xd8]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov ebx, eax
jmp 0x402ca6
mov ecx, eax
jmp 0x402db8
mov edi, dword [ebp - 0xc4]
xor esi, esi
imul edi, dword [ebp + 0xc]
fld dword [0x423c24]
mov edx, dword [ebp - 0xd8]
test edi, edi
jg 0x402e82
fstp st(0)
jmp 0x402c39
fld dword [0x423c1c]
mov eax, 0xffff8000
fucompi st(1)
ja 0x402e71
fxch st(1)
jmp 0x402e1b
fxch st(1)
fstp dword [ebp - 0x9c]
fadd dword [0x423c20]
mov dword [ebp - 0xa0], edx
fstp qword [esp]
call fcn.0041eb20
mov edx, dword [ebp - 0xa0]
fnstcw word [ebp - 0x8a]
movzx eax, word [ebp - 0x8a]
mov ah, 0xc
mov word [ebp - 0x8c], ax
fldcw word [ebp - 0x8c]
fistp dword [ebp - 0x90]
fldcw word [ebp - 0x8a]
mov eax, dword [ebp - 0x90]
fld dword [ebp - 0x9c]
jmp 0x402e73
fstp st(0)
mov word [edx + esi*2], ax
add esi, 1
cmp esi, edi
je 0x402c37
fld dword [ebx + esi*4]
fmul st(1)
fld dword [0x423c18]
fucompi st(1)
ja 0x402e06
ja 0x402e19
fstp st(0)
mov eax, 0x7fff
jmp 0x402e73
mov eax, dword [ebp + 0x10]
add ebx, dword [ebp + 8]
mov dword [ebp + 0x10], 0
sub eax, esi
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0xc4], eax
jmp 0x402973
fld dword [0x423c04]
mov esi, 1
fstp dword [ebp - 0xb8]
jmp 0x4029ba
mov eax, dword [ebp - 0xf0]
mov dword [esp + 4], 0
mov dword [esp], ecx
mov dword [esp + 8], eax
call sub.msvcrt.dll_memset
jmp 0x4029e6
cmp dword [ebp - 0xe0], 0
jbe 0x402ce7
nop
jmp 0x402c4c
fld dword [0x423c04]
xor si, si
fstp dword [ebp - 0xb8]
jmp 0x4029ba
xor ebx, ebx
xor esi, esi
jmp 0x4028f8
cmp eax, 0x400
jbe 0x402929
jmp 0x402924
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x15
mov dword [esp + 4], 1
mov dword [esp], str.Error_playing_audio._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
jmp 0x402ca6