Function at 0x4019c2
Capabilities:
Read file on windows

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x28
mov ebp, ecx
mov dword [esp + 0xc], edx
mov edi, eax
test edi, edi
je 0x401bcc
mov eax, dword [edi + 4]
test eax, eax
je 0x401bcc
mov eax, edx
test eax, eax
je 0x401bcc
mov eax, dword [edi]
test eax, eax
je 0x401bcc
mov eax, dword [edi + 0x64]
mov dword [esp + 0x1c], eax
test eax, eax
jle 0x42d96a
mov ebx, eax
cmp ebp, 0x3a980
mov eax, dword [edi + 0x24]
jle 0x401a19
mov ebp, 0x3a980
imul ebx, ebp
test eax, eax
jne 0x401a5f
mov eax, dword [edi + 0x18]
mov ecx, dword [edi + 0x30]
mov esi, dword [edi + 0x34]
mov edx, dword [edi + 0x38]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], ebp
mov ebp, dword [edi + 0x1c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ecx
add ebx, eax
adc ebp, 0
mov dword [esp + 0x24], edx
add ecx, edx
adc esi, dword [edi + 0x3c]
sub ebx, ecx
sbb ebp, esi
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x10]
jae 0x401b9e
test ebp, ebp
jle 0x401bec
mov ecx, dword [edi + 0x58]
cmp ecx, 1
jne 0x401b8e
mov eax, dword [esp + 0x1c]
cmp eax, 3
je 0x42d9aa
mov ebp, ebx
push 1
lea eax, [ebp + 1]
push eax
call fcn.0041cc0d
add esp, 8
mov esi, eax
test esi, esi
je 0x42d98a
mov eax, esi
sub eax, ebx
add eax, ebp
mov dword [esp + 0x24], eax
mov eax, dword [edi + 0x10]
cmp ebx, eax
jg 0x401aaf
xor ebp, ebp
jmp 0x401afc
mov dword [esp + 8], esi
mov esi, dword [esp + 0x24]
xor ebp, ebp
push eax
mov edx, dword [edi + 8]
add edx, dword [edi + 0xc]
lea ecx, [esi + ebp]
push edx
push ecx
call fcn.0042a880
push dword [edi + 4]
mov eax, dword [edi + 0x10]
push 0x4000
add ebp, eax
mov dword [edi + 0xc], 0
push 1
sub ebx, eax
push dword [edi + 8]
call fcn.0041d746
add esp, 0x1c
mov dword [edi + 0x10], eax
test eax, eax
je 0x401af8
cmp ebx, eax
jg 0x401ab9
mov esi, dword [esp + 8]
cmp eax, ebx
jl 0x401b24
test ebx, ebx
jle 0x401b24
mov eax, dword [esp + 0x24]
push ebx
mov edx, dword [edi + 8]
lea ecx, [eax + ebp]
add edx, dword [edi + 0xc]
push edx
push ecx
call fcn.0042a880
add esp, 0xc
sub dword [edi + 0x10], ebx
add ebp, ebx
add dword [edi + 0xc], ebx
test ebp, ebp
jle 0x42d9b5
mov ecx, dword [edi + 0x64]
add dword [edi + 0x18], ebp
mov eax, ebp
cdq
adc dword [edi + 0x1c], edx
cmp ecx, 2
jne 0x401b85
mov eax, 0x80000001
imul ebp
mov ebx, edx
add ebx, ebp
sar ebp, 0x1f
sub ebx, ebp
mov eax, dword [esp + 0x1c]
mov ebp, ebx
imul ebp, dword [edi + 0x58]
cmp eax, 2
jne 0x42d7ba
mov eax, dword [edi + 0x54]
cmp eax, 1
je 0x42d932
push ebp
push esi
mov eax, dword [esp + 0x14]
push eax
call dword [edi]
push esi
call fcn.0041cdf3
mov eax, ebx
add esp, 0x38
pop ebx
pop ebp
pop esi
pop edi
ret
mov eax, ebp
cdq
idiv ecx
mov ebx, eax
jmp 0x401b4d
mov eax, dword [esp + 0x1c]
cdq
idiv ecx
mov dword [esp + 0x1c], eax
jmp 0x401a73
mov eax, dword [esp + 0x18]
sub eax, dword [esp + 0x20]
mov ebx, edx
mov edx, dword [esp + 0x1c]
lea ebx, [ebx + eax]
cmp edx, 2
jne 0x401bbd
mov ebp, ebx
shr ebp, 1
jmp 0x401a5f
mov ecx, edx
mov eax, ebx
xor edx, edx
div ecx
mov ebp, eax
jmp 0x401a5f
call fcn.0041c54e
add eax, 0x40
push eax
push str.null_input_to_pcmfile_read_samples___n
call fcn.0041c85e
mov eax, 0xffffffff
add esp, 0x30
pop ebx
pop ebp
pop esi
pop edi
ret
xor eax, eax
add esp, 0x28
pop ebx
pop ebp
pop esi
pop edi
ret
cmp eax, 3
jne 0x42d897
mov eax, dword [edi + 0x68]
mov edx, dword [edi + 0x54]
neg eax
mov dword [esp + 0x20], eax
cmp edx, 1
jne 0x42d83f
mov ecx, dword [esp + 0x1c]
imul ecx, ebp
test ecx, ecx
jle 0x401b6c
mov dword [esp + 0x18], ecx
mov eax, esi
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ebx
mov dword [esp + 8], esi
mov esi, dword [esp + 0x24]
mov dword [esp + 4], edi
mov edi, dword [esp + 0x1c]
xor edx, edx
mov ebx, eax
mov ebp, edx
mov eax, dword [ebp + esi]
shl eax, 8
call fcn.00406ef4
mov ecx, dword [esp + 0x20]
shl eax, cl
sar eax, cl
mov ecx, dword [esp + 0x18]
add ebp, edi
mov dword [ebx], eax
add ebx, 4
cmp ebp, ecx
jl 0x42d807
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x401b6c
mov ecx, dword [esp + 0x1c]
imul ecx, ebp
test ecx, ecx
jle 0x401b6c
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x24]
mov dword [esp + 0x10], ebx
mov edx, esi
xor eax, eax
mov dword [esp + 8], esi
mov esi, dword [esp + 0x1c]
mov dword [esp + 4], edi
mov ebx, ecx
mov ecx, dword [esp + 0x20]
mov edi, dword [eax + ebp]
shl edi, cl
sar edi, cl
add eax, esi
mov dword [edx], edi
add edx, 4
cmp eax, ebx
jl 0x42d870
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x401b6c
cmp eax, 4
jne 0x42d8de
mov eax, dword [edi + 0x54]
cmp eax, 1
jne 0x401b6c
test ebp, ebp
jle 0x401b6c
mov dword [esp + 8], esi
mov edx, esi
mov dword [esp + 4], edi
lea eax, [esi + ebp*4]
mov esi, eax
mov edi, edx
mov eax, dword [edi]
call fcn.00406ef4
mov dword [edi], eax
add edi, 4
cmp edi, esi
jb 0x42d8c1
mov esi, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x401b6c
cmp eax, 8
jne 0x401b6c
mov eax, dword [edi + 0x54]
cmp eax, 1
jne 0x401b6c
test ebp, ebp
jle 0x401b6c
mov dword [esp + 8], esi
mov edx, esi
mov dword [esp + 4], edi
lea eax, [esi + ebp*8]
mov esi, eax
mov edi, edx
push dword [edi + 4]
push dword [edi]
call fcn.00406ed6
add esp, 8
mov dword [edi], eax
mov dword [edi + 4], edx
add edi, 8
cmp edi, esi
jb 0x42d90c
mov esi, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x401b6c
test ebp, ebp
jle 0x401b6c
mov dword [esp + 8], esi
mov edx, esi
mov dword [esp + 4], edi
lea eax, [esi + ebp*2]
mov esi, eax
mov edi, edx
movzx eax, word [edi]
call fcn.00406f10
mov word [edi], ax
add edi, 2
cmp edi, esi
jb 0x42d94b
mov esi, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x401b6c
call fcn.0041c54e
add eax, 0x40
push eax
push 0x437bf0
call fcn.0041c85e
mov eax, 0xffffffff
add esp, 0x30
pop ebx
pop ebp
pop esi
pop edi
ret
call fcn.0041c54e
add eax, 0x40
push eax
push str.error_allocating_read_buffer_n
call fcn.0041c85e
mov eax, 0xffffffff
add esp, 0x30
pop ebx
pop ebp
pop esi
pop edi
ret
shl ebp, 2
imul ebp, ecx
jmp 0x401a82
push esi
call fcn.0041cdf3
mov eax, ebp
add esp, 0x2c
pop ebx
pop ebp
pop esi
pop edi
ret