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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x1c]
mov eax, dword [esi + 0x3c]
test eax, eax
push edi
mov edi, dword [ebp + 0x10]
jne 0x504a26
push 0
call fcn.0044b1f0
add esp, 4
test edi, edi
mov eax, dword [esi + 0x3c]
mov esi, dword [ebp + 0x18]
movsx ecx, word [esi + 2]
movsx edx, word [esi]
mov dword [esp + 0x28], ecx
movsx ecx, word [esi + 4]
fild dword [esp + 0x28]
mov dword [esp + 0x24], eax
movsx eax, word [esi + 6]
fstp dword [esp + 0x1c]
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
mov dword [esp + 0x28], eax
mov eax, 1
fstp dword [esp + 0x18]
fild dword [esp + 0x28]
mov dword [esp + 0x28], ecx
fstp dword [esp + 0x14]
fild dword [esp + 0x28]
fstp dword [esp + 0x20]
jne 0x504a7b
mov eax, dword [ebp + 8]
test eax, eax
jle 0x504d82
mov esi, dword [ebp + 0xc]
add esi, 6
mov dword [esp + 0x28], eax
lea ecx, [ecx]
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x504b2a
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
movsx edx, word [esi - 6]
movsx ebx, word [esi - 2]
add ebx, eax
add edx, ecx
mov dword [esp + 0x2c], ebx
movsx ebx, word [esi - 4]
mov dword [esp + 0x10], edx
add ebx, ecx
fild dword [esp + 0x10]
fstp dword [esp + 0x10]
fild dword [esp + 0x2c]
mov edx, dword [esp + 0x10]
mov dword [esp + 0x2c], ebx
movsx ebx, word [esi]
fstp dword [esp + 0x30]
add ebx, eax
fild dword [esp + 0x2c]
mov dword [esp + 0x34], edx
fstp dword [esp + 0x2c]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x2c], ebx
fild dword [esp + 0x2c]
mov ebx, edx
mov dword [esp + 0x44], ebx
movsx ebx, word [esi + 0xa]
mov dword [esp + 0x3c], ecx
fstp dword [esp + 0x38]
add ebx, eax
mov dword [esp + 0x4c], ecx
movsx ecx, word [esi + 0xc]
mov dword [esp + 0x2c], ebx
add ecx, eax
fild dword [esp + 0x2c]
mov dword [esp + 0x2c], ecx
fstp dword [esp + 0x40]
fild dword [esp + 0x2c]
fstp dword [esp + 0x48]
jmp 0x504bb0
movsx edx, word [edi + 4]
mov eax, dword [ebx + 4]
movsx edi, word [edi]
mov ecx, dword [ebx]
add edx, eax
mov dword [esp + 0x2c], edx
add edi, ecx
fild dword [esp + 0x2c]
fstp dword [esp + 0x2c]
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x2c], edi
fild dword [esp + 0x2c]
mov dword [esp + 0x34], edx
mov dword [esp + 0x44], edx
fstp dword [esp + 0x10]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x30], edi
mov edi, dword [ebp + 0x10]
movsx edi, word [edi + 6]
add edi, eax
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x10]
mov dword [esp + 0x38], edi
fild dword [esp + 0x2c]
mov edi, dword [ebp + 0x10]
movsx ebx, word [edi + 2]
fstp dword [esp + 0x2c]
mov eax, dword [esp + 0x2c]
add ebx, ecx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x4c], eax
fild dword [esp + 0x2c]
fstp dword [esp + 0x2c]
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x48], ecx
mov ecx, dword [ebp + 0x1c]
mov ebx, dword [ebp + 0x14]
lea eax, [esp + 0x30]
push eax
mov eax, dword [ecx]
mov ecx, dword [esp + 0x34]
push eax
push edx
push ecx
call fcn.00510a40
mov eax, dword [ebp + 0x1c]
mov ecx, dword [eax]
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x48]
push edx
mov edx, dword [esp + 0x50]
push ecx
push edx
push eax
call fcn.00510a40
mov edx, dword [ebp + 0x1c]
mov eax, dword [edx]
mov edx, dword [esp + 0x60]
lea ecx, [esp + 0x60]
push ecx
mov ecx, dword [esp + 0x68]
push eax
push ecx
push edx
call fcn.00510a40
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x78]
lea eax, [esp + 0x78]
push eax
mov eax, dword [esp + 0x80]
push edx
push eax
push ecx
call fcn.00510a40
fld dword [esp + 0x5c]
fcomp dword [esp + 0x70]
mov ecx, dword [esp + 0x70]
add esp, 0x40
fnstsw ax
test ah, 0x41
jne 0x504c34
mov dword [esp + 0x1c], ecx
fld dword [esp + 0x18]
fcomp dword [esp + 0x30]
fnstsw ax
test ah, 5
jp 0x504c47
mov dword [esp + 0x18], ecx
fld dword [esp + 0x14]
mov ecx, dword [esp + 0x34]
fcomp dword [esp + 0x34]
fnstsw ax
test ah, 0x41
jne 0x504c5e
mov dword [esp + 0x14], ecx
fld dword [esp + 0x20]
fcomp dword [esp + 0x34]
fnstsw ax
test ah, 5
jp 0x504c71
mov dword [esp + 0x20], ecx
fld dword [esp + 0x1c]
mov ecx, dword [esp + 0x38]
fcomp dword [esp + 0x38]
fnstsw ax
test ah, 0x41
jne 0x504c88
mov dword [esp + 0x1c], ecx
fld dword [esp + 0x18]
fcomp dword [esp + 0x38]
fnstsw ax
test ah, 5
jp 0x504c9b
mov dword [esp + 0x18], ecx
fld dword [esp + 0x14]
mov ecx, dword [esp + 0x3c]
fcomp dword [esp + 0x3c]
fnstsw ax
test ah, 0x41
jne 0x504cb2
mov dword [esp + 0x14], ecx
fld dword [esp + 0x20]
fcomp dword [esp + 0x3c]
fnstsw ax
test ah, 5
jp 0x504cc5
mov dword [esp + 0x20], ecx
fld dword [esp + 0x1c]
mov ecx, dword [esp + 0x40]
fcomp dword [esp + 0x40]
fnstsw ax
test ah, 0x41
jne 0x504cdc
mov dword [esp + 0x1c], ecx
fld dword [esp + 0x18]
fcomp dword [esp + 0x40]
fnstsw ax
test ah, 5
jp 0x504cef
mov dword [esp + 0x18], ecx
fld dword [esp + 0x14]
mov ecx, dword [esp + 0x44]
fcomp dword [esp + 0x44]
fnstsw ax
test ah, 0x41
jne 0x504d06
mov dword [esp + 0x14], ecx
fld dword [esp + 0x20]
fcomp dword [esp + 0x44]
fnstsw ax
test ah, 5
jp 0x504d19
mov dword [esp + 0x20], ecx
fld dword [esp + 0x1c]
mov ecx, dword [esp + 0x48]
fcomp dword [esp + 0x48]
fnstsw ax
test ah, 0x41
jne 0x504d30
mov dword [esp + 0x1c], ecx
fld dword [esp + 0x18]
fcomp dword [esp + 0x48]
fnstsw ax
test ah, 5
jp 0x504d43
mov dword [esp + 0x18], ecx
fld dword [esp + 0x14]
mov ecx, dword [esp + 0x4c]
fcomp dword [esp + 0x4c]
fnstsw ax
test ah, 0x41
jne 0x504d5a
mov dword [esp + 0x14], ecx
fld dword [esp + 0x20]
fcomp dword [esp + 0x4c]
fnstsw ax
test ah, 5
jp 0x504d6d
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x28]
add esi, 0x1c
dec eax
mov dword [esp + 0x28], eax
jne 0x504a90
mov esi, dword [ebp + 0x18]
fld dword [esp + 0x1c]
sub esp, 8
fstp qword [esp]
call fcn.005386b0
fsub qword [0x66a710]
fstp dword [esp + 0x24]
fld dword [esp + 0x20]
fstp qword [esp]
call fcn.00538660
fadd qword [0x66a710]
fstp dword [esp + 0x20]
fld dword [esp + 0x1c]
fstp qword [esp]
call fcn.005386b0
fsub qword [0x66a710]
fstp dword [esp + 0x1c]
fld dword [esp + 0x28]
fstp qword [esp]
call fcn.00538660
mov edx, dword [ebp + 0x1c]
fadd qword [0x66a710]
mov eax, dword [edx + 0x28]
mov cl, byte [eax + 0x30]
add esp, 8
fstp dword [esp + 0x20]
test cl, 1
je 0x504df4
movsx ecx, word [eax + 0x18]
jmp 0x504df9
mov ecx, 1
movzx eax, byte [eax + 0x2e]
push ecx
call fcn.00504220
add esp, 4
fld dword [esp + 0x1c]
mov edi, eax
call fcn.00667ad0
cdq
idiv edi
imul eax, edi
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fstp dword [esp + 0x1c]
fld dword [esp + 0x18]
call fcn.00667ad0
lea eax, [eax + edi - 1]
cdq
idiv edi
imul eax, edi
mov dword [esp + 0x2c], eax
movsx eax, word [esi]
fild dword [esp + 0x2c]
mov dword [esp + 0x2c], eax
fstp dword [esp + 0x18]
fild dword [esp + 0x2c]
fstp dword [esp + 0x28]
fld dword [esp + 0x1c]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 5
jp 0x504e68
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x1c], ecx
movsx edx, word [esi + 2]
mov dword [esp + 0x2c], edx
fild dword [esp + 0x2c]
fstp dword [esp + 0x28]
fld dword [esp + 0x18]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 0x41
jne 0x504e8f
mov eax, dword [esp + 0x28]
mov dword [esp + 0x18], eax
movsx ecx, word [esi + 4]
mov dword [esp + 0x2c], ecx
fild dword [esp + 0x2c]
fstp dword [esp + 0x28]
fld dword [esp + 0x14]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 5
jp 0x504eb6
mov edx, dword [esp + 0x28]
mov dword [esp + 0x14], edx
movsx eax, word [esi + 6]
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fstp dword [esp + 0x28]
fld dword [esp + 0x20]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 0x41
jne 0x504edd
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x20], ecx
fld dword [esp + 0x1c]
call fcn.00667ad0
fld dword [esp + 0x18]
mov edi, dword [ebp + 0x20]
mov word [esp + 0x10], ax
mov word [edi], ax
call fcn.00667ad0
fld dword [esp + 0x14]
mov word [esp + 0x18], ax
mov word [edi + 2], ax
call fcn.00667ad0
fld dword [esp + 0x20]
mov word [esp + 0x14], ax
mov word [edi + 4], ax
call fcn.00667ad0
mov word [edi + 6], ax
mov word [esp + 0x1c], ax
mov eax, dword [esp + 0x24]
mov ecx, dword [eax + 0x50]
test ecx, ecx
je 0x50502c
mov ax, word [eax + 0x56]
cmp ax, 1
jne 0x504f47
mov esi, 1
jmp 0x504f4b
movsx esi, ax
dec esi
mov edx, dword [esp + 0x24]
mov ax, word [edx + 0x54]
cmp ax, 1
jne 0x504f60
mov ecx, 1
jmp 0x504f64
movsx ecx, ax
dec ecx
mov ebx, dword [ebp + 0x18]
mov dx, word [ebx]
movsx eax, word [esp + 0x10]
movsx edx, dx
sub eax, edx
cdq
idiv esi
mov edx, eax
xor eax, eax
imul edx, esi
mov ax, word [ebx]
add edx, eax
movsx eax, word [esp + 0x14]
mov word [edi], dx
movsx edx, word [ebx + 4]
sub eax, edx
cdq
idiv ecx
mov edx, eax
xor eax, eax
imul edx, ecx
mov ax, word [ebx + 4]
add edx, eax
movsx eax, word [esp + 0x18]
mov word [edi + 4], dx
mov dx, word [ebx]
movsx edx, dx
sub eax, edx
add eax, esi
cdq
idiv esi
mov edx, eax
xor eax, eax
imul edx, esi
mov ax, word [ebx]
lea eax, [edx + eax + 1]
mov word [edi + 2], ax
movsx edx, word [ebx + 4]
movsx eax, word [esp + 0x1c]
sub eax, edx
add eax, ecx
cdq
idiv ecx
mov edx, eax
imul edx, ecx
xor eax, eax
mov ax, word [ebx + 4]
lea eax, [edx + eax + 1]
mov word [edi + 6], ax
mov ax, word [ebx + 2]
cmp word [edi + 2], ax
jle 0x504ffa
mov word [edi + 2], ax
mov ax, word [ebx + 6]
cmp word [edi + 6], ax
jle 0x505008
mov word [edi + 6], ax
movsx edx, word [ebx]
movsx eax, word [edi]
sub eax, edx
cdq
idiv esi
mov esi, dword [esp + 0x24]
mov word [esi + 0x26], ax
movsx edx, word [ebx + 4]
movsx eax, word [edi + 4]
sub eax, edx
cdq
idiv ecx
mov word [esi + 0x24], ax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret