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

Disassembly:
sub esp, 0x64
push ebx
push ebp
mov ebp, dword [esp + 0x74]
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, edi
mov ebp, dword [ebp + 4]
mov ebx, edi
movzx eax, bp
mov ecx, ebp
shr ebx, 0xa
shr esi, 0x14
and ebx, 0x3ff
mov dword [esp + 0x24], eax
add ebx, ebx
mov word [esp + 0x2c], ax
xor eax, eax
shl esi, 3
push esi
mov word [esp + 0x34], ax
lea eax, [esp + 0x30]
shr ecx, 0x10
push ebx
push eax
mov dword [esp + 0x40], ebp
mov dword [esp + 0x34], ecx
mov word [esp + 0x3a], cx
call fcn.004ab140
movzx eax, word [esp + 0x38]
and edi, 0x3ff
add edi, edi
mov word [esp + 0x48], ax
movzx eax, word [esp + 0x3a]
sub ebx, edi
sub ebx, 0x200
mov word [esp + 0x4a], ax
and ebx, 0x7ff
mov dword [esp + 0x1c], esi
mov ecx, 0x200
add esp, 0xc
sub ecx, edi
and ecx, 0x7ff
mov eax, dword [ebx*4 + 0x596de0]
mov dword [esp + 0x20], eax
mov eax, dword [ebx*4 + 0x5975e0]
mov dword [esp + 0x14], eax
mov eax, dword [ecx*4 + 0x596de0]
mov dword [esp + 0x1c], eax
mov eax, dword [ecx*4 + 0x5975e0]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x10]
imul dword [esp + 0x14]
shl edx, 0x10
shr eax, 0x10
or eax, edx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x10]
imul dword [esp + 0x20]
shl edx, 0x10
shr eax, 0x10
or eax, edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
imul dword [esp + 0x1c]
shl edx, 0x10
shr eax, 0x10
or eax, edx
lea ecx, [eax + ebp]
mov eax, dword [esp + 0x14]
imul dword [esp + 0x18]
shl edx, 0x10
shr eax, 0x10
or eax, edx
mov esi, eax
mov eax, dword [esp + 0x10]
imul dword [esp + 0x18]
shl edx, 0x10
shr eax, 0x10
or eax, edx
mov edi, eax
mov eax, dword [esp + 0x10]
imul dword [esp + 0x1c]
shl edx, 0x10
shr eax, 0x10
or eax, edx
mov word [esp + 0x38], cx
sub ebp, edi
mov edx, dword [esp + 0x36]
mov ecx, edx
sub edx, eax
mov word [esp + 0x40], bp
lea eax, [esp + 0x44]
mov word [esp + 0x42], dx
push eax
lea eax, [esp + 0x38]
sub ecx, esi
push eax
mov word [esp + 0x42], cx
call fcn.00497860
mov esi, dword [esp + 0x5c]
add esp, 8
sub esi, dword [esp + 0x48]
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x58]
sub eax, ecx
sub ecx, dword [esp + 0x4c]
imul esi, eax
mov eax, dword [esp + 0x60]
sub eax, dword [esp + 0x54]
imul eax, ecx
sub esi, eax
test esi, esi
jle 0x4998dc
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x40], eax
mov ebp, dword [esp + 0x7c]
mov eax, dword [ebp + 8]
and eax, 0x3ff
add eax, eax
movzx edi, ax
mov dword [esp + 0x20], eax
mov ebx, edi
mov eax, dword [esp + 0x3c]
sub eax, dword [esp + 0x24]
movzx edx, ax
lea esi, [edi + 0x200]
mov eax, dword [esp + 0x3e]
and esi, 0x7ff
sub eax, dword [esp + 0x28]
movzx ecx, ax
shr ebx, 9
cmp ecx, 0x8000
lea eax, [ecx - 0x10000]
cmovb eax, ecx
neg eax
cmp edx, 0x8000
push eax
lea eax, [edx - 0x10000]
cmovb eax, edx
push eax
call fcn.005510b4
mov edx, 0x7ff
mov cx, ax
and cx, dx
add esp, 8
mov edx, 0x600
cmp di, dx
jb 0x49995e
cmp cx, di
jae 0x499968
jmp 0x499963
cmp cx, di
jb 0x499972
cmp cx, si
jae 0x499972
mov esi, 4
lea edi, [esi - 1]
jmp 0x4999c7
lea eax, [esi + 0x200]
and eax, 0x7ff
cmp si, dx
jb 0x499989
cmp cx, si
jae 0x499993
jmp 0x49998e
cmp cx, si
jb 0x49999d
cmp cx, ax
jae 0x49999d
mov esi, 3
lea edi, [esi - 1]
jmp 0x4999c7
lea eax, [edi - 0x400]
and eax, 0x7ff
push eax
push ecx
call fcn.00498140
add esp, 8
test al, al
je 0x4999c0
mov esi, 2
lea edi, [esi - 1]
jmp 0x4999c7
mov esi, 1
xor edi, edi
lea eax, [esp + 0x44]
sub esi, ebx
push eax
lea eax, [esp + 0x38]
sub edi, ebx
push eax
and esi, 3
and edi, 3
call fcn.00497860
mov cx, word [esp + esi*4 + 0x3c]
lea eax, [esi + 2]
and eax, 3
mov bx, word [esp + edi*4 + 0x3e]
sub cx, 8
sub bx, 8
sar cx, 8
mov esi, 0x100
and cl, 0xfe
sar bx, 8
movsx ax, byte [esp + eax*4 + 0x3d]
and bl, 0xfe
mov byte [esp + 0x84], cl
add esp, 8
mov word [esp + 0x10], cx
movzx ecx, cl
and eax, 0xfe
mov byte [esp + 0x7d], bl
sub eax, ecx
cdq
mov ecx, eax
mov eax, esi
xor ecx, edx
sub ecx, edx
sub eax, ecx
cmp ecx, 0x80
cmovle eax, ecx
lea ecx, [edi + 2]
cdq
and ecx, 3
sub eax, edx
sar eax, 1
inc eax
mov dword [esp + 0x18], eax
movsx ax, byte [esp + ecx*4 + 0x37]
movzx ecx, bl
and eax, 0xfe
sub eax, ecx
movzx ecx, word [esp + 0x7c]
cdq
xor eax, edx
mov word [esp + 0x7c], cx
sub eax, edx
sub esi, eax
cmp eax, 0x80
cmovle esi, eax
mov eax, esi
cdq
sub eax, edx
mov ecx, eax
sar ecx, 1
add ecx, 1
mov dword [esp + 0x14], ecx
je 0x499b77
mov ebx, dword [esp + 0x20]
xor edi, edi
mov dl, byte [esp + 0x7c]
mov al, byte [esp + 0x7d]
mov esi, dword [esp + 0x18]
mov dword [esp + 0x1c], esi
test esi, esi
je 0x499b5c
nop
movzx eax, word [esp + 0x7c]
mov ecx, eax
and eax, 0xfe
shr ecx, 1
and ecx, 0x7f00
or ecx, eax
shr ecx, 1
imul eax, ecx, 0x1a
movsx esi, word [eax + 0x5d769a]
mov esi, dword [esi*4 + 0x5c4ea4]
test esi, esi
je 0x499b38
nop dword [eax]
push ebx
lea eax, [esp + 0x48]
push eax
lea eax, [esi + 0x4d]
push eax
call fcn.00498190
add esp, 0xc
test al, al
je 0x499b25
test edi, edi
jne 0x499b18
cmp byte [ebp + 0xc], 0x79
mov dword [esp + 0x28], 1
je 0x499b13
call fcn.00477390
mov edi, dword [esp + 0x28]
jmp 0x499b18
mov edi, 1
movzx eax, word [esi + 0x29]
push eax
call fcn.00478e10
add esp, 4
movzx esi, word [esi + 0x25]
mov esi, dword [esi*4 + 0x5c4ea4]
test esi, esi
jne 0x499ae0
mov dl, byte [esp + 0x7c]
mov eax, dword [esp + 0x1c]
add dl, 2
dec eax
mov byte [esp + 0x7c], dl
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x499ab0
mov al, byte [esp + 0x7d]
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov dl, byte [esp + 0x10]
dec ecx
add al, 2
mov dword [esp + 0x14], ecx
mov byte [esp + 0x7d], al
mov byte [esp + 0x7c], dl
test ecx, ecx
jne 0x499aa3
push dword [esp + 0x78]
push 0
call fcn.00444dc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret