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

Disassembly:
push 0xffffffffffffffff
push 0x531720
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xe8
mov eax, dword [esp + 0xf8]
push ebx
push ebp
mov ebp, ecx
movsx ebx, word [eax + 6]
movsx edx, word [eax + 2]
movsx ecx, word [eax]
push esi
sub ebx, edx
movsx esi, word [eax + 4]
mov eax, dword [ebp + 0x1c]
add ebx, 2
sub esi, ecx
mov ecx, dword [0x659a28]
and ebx, 0xfffffffe
inc esi
push edi
mov dword [esp + 0x48], eax
lea edx, [ebx + 4]
push ecx
lea eax, [esi + 4]
push edx
push eax
lea ecx, [esp + 0xec]
mov dword [esp + 0x74], esi
mov dword [esp + 0x78], ebx
call fcn.004a8200
xor edi, edi
lea ecx, [esp + 0xe0]
mov dword [esp + 0x100], edi
call fcn.004a8b90
lea ecx, [esp + 0xe0]
mov dword [ebp + 0x1c], ecx
mov al, byte [0x8d8140]
test al, 1
jne 0x495426
mov dl, al
mov ecx, 0x8fa7e0
or dl, 1
mov byte [0x8d8140], dl
call fcn.00453870
push fcn.00402b00
call fcn.0051c6ca
add esp, 4
push edi
push 0x8fa7e0
push ebx
push esi
push edi
push edi
mov ecx, ebp
call fcn.00493ff0
mov eax, dword [esp + 0x110]
lea edx, [esp + 0x24]
sar ebx, 1
push edx
push eax
sar esi, 1
push ebx
push esi
mov dword [esp + 0x48], esi
mov word [esp + 0x34], di
mov word [esp + 0x36], di
mov word [esp + 0x40], di
mov word [esp + 0x42], di
call fcn.00495040
mov edx, dword [esp + 0x11c]
lea ecx, [esp + 0x40]
push ecx
push edx
push ebx
push esi
mov dword [esp + 0x34], eax
call fcn.00495040
mov dword [esp + 0x40], eax
add esp, 0x20
lea eax, [esp + 0xa8]
mov ecx, 7
mov word [eax], di
mov word [eax + 2], di
add eax, 4
dec ecx
jne 0x495492
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x8c], eax
mov al, byte [0x8d8105]
test al, 1
mov dword [esp + 0x90], ecx
jne 0x4954e4
mov dl, al
push fcn.00402b00
or dl, 1
mov word [0x8fa7d8], di
mov byte [0x8d8105], dl
mov word [0x8fa7da], di
call fcn.0051c6ca
add esp, 4
lea ecx, [ebx + 1]
mov word [esp + 0x10], si
mov word [esp + 0x12], cx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x98], eax
mov eax, esi
mov edx, dword [0x8fa7d8]
mov word [esp + 0x12], cx
neg eax
mov word [esp + 0x10], ax
mov ecx, dword [esp + 0x10]
mov word [esp + 0x10], ax
mov eax, ebx
neg eax
mov dword [esp + 0x94], edx
mov word [esp + 0x12], ax
mov edx, dword [esp + 0x10]
mov dword [esp + 0x9c], ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0xa0], edx
mov edx, dword [esp + 0x20]
mov word [esp + 0x10], si
mov word [esp + 0x12], ax
mov eax, dword [esp + 0x10]
mov dword [esp + 0xa4], eax
lea eax, [edx + ecx*4]
lea ecx, [esp + 0xa8]
lea edx, [esp + 0x8c]
push ecx
push edx
call dword [eax*4 + 0x53e308]
add esp, 8
xor ecx, ecx
cmp eax, edi
mov dword [esp + 0x1c], eax
mov word [esp + 0x28], si
mov word [esp + 0x2a], bx
mov dword [esp + 0x18], edi
mov edx, 0x270f
jle 0x49565f
lea eax, [esp + 0xa8]
add word [eax], si
add word [eax + 2], bx
movsx edi, word [eax + 2]
cmp edi, edx
mov dword [esp + 0x10], edi
jge 0x4955b6
mov dword [esp + 0x18], ecx
mov edx, edi
mov edi, dword [esp + 0x1c]
inc ecx
add eax, 4
cmp ecx, edi
jl 0x49559d
mov edx, dword [esp + 0x18]
xor edi, edi
cmp edx, edi
je 0x49565f
lea eax, [esp + 0xc4]
mov ecx, 7
mov word [eax], di
mov word [eax + 2], di
add eax, 4
dec ecx
jne 0x4955dc
shl edx, 2
mov ecx, edx
lea esi, [esp + 0xa8]
mov eax, ecx
lea edi, [esp + 0xc4]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
mov dword [esp + 0x14], edx
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
lea esi, [esp + edx + 0xa8]
sub eax, edi
lea edi, [esp + 0xa8]
shl eax, 2
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
lea edi, [esp + eax + 0xa8]
mov eax, ecx
lea esi, [esp + 0xc4]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x38]
xor edi, edi
push ecx
mov dword [esp + 0x48], esp
mov eax, esp
push ecx
mov ecx, esp
mov dword [esp + 0x4c], esp
push edi
mov dword [eax], edi
call fcn.00411730
push 1
lea ecx, [esp + 0x8c]
call fcn.0041b380
lea eax, [ebp + 0xc]
mov ecx, eax
mov dword [esp + 0x44], eax
mov edx, dword [ecx]
mov dword [esp + 0x5c], edx
mov edx, dword [ecx + 4]
mov dword [esp + 0x60], edx
mov edx, dword [esp + 0x80]
mov ecx, dword [ecx + 8]
mov dword [eax], edx
mov edx, dword [esp + 0x88]
mov dword [esp + 0x64], ecx
mov ecx, dword [esp + 0x84]
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
mov al, byte [0x8d8140]
test al, 1
jne 0x4956fb
mov dl, al
or eax, 0xffffffff
or dl, 1
push fcn.00402b00
mov byte [0x8d8140], dl
mov word [0x8fa7e2], di
mov word [0x8fa7e0], di
mov word [0x8fa7e6], ax
mov word [0x8fa7e4], ax
call fcn.0051c6ca
add esp, 4
mov edx, dword [esp + 0x118]
xor eax, eax
xor ecx, ecx
push edi
mov ax, word [edx + 2]
mov cx, word [edx]
push 0x8fa7e0
push eax
shr eax, 1
mov edx, ebx
push ecx
sub edx, eax
mov eax, esi
shr ecx, 1
sub eax, ecx
push edx
push eax
mov ecx, ebp
call fcn.00493ff0
mov eax, dword [esp + 0x110]
mov edx, dword [esp + 0x10c]
sub eax, edx
mov ecx, 0x168
add eax, 0xe10
cdq
idiv ecx
cmp edx, edi
jle 0x4957a9
cmp edx, ecx
jge 0x4957a9
lea ecx, [esp + 0xc4]
call fcn.004b1f80
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0xa8]
push edx
push eax
lea ecx, [esp + 0xcc]
mov byte [esp + 0x108], 1
call fcn.004b2040
mov ecx, dword [esp + 0x108]
push 1
lea edx, [esp + 0xc8]
push ecx
push edx
mov ecx, ebp
call fcn.00496230
lea ecx, [esp + 0xc4]
mov byte [esp + 0x100], 0
call fcn.004b2330
mov al, byte [esp + 0x114]
test al, al
je 0x495a74
test byte [ebp + 4], 0xf
je 0x495a74
movsx eax, word [ebp + 6]
movsx edi, word [esp + 0x26]
cdq
sub eax, edx
mov dword [esp + 0x34], edi
fild dword [esp + 0x34]
sar eax, 1
sub esi, eax
sub ebx, eax
mov eax, esi
mov ecx, ebx
imul eax, esi
imul ecx, ebx
fld st(0)
fmul st(1)
fstp qword [esp + 0x70]
fstp st(0)
movsx edx, word [esp + 0x24]
imul ebx, esi
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], edx
fild dword [esp + 0x14]
fild dword [esp + 0x1c]
mov dword [esp + 0x20], ecx
mov esi, ebx
fld st(0)
fmul st(1)
fstp qword [esp + 0x78]
fstp st(0)
fild dword [esp + 0x20]
fld st(0)
fmul qword [esp + 0x78]
fld st(2)
fmul qword [esp + 0x70]
faddp st(1)
fsqrt
call sub.MSVCRT.dll__ftol
mov ebx, 1
mov dword [esp + 0x18], eax
cmp eax, ebx
jg 0x495842
mov dword [esp + 0x18], ebx
movsx eax, word [esp + 0x32]
mov dword [esp + 0x40], eax
fild dword [esp + 0x40]
movsx ecx, word [esp + 0x30]
fld st(0)
fmul st(1)
mov dword [esp + 0x10], ecx
fstp qword [esp + 0x4c]
fstp st(0)
fild dword [esp + 0x10]
fld st(0)
fmul st(1)
fstp qword [esp + 0x54]
fstp st(0)
fld qword [esp + 0x54]
fmul st(1)
fld qword [esp + 0x4c]
fmul st(3)
faddp st(1)
fsqrt
call sub.MSVCRT.dll__ftol
fstp st(0)
cmp eax, ebx
fstp st(0)
jle 0x49588f
mov ebx, eax
mov eax, edi
mov ecx, dword [esp + 0x18]
imul eax, esi
sar ecx, 1
add eax, ecx
mov dword [ebp + 0x24], 1
cdq
idiv dword [esp + 0x18]
mov edi, eax
mov eax, dword [esp + 0x1c]
imul eax, esi
add eax, ecx
mov ecx, ebx
cdq
idiv dword [esp + 0x18]
sar ecx, 1
mov dword [esp + 0x3c], edi
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x40]
imul eax, esi
add eax, ecx
cdq
idiv ebx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x10]
imul eax, esi
add eax, ecx
cdq
idiv ebx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x118]
mov si, word [eax]
cmp si, 1
jb 0x4958fe
mov ax, word [eax + 2]
cmp ax, 1
jae 0x49594e
movsx esi, word [esp + 0x2a]
movsx ebx, word [esp + 0x28]
movsx ecx, word [esp + 0x38]
movsx eax, di
add eax, esi
add ecx, ebx
movsx edx, ax
movsx eax, cx
push edx
push eax
mov ecx, ebp
call fcn.004923f0
push esi
push ebx
mov ecx, ebp
call fcn.00492410
movsx eax, word [esp + 0x20]
movsx ecx, word [esp + 0x14]
add eax, esi
add ecx, ebx
movsx edx, ax
movsx eax, cx
push edx
push eax
mov ecx, ebp
call fcn.00492410
jmp 0x495a72
and esi, 0xffff
and eax, 0xffff
mov ecx, esi
mov edx, eax
imul ecx, esi
imul edx, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x2c], edx
fild dword [esp + 0x18]
imul esi, eax
fild dword [esp + 0x2c]
fld st(0)
fmul qword [esp + 0x78]
fld st(2)
fmul qword [esp + 0x70]
faddp st(1)
fsqrt
call sub.MSVCRT.dll__ftol
cmp eax, 1
jg 0x495995
mov eax, 1
fmul qword [esp + 0x54]
fxch st(1)
fmul qword [esp + 0x4c]
lea edi, [eax + eax]
mov dword [esp + 0x18], edi
faddp st(1)
fsqrt
call sub.MSVCRT.dll__ftol
cmp eax, 1
jg 0x4959b9
mov eax, 1
lea ecx, [eax + eax]
mov eax, esi
imul eax, dword [esp + 0x34]
sar edi, 1
add eax, edi
cdq
idiv dword [esp + 0x18]
mov ebx, eax
mov eax, esi
imul eax, dword [esp + 0x1c]
add eax, edi
mov edi, ecx
cdq
idiv dword [esp + 0x18]
sar edi, 1
mov dword [esp + 0x2c], eax
mov eax, esi
imul eax, dword [esp + 0x40]
add eax, edi
cdq
idiv ecx
mov dword [esp + 0x34], eax
mov eax, esi
imul eax, dword [esp + 0x10]
add eax, edi
cdq
idiv ecx
movsx esi, word [esp + 0x2a]
movsx edi, word [esp + 0x28]
movsx ecx, word [esp + 0x2c]
movsx edx, word [esp + 0x3c]
add ecx, edi
add edx, esi
movsx ecx, cx
movsx edx, dx
mov dword [esp + 0x10], eax
movsx eax, bx
movsx ebx, word [esp + 0x38]
add eax, esi
add ebx, edi
movsx eax, ax
push eax
push ecx
movsx eax, bx
push edx
push eax
mov ecx, ebp
call fcn.00492360
movsx eax, word [esp + 0x20]
movsx edx, word [esp + 0x34]
movsx ecx, word [esp + 0x14]
add eax, esi
add edx, esi
movsx esi, word [esp + 0x10]
movsx eax, ax
add ecx, edi
add esi, edi
movsx ecx, cx
push eax
push ecx
movsx edx, dx
movsx eax, si
push edx
push eax
mov ecx, ebp
call fcn.00492360
xor edi, edi
mov eax, dword [ebp + 0x1c]
mov ebx, dword [esp + 0x48]
cmp eax, edi
je 0x495b20
cmp ebx, edi
je 0x495b20
mov esi, dword [esp + 0x108]
lea ecx, [esp + 0x54]
push esi
push ecx
lea edx, [esp + 0x78]
push edi
push edx
mov ecx, ebx
call fcn.004a8cf0
mov ecx, eax
call fcn.004b4d00
mov ecx, dword [eax]
push edi
mov dword [esp + 0x50], ecx
push 1
mov eax, dword [eax + 4]
mov dword [esp + 0x58], eax
movsx eax, word [esp + 0x56]
movsx ecx, cx
mov word [esp + 0x1c], cx
mov word [esp + 0x1e], ax
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x44], edx
movsx edx, word [esi + 2]
movsx esi, word [esi]
movsx eax, ax
movsx edx, dx
sub eax, edx
movsx ecx, cx
movsx edx, si
sub ecx, edx
mov edx, dword [esp + 0x70]
mov word [esp + 0x1c], cx
mov ecx, dword [esp + 0x74]
mov word [esp + 0x1e], ax
mov eax, dword [esp + 0x1c]
push ecx
push edx
lea ecx, [esp + 0x4c]
lea edx, [esp + 0x3c]
mov dword [esp + 0x3c], eax
mov eax, dword [ebp + 0x1c]
push ecx
push edx
push ebx
push eax
call fcn.00474b30
add esp, 0x20
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x60]
mov dword [ebp + 0x1c], ebx
mov dword [eax], ecx
mov ecx, dword [esp + 0x64]
mov dword [eax + 4], edx
mov dword [eax + 8], ecx
lea ecx, [esp + 0xe0]
mov dword [esp + 0x100], 0xffffffff
call fcn.004a8ce0
mov ecx, dword [esp + 0xf8]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0xf4
ret 0x14