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

Disassembly:
sub esp, 0x13c
mov eax, dword [0x6285c8]
push ebx
mov ebx, ecx
push ebp
push esi
lea ecx, [esp + 0xf]
push edi
push ecx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x78], eax
xor edi, edi
call fcn.00405d90
lea edx, [esp + 0x13]
lea ecx, [esp + 0x18]
push edx
call fcn.00405d90
mov eax, dword [str..cfg]
mov ecx, dword [str.terrain_tilete]
push eax
lea edx, [esp + 0x48]
push ecx
push edx
call fcn.00415c00
add esp, 0xc
lea eax, [esp + 0x60]
lea ecx, [esp + 0x44]
push eax
call fcn.00470dc0
mov eax, dword [eax]
lea ecx, [esp + 0x60]
push ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x38], eax
call fcn.005d8060
mov eax, dword [eax]
mov ecx, dword [esp + 0x34]
cmp ecx, eax
je 0x4d6057
mov edx, dword [ecx + 0x10]
lea ecx, [esp + 0x28]
push edx
call fcn.00415e80
lea eax, [esp + 0x50]
lea ecx, [esp + 0x28]
push eax
call fcn.004165e0
mov ebp, dword [esp + 0x54]
mov ecx, dword [esp + 0x50]
sub ebp, ecx
sar ebp, 2
je 0x4d620e
xor eax, eax
lea esi, [edi + ebp]
push eax
lea ecx, [esp + 0xb8]
mov dword [esp + 0x6c], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x60], esi
call fcn.005bdf70
push eax
push esi
lea ecx, [ebx + 0x190]
call fcn.004d7980
lea ecx, [esp + 0xb4]
call fcn.005be120
lea ecx, [esp + 0x84]
add ebx, 0x10
call fcn.004d9020
push eax
push esi
mov ecx, ebx
call fcn.004d7ce0
lea ecx, [esp + 0x84]
call fcn.00450760
xor ebx, ebx
test ebp, ebp
jle 0x4d600d
lea edi, [edi + edi*2]
shl edi, 4
mov dword [esp + 0x64], edi
call dword [0x609ac0]
mov eax, dword [esp + 0x50]
mov edx, dword [str.type]
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [eax + ebx*4]
push edx
push ecx
lea ecx, [esp + 0x34]
call fcn.00416920
test al, al
je 0x4d62af
mov eax, dword [esp + 0x24]
test eax, eax
jl 0x4d62af
cmp eax, esi
jge 0x4d62af
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
cmp eax, ecx
je 0x4d5f34
lea edx, [esp + 0x24]
push edx
push eax
call fcn.00414a00
mov eax, dword [esp + 0x44]
add esp, 8
add eax, 4
mov dword [esp + 0x3c], eax
jmp 0x4d5f45
lea ecx, [esp + 0x24]
push 1
push ecx
push eax
lea ecx, [esp + 0x44]
call fcn.0043bda0
mov ecx, dword [esp + 0x50]
mov eax, dword [str.texture]
lea edx, [esp + 0x68]
push edx
mov edx, dword [ecx + ebx*4]
push eax
push edx
lea ecx, [esp + 0x34]
call fcn.004169f0
test al, al
je 0x4d6250
mov esi, dword [esp + 0x68]
lea eax, [esp + 0x13]
push eax
lea ecx, [esp + 0x7c]
call fcn.00405d90
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, esi
push ecx
push esi
lea ecx, [esp + 0x80]
call fcn.00406380
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
cmp eax, ecx
je 0x4d5fbe
lea ecx, [esp + 0x78]
push ecx
push eax
call fcn.004252f0
mov eax, dword [esp + 0x24]
add esp, 8
add eax, 0xc
mov dword [esp + 0x1c], eax
jmp 0x4d5fcf
lea edx, [esp + 0x78]
push 1
push edx
push eax
lea ecx, [esp + 0x24]
call fcn.00424b00
lea ecx, [esp + 0x78]
call fcn.00406010
mov eax, dword [esp + 0x50]
mov esi, dword [esp + 0x64]
lea edx, [esp + 0x28]
mov ecx, dword [eax + ebx*4]
mov eax, dword [esp + 0x14]
add eax, 0x10
push ecx
mov ecx, esi
push edx
add ecx, dword [eax]
call fcn.0044fc60
inc ebx
add esi, 0x30
mov dword [esp + 0x64], esi
mov esi, dword [esp + 0x5c]
cmp ebx, ebp
jl 0x4d5ece
lea ecx, [esp + 0x50]
mov edi, esi
call fcn.0040ee80
lea ecx, [esp + 0x28]
call fcn.00416100
lea ecx, [esp + 0x28]
call fcn.004c9fb0
lea ecx, [esp + 0x34]
push ecx
call fcn.004149c0
add esp, 4
lea edx, [esp + 0x60]
lea ecx, [esp + 0x44]
push edx
call fcn.005d8060
mov eax, dword [eax]
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x14]
cmp ecx, eax
jne 0x4d5e31
lea ecx, [esp + 0x6c]
call fcn.005c0150
xor esi, esi
test edi, edi
jle 0x4d60fa
xor ebx, ebx
call dword [0x609ac0]
mov eax, dword [esp + 0x18]
mov ecx, dword [ebx + eax]
push ecx
lea ecx, [esp + 0x70]
call fcn.005c01d0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x74]
mov ecx, dword [edx + 0x190]
mov edx, dword [esp + 0x38]
mov ebp, dword [eax + 0x18]
mov eax, dword [edx + esi*4]
lea edx, [eax + eax*8]
lea eax, [eax + edx*2]
lea ecx, [ecx + eax*8]
push ecx
lea ecx, [esp + 0x70]
call fcn.005c02c0
push eax
lea ecx, [esp + 0x74]
call fcn.005c02b0
push eax
push ebp
call fcn.004d5b90
mov edx, dword [esp + 0x48]
add esp, 0x10
mov eax, dword [edx + esi*4]
push 0
push 0
lea ecx, [eax + eax*8]
lea edx, [eax + ecx*2]
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x190]
lea edx, [ecx + edx*8]
lea ecx, [esp + 0x74]
push edx
call fcn.005c03f0
inc esi
add ebx, 0xc
cmp esi, edi
jl 0x4d606c
mov ebx, dword [esp + 0x14]
mov esi, dword [ebx + 0x14]
mov edi, dword [ebx + 0x10]
cmp edi, esi
je 0x4d613f
mov ecx, esi
mov eax, 0x2aaaaaab
sub ecx, edi
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
xor eax, eax
cmp edx, 1
je 0x4d6128
sar edx, 1
inc eax
cmp edx, 1
jne 0x4d6120
lea ecx, [eax + eax]
push ecx
push 0
push esi
push edi
call fcn.004d91d0
push esi
push edi
call fcn.004d9480
add esp, 0x18
mov esi, dword [ebx + 0x20]
mov edi, dword [ebx + 0x1c]
cmp edi, esi
je 0x4d6184
mov ecx, esi
mov eax, 0x2e8ba2e9
sub ecx, edi
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
xor eax, eax
cmp edx, 1
je 0x4d616d
sar edx, 1
inc eax
cmp edx, 1
jne 0x4d6165
lea ecx, [eax + eax]
push ecx
push 0
push esi
push edi
call fcn.004d95f0
push esi
push edi
call fcn.004d97b0
add esp, 0x18
mov edx, dword [ebx + 0x190]
mov esi, dword [ebx + 0x194]
cmp edx, esi
lea ecx, [esp + 0x6c]
setne bl
call fcn.005c01b0
lea ecx, [esp + 0x44]
call fcn.00487440
mov eax, dword [esp + 0x44]
push 1
push eax
lea ecx, [esp + 0x4c]
call fcn.004a6e10
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
cmp esi, edi
je 0x4d61d7
push 0
mov ecx, esi
call fcn.005a95c0
add esi, 0xc
cmp esi, edi
jne 0x4d61c3
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov eax, 0x2aaaaaab
sub ecx, esi
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
lea ecx, [esp + 0x20]
push edx
push esi
call fcn.00561ad0
lea ecx, [esp + 0x38]
call fcn.0040ee80
pop edi
pop esi
mov al, bl
pop ebp
pop ebx
add esp, 0x13c
ret
lea ecx, [esp + 0x50]
call fcn.0040ee80
lea ecx, [esp + 0x28]
call fcn.00416100
lea ecx, [esp + 0x28]
call fcn.004c9fb0
lea ecx, [esp + 0x44]
call fcn.00424470
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
cmp esi, edi
je 0x4d6290
push 0
mov ecx, esi
call fcn.005a95c0
add esi, 0xc
cmp esi, edi
jne 0x4d623e
jmp 0x4d6290
lea ecx, [esp + 0x50]
call fcn.0040ee80
lea ecx, [esp + 0x28]
call fcn.00416100
lea ecx, [esp + 0x28]
call fcn.004c9fb0
lea ecx, [esp + 0x44]
call fcn.00424470
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
cmp esi, edi
je 0x4d6290
push 0
mov ecx, esi
call fcn.005a95c0
add esi, 0xc
cmp esi, edi
jne 0x4d6280
lea ecx, [esp + 0x18]
call fcn.0040f560
lea ecx, [esp + 0x38]
call fcn.0040ee80
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x13c
ret
lea ecx, [esp + 0x50]
call fcn.0040ee80
lea ecx, [esp + 0x28]
call fcn.00416100
lea ecx, [esp + 0x28]
call fcn.004c9fb0
lea ecx, [esp + 0x44]
call fcn.00424470
mov edi, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
cmp esi, edi
je 0x4d6290
push 0
mov ecx, esi
call fcn.005a95c0
add esi, 0xc
cmp esi, edi
jne 0x4d62df
jmp 0x4d6290