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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push esi
mov dword [ebp - 0x5c], 0x12e0d
mov dword [ebp - 0x14], 0x74fc
mov dword [ebp - 0x10], 0x3c38
mov dword [ebp - 4], 0xe45e
mov dword [ebp - 8], 0x64c8
cmp dword [0x4306d0], 0
je 0x40a5bd
mov eax, 1
jmp 0x40a842
mov eax, dword [0x42fac0]
add eax, 0x1c
mov ecx, dword fs:[eax]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x38]
mov eax, dword [edx + 0xc]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0xc], 0
mov ecx, 4
shl ecx, 0
mov edx, dword [ebp - 0x3c]
mov eax, dword [edx + ecx + 8]
mov dword [ebp - 0x24], eax
jmp 0x40a607
mov ecx, 4
imul edx, ecx, 0
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + edx]
mov dword [ebp - 0x24], ecx
mov edx, dword [ebp - 0x24]
cmp dword [edx + 0x18], 0
je 0x40a6e1
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 0x18]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x40], edx
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x44]
add edx, 0x78
mov dword [ebp - 0x48], edx
mov eax, 8
imul ecx, eax, 0
mov edx, dword [ebp - 0x48]
mov eax, dword [edx + ecx]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x40a651
jmp 0x40a5f6
mov ecx, dword [ebp - 0xc]
add ecx, dword [ebp - 0x30]
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0xc]
mov dword [ebp - 0x4c], eax
mov ecx, dword [ebp - 0x4c]
push ecx
call fcn.004087d0
add esp, 4
cmp eax, 0xe6c05ed0
jne 0x40a6dc
mov edx, dword [0x42f9f4]
cmp edx, dword [ebp - 8]
jg 0x40a6da
mov eax, dword [ebp - 8]
cdq
idiv dword [ebp - 0x14]
mov esi, eax
mov eax, dword [ebp - 4]
cdq
idiv dword [ebp - 4]
mov ecx, edx
shl esi, cl
mov ecx, dword [ebp - 0x10]
sar esi, cl
mov dword [ebp - 4], esi
mov eax, dword [ebp - 4]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 8]
mov dword [ebp - 0x10], edx
imul eax, dword [ebp - 8], 0x15c29
imul eax, dword [ebp - 0x10]
cdq
idiv dword [ebp - 4]
mov eax, edx
cdq
idiv dword [ebp - 0x10]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
shl eax, cl
and eax, dword [ebp - 0x14]
mov dword [ebp - 4], eax
jmp 0x40a679
jmp 0x40a6e1
jmp 0x40a5f6
cmp dword [ebp - 0x18], 0
jne 0x40a6ee
xor eax, eax
jmp 0x40a842
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx + 0x18]
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
add ecx, dword [eax + 0x1c]
mov dword [ebp - 0x58], ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
add eax, dword [edx + 0x20]
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
add edx, dword [ecx + 0x24]
mov dword [ebp - 0x54], edx
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x28], 0x4306d4
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x50]
mov edx, dword [ebp - 0xc]
add edx, dword [ecx + eax*4 - 4]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x34]
movzx ecx, word [eax]
cmp ecx, 0x775a
jne 0x40a7fc
mov edx, dword [ebp - 0x34]
push edx
call fcn.00407b80
add esp, 4
imul ecx, dword [ebp - 0x1c], 0xc
mov edx, dword [ebp - 0x28]
mov dword [edx + ecx], eax
mov eax, dword [0x42f93c]
cmp eax, dword [ebp - 4]
jae 0x40a7cc
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x2c], ecx
jmp 0x40a77c
mov edx, dword [ebp - 0x2c]
sub edx, 1
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x2c]
cmp eax, dword [0x42f9f4]
jl 0x40a7ca
mov ecx, dword [ebp - 4]
imul ecx, dword [ebp - 8]
imul ecx, dword [ebp - 8]
sub ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0x14]
or ecx, 0xa92e
mov dword [ebp - 8], ecx
mov dword [ebp - 0x10], 0x1a5b3
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
imul eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x14]
lea edx, [eax + ecx + 0x53c6]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x14]
mov dword [ebp - 8], eax
jmp 0x40a773
jmp 0x40a761
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x54]
movzx eax, word [edx + ecx*2 - 2]
imul ecx, dword [ebp - 0x1c], 0xc
mov edx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x58]
mov eax, dword [esi + eax*4]
mov dword [edx + ecx + 4], eax
mov ecx, dword [ebp - 0x1c]
add ecx, 1
mov dword [ebp - 0x1c], ecx
cmp dword [ebp - 0x1c], 0x226
jne 0x40a7fc
jmp 0x40a80b
mov edx, dword [ebp - 0x20]
sub edx, 1
mov dword [ebp - 0x20], edx
jne 0x40a729
mov eax, dword [ebp - 0x1c]
mov dword [0x4306d0], eax
mov ecx, dword [0x4306d0]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call fcn.00409af0
add esp, 8
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [0x4306d0]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call fcn.0040a330
add esp, 0xc
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret