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

Disassembly:
sub esp, 0x54
xor eax, eax
push ebx
mov al, byte [0x607f40]
mov ebx, dword [esp + 0x74]
mov ecx, eax
mov edx, ebx
shr eax, 1
and ecx, 1
and eax, 1
push esi
push edi
lea ecx, [ecx + eax + 1]
mov edi, dword [esp + 0x64]
shl edx, cl
mov dword [esp + 0x4c], ecx
xor eax, eax
mov dword [esp + 0x2c], 0
mov ecx, edx
mov esi, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x68]
mov ecx, edx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x6c]
mov ecx, edx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x70]
mov ecx, edx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x74]
mov ecx, edx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esp + 0x78]
mov ecx, edx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
test ebx, ebx
rep stosb byte es:[edi], al
je 0x4a08ba
push ebp
mov ecx, dword [0x608464]
mov esi, ebx
shl esi, 0x10
cmp ecx, esi
jge 0x4a044e
mov eax, ecx
and eax, 0xffff0000
mov dword [esp + 0x10], eax
mov esi, eax
mov eax, dword [0x6085f8]
cmp eax, esi
jge 0x4a0462
and eax, 0xffff0000
mov dword [esp + 0x10], eax
mov esi, eax
sub ecx, esi
cmp ecx, 0x10000
mov dword [0x608464], ecx
jge 0x4a048a
call fcn.004a13e0
mov eax, dword [0x607f88]
mov ecx, dword [0x608464]
add ecx, eax
mov dword [0x608464], ecx
mov eax, dword [0x6085f8]
sub eax, esi
cmp eax, 0x10000
mov dword [0x6085f8], eax
jge 0x4a04b4
call fcn.004a0bd0
mov ecx, dword [0x6083e0]
mov eax, dword [0x6085f8]
add eax, ecx
mov dword [0x6085f8], eax
xor edx, edx
xor eax, eax
mov dl, byte [0x6085a0]
mov al, byte [0x6083e5]
add edx, eax
mov dword [esp + 0x48], 0
sar esi, 0x10
test edx, edx
mov dword [esp + 0x10], esi
jle 0x4a0890
mov edi, 0x6059f4
mov al, byte [edi - 4]
test al, al
je 0x4a0867
mov al, byte [edi - 5]
test al, al
je 0x4a0867
mov ebp, dword [edi + 0x4e]
test ebp, ebp
je 0x4a0867
mov eax, dword [edi - 0xc]
test eax, eax
jne 0x4a051f
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x78]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x3c], edx
jmp 0x4a0533
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x74]
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x3c], edx
mov si, word [edi]
mov cl, byte [0x607f40]
mov dword [esp + 0x38], eax
mov eax, esi
shr ecx, 1
and eax, 0xffff
and ecx, 2
xor edx, edx
cmp ebp, 0x10000
setge dl
dec edx
mov ebx, eax
and edx, 2
and eax, 0x7fff
and ecx, edx
mov dl, byte [edi + 0x38]
shr edx, 2
shr ebx, 0xd
and edx, 1
and ebx, 4
or edx, ebx
or ecx, edx
mov dword [esp + 0x54], ecx
mov cx, word [edi + 2]
and ecx, 0x7fff
sub ecx, eax
je 0x4a05aa
cmp ecx, 0xfffffe00
jge 0x4a0598
mov ecx, 0xfffffe00
jmp 0x4a05a5
cmp ecx, 0x200
jle 0x4a05a5
mov ecx, 0x200
add ecx, esi
mov word [edi], cx
mov cx, word [edi]
and ecx, 0x7fff
lea eax, [ecx - 0x4000]
cdq
mov esi, eax
mov eax, 0x4000
xor esi, edx
sub esi, edx
movsx edx, word [edi + 0x22]
sub eax, esi
xor esi, esi
imul eax, edx
xor edx, edx
mov si, word [edi + 4]
mov dx, word [edi + 0x28]
sar eax, 0xf
imul eax, edx
sar eax, 0xf
add eax, ecx
xor ecx, ecx
mov cx, word [edi - 2]
mov ebx, eax
imul esi, ecx
movsx edx, word [edi + 0x10]
sar esi, 0xf
imul esi, edx
xor ecx, ecx
xor edx, edx
mov cx, word [edi + 0x16]
mov dx, word [edi + 0x52]
sar esi, 0xf
imul esi, ecx
sar esi, 0xf
imul esi, edx
sar esi, 0xf
imul ebx, esi
xor edx, edx
xor ecx, ecx
mov dx, word [edi + 8]
mov cx, word [edi + 0xa]
imul edx, esi
imul ecx, esi
sar ebx, 0xf
mov dword [esp + 0x34], ebx
mov ebx, esi
mov ebp, dword [esp + 0x34]
sar edx, 7
sub ebx, ebp
mov ebp, edx
sar ecx, 7
imul ebp, eax
mov dword [esp + 0x60], ebx
mov ebx, ecx
imul ebx, eax
lea eax, [edi + 0x38]
mov dword [esp + 0x18], eax
lea eax, [edi + 0x36]
mov dword [esp + 0x2c], eax
lea eax, [edi + 0x32]
sar ebp, 0xf
mov dword [esp + 0x24], eax
sub edx, ebp
sar ebx, 0xf
lea eax, [edi + 0x4e]
sub ecx, ebx
mov dword [esp + 0x58], edx
mov dword [esp + 0x14], eax
xor edx, edx
lea eax, [edi - 5]
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x28], edx
mov dword [esp + 0x44], eax
jmp 0x4a068e
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
test byte [eax], 8
je 0x4a06c3
mov cl, byte [edi + 0x38]
lea eax, [edi + 0x38]
test cl, 0x80
mov dword [esp + 0x18], eax
jne 0x4a06ba
test byte [edi - 8], 0x80
je 0x4a06ba
mov ecx, dword [edi + 0x4e]
lea eax, [edi + 0x4e]
test ecx, ecx
mov dword [esp + 0x14], eax
jge 0x4a06c3
mov ecx, dword [edi + 0x42]
mov dword [esp + 0x20], ecx
jmp 0x4a06ca
mov eax, dword [edi + 0x46]
mov dword [esp + 0x20], eax
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
sub eax, dword [ecx]
mov ecx, dword [esp + 0x10]
sub ecx, edx
cmp eax, ecx
mov dword [esp + 0x4c], ecx
jle 0x4a06e4
mov eax, ecx
sub edx, dword [esp + 0x10]
cmp eax, edx
jge 0x4a06ee
mov eax, edx
mov ecx, dword [esp + 0x2c]
xor edx, edx
shl eax, 0x10
mov dx, word [ecx]
mov ecx, dword [esp + 0x14]
sub eax, edx
cdq
idiv dword [ecx]
mov ecx, dword [esp + 0x4c]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jle 0x4a0716
mov dword [esp + 0x1c], ecx
mov eax, ecx
test esi, esi
je 0x4a078f
mov ecx, dword [esp + 0x30]
lea eax, [edi + 0x4e]
mov dword [esp + 0x14], eax
lea eax, [edi + 0x32]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
add eax, ecx
mov ecx, dword [esp + 0x50]
shl eax, cl
mov ecx, dword [esp + 0x54]
lea edx, [edi + 0x36]
push ecx
mov ecx, dword [esp + 0x5c]
push ebp
push ecx
mov ecx, dword [esp + 0x68]
push ebx
push ecx
mov ecx, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x78]
push ecx
mov ecx, dword [edi + 0x4e]
push ecx
xor ecx, ecx
mov cx, word [edx]
mov dword [esp + 0x4c], edx
mov edx, dword [edi + 0x32]
push ecx
mov ecx, dword [esp + 0x40]
push edx
mov edx, dword [esp + 0x60]
push ecx
mov ecx, dword [esp + 0x68]
add edx, eax
push edx
mov edx, dword [esp + 0x70]
add ecx, eax
add edx, eax
push ecx
push edx
call dword [0x608600]
mov eax, dword [esp + 0x54]
add esp, 0x38
mov ecx, dword [esp + 0x14]
xor edx, edx
imul eax, dword [ecx]
mov ecx, dword [esp + 0x2c]
mov dx, word [ecx]
add eax, edx
mov word [ecx], ax
mov ecx, dword [esp + 0x24]
sar eax, 0x10
mov edx, dword [ecx]
add edx, eax
mov eax, dword [esp + 0x14]
mov dword [ecx], edx
mov ecx, edx
mov edx, dword [eax]
mov eax, dword [esp + 0x20]
test edx, edx
jge 0x4a07c7
sub eax, ecx
mov ecx, eax
jmp 0x4a07c9
sub ecx, eax
test ecx, ecx
mov dword [esp + 0x20], ecx
jl 0x4a083b
mov ax, word [edi + 0x38]
lea edx, [edi + 0x38]
test al, 8
mov dword [esp + 0x18], edx
je 0x4a07ee
test al, 0x80
mov dword [esp + 0x18], edx
jne 0x4a07ff
test byte [edi - 8], 0x80
je 0x4a07ff
cmp dword [edi + 0x4e], 0
lea ecx, [edi + 0x4e]
mov dword [esp + 0x14], ecx
jge 0x4a0831
mov ecx, dword [esp + 0x20]
test al, 0x10
mov dword [esp + 0x18], edx
je 0x4a0821
mov edx, dword [edi + 0x42]
mov eax, dword [edi + 0x3e]
mov dword [edi + 0x3e], edx
mov dword [edi + 0x42], eax
mov edx, dword [edi + 0x4e]
lea eax, [edi + 0x4e]
neg edx
mov dword [esp + 0x14], eax
mov dword [eax], edx
mov edx, dword [edi + 0x3e]
lea eax, [edi + 0x32]
add edx, ecx
mov dword [esp + 0x24], eax
mov dword [eax], edx
jmp 0x4a083b
lea eax, [edi - 5]
mov dword [esp + 0x44], eax
mov byte [eax], 0
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x1c]
add eax, ecx
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x28], eax
cmp byte [ecx], 0
je 0x4a085c
cmp eax, dword [esp + 0x10]
jl 0x4a068a
mov esi, dword [esp + 0x10]
mov ebx, dword [esp + 0x80]
mov eax, dword [esp + 0x48]
xor edx, edx
mov dl, byte [0x6085a0]
xor ecx, ecx
mov cl, byte [0x6083e5]
inc eax
add edx, ecx
add edi, 0x94
cmp eax, edx
mov dword [esp + 0x48], eax
jl 0x4a04e1
mov edi, dword [0x6083e8]
mov ecx, dword [esp + 0x30]
sub ebx, esi
add edi, esi
add ecx, esi
mov dword [0x6083e8], edi
test ebx, ebx
mov dword [esp + 0x80], ebx
mov dword [esp + 0x30], ecx
jne 0x4a0432
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x54
ret