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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x747f30
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x50
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
push esi
mov dword [esp + 0x10], edi
call fcn.005eb820
xor ebx, ebx
cmp eax, ebx
jne 0x5980e5
xor ecx, ecx
mov dword [esp + 0x10], ecx
add edi, 0x1e0
jmp 0x597cd0
mov edx, dword [esp + 0xc]
mov eax, 1
shl eax, cl
test byte [edx + 0x1dd], al
je 0x597fa9
push eax
lea ecx, [esp + 0x1c]
call fcn.00413ef0
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x2c]
push str.dir_
push ecx
mov dword [esp + 0x70], ebx
call fcn.00413c20
add esp, 0xc
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x68], 1
call fcn.004133c0
lea ecx, [esp + 0x28]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [esp + 0x18]
mov edx, dword [esi]
push eax
mov ecx, esi
call dword [edx + 0x24]
mov ax, word [edi]
cmp ax, bx
je 0x597d53
mov ecx, dword [edi + 4]
mov edx, dword [esi]
movsx eax, ax
push eax
push ecx
push str.occupy
mov ecx, esi
call dword [edx + 0xbc]
mov ax, word [edi + 8]
cmp ax, bx
je 0x597d73
mov ecx, dword [edi + 0xc]
mov edx, dword [esi]
movsx eax, ax
push eax
push ecx
push str.require_walls
mov ecx, esi
call dword [edx + 0xbc]
mov ax, word [edi + 0x10]
cmp ax, bx
je 0x597d93
mov ecx, dword [edi + 0x14]
mov edx, dword [esi]
movsx eax, ax
push eax
push ecx
push str.semi_walls
mov ecx, esi
call dword [edx + 0xbc]
mov ax, word [edi + 0x38]
cmp ax, bx
je 0x597db3
mov ecx, dword [edi + 0x3c]
mov edx, dword [esi]
movsx eax, ax
push eax
push ecx
push str.conn
mov ecx, esi
call dword [edx + 0xbc]
mov eax, dword [edi + 0x18]
cmp eax, ebx
je 0x597def
mov edx, dword [eax + 0x10]
push edx
lea eax, [esp + 0x34]
push eax
call fcn.00401e20
add esp, 8
mov eax, dword [eax]
mov edx, dword [esi]
push eax
push str.caps
mov ecx, esi
mov byte [esp + 0x6c], 2
call dword [edx + 0x84]
lea ecx, [esp + 0x30]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [edi + 0x1c]
cmp eax, ebx
je 0x597e2b
mov eax, dword [eax + 0x10]
push eax
lea ecx, [esp + 0x3c]
push ecx
call fcn.00401e20
add esp, 8
mov eax, dword [eax]
mov edx, dword [esi]
push eax
push str.caps_alt
mov ecx, esi
mov byte [esp + 0x6c], 3
call dword [edx + 0x84]
lea ecx, [esp + 0x38]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [edi + 0x20]
cmp eax, ebx
je 0x597e67
mov eax, dword [eax + 0x10]
push eax
lea ecx, [esp + 0x44]
push ecx
call fcn.00401e20
add esp, 8
mov eax, dword [eax]
mov edx, dword [esi]
push eax
push str.conn_door
mov ecx, esi
mov byte [esp + 0x6c], 4
call dword [edx + 0x84]
lea ecx, [esp + 0x40]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [edi + 0x24]
cmp eax, ebx
je 0x597ea3
mov eax, dword [eax + 0x10]
push eax
lea ecx, [esp + 0x4c]
push ecx
call fcn.00401e20
add esp, 8
mov eax, dword [eax]
mov edx, dword [esi]
push eax
push str.conn_door_2
mov ecx, esi
mov byte [esp + 0x6c], 5
call dword [edx + 0x84]
lea ecx, [esp + 0x48]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [edi + 0x28]
cmp eax, ebx
je 0x597edf
mov eax, dword [eax + 0x10]
push eax
lea ecx, [esp + 0x54]
push ecx
call fcn.00401e20
add esp, 8
mov eax, dword [eax]
mov edx, dword [esi]
push eax
push str.destr_caps
mov ecx, esi
mov byte [esp + 0x6c], 6
call dword [edx + 0x84]
lea ecx, [esp + 0x50]
mov byte [esp + 0x64], bl
call fcn.00412de0
mov eax, dword [edi + 0x30]
cmp eax, ebx
je 0x597efb
cmp word [eax], bx
je 0x597efb
mov edx, dword [esi]
push eax
push str.pass
mov ecx, esi
call dword [edx + 0x84]
mov eax, dword [edi + 0x40]
cmp eax, ebx
je 0x597f17
cmp word [eax], bx
je 0x597f17
mov edx, dword [esi]
push eax
push str.conn_pass
mov ecx, esi
call dword [edx + 0x84]
mov eax, dword [edi + 0x58]
cmp eax, ebx
je 0x597f8d
cmp word [eax], bx
je 0x597f8d
mov ecx, dword [edi + 0x48]
sub esp, 8
mov eax, esp
mov dword [eax], ecx
mov edx, dword [edi + 0x4c]
mov dword [esp + 0x1c], esp
mov dword [eax + 4], edx
mov eax, dword [esi]
push str.inner
mov ecx, esi
call dword [eax + 0xf0]
mov eax, dword [edi + 0x50]
cmp eax, ebx
je 0x597f60
mov eax, dword [eax + 0x10]
mov edx, dword [esi]
push eax
push str.inner_door
mov ecx, esi
call dword [edx + 0x84]
mov eax, dword [edi + 0x54]
cmp eax, ebx
je 0x597f7a
mov eax, dword [eax + 0x10]
mov edx, dword [esi]
push eax
push str.inner_door_2
mov ecx, esi
call dword [edx + 0x84]
mov eax, dword [edi + 0x58]
mov edx, dword [esi]
push eax
push str.inner_pass
mov ecx, esi
call dword [edx + 0x84]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x28]
lea ecx, [esp + 0x18]
mov dword [esp + 0x64], 0xffffffff
call fcn.00412de0
mov ecx, dword [esp + 0x10]
add ecx, 1
add edi, 0xa0
cmp ecx, 8
mov dword [esp + 0x10], ecx
jb 0x597cd0
mov ecx, dword [esp + 0xc]
movzx eax, byte [ecx + 0x1dc]
add eax, 0xffffffff
cmp eax, 5
ja case.default.0x597fd2
jmp dword [eax*4 + 0x5980fc]
mov eax, str.wall
jmp 0x598005
mov eax, str.corner
jmp 0x598005
mov eax, str.gate
jmp 0x598005
mov eax, str.tower
jmp 0x598005
mov eax, str.stair
jmp 0x598005
mov eax, str.platform
jmp 0x598005
xor eax, eax
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0x28]
call fcn.00413870
mov eax, dword [esp + 0x20]
cmp eax, ebx
mov dword [esp + 0x64], 7
je 0x598036
cmp word [eax], bx
je 0x598036
mov edx, dword [esi]
push eax
push str.wall_type
mov ecx, esi
call dword [edx + 0x84]
mov edi, dword [esp + 0xc]
mov al, byte [edi + 0x1dd]
cmp al, bl
je 0x598054
mov edx, dword [esi]
push eax
push str.wall_dirs
mov ecx, esi
call dword [edx + 0x9c]
mov ax, word [edi + 0x6e0]
cmp ax, bx
je 0x59806d
mov edx, dword [esi]
push eax
push str.wall_height
mov ecx, esi
call dword [edx + 0x78]
mov al, byte [edi + 0x6e2]
cmp al, bl
je 0x598087
mov edx, dword [esi]
push eax
push str.wall_drawcaps
mov ecx, esi
call dword [edx + 0x9c]
mov al, byte [edi + 0x6ec]
cmp al, bl
je 0x5980a1
mov edx, dword [esi]
push eax
push str.wall_semi
mov ecx, esi
call dword [edx + 0x9c]
mov cx, word [edi + 0x6e4]
mov eax, dword [esi]
push ecx
push str.grid_size
mov ecx, esi
call dword [eax + 0x78]
mov eax, dword [edi + 0x6e8]
cmp eax, ebx
je 0x5980d2
mov eax, dword [eax + 0x10]
mov edx, dword [esi]
push eax
push str.flag_image
mov ecx, esi
call dword [edx + 0x84]
lea ecx, [esp + 0x20]
mov dword [esp + 0x64], 0xffffffff
call fcn.00412de0
xor eax, eax
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 4