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

Disassembly:
sub esp, 0x98
mov edx, ecx
push ebx
push ebp
push esi
mov ecx, dword [edx + 4]
xor esi, esi
test ecx, ecx
push edi
mov dword [esp + 0x18], edx
jle 0x4045b3
xor edi, edi
test ecx, ecx
jle 0x4045a7
lea ebp, [edi + edi*4]
shl ebp, 4
lea eax, [esi + ebp]
add eax, edx
mov dword [esp + 0x1c], eax
mov al, byte [eax + 0x191d]
cmp al, 0x53
mov byte [esp + 0x17], al
je 0x404400
cmp al, 0x4d
je 0x404400
cmp al, 0x4c
jne 0x40459b
lea eax, [edi + 1]
cdq
idiv ecx
mov eax, dword [esp + 0x18]
lea ebx, [edx + edx*4]
shl ebx, 4
lea edx, [ebx + esi]
mov al, byte [edx + eax + 0x1d]
mov edx, dword [esp + 0x1c]
mov byte [esp + 0x14], al
mov dl, byte [edx + 0x1d]
cmp dl, al
mov byte [esp + 0x16], dl
jne 0x404658
lea eax, [esi + 1]
cdq
idiv ecx
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], edx
add edx, ebx
mov dl, byte [edx + eax + 0x1d]
mov eax, dword [esp + 0x1c]
add eax, ebp
mov ebp, dword [esp + 0x18]
mov byte [esp + 0x13], dl
mov al, byte [eax + ebp + 0x1d]
cmp al, dl
mov byte [esp + 0x15], al
jne 0x404658
cmp byte [esp + 0x16], al
jne 0x404658
mov dl, byte [esp + 0x13]
mov al, byte [esp + 0x14]
cmp al, dl
jne 0x404658
mov al, byte [esp + 0x17]
cmp al, 0x4c
jne 0x40453d
mov al, byte [esp + 0x15]
mov dl, byte [esp + 0x16]
cmp dl, al
jne 0x4045c0
test esi, esi
lea ebp, [ecx - 1]
je 0x4044a0
lea ebp, [esi - 1]
test edi, edi
lea eax, [ecx - 1]
je 0x4044aa
lea eax, [edi - 1]
inc eax
cdq
idiv ecx
mov al, byte [esp + 0x15]
lea edx, [edx + edx*4]
shl edx, 4
add edx, ebp
mov ebp, edx
mov edx, dword [esp + 0x18]
cmp byte [edx + ebp + 0x1d], al
jne 0x4045c0
test esi, esi
jne 0x4044d1
dec ecx
jmp 0x4044d4
lea ecx, [esi - 1]
add ebx, ecx
cmp byte [ebx + edx + 0x1d], al
jne 0x4045c0
cmp byte [esp + 0x14], al
jne 0x4045c0
cmp byte [esp + 0x13], al
jne 0x4045c0
lea eax, [edi + edi*2]
lea eax, [eax + eax*4]
lea ecx, [eax*4 + 0x1e]
lea eax, [esi + esi*2]
lea eax, [eax + eax*4]
shl eax, 2
mov edx, dword [esp + 0xac]
mov bx, word [edx + 8]
cmp bx, 0x31
jae 0x40457d
and ebx, 0xffff
mov word [edx + ebx*8 + 0xca8e], cx
xor ecx, ecx
mov cx, word [edx + 8]
mov word [edx + ecx*8 + 0xca90], ax
inc word [edx + 8]
jmp 0x404597
cmp al, 0x53
jne 0x40455d
lea eax, [edi + edi*2]
lea ecx, [eax + eax*4]
lea eax, [esi + esi*2]
lea edx, [eax + eax*4]
lea ecx, [ecx*4 + 0x4e3e]
lea eax, [edx*4 + 0x1e]
jmp 0x40450a
cmp al, 0x4d
jne 0x4044f4
lea eax, [edi + edi*2]
lea eax, [eax + eax*4]
lea ecx, [eax*4 + 0x272e]
lea eax, [esi + esi*2]
lea edx, [eax + eax*4]
lea eax, [edx*4 + 0x1e]
jmp 0x40450a
jne 0x40460c
mov word [edx + 0xcc16], cx
mov word [edx + 0xcc18], ax
mov word [edx + 8], 0x32
mov edx, dword [esp + 0x18]
mov ecx, dword [edx + 4]
inc edi
cmp edi, ecx
jl 0x4043d7
mov ecx, dword [edx + 4]
inc esi
cmp esi, ecx
jl 0x4043cd
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x98
ret 4
mov dword [esp + 0x20], edi
mov edi, str.large_energy_pools_must_be_on_the_lower_of_two_flat_tiles
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x24], esi
lea edx, [esp + 0x28]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x4157c0
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x22
lea esi, [esp + 0x24]
lea edi, [esp + 0x24]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x24]
push ecx
call fcn.0040b2f1
mov dword [esp + 0x20], edi
mov edi, str.only_50_energy_pools_are_allowed__this_is_the_51st
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x24], esi
lea edx, [esp + 0x28]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x4157c0
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x22
lea esi, [esp + 0x24]
lea edi, [esp + 0x24]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x24]
push ecx
call fcn.0040b2f1
mov dword [esp + 0x20], edi
mov edi, str.small_and_medium_energy_pools_must_be_on_a_flat_tile
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x24], esi
lea edx, [esp + 0x28]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x4157c0
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x22
lea esi, [esp + 0x24]
lea edi, [esp + 0x24]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x24]
push ecx
call fcn.0040b2f1
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop