Function at 0x40a700
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0x5f0
mov eax, dword [0x72eb0c]
xor eax, esp
mov dword [esp + 0x5ec], eax
push ebx
mov ebx, dword [esp + 0x5f8]
push ebp
xor ebp, ebp
cmp dword [ebx + 0x30], 0xff
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
jle 0x40a772
push str.255_channels_should_be_enough_for_anyone.__Sorry__vorbis_doesnt_support_more__n
call fcn.00427b1a
add eax, 0x40
push eax
call fcn.004279fe
add esp, 8
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x5ec]
xor ecx, esp
call fcn.004279ef
add esp, 0x5f0
ret
call fcn.0040f600
mov ecx, dword [ebx + 0x5c]
mov dword [esp + 0x30], eax
cmp ecx, ebp
jne 0x40a793
cmp dword [ebx + 0x64], ebp
jge 0x40a78c
cmp dword [ebx + 0x68], ebp
jl 0x40a793
push str.Requesting_a_minimum_or_maximum_bitrate_requires___managed_n
jmp 0x40a745
mov eax, dword [ebx + 0x60]
cmp eax, ebp
jge 0x40a7ab
cmp dword [ebx + 0x64], ebp
jge 0x40a7ab
cmp dword [ebx + 0x68], ebp
jge 0x40a7ab
mov dword [ebx + 0x70], 1
mov edx, dword [ebx + 0x68]
fld dword [ebx + 0x6c]
push esi
push edx
mov edx, dword [ebx + 0x64]
push edx
mov edx, dword [ebx + 0x80]
push ecx
mov ecx, dword [ebx + 0x70]
push ecx
push ecx
mov ecx, dword [ebx + 0x1c]
fstp dword [esp]
push eax
mov eax, dword [ebx + 0x84]
push edx
push eax
call ecx
lea edx, [esp + 0x58]
push edx
call fcn.00413a10
add esp, 0x24
cmp dword [ebx + 0x70], ebp
jle 0x40a986
fld dword [ebx + 0x6c]
mov eax, dword [ebx + 0x34]
push ecx
mov ecx, dword [ebx + 0x30]
fstp dword [esp]
push eax
push ecx
lea edx, [esp + 0x44]
push edx
call fcn.00426d80
add esp, 0x10
test eax, eax
je 0x40a814
push 0x4471b8
jmp 0x40a94e
cmp dword [ebx + 0x68], ebp
jg 0x40a822
cmp dword [ebx + 0x64], ebp
jle 0x40a900
lea ecx, [esp + 0x58]
push ecx
lea edx, [esp + 0x3c]
push 0x14
push edx
call fcn.00426f60
lea eax, [esp + 0x8c]
push eax
call fcn.00413a10
fld dword [ebx + 0x6c]
mov ecx, dword [ebx + 0x34]
fstp dword [esp + 0xc]
mov edx, dword [ebx + 0x30]
add esp, 0xc
push ecx
push edx
lea eax, [esp + 0x8c]
push eax
call fcn.00426d80
lea ecx, [esp + 0x90]
push ecx
call fcn.00426640
mov esi, dword [esp + 0xa4]
lea edx, [esp + 0x94]
push edx
call fcn.00413a50
fld qword [0x4471b0]
mov eax, 0x10624dd3
fstp qword [esp + 0x90]
fld qword [0x4471a8]
imul esi
fstp qword [esp + 0x80]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [ebx + 0x64]
lea ecx, [esi + esi]
mov dword [esp + 0x7c], ecx
lea ecx, [esp + 0x70]
push ecx
mov dword [esp + 0x78], edx
mov dword [esp + 0x8c], eax
mov eax, dword [ebx + 0x68]
lea edx, [esp + 0x54]
push 0x15
push edx
mov dword [esp + 0x84], eax
mov dword [esp + 0x7c], 1
call fcn.00426f60
add esp, 0x24
test eax, eax
jne 0x40a949
push str.Set_optional_hard_quality_restrictions_n
call fcn.00427b1a
add eax, 0x40
push eax
call fcn.004279fe
add esp, 8
mov eax, dword [ebx + 0x5c]
cmp eax, ebp
je 0x40aa16
cmp dword [ebx + 0x60], ebp
jge 0x40aa12
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x3c]
push 0x14
push ecx
call fcn.00426f60
lea edx, [esp + 0x64]
push edx
lea eax, [esp + 0x48]
push 0x15
push eax
mov dword [esp + 0x88], 0xffffffff
call fcn.00426f60
add esp, 0x18
jmp 0x40aa26
push str.Failed_to_set_bitrate_min_max_in_quality_mode_n
call fcn.00427b1a
add eax, 0x40
push eax
call fcn.004279fe
lea eax, [esp + 0x40]
push eax
call fcn.00413a50
add esp, 0xc
pop esi
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x5ec]
xor ecx, esp
call fcn.004279ef
add esp, 0x5f0
ret
mov eax, dword [ebx + 0x64]
cmp eax, ebp
jle 0x40a997
imul eax, eax, 0x3e8
mov ecx, eax
jmp 0x40a99a
or ecx, 0xffffffff
mov eax, dword [ebx + 0x68]
cmp eax, ebp
jle 0x40a9a9
imul eax, eax, 0x3e8
jmp 0x40a9ac
or eax, 0xffffffff
mov edx, dword [ebx + 0x34]
push ecx
mov ecx, dword [ebx + 0x60]
imul ecx, ecx, 0x3e8
push ecx
push eax
mov eax, dword [ebx + 0x30]
push edx
push eax
lea ecx, [esp + 0x4c]
push ecx
call fcn.00426e20
add esp, 0x18
test eax, eax
je 0x40a900
push str.Mode_initialisation_failed:_invalid_parameters_for_bitrate_n
call fcn.00427b1a
add eax, 0x40
push eax
call fcn.004279fe
lea edx, [esp + 0x40]
push edx
call fcn.00413a50
add esp, 0xc
pop esi
pop ebp
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x5ec]
xor ecx, esp
call fcn.004279ef
add esp, 0x5f0
ret
cmp eax, ebp
jne 0x40aa26
push ebp
lea ecx, [esp + 0x3c]
push 0x15
push ecx
call fcn.00426f60
add esp, 0xc
mov eax, dword [ebx + 0x78]
push edi
mov edi, dword [ebx + 0x74]
lea edx, [esp + 0x3c]
push edx
push eax
call fcn.00409aa0
lea ecx, [esp + 0x44]
push ecx
call fcn.00426640
lea edx, [esp + 0x48]
push edx
lea eax, [esp + 0xb4]
push eax
call fcn.004130b0
lea ecx, [esp + 0x168]
push ecx
lea edx, [esp + 0xbc]
push edx
call fcn.00412290
mov eax, dword [ebx + 4]
push eax
lea ecx, [esp + 0x1e4]
push ecx
call fcn.00412210
add esp, 0x24
cmp dword [ebx + 0x54], ebp
je 0x40aa96
mov edx, dword [ebx + 8]
push edx
lea eax, [esp + 0x330]
push eax
call fcn.00412210
add esp, 8
cmp dword [ebx + 0x90], ebp
je 0x40aab2
mov ecx, dword [ebx + 0xc]
push ecx
lea edx, [esp + 0x498]
push edx
call fcn.00412210
add esp, 8
cmp dword [ebx + 0x54], ebp
je 0x40aaea
lea edi, [esp + 0x32c]
call fcn.0040a090
mov eax, dword [ebx + 0x7c]
push eax
mov ecx, edi
push ecx
call fcn.0040fdd0
mov esi, eax
add esp, 8
cmp esi, ebp
je 0x40aaea
mov edx, dword [ebx + 0x20]
push str.Failed_writing_fishead_packet_to_output_stream_n
call edx
add esp, 4
jmp 0x40aec5
lea eax, [esp + 0x5c]
push eax
mov eax, dword [ebx]
lea ecx, [esp + 0x138]
push ecx
lea edx, [esp + 0x8c]
push edx
push eax
lea ecx, [esp + 0xb4]
push ecx
call fcn.00413fa0
lea edx, [esp + 0x98]
push edx
lea eax, [esp + 0x1dc]
push eax
call fcn.00411730
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x1e4]
push edx
call fcn.00411a00
add esp, 0x24
cmp eax, ebp
je 0x40ab92
mov esi, dword [ebx + 0x7c]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push esi
push eax
push 1
push ecx
call fcn.00428ce2
mov edx, dword [esp + 0x2c]
push esi
push edx
mov edi, eax
mov eax, dword [esp + 0x30]
push 1
push eax
call fcn.00428ce2
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x34]
add eax, edi
add ecx, edx
add esp, 0x20
cmp eax, ecx
jne 0x40abd1
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c8]
push ecx
call fcn.00411a00
add esp, 8
cmp eax, ebp
jne 0x40ab3d
cmp dword [ebx + 0x54], ebp
je 0x40abe8
lea eax, [esp + 0x32c]
push ebx
push eax
call fcn.0040a100
mov ecx, dword [ebx + 0x7c]
push ecx
lea edx, [esp + 0x338]
push edx
call fcn.0040fdd0
mov esi, eax
add esp, 0x10
cmp esi, ebp
je 0x40abe8
mov eax, dword [ebx + 0x20]
push str.Failed_writing_fisbone_header_packet_to_output_stream_n
call eax
add esp, 4
jmp 0x40aec5
mov edx, dword [ebx + 0x20]
push str.Failed_writing_header_to_output_stream_n
call edx
add esp, 4
mov esi, 1
jmp 0x40aec5
lea ecx, [esp + 0x134]
push ecx
lea edx, [esp + 0x1c8]
push edx
call fcn.00411730
lea eax, [esp + 0x64]
push eax
lea ecx, [esp + 0x1d0]
push ecx
call fcn.00411730
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x1d8]
push eax
call fcn.00411a00
add esp, 0x18
cmp eax, ebp
je 0x40ac7d
mov esi, dword [ebx + 0x7c]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
push esi
push ecx
push 1
push edx
call fcn.00428ce2
mov ecx, dword [esp + 0x28]
mov edi, eax
mov eax, dword [esp + 0x2c]
push esi
push eax
push 1
push ecx
call fcn.00428ce2
mov edx, dword [esp + 0x34]
mov ecx, dword [esp + 0x3c]
add eax, edi
add ecx, edx
add esp, 0x20
cmp eax, ecx
jne 0x40acbb
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c8]
push eax
call fcn.00411a00
add esp, 8
cmp eax, ebp
jne 0x40ac28
cmp dword [ebx + 0x54], ebp
je 0x40acd2
lea edx, [esp + 0x32c]
push edx
call fcn.0040fd90
mov eax, dword [ebx + 0x7c]
push eax
lea ecx, [esp + 0x334]
push ecx
call fcn.0040fdd0
mov esi, eax
add esp, 0xc
cmp esi, ebp
je 0x40acd2
mov edx, dword [ebx + 0x20]
push str.Failed_writing_skeleton_eos_packet_to_output_stream_n
call edx
add esp, 4
jmp 0x40aec5
mov ecx, dword [ebx + 0x20]
push str.Failed_writing_header_to_output_stream_n
call ecx
add esp, 4
mov esi, 1
jmp 0x40aec5
lea eax, [esp + 0xa4]
push 0x400
push eax
call fcn.004126c0
mov ecx, dword [ebx + 0x24]
mov edx, dword [ebx + 0x10]
push 0x400
push eax
push ecx
call edx
mov esi, eax
xor edi, edi
add esp, 0x14
cmp esi, edi
jne 0x40ad09
push edi
lea eax, [esp + 0xa8]
push eax
jmp 0x40ad60
mov eax, esi
cdq
add dword [esp + 0x28], eax
adc dword [esp + 0x2c], edx
cmp dword [esp + 0x24], edi
jl 0x40ad57
jg 0x40ad23
cmp dword [esp + 0x20], 0x28
jb 0x40ad57
mov ecx, dword [esp + 0x38]
push ecx
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
call fcn.0040f620
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push ecx
mov ecx, dword [ebx + 0x28]
fstp qword [esp]
push edx
mov edx, dword [ebx + 0x80]
push eax
mov eax, dword [ebx + 0x14]
push edi
push ecx
push edx
call eax
add esp, 0x1c
push esi
lea ecx, [esp + 0xa8]
push ecx
call fcn.00412880
add esp, 8
lea edx, [esp + 0x154]
push edx
lea eax, [esp + 0xa8]
push eax
call fcn.004129c0
add esp, 8
cmp eax, 1
jne 0x40aeb9
lea esp, [esp]
lea ecx, [esp + 0x154]
push 0
push ecx
call fcn.00413770
lea edx, [esp + 0x15c]
push edx
call fcn.00413260
lea eax, [esp + 0x120]
push eax
lea ecx, [esp + 0xb4]
push ecx
call fcn.004136d0
add esp, 0x14
test eax, eax
je 0x40ae98
lea esp, [esp]
lea edx, [esp + 0x114]
push edx
lea eax, [esp + 0x1c8]
push eax
call fcn.00411730
add esp, 8
add dword [esp + 0x20], 1
adc dword [esp + 0x24], 0
test ebp, ebp
jne 0x40ae78
lea ebx, [ebx]
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x1c8]
push edx
call fcn.00411a20
add esp, 8
test eax, eax
je 0x40ae78
mov esi, dword [ebx + 0x7c]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push esi
push eax
push 1
push ecx
call fcn.00428ce2
mov edx, dword [esp + 0x2c]
push esi
push edx
mov edi, eax
mov eax, dword [esp + 0x30]
push 1
push eax
call fcn.00428ce2
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
add eax, edi
add edx, ecx
add esp, 0x20
cmp eax, edx
jne 0x40af66
cdq
add dword [esp + 0x30], eax
lea eax, [esp + 0x10]
push eax
adc dword [esp + 0x38], edx
call fcn.004112d0
add esp, 4
test eax, eax
je 0x40ae00
mov ebp, 1
lea ecx, [esp + 0x114]
push ecx
lea edx, [esp + 0xa8]
push edx
call fcn.004136d0
add esp, 8
test eax, eax
jne 0x40add0
lea eax, [esp + 0x154]
push eax
lea ecx, [esp + 0xa8]
push ecx
call fcn.004129c0
add esp, 8
cmp eax, 1
je 0x40ad90
test ebp, ebp
je 0x40acd2
xor esi, esi
xor ebp, ebp
cmp dword [ebx + 0x54], ebp
je 0x40aeda
lea eax, [esp + 0x32c]
push eax
call fcn.004113a0
add esp, 4
lea ecx, [esp + 0x1c4]
push ecx
call fcn.004113a0
lea edx, [esp + 0x158]
push edx
call fcn.004123f0
lea eax, [esp + 0xac]
push eax
call fcn.00412470
lea ecx, [esp + 0x48]
push ecx
call fcn.00413a50
mov edi, dword [esp + 0x48]
push edi
call fcn.0040f620
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
add esp, 0x14
push edx
mov edx, dword [esp + 0x2c]
push eax
mov eax, dword [ebx + 0x34]
push ecx
mov ecx, dword [ebx + 0x80]
push edx
mov edx, dword [ebx + 0x18]
push eax
sub esp, 8
fstp qword [esp]
push ecx
call edx
push edi
call fcn.0040f660
mov ecx, dword [esp + 0x620]
add esp, 0x24
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004279ef
add esp, 0x5f0
ret
mov edx, dword [ebx + 0x20]
push str.Failed_writing_data_to_output_stream_n
call edx
add esp, 4
mov esi, 1
jmp 0x40aec3