Function at 0x513090
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x80
mov ax, word [0x5f8d84]
push ebx
push ebp
mov ebp, dword [esp + 0x8c]
push esi
xor ebx, ebx
push edi
mov word [esp + 0x12], ax
mov dword [esp + 0x48], ebx
mov dword [ebp], ebx
call fcn.004bae60
cmp eax, ebx
mov dword [ebp + 0x14], eax
jne 0x5130ce
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x80
ret
mov esi, dword [ebp + 0x124]
mov dword [esp + 0x28], ebx
cmp esi, ebx
mov dword [esp + 0x2c], esi
jne 0x5130ec
mov dword [esp + 0x2c], 0x100
mov esi, dword [esp + 0x2c]
mov edx, dword [ebp + 0x128]
mov ecx, dword [0x838f6c]
push esi
push edx
mov dword [esp + 0x40], ecx
call fcn.00578400
mov eax, dword [ebp + 0x128]
push eax
call fcn.005784c0
mov ecx, esi
mov edi, eax
shl ecx, 5
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [esp + 0x64], edi
add esp, 0xc
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0xa0]
mov esi, dword [esp + 0xa4]
mov ecx, dword [esp + 0x98]
push eax
push 0xa00
push esi
call dword [ecx + 0x14]
add esp, 0xc
test eax, eax
je 0x5138f4
mov edi, dword [esp + 0x9c]
mov edx, dword [0x69fdfc]
push 0x838f1c
push edi
push str._s__s_n
push esi
call dword [edx + 0x130]
add esp, 0x10
mov dword [esp + 0x88], eax
test eax, eax
je 0x5138f4
cmp eax, 1
je 0x513196
cmp eax, 2
jne 0x5138f4
push 0x8386ac
call fcn.004bfc20
push edi
call fcn.004bfce0
mov ebp, eax
add esp, 8
test ebp, ebp
mov dword [esp + 0x6c], ebp
je 0x513932
mov eax, dword [ebp + 4]
mov edi, dword [ebp + 8]
mov dword [esp + 0x30], eax
mov dword [esp + 0x24], edi
fild dword [esp + 0x30]
lea ecx, [esp + 0x40]
lea edx, [esp + 0x44]
push ecx
lea eax, [esp + 0x1c]
fstp dword [esp + 0x74]
fld dword [0x58b454]
fdiv dword [esp + 0x74]
push edx
lea ecx, [esp + 0x1c]
push eax
push ecx
push 4
push ebp
fstp dword [esp + 0x7c]
fild dword [esp + 0x3c]
fstp dword [esp + 0x8c]
fld dword [0x58b454]
fdiv dword [esp + 0x8c]
fstp dword [esp + 0x80]
call fcn.004c8420
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x30]
or dh, 0x90
push edx
mov edx, dword [esp + 0x30]
push eax
push ecx
push edx
call fcn.004beea0
mov ecx, dword [esp + 0xc0]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0xc8]
push eax
push 0xa00
push esi
call dword [ecx + 0x14]
mov eax, dword [0x69fdfc]
lea edx, [esp + 0xc0]
push edx
push 0x5f8d80
push esi
call dword [eax + 0x130]
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x14]
mov eax, 1
add esp, 0x40
sar ecx, 3
cmp edi, eax
mov dword [esp + 0x60], esi
mov dword [esp + 0x50], ecx
jle 0x513932
mov edx, dword [ebp + 0x10]
lea edi, [edx + esi]
mov dword [esp + 0x5c], edi
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x5132bc
mov ecx, dword [ebp + 0x10]
mov edi, dword [esp + 0x5c]
add edi, ecx
mov ecx, dword [esp + 0x24]
inc eax
mov dword [esp + 0x5c], edi
cmp eax, ecx
jge 0x513932
mov ecx, dword [esp + 0x50]
mov esi, dword [esp + 0x60]
jmp 0x513292
test eax, eax
mov dword [esp + 0x5c], eax
jle 0x513932
mov eax, dword [esp + 0x24]
mov dword [esp + 0x20], 0
test eax, eax
jle 0x5136b4
mov edi, dword [esp + 0x30]
mov eax, 1
cmp edi, eax
mov dword [esp + 0x4c], 0
mov dword [esp + 0x3c], eax
jle 0x513698
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x50]
shl ebp, 5
mov dword [esp + 0x54], ecx
mov edx, dword [esp + 0x6c]
mov esi, dword [esp + 0x54]
mov edi, dword [edx + 0x10]
imul edi, dword [esp + 0x20]
add edi, esi
mov esi, dword [esp + 0x60]
add edi, esi
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x513671
sub eax, dword [esp + 0x4c]
cmp eax, 1
mov dword [esp + 0x84], eax
je 0x513690
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x20]
test ebx, ebx
lea edi, [ecx + eax]
mov dword [esp + 0x80], edi
je 0x513359
cmp byte [ebx], 0xa
jne 0x51337b
mov edx, dword [esp + 0xa0]
mov ebx, dword [esp + 0xa4]
mov eax, dword [esp + 0x98]
push edx
push 0xa00
push ebx
call dword [eax + 0x14]
add esp, 0xc
mov al, byte [ebx]
test al, al
js 0x513392
movsx ecx, al
mov dword [esp + 0x1c], ecx
mov eax, 1
jmp 0x51349a
mov dl, al
and dl, 0xe0
cmp dl, 0xc0
jne 0x5133b8
mov cl, byte [ebx + 1]
and eax, 0x1f
shl eax, 6
and ecx, 0x3f
or eax, ecx
mov dword [esp + 0x1c], eax
mov eax, 2
jmp 0x51349a
mov dl, al
and dl, 0xf0
cmp dl, 0xe0
jne 0x5133e9
mov cl, byte [ebx + 1]
mov dl, byte [ebx + 2]
and eax, 0xf
and ecx, 0x3f
shl eax, 6
or eax, ecx
and edx, 0x3f
shl eax, 6
or eax, edx
mov dword [esp + 0x1c], eax
mov eax, 3
jmp 0x51349a
mov dl, byte [ebx + 1]
mov cl, al
and cl, 0xf8
and edx, 0x3f
cmp cl, 0xf0
jne 0x513422
mov cl, byte [ebx + 2]
and eax, 7
shl eax, 6
or eax, edx
mov dl, byte [ebx + 3]
shl eax, 6
and ecx, 0x3f
and edx, 0x3f
or eax, ecx
shl eax, 6
or eax, edx
mov dword [esp + 0x1c], eax
mov eax, 4
jmp 0x51349a
mov cl, al
and cl, 0xfe
cmp cl, 0xf8
mov cl, byte [ebx + 2]
jne 0x513460
and eax, 3
and ecx, 0x3f
shl eax, 6
or eax, edx
mov dl, byte [ebx + 3]
shl eax, 6
or eax, ecx
mov cl, byte [ebx + 4]
shl eax, 6
and edx, 0x3f
and ecx, 0x3f
or eax, edx
shl eax, 6
or eax, ecx
mov dword [esp + 0x1c], eax
mov eax, 5
jmp 0x51349a
and eax, 1
and ecx, 0x3f
shl eax, 6
or eax, edx
mov dl, byte [ebx + 3]
shl eax, 6
or eax, ecx
mov cl, byte [ebx + 4]
shl eax, 6
and edx, 0x3f
and ecx, 0x3f
or eax, edx
mov dl, byte [ebx + 5]
shl eax, 6
or eax, ecx
and edx, 0x3f
shl eax, 6
or eax, edx
mov dword [esp + 0x1c], eax
mov eax, 6
mov esi, dword [esp + 0x28]
add ebx, eax
mov eax, dword [0x838f70]
cmp esi, eax
jl 0x51352e
mov ecx, dword [0x69fdfc]
add eax, 0x20
mov dword [esp + 0x78], eax
shl eax, 2
push eax
call dword [ecx + 0x134]
mov ecx, dword [0x838f70]
mov esi, dword [esp + 0x3c]
mov edx, eax
add esp, 4
mov edi, edx
mov dword [esp + 0x7c], edx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x838f70]
mov esi, dword [esp + 0x78]
cmp eax, esi
jge 0x5134f4
mov ecx, esi
lea edi, [edx + eax*4]
sub ecx, eax
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x38]
test eax, eax
je 0x513513
mov edx, dword [0x69fdfc]
push eax
call dword [edx + 0x138]
mov edx, dword [esp + 0x80]
add esp, 4
mov edi, dword [esp + 0x80]
mov dword [0x838f70], esi
mov esi, dword [esp + 0x28]
mov dword [esp + 0x38], edx
mov dword [0x838f6c], edx
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x94]
cmp eax, 0x80
jl 0x513552
mov edx, dword [ecx + 0x10]
or edx, 2
mov dword [ecx + 0x10], edx
mov edx, dword [esp + 0x38]
mov dword [edx + esi*4], eax
jmp 0x51355e
mov word [ecx + eax*2 + 0x18], si
mov ecx, dword [esp + 0x94]
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0x58]
add edx, 2
add ebp, 0x20
mov dword [esp + 0x80], edx
mov edx, dword [esp + 0x20]
fild dword [esp + 0x80]
add edx, 2
mov dword [esp + 0x80], edx
mov edx, dword [esp + 0x3c]
fmul dword [esp + 0x64]
add edx, 0xfffffffe
fstp dword [eax + ebp - 0x18]
fild dword [esp + 0x80]
mov dword [esp + 0x80], edx
lea edx, [edi - 2]
fmul dword [esp + 0x68]
fstp dword [eax + ebp - 0x14]
fild dword [esp + 0x80]
mov dword [esp + 0x80], edx
mov edx, dword [esp + 0x34]
mov dword [eax + ebp - 0x1c], edx
mov edx, dword [esp + 0x84]
fmul dword [esp + 0x64]
add edx, 0xfffffffc
mov dword [esp + 0x84], edx
mov edx, dword [esp + 0x20]
sub edi, edx
mov dl, byte [esp + 0x48]
fstp dword [eax + ebp - 0x10]
fild dword [esp + 0x80]
sub edi, 2
add dl, 0x61
mov byte [eax + ebp - 4], dl
inc esi
fmul dword [esp + 0x68]
mov dword [esp + 0x28], esi
fstp dword [eax + ebp - 0xc]
fild dword [esp + 0x84]
mov dword [esp + 0x84], edi
fild dword [esp + 0x84]
fdivp st(1)
fstp dword [eax + ebp - 0x20]
cmp esi, dword [esp + 0x2c]
jl 0x513669
mov eax, dword [ecx + 0x128]
push 0x20
push eax
call fcn.00578400
mov ecx, dword [esp + 0x9c]
mov edx, dword [ecx + 0x128]
push edx
call fcn.005784c0
mov edx, eax
mov eax, dword [esp + 0x38]
add eax, 0x20
add esp, 0xc
mov dword [esp + 0x2c], eax
mov ecx, 0x100
xor eax, eax
lea edi, [edx + ebp]
mov dword [esp + 0x58], edx
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x4c], eax
mov ecx, dword [esp + 0x50]
mov esi, dword [esp + 0x54]
mov edx, dword [esp + 0x30]
inc eax
add esi, ecx
cmp eax, edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x54], esi
jl 0x513308
mov ebp, dword [esp + 0x6c]
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x5c]
mov ecx, dword [esp + 0x24]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x20], eax
jl 0x5132dc
jmp 0x5136b8
mov edi, dword [esp + 0x30]
cmp dword [esp + 0x88], 2
jne 0x51387c
mov eax, dword [esp + 0x34]
push eax
mov dword [esp + 0x8c], eax
call fcn.004becf0
push 0x838f1c
call fcn.004bfce0
mov esi, eax
push esi
call fcn.004bf7a0
push esi
push ebp
call fcn.004bf870
push esi
call fcn.004bf4c0
lea eax, [esp + 0x58]
lea ecx, [esp + 0x5c]
push eax
lea edx, [esp + 0x34]
push ecx
lea eax, [esp + 0x34]
push edx
push eax
push 4
push ebp
call fcn.004c8420
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x54]
add esp, 0x30
cmp edi, eax
jne 0x51372d
cmp esi, ecx
je 0x5137f9
cmp eax, edi
jl 0x51374d
cmp ecx, esi
jl 0x51374d
push ecx
push eax
push ebp
call fcn.004bf610
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
add esp, 0xc
jmp 0x5137f9
cmp edi, esi
jle 0x513753
mov esi, edi
test esi, 0xffff0000
je 0x513786
mov eax, esi
sar eax, 0x10
test ah, 0xff
je 0x513779
mov ecx, esi
sar ecx, 0x18
movsx eax, byte [ecx + 0x5f5660]
add eax, 7
lea ecx, [eax + 0x10]
jmp 0x5137a7
movsx eax, byte [eax + 0x5f5660]
dec eax
lea ecx, [eax + 0x10]
jmp 0x5137a7
test esi, 0xff00
je 0x51379f
mov edx, esi
sar edx, 8
movsx ecx, byte [edx + 0x5f5660]
add ecx, 7
jmp 0x5137a7
movsx ecx, byte [esi + 0x5f5660]
dec ecx
mov eax, 1
shl eax, cl
cmp esi, eax
je 0x5137ba
inc ecx
mov esi, 1
shl esi, cl
push esi
push esi
push ebp
call fcn.004bf610
lea ecx, [esp + 0x4c]
lea edx, [esp + 0x50]
push ecx
lea eax, [esp + 0x28]
push edx
lea ecx, [esp + 0x28]
push eax
push ecx
push 4
push ebp
call fcn.004c8420
mov eax, dword [esp + 0x38]
add esp, 0x24
cmp esi, eax
jne 0x513929
mov ecx, dword [esp + 0x18]
cmp esi, ecx
jne 0x513929
mov edx, dword [esp + 0x40]
or dh, 0x90
push edx
mov edx, dword [esp + 0x48]
push edx
push ecx
push eax
call fcn.004beea0
fild dword [esp + 0x24]
mov ecx, dword [esp + 0x38]
add esp, 0x10
test ecx, ecx
fdivr dword [esp + 0x70]
mov dword [esp + 0x34], eax
fstp dword [esp + 0x70]
fild dword [esp + 0x18]
fdivr dword [esp + 0x74]
fstp dword [esp + 0x74]
jle 0x51387c
mov eax, dword [esp + 0x58]
add eax, 8
mov edx, dword [esp + 0x88]
mov esi, dword [eax - 4]
cmp esi, edx
jne 0x513876
fld dword [esp + 0x70]
fmul dword [eax]
mov edx, dword [esp + 0x34]
mov dword [eax - 4], edx
fstp dword [eax]
fld dword [esp + 0x74]
fmul dword [eax + 4]
fstp dword [eax + 4]
fld dword [esp + 0x70]
fmul dword [eax + 8]
fstp dword [eax + 8]
fld dword [esp + 0x74]
fmul dword [eax + 0xc]
fstp dword [eax + 0xc]
add eax, 0x20
dec ecx
jne 0x51383b
mov esi, dword [esp + 0x34]
push ebp
push esi
call fcn.004c83f0
push ebp
call fcn.004bf4c0
push esi
call fcn.004bafd0
mov esi, eax
mov al, byte [esp + 0x58]
lea ecx, [esp + 0x22]
add al, 0x61
push ecx
push esi
mov byte [esp + 0x2a], al
call fcn.004bb0b0
push esi
mov esi, dword [esp + 0xb0]
mov edx, dword [esi + 0x14]
push edx
call fcn.004bb190
fild dword [esp + 0x7c]
mov eax, dword [esp + 0x68]
add esp, 0x20
inc eax
mov dword [esi + 0xc], 0
fsub dword [0x58b508]
cmp eax, 4
mov dword [esp + 0x48], eax
mov ebp, esi
fst dword [esi + 4]
fild dword [esp + 0x8c]
fdiv st(1)
fstp dword [esi + 8]
fstp st(0)
jb 0x51312d
mov eax, dword [esp + 0x28]
push ebp
mov dword [ebp + 0x124], eax
call fcn.00512fc0
mov edi, dword [0x838f6c]
add esp, 4
test edi, edi
je 0x51391c
mov ecx, dword [0x838f70]
or eax, 0xffffffff
rep stosd dword es:[edi], eax
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x80
ret
push ebp
call fcn.004bf4c0
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x80
ret