Function at 0x509a79
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push 0
mov ebx, ecx
push dword [edi + 0x18]
call fcn.00410c5f
push 0
mov esi, eax
push dword [edi + 0x14]
call fcn.00410c5f
add esp, 0x10
mov edi, eax
test esi, esi
je 0x509b7e
mov eax, dword [ebx + 0x240]
mov ecx, dword [esi + 0x84]
add esi, 0x84
cmp ecx, eax
je 0x509b7e
push eax
push ecx
mov ecx, 0x73e890
call fcn.004701a2
test eax, eax
je 0x509b7e
mov esi, dword [esi]
mov ecx, ebx
call fcn.004af470
fld dword [ebx + 0x2c]
push eax
push ecx
fstp dword [esp]
fld dword [ebx + 0x28]
push ecx
fstp dword [esp]
push esi
mov esi, 0x7184d0
mov ecx, esi
call fcn.0046cb43
mov edi, dword [ebx + 0x240]
mov ecx, ebx
mov dword [ebp - 4], eax
call fcn.004af470
fld dword [ebx + 0x2c]
push eax
push ecx
fstp dword [esp]
fld dword [ebx + 0x28]
push ecx
mov ecx, esi
fstp dword [esp]
push edi
call fcn.0046cb43
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x10], eax
test ecx, ecx
je 0x509c4d
test eax, eax
je 0x509c7d
lea esi, [ecx + 0x28]
lea edi, [ebp - 0x1c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea esi, [eax + 0x28]
lea edi, [ebp - 0x28]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea esi, [ebx + 0x28]
lea ecx, [ebp - 0x1c]
push esi
call fcn.004051c9
fstp dword [ebp - 0xc]
push esi
lea ecx, [ebp - 0x28]
call fcn.004051c9
fstp dword [ebp - 8]
fld dword [ebp - 8]
fcomp dword [ebp - 0xc]
fnstsw ax
sahf
jae 0x509c7d
mov eax, dword [ebp - 0x10]
jmp 0x509c7a
test edi, edi
je 0x509c53
mov eax, dword [ebx + 0x240]
mov ecx, dword [edi + 0x84]
lea esi, [edi + 0x84]
cmp ecx, eax
je 0x509c53
push eax
push ecx
mov ecx, 0x73e890
call fcn.004701a2
test eax, eax
je 0x509c53
mov esi, dword [esi]
mov ecx, ebx
call fcn.004af470
fld dword [ebx + 0x2c]
push eax
push ecx
fstp dword [esp]
fld dword [ebx + 0x28]
push ecx
fstp dword [esp]
push esi
mov esi, 0x7184d0
mov ecx, esi
call fcn.0046cb43
mov edi, dword [ebx + 0x240]
mov ecx, ebx
mov dword [ebp - 4], eax
call fcn.004af470
fld dword [ebx + 0x2c]
push eax
push ecx
fstp dword [esp]
fld dword [ebx + 0x28]
push ecx
mov ecx, esi
fstp dword [esp]
push edi
call fcn.0046cb43
cmp dword [ebp - 4], 0
mov dword [ebp - 8], eax
je 0x509c4d
test eax, eax
je 0x509c7d
mov ecx, dword [ebp - 4]
lea edi, [ebp - 0x28]
lea esi, [ecx + 0x28]
lea ecx, [ebp - 0x28]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea esi, [eax + 0x28]
lea edi, [ebp - 0x1c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea esi, [ebx + 0x28]
push esi
call fcn.004051c9
fstp dword [ebp - 0xc]
push esi
lea ecx, [ebp - 0x1c]
call fcn.004051c9
fstp dword [ebp - 0x10]
fld dword [ebp - 0x10]
fcomp dword [ebp - 0xc]
fnstsw ax
sahf
jae 0x509c7d
mov eax, dword [ebp - 8]
jmp 0x509c7a
test eax, eax
je 0x509c84
jmp 0x509c7a
mov esi, dword [ebx + 0x240]
mov ecx, ebx
call fcn.004af470
fld dword [ebx + 0x2c]
push eax
push ecx
fstp dword [esp]
fld dword [ebx + 0x28]
push ecx
mov ecx, 0x7184d0
fstp dword [esp]
push esi
call fcn.0046cb43
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
test ecx, ecx
jne 0x509cb1
mov ecx, ebx
call fcn.004aaf07
push ebx
push 0xa
mov esi, eax
call fcn.004b1478
pop ecx
cmp esi, eax
pop ecx
je 0x509caa
push 0
push 0xffffffffffffffff
push 0xa
push 1
mov ecx, ebx
call fcn.004aaaa3
pop edi
pop esi
pop ebx
leave
ret 8
mov eax, dword [ecx + 4]
and eax, 0xffff
cmp eax, 3
jne 0x509ccb
push ecx
mov ecx, ebx
push dword [ebp + 8]
call fcn.00509d9c
jmp 0x509caa
cmp eax, 1
jne 0x509cdd
push ecx
mov ecx, ebx
push dword [ebp + 8]
call fcn.00509f83
jmp 0x509caa
cmp eax, 2
jne 0x509cef
push ecx
mov ecx, ebx
push dword [ebp + 8]
call 0x509d38
jmp 0x509caa
call fcn.0067f5ad
sub esp, 0x18
mov ecx, esp
push 0x2a2
call fcn.0066b1cd
sub esp, 0x18
mov eax, esp
push str.C:ProjectsSamuraiCodeUnitOrders_PeasantAI_GatherWater.cpp
push eax
call fcn.0066b0d0
pop ecx
pop ecx
push str.Gather_Water_Order_was_not_Created_
call fcn.0067f4fe
add esp, 0x34
call sub.kernel32.dll_IsDebuggerPresent
test eax, eax
je 0x509d31
int3
push 1
call fcn.006a16bc
push ebp
mov ebp, esp
sub esp, 0x4c
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
push dword [ebp + 0xc]
mov dword [esi + 0x1c], 5
call fcn.0049ed9c
push 0x4c
lea eax, [ebp - 0x4c]
push 0
push eax
call fcn.006a10b0
mov eax, dword [esi + 8]
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x44], eax
mov eax, dword [esi + 0xc]
add esp, 0xc
mov dword [ebp - 0x4c], 0x1e
mov dword [ebp - 0x40], eax
call fcn.004172cf
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x4c]
push 0
push eax
mov ecx, edi
mov dword [ebp - 0x34], 0x26
call fcn.004a5a7b
pop edi
pop esi
leave
ret 8