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

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x6ca1d0
push eax
mov dword fs:[0], esp
sub esp, 0x58
push ebx
push ebp
mov ebp, dword [esp + 0x70]
mov eax, dword [ebp]
push esi
push edi
mov esi, ecx
push 0x10
lea ecx, [esp + 0x5c]
push ecx
mov ecx, ebp
call dword [eax + 0x10]
test al, al
je 0x5b047a
cmp dword [esp + 0x58], 0x50414d58
jne 0x5b047a
mov eax, dword [esp + 0x5c]
cmp eax, 7
je 0x5afd98
cmp eax, 3
je 0x5afd98
cmp eax, 5
je 0x5afd98
cmp eax, 6
je 0x5afd98
cmp eax, 0xa
jne 0x5b047a
mov edx, dword [esp + 0x64]
mov eax, dword [esp + 0x60]
push edx
push eax
mov ecx, esi
call fcn.0059cef0
mov edx, dword [ebp]
push 8
lea eax, [esp + 0x2c]
push eax
mov ecx, ebp
call dword [edx + 0x10]
test al, al
je 0x5b047a
mov eax, dword [esp + 0x28]
cmp eax, 0x49444441
ja 0x5b0121
je 0x5b00af
cmp eax, 0x444e4520
je 0x5b03ad
cmp eax, 0x4548544f
je 0x5aff90
cmp eax, 0x454c4954
jne 0x5b0133
push 0x6efa94
call fcn.0040f210
mov ebx, dword [esi + 0x44]
mov eax, dword [esp + 0x60]
imul ebx, dword [esi + 0x40]
add esp, 4
cmp eax, 3
jne 0x5afe89
cmp dword [esp + 0x2c], ebx
jne 0x5b047a
test ebx, ebx
jbe 0x5b0391
xor edi, edi
mov edx, dword [ebp]
push 8
lea eax, [esp + 0x34]
push eax
mov ecx, ebp
call dword [edx + 0x10]
mov ecx, dword [esi + 0x50]
mov dl, byte [esp + 0x34]
mov byte [edi + ecx + 3], dl
mov eax, dword [esi + 0x50]
mov cl, byte [esp + 0x35]
mov byte [edi + eax + 4], cl
mov edx, dword [esi + 0x50]
mov ax, word [esp + 0x30]
mov word [edi + edx], ax
mov ecx, dword [esi + 0x50]
mov dl, byte [esp + 0x32]
mov byte [edi + ecx + 2], dl
mov eax, dword [esi + 0x50]
mov byte [edi + eax + 6], 0
mov ecx, dword [esi + 0x50]
mov dword [edi + ecx + 7], 0
mov edx, dword [esi + 0x50]
mov byte [edi + edx + 5], 0xff
add edi, 0xf
dec ebx
jne 0x5afe27
jmp 0x5b0391
cmp eax, 5
mov ecx, dword [esp + 0x2c]
jne 0x5afef1
lea eax, [ebx + ebx*4]
cmp ecx, eax
jne 0x5b047a
test ebx, ebx
jbe 0x5b0391
xor edi, edi
mov edx, dword [ebp]
push 5
lea eax, [esp + 0x1c]
push eax
mov ecx, ebp
call dword [edx + 0x10]
mov edx, dword [esi + 0x50]
push 5
lea ecx, [esp + 0x1c]
push ecx
add edx, edi
push edx
call fcn.0062f860
mov eax, dword [esi + 0x50]
mov dword [edi + eax + 7], 0
mov ecx, dword [esi + 0x50]
mov byte [edi + ecx + 6], 0
mov edx, dword [esi + 0x50]
mov byte [edi + edx + 5], 0xff
add esp, 0xc
add edi, 0xf
dec ebx
jne 0x5afea7
jmp 0x5b0391
cmp eax, 0xa
lea eax, [ebx + ebx*2]
jne 0x5aff4e
shl eax, 1
cmp ecx, eax
jne 0x5b047a
push 0x6efa84
call fcn.0040f210
add esp, 4
test ebx, ebx
jbe 0x5b0391
xor edi, edi
lea ebx, [ebx]
mov eax, dword [esi + 0x50]
mov edx, dword [ebp]
push 6
add eax, edi
push eax
mov ecx, ebp
call dword [edx + 0x10]
mov ecx, dword [esi + 0x50]
mov byte [edi + ecx + 6], 0
mov edx, dword [esi + 0x50]
mov dword [edi + edx + 0xb], 0
add edi, 0xf
dec ebx
jne 0x5aff20
jmp 0x5b0391
shl eax, 1
cmp ecx, eax
jne 0x5b047a
test ebx, ebx
jbe 0x5b0391
xor edi, edi
mov eax, dword [esi + 0x50]
mov edx, dword [ebp]
push 6
add eax, edi
push eax
mov ecx, ebp
call dword [edx + 0x10]
mov ecx, dword [esi + 0x50]
mov byte [edi + ecx + 6], 0
mov edx, dword [esi + 0x50]
mov dword [edi + edx + 7], 0
add edi, 0xf
dec ebx
jne 0x5aff62
jmp 0x5b0391
push 0x6efa6c
call fcn.0040f210
mov eax, dword [esp + 0x60]
add esp, 4
cmp eax, 0xa
jne 0x5b0080
mov eax, dword [esp + 0x2c]
lea edx, [eax + 0xe]
mov eax, 0x88888889
mul edx
shr edx, 3
lea ecx, [esi + 0x10]
push edx
call fcn.0059cc10
xor ebx, ebx
xor edi, edi
jmp 0x5affd0
mov eax, dword [esi + 0x14]
test eax, eax
je 0x5b0391
mov ecx, dword [esi + 0x18]
sub ecx, eax
mov eax, 0xb21642c9
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x5b0391
mov eax, dword [ebp]
push 0xf
lea ecx, [esp + 0x3c]
push ecx
mov ecx, ebp
call dword [eax + 0x10]
mov eax, dword [esi + 0x14]
mov dx, word [esp + 0x45]
mov word [eax + edi + 0xd], dx
mov ecx, dword [esp + 0x3f]
add eax, edi
mov eax, dword [esi + 0x14]
mov dword [eax + edi + 7], ecx
mov dx, word [esp + 0x43]
add eax, edi
mov eax, dword [esi + 0x14]
mov word [eax + edi + 0xb], dx
mov ecx, dword [esp + 0x38]
add eax, edi
mov eax, dword [esi + 0x14]
mov dword [eax + edi], ecx
mov dx, word [esp + 0x3d]
add eax, edi
mov eax, dword [esi + 0x14]
mov word [eax + edi + 5], dx
mov cl, byte [esp + 0x3c]
add eax, edi
mov eax, dword [esi + 0x14]
add eax, edi
mov byte [eax + 4], cl
mov eax, dword [esi + 0x14]
mov dx, word [esp + 0x38]
add eax, edi
mov word [eax], dx
mov eax, dword [esi + 0x14]
mov cx, word [esp + 0x3a]
add eax, edi
inc ebx
mov word [eax + 2], cx
add edi, 0x17
jmp 0x5affd0
mov edx, dword [esp + 0x2c]
add edx, 0xc
mov eax, 0x4ec4ec4f
mul edx
shr edx, 2
push edx
mov ecx, esi
call fcn.0059cbe0
mov ecx, dword [esp + 0x2c]
mov eax, dword [esi + 4]
mov edx, dword [ebp]
push ecx
push eax
mov ecx, ebp
call dword [edx + 0x10]
jmp 0x5b0391
xor eax, eax
sub esp, 0xc
mov ecx, eax
mov edx, esp
mov dword [edx], eax
mov dword [edx + 4], ecx
mov byte [edx + 8], al
mov eax, dword [esp + 0x38]
lea ecx, [eax + 8]
mov eax, 0x38e38e39
mul ecx
shr edx, 1
lea edi, [esi + 0x30]
push edx
mov ecx, edi
call fcn.0059b860
mov ecx, dword [esp + 0x2c]
mov eax, dword [esi + 0x34]
mov edx, dword [ebp]
push ecx
push eax
mov ecx, ebp
call dword [edx + 0x10]
mov eax, dword [edi + 4]
test eax, eax
je 0x5b0108
mov edi, dword [edi + 8]
sub edi, eax
mov eax, 0x38e38e39
imul edi
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
mov ecx, dword [esi + 0x34]
push 0x5af850
push 9
push eax
push ecx
call fcn.00631c80
add esp, 0x10
jmp 0x5b0391
cmp eax, 0x52455453
je 0x5b0284
cmp eax, 0x52524554
je 0x5b0157
push 0x6efa58
call fcn.0040f210
mov edi, dword [ebp]
add esp, 4
mov ecx, ebp
call dword [edi + 4]
add eax, dword [esp + 0x2c]
push eax
mov ecx, ebp
call dword [edi + 8]
jmp 0x5b0391
push 0x6efa3c
call fcn.0040f210
mov eax, dword [esp + 0x60]
add esp, 4
cmp eax, 3
jne 0x5b01c9
mov eax, dword [esi + 0x44]
add eax, 3
cdq
and edx, 3
add eax, edx
mov ebx, eax
mov eax, dword [esi + 0x40]
sar ebx, 2
inc eax
cdq
sub eax, edx
sar eax, 1
imul ebx, eax
mov eax, dword [esp + 0x2c]
lea edx, [ebx + ebx*2]
shl edx, 1
cmp eax, edx
jne 0x5b047a
xor edi, edi
test ebx, ebx
jbe 0x5b0391
mov eax, dword [ebp]
push 6
lea ecx, [esp + 0x24]
push ecx
mov ecx, ebp
call dword [eax + 0x10]
movzx edx, word [esp + 0x20]
mov eax, dword [esi + 0x48]
mov dword [eax + edi*4], edx
inc edi
cmp edi, ebx
jb 0x5b01a5
jmp 0x5b0391
cmp eax, 0xa
jne 0x5b0200
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x40]
push ecx
push edx
mov ecx, esi
call fcn.005985e0
mov ecx, eax
mov eax, dword [esp + 0x2c]
shl ecx, 2
cmp eax, ecx
jne 0x5b047a
mov edx, dword [ebp]
push eax
mov eax, dword [esi + 0x48]
push eax
mov ecx, ebp
call dword [edx + 0x10]
jmp 0x5b0391
mov ecx, dword [esp + 0x2c]
push ecx
push 0x6efa24
call fcn.0040f210
mov edx, dword [esi + 0x44]
mov eax, dword [esi + 0x40]
add esp, 8
push edx
push eax
mov ecx, esi
call fcn.005985e0
shl eax, 1
push eax
push str.CalculateTerrainCount_m_width_m_height_:_d_n
call fcn.0040f210
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x40]
add esp, 8
push ecx
push edx
mov ecx, esi
call fcn.005985e0
mov ecx, dword [esp + 0x2c]
mov ebx, eax
lea eax, [ebx + ebx]
cmp ecx, eax
jne 0x5b047a
xor edi, edi
test ebx, ebx
jbe 0x5b0391
jmp 0x5b0260
mov edx, dword [ebp]
push 2
lea eax, [esp + 0x7c]
push eax
mov ecx, ebp
call dword [edx + 0x10]
movzx ecx, word [esp + 0x78]
mov edx, dword [esi + 0x48]
mov dword [edx + edi*4], ecx
inc edi
cmp edi, ebx
jb 0x5b0260
jmp 0x5b0391
push 0x6ef9d8
call fcn.0040f210
mov eax, dword [esp + 0x60]
add esp, 4
cmp eax, 7
jne 0x5b02ca
mov eax, dword [esi + 0x44]
inc eax
cdq
sub eax, edx
mov ecx, eax
mov eax, dword [esp + 0x2c]
sar ecx, 1
imul ecx, dword [esi + 0x40]
shl ecx, 2
cmp eax, ecx
jne 0x5b047a
mov edx, dword [ebp]
push eax
mov eax, dword [esi + 0x4c]
push eax
mov ecx, ebp
call dword [edx + 0x10]
jmp 0x5b0391
cmp eax, 0xa
je 0x5b029a
mov ecx, dword [0x74f090]
mov dword [esp + 0x10], ecx
xor ebx, ebx
mov dword [esp + 0x70], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov eax, dword [esi + 0x44]
inc eax
cdq
sub eax, edx
sar eax, 1
imul eax, dword [esi + 0x40]
mov word [esp + 0x14], bx
mov edx, dword [esp + 0x14]
push edx
push eax
lea ecx, [esp + 0x50]
mov byte [esp + 0x78], 1
call fcn.005afcc0
mov edi, dword [esp + 0x4c]
cmp edi, ebx
jne 0x5b031d
xor eax, eax
jmp 0x5b0325
mov eax, dword [esp + 0x50]
sub eax, edi
sar eax, 1
lea ecx, [eax + eax]
mov eax, dword [esp + 0x2c]
cmp eax, ecx
jne 0x5b0471
mov edx, dword [ebp]
push eax
push edi
mov ecx, ebp
call dword [edx + 0x10]
xor ecx, ecx
cmp edi, ebx
je 0x5b0373
mov eax, dword [esp + 0x50]
sub eax, edi
sar eax, 1
cmp ecx, eax
jae 0x5b0373
mov ax, word [edi + ecx*2]
cmp ax, 0xffff
jne 0x5b0367
mov eax, dword [esi + 0x4c]
mov dword [eax + ecx*4], 0xffffffff
inc ecx
jmp 0x5b0340
movzx edx, ax
mov eax, dword [esi + 0x4c]
mov dword [eax + ecx*4], edx
inc ecx
jmp 0x5b0340
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x70], 0xffffffff
mov dword [0x74f090], ecx
mov edx, dword [ebp]
push 8
lea eax, [esp + 0x2c]
push eax
mov ecx, ebp
call dword [edx + 0x10]
test al, al
jne 0x5afdc0
jmp 0x5b047a
push 0x6ef9c0
call fcn.0040f210
add esp, 4
xor ebx, ebx
xor ebp, ebp
mov edi, edi
mov edi, dword [esi + 4]
test edi, edi
je 0x5b0406
mov ecx, dword [esi + 8]
sub ecx, edi
mov eax, 0x4ec4ec4f
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x5b0406
movzx eax, word [edi + ebp + 2]
imul eax, dword [esi + 0x40]
movzx edx, word [edi + ebp]
lea ecx, [edi + ebp]
add eax, edx
mov edx, dword [esi + 0x50]
imul eax, eax, 0xf
add eax, edx
je 0x5b0400
mov dword [eax + 7], ecx
inc ebx
add ebp, 0xd
jmp 0x5b03c0
xor edi, edi
xor ebx, ebx
lea ebx, [ebx]
mov eax, dword [esi + 0x14]
test eax, eax
je 0x5b045a
mov ecx, dword [esi + 0x18]
sub ecx, eax
mov eax, 0xb21642c9
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp edi, eax
jae 0x5b045a
mov eax, dword [esi + 0x14]
movzx edx, word [eax + ebx]
lea ecx, [eax + ebx]
movzx eax, word [ecx + 2]
imul eax, dword [esi + 0x40]
add eax, edx
mov edx, dword [esi + 0x50]
imul eax, eax, 0xf
add eax, edx
je 0x5b0454
mov dword [eax + 0xb], ecx
inc edi
add ebx, 0x17
jmp 0x5b0410
mov al, 1
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret 4
mov eax, dword [esp + 0x10]
mov dword [0x74f090], eax
mov ecx, dword [esp + 0x68]
pop edi
pop esi
pop ebp
xor al, al
mov dword fs:[0], ecx
pop ebx
add esp, 0x64
ret 4