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

Disassembly:
sub esp, 0x70
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov dword [esp + 0x28], ebp
call fcn.004da550
mov dword [esp + 0x7c], eax
mov eax, dword [0x84f940]
push eax
call fcn.004da530
mov esi, dword [esp + 0x88]
add esp, 4
mov dword [esp + 0x18], esi
mov dword [esp + 0x2c], ebp
mov ebx, dword [esi + 0x130]
mov dword [esi], ebp
cmp ebx, ebp
mov dword [esp + 0x1c], ebx
jne 0x51215f
mov dword [esp + 0x1c], 0x100
mov ebx, dword [esp + 0x1c]
mov edx, dword [esi + 0x134]
mov ecx, dword [0x85017c]
push 0x30190
push ebx
push edx
mov dword [esp + 0x3c], ecx
call fcn.00528650
mov eax, dword [esi + 0x134]
push eax
call fcn.00528710
mov ecx, ebx
mov edi, eax
shl ecx, 5
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [esp + 0x74], edi
add esp, 0x10
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [esp + 0x54], ebp
and ecx, 3
mov dword [esp + 0x50], ebp
rep stosb byte es:[edi], al
xor edi, edi
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x8c]
mov ebx, dword [esp + 0x90]
push eax
push 0x100
push ebx
call fcn.00488ad0
add esp, 0xc
test eax, eax
je 0x512856
mov ecx, dword [esp + 0x88]
mov edx, dword [0x84a7c8]
push 0x85012c
push ecx
push 0x81975c
push ebx
call dword [edx + 0x104]
mov esi, eax
add esp, 0x10
test esi, esi
je 0x51284f
cmp esi, 1
je 0x512212
cmp esi, 2
jne 0x51284f
mov eax, dword [0x84f92c]
push eax
call fcn.004d4000
add esp, 4
cmp esi, 1
jne 0x51223a
mov ecx, dword [esp + 0x88]
push 0
push ecx
call fcn.004da560
mov dword [esp + 0x48], eax
jmp 0x512250
mov edx, dword [esp + 0x88]
push 0x85012c
push edx
call fcn.004da560
mov dword [esp + 0x48], eax
add esp, 8
test eax, eax
je 0x512847
mov ecx, dword [esp + 0x84]
mov edx, dword [esp + 0x28]
test edi, edi
mov dword [ecx + edx*4 + 0x14], eax
mov eax, dword [eax]
mov dword [esp + 0x68], eax
mov ecx, dword [eax + 0xc]
mov esi, dword [eax + 0x10]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x38], esi
je 0x512297
cmp dword [esp + 0x50], ecx
jne 0x51228e
cmp dword [esp + 0x54], esi
je 0x5122b9
push edi
call fcn.004d38a0
add esp, 4
mov eax, dword [esp + 0x24]
push 0x20
push esi
push eax
call fcn.004d3840
push eax
mov dword [esp + 0x24], eax
call fcn.004d3900
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x78]
add esp, 0x10
push eax
push edi
call fcn.004d4f50
fild dword [esp + 0x2c]
mov edx, dword [esp + 0x94]
mov ecx, dword [esp + 0x2c]
push edx
push 0x100
fdivr dword [0x5303b4]
push ebx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x68], esi
fstp dword [esp + 0x70]
fild dword [esp + 0x4c]
fdivr dword [0x5303b4]
fstp dword [esp + 0x74]
call fcn.00488ad0
mov ecx, dword [0x84a7c8]
lea eax, [esp + 0x8c]
push eax
push 0x81974c
push ebx
call dword [ecx + 0x104]
mov ecx, dword [edi + 0xc]
mov edx, dword [edi + 0x14]
mov eax, 1
add esp, 0x20
sar ecx, 3
cmp esi, eax
mov dword [esp + 0x58], edx
mov dword [esp + 0x34], ecx
jle 0x512847
mov edi, dword [edi + 0x10]
mov dword [esp + 0x68], edi
add edi, edx
mov dword [esp + 0x4c], edi
mov esi, edx
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x512370
mov edi, dword [esp + 0x4c]
mov edx, dword [esp + 0x68]
mov ecx, dword [esp + 0x38]
inc eax
add edi, edx
cmp eax, ecx
mov dword [esp + 0x4c], edi
jge 0x512843
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x34]
jmp 0x512343
test eax, eax
mov dword [esp + 0x4c], eax
jle 0x512843
mov eax, dword [esp + 0x38]
mov dword [esp + 0x10], 0
test eax, eax
jle 0x5127e3
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x84]
cmp eax, ecx
jne 0x5127e3
mov ecx, dword [esp + 0x24]
mov eax, 1
xor edx, edx
cmp ecx, eax
mov dword [esp + 0x68], edx
mov dword [esp + 0x20], eax
jle 0x5127c9
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x34]
shl eax, 5
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], ecx
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x18]
cmp ecx, eax
jne 0x5127c9
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x48]
mov ecx, dword [esp + 0x34]
mov edi, dword [eax + 0x10]
imul edi, dword [esp + 0x10]
add edi, esi
mov esi, dword [esp + 0x58]
add edi, esi
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x5127a6
mov eax, dword [esp + 0x20]
sub eax, edx
cmp eax, 1
mov dword [esp + 0x74], eax
je 0x5127c9
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x4c]
test ebp, ebp
lea edi, [ecx + edx]
mov dword [esp + 0x3c], edi
je 0x5124a1
mov al, byte [ebp]
cmp al, 0xa
je 0x5124a1
test al, al
je 0x5124a1
mov eax, ebp
sub eax, ebx
cmp eax, 0x80
jl 0x5124b9
mov ecx, dword [0x84a7c8]
push ebp
call dword [ecx + 0xf4]
mov edx, eax
add esp, 4
sub edx, ebx
add edx, ebp
cmp edx, 0xff
jne 0x5124b9
lea ecx, [eax + 1]
mov esi, ebp
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov ebp, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp byte [eax + ebx - 1], 0xa
jne 0x512483
dec eax
mov ecx, dword [esp + 0x8c]
mov edx, 0x100
sub edx, eax
push ecx
add eax, ebx
push edx
push eax
call fcn.00488ad0
mov edi, dword [esp + 0x48]
jmp 0x5124b6
mov eax, dword [esp + 0x8c]
push eax
push 0x100
push ebx
call fcn.00488ad0
mov ebp, ebx
add esp, 0xc
mov al, byte [ebp]
test al, al
js 0x5124cd
movsx ebx, al
mov eax, 1
jmp 0x5125eb
mov cl, al
and cl, 0xe0
cmp cl, 0xc0
jne 0x5124f1
mov dl, byte [ebp + 1]
and eax, 0x1f
shl eax, 6
and edx, 0x3f
or eax, edx
mov ebx, eax
mov eax, 2
jmp 0x5125eb
mov cl, al
and cl, 0xf0
cmp cl, 0xe0
jne 0x512520
mov dl, byte [ebp + 1]
mov cl, byte [ebp + 2]
and eax, 0xf
and edx, 0x3f
shl eax, 6
or eax, edx
and ecx, 0x3f
shl eax, 6
or eax, ecx
mov ebx, eax
mov eax, 3
jmp 0x5125eb
mov dl, al
and dl, 0xf8
cmp dl, 0xf0
jne 0x51255a
mov cl, byte [ebp + 1]
mov dl, byte [ebp + 2]
and eax, 7
and ecx, 0x3f
shl eax, 6
or eax, ecx
mov cl, byte [ebp + 3]
shl eax, 6
and edx, 0x3f
and ecx, 0x3f
or eax, edx
shl eax, 6
or eax, ecx
mov ebx, eax
mov eax, 4
jmp 0x5125eb
mov dl, al
and dl, 0xfc
cmp dl, 0xf8
jne 0x51259c
mov cl, byte [ebp + 1]
mov dl, byte [ebp + 2]
and eax, 3
and ecx, 0x3f
shl eax, 6
or eax, ecx
mov cl, byte [ebp + 3]
shl eax, 6
and edx, 0x3f
and ecx, 0x3f
or eax, edx
mov dl, byte [ebp + 4]
shl eax, 6
or eax, ecx
and edx, 0x3f
shl eax, 6
or eax, edx
mov ebx, eax
mov eax, 5
jmp 0x5125eb
mov cl, al
and cl, 0xfe
cmp cl, 0xfc
jne 0x51282e
mov dl, byte [ebp + 1]
mov cl, byte [ebp + 2]
and eax, 1
and edx, 0x3f
shl eax, 6
or eax, edx
mov dl, byte [ebp + 3]
shl eax, 6
and ecx, 0x3f
and edx, 0x3f
or eax, ecx
mov cl, byte [ebp + 4]
shl eax, 6
or eax, edx
mov dl, byte [ebp + 5]
shl eax, 6
and ecx, 0x3f
and edx, 0x3f
or eax, ecx
shl eax, 6
or eax, edx
mov ebx, eax
mov eax, 6
cmp ebx, 0xffff
jg 0x512827
mov esi, dword [esp + 0x2c]
add ebp, eax
mov eax, dword [0x850180]
cmp esi, eax
jl 0x51268f
mov ecx, dword [0x84a7c8]
add eax, 0x20
mov dword [esp + 0x6c], eax
push 0x30190
shl eax, 2
push eax
call dword [ecx + 0x108]
mov ecx, dword [0x850180]
mov edx, eax
mov eax, dword [esp + 0x38]
mov edi, edx
mov esi, eax
add esp, 8
rep movsd dword es:[edi], dword [esi]
mov edi, dword [0x850180]
mov esi, dword [esp + 0x6c]
cmp edi, esi
mov dword [esp + 0x70], edx
jge 0x51265f
lea eax, [edx + edi*4]
mov ecx, esi
sub ecx, edi
mov edi, eax
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x512677
mov ecx, dword [0x84a7c8]
push eax
call dword [ecx + 0x10c]
mov edx, dword [esp + 0x74]
add esp, 4
mov edi, dword [esp + 0x3c]
mov dword [0x850180], esi
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x30], edx
mov dword [0x85017c], edx
mov eax, dword [esp + 0x84]
cmp ebx, 0x80
jl 0x5126b0
mov ecx, dword [eax + 0x10]
mov edx, dword [esp + 0x30]
or ecx, 2
mov dword [eax + 0x10], ecx
mov dword [edx + esi*4], ebx
jmp 0x5126b5
mov word [eax + ebx*2 + 0x24], si
fild dword [esp + 0x68]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x40]
fadd dword [0x530790]
mov dword [eax + ecx + 4], edx
mov edx, dword [esp + 0x74]
add edx, 0xfffffffd
add eax, 0x20
fmul dword [esp + 0x5c]
mov dword [esp + 0x74], edx
mov edx, dword [esp + 0x10]
sub edi, edx
mov dl, byte [esp + 0x28]
sub edi, 3
mov byte [eax + ecx - 4], dl
fstp dword [eax + ecx - 0x18]
fild dword [esp + 0x10]
mov dword [esp + 0x44], eax
inc esi
mov dword [esp + 0x2c], esi
fadd dword [0x530790]
fmul dword [esp + 0x60]
fstp dword [eax + ecx - 0x14]
fild dword [esp + 0x20]
fsub dword [0x5303bc]
fmul dword [esp + 0x5c]
fstp dword [eax + ecx - 0x10]
fild dword [esp + 0x3c]
fsub dword [0x5303bc]
fmul dword [esp + 0x60]
fstp dword [eax + ecx - 0xc]
fild dword [esp + 0x74]
mov dword [esp + 0x74], edi
fild dword [esp + 0x74]
fdivp st(1)
fstp dword [eax + ecx - 0x20]
cmp esi, dword [esp + 0x1c]
jl 0x512797
mov esi, dword [esp + 0x84]
push 0x30190
push 0x20
mov eax, dword [esi + 0x134]
push eax
call fcn.00528650
mov ecx, dword [esi + 0x134]
push ecx
call fcn.00528710
mov esi, dword [esp + 0x54]
mov edx, eax
mov eax, dword [esp + 0x2c]
add esp, 0x10
add eax, 0x20
mov ecx, 0x100
mov dword [esp + 0x1c], eax
xor eax, eax
lea edi, [esi + edx]
mov dword [esp + 0x64], edx
rep stosd dword es:[edi], eax
mov ebx, dword [esp + 0x90]
mov edx, dword [esp + 0x20]
mov dword [esp + 0x68], edx
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x48]
mov eax, dword [esp + 0x20]
add esi, ecx
mov ecx, dword [esp + 0x24]
inc eax
cmp eax, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x48], esi
jl 0x5123d1
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x38]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x512390
fild dword [esp + 0x4c]
mov eax, dword [esp + 0x84]
xor ebp, ebp
mov esi, dword [esp + 0x84]
mov edi, dword [esp + 0x14]
fsub dword [0x533b14]
mov dword [eax + 0xc], ebp
fld st(0)
fstp dword [eax + 4]
fild dword [esp + 0x78]
fdiv st(1)
fstp dword [eax + 8]
mov eax, dword [esp + 0x28]
inc eax
cmp eax, 4
mov dword [esp + 0x28], eax
fstp st(0)
jae 0x512856
jmp 0x5121b3
mov ebx, dword [esp + 0x90]
mov dword [esp + 0x28], 4
mov dword [esp + 0x18], 0
jmp 0x51279e
mov edi, dword [esp + 0x14]
mov dword [esp + 0x18], 0
mov esi, dword [esp + 0x84]
test edi, edi
je 0x512863
push edi
call fcn.004d38a0
add esp, 4
mov ebx, dword [esp + 0x18]
cmp ebx, esi
jne 0x512893
mov edx, dword [esp + 0x2c]
push esi
mov dword [esi + 0x130], edx
call fcn.00512040
mov edi, dword [0x85017c]
add esp, 4
test edi, edi
je 0x512893
mov ecx, dword [0x850180]
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x7c]
push eax
call fcn.004da530
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x70
ret