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

Disassembly:
sub esp, 0x10
mov eax, dword [esp + 0x18]
push ebx
xor ebx, ebx
imul eax, eax, 0x288
push ebp
mov ebp, dword [0x4b5b24]
push esi
push edi
mov dword [esp + 0x10], eax
lea ecx, [ecx]
mov eax, 0x55555556
imul ebx
mov edi, edx
shr edi, 0x1f
xor esi, esi
add edi, edx
mov ecx, dword [ebp + 0x2124]
mov eax, esi
shr eax, 2
lea eax, [eax + eax*4]
lea edx, [ecx + eax*4]
mov eax, dword [esp + 0x10]
add edx, edi
cmp byte [edx + eax + 0x134], 0x30
je 0x40dcfc
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x34]
lea eax, [ebx + ecx]
mov ecx, dword [esp + 0x30]
push edx
lea edx, [esi + ecx + 4]
push edx
lea edx, [eax + 3]
push edx
add ecx, esi
push ecx
push eax
call fcn.0043ea40
mov ebp, dword [0x4b5b24]
add esp, 0x14
add esi, 4
cmp esi, 0x3c
jl 0x40dcb0
add ebx, 3
cmp ebx, 0x3c
jl 0x40dca0
mov edi, dword [0x4b5b30]
mov edx, dword [edi + 0x78]
mov eax, dword [edi + 0x74]
lea ecx, [eax + edx*8 + 8]
movsx esi, byte [ecx + ebp]
sub esi, 0x61
jns 0x40dd48
push 0x2b7
push str..landscape.cpp
push str.map___0
call fcn.00449840
mov ebp, dword [0x4b5b24]
mov edi, dword [0x4b5b30]
add esp, 0xc
cmp esi, dword [ebp + 0x2114]
jl 0x40dd73
push 0x2b8
push str..landscape.cpp
push str.map___g_pLevel__NumOfMaps
call fcn.00449840
mov ebp, dword [0x4b5b24]
mov edi, dword [0x4b5b30]
add esp, 0xc
cmp esi, dword [esp + 0x28]
jne 0x40de32
mov eax, dword [esp + 0x24]
mov ecx, dword [eax + 0x78]
cmp ecx, 0xff
mov byte [esp + 0x2a], 0
mov byte [esp + 0x29], 0
mov byte [esp + 0x28], 0
mov byte [esp + 0x2b], cl
jle 0x40dda4
mov byte [esp + 0x2b], 0xff
mov eax, dword [eax + 0xc]
movsx ecx, word [eax + 2]
movsx esi, word [eax]
mov edx, dword [esp + 0x28]
push edx
push ecx
push esi
push 0
push 0
push eax
mov eax, dword [0x4b5b20]
push ecx
mov ecx, dword [eax + 0xd4]
add ecx, dword [edi + 0xc]
mov eax, 0xdd67c8a7
imul ecx
add edx, ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov edx, dword [esp + 0x4c]
lea eax, [edx + ecx*4 - 3]
mov ecx, dword [edi + 8]
push esi
push eax
mov eax, 0x66666667
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*2]
mov eax, esi
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
add ecx, dword [esp + 0x50]
mov byte [esp + 0x59], 2
mov byte [esp + 0x58], 3
mov byte [esp + 0x5a], 1
mov byte [esp + 0x5b], 0x1e
mov edx, dword [esp + 0x58]
push ecx
push edx
call fcn.0043f3f0
mov ebp, dword [0x4b5b24]
add esp, 0x2c
mov ecx, dword [ebp + 0x2124]
mov edx, dword [esp + 0x10]
xor eax, eax
cmp dword [ecx + edx + 0x260], eax
mov dword [esp + 0x18], eax
jle 0x40df86
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0x2124]
mov ecx, dword [esp + 0x10]
mov edx, dword [eax + ecx + 0x264]
mov eax, dword [esp + 0x14]
mov ecx, dword [edx + eax]
lea esi, [edx + eax]
mov eax, 0x66666667
imul ecx
mov ecx, dword [0x4b5b20]
mov edi, dword [ecx + 0xd4]
mov ecx, dword [esi + 4]
sar edx, 4
mov esi, dword [esi + 8]
mov eax, edx
shr eax, 0x1f
add eax, edx
add ecx, edi
lea ebx, [eax + eax*2]
mov eax, 0xdd67c8a7
imul ecx
add edx, ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add esi, edi
mov eax, 0xdd67c8a7
imul esi
add edx, esi
sar edx, 5
mov eax, edx
add ecx, ecx
shr eax, 0x1f
add ecx, ecx
add eax, edx
lea esi, [eax*4 - 2]
lea edi, [ecx + 6]
cmp esi, edi
jge 0x40df5f
mov ecx, dword [esp + 0x2c]
lea edx, [ebx + ecx - 1]
mov byte [esp + 0x2a], 0
mov byte [esp + 0x29], 0
mov byte [esp + 0x28], 0
mov byte [esp + 0x35], 2
mov byte [esp + 0x34], 3
mov byte [esp + 0x36], 1
mov byte [esp + 0x37], 0x1e
mov dword [esp + 0x1c], edx
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + 0x78]
cmp eax, 0xff
mov byte [esp + 0x2b], al
jle 0x40df1a
mov byte [esp + 0x2b], 0xff
mov eax, dword [ebx + 0x14]
movsx ecx, word [eax + 2]
movsx edx, word [eax]
mov ebp, dword [esp + 0x28]
push ebp
push ecx
push edx
push 0
push 0
push eax
mov eax, dword [esp + 0x48]
push ecx
push edx
mov edx, dword [esp + 0x3c]
lea ecx, [esi + eax]
mov eax, dword [esp + 0x54]
push ecx
push edx
push eax
call fcn.0043f3f0
mov ecx, dword [ebx + 0x14]
movsx edx, word [ecx + 2]
add esi, edx
add esp, 0x2c
cmp esi, edi
jl 0x40df03
mov ebp, dword [0x4b5b24]
mov eax, dword [esp + 0x18]
mov ecx, dword [ebp + 0x2124]
mov edx, dword [esp + 0x10]
add dword [esp + 0x14], 0xc
add eax, 1
cmp eax, dword [ecx + edx + 0x260]
mov dword [esp + 0x18], eax
jl 0x40de53
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0x14