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

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
push edi
mov al, byte [esi + 0x4f]
test al, al
jne 0x494290
mov al, byte [esi + 0x4a]
mov cl, byte [esi + 0x48]
cmp al, cl
jne 0x494290
mov cl, byte [esi + 0x4b]
mov al, byte [esi + 0x49]
cmp cl, al
jne 0x494290
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, dword [esi + 0x34]
cdq
and edx, 0xffff
add eax, edx
sar eax, 0x10
cdq
and edx, 0x1f
add eax, edx
xor edx, edx
mov dl, byte [esi + 0x4a]
mov ecx, eax
sar ecx, 5
mov eax, ecx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jle 0x4942e4
xor eax, eax
mov al, byte [esi + 0x4c]
mov edx, eax
mov eax, ecx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jle 0x4942e4
push str.Invalid_pos.x
push str.MoveUnit
call fcn.0042b590
add esp, 8
mov eax, dword [esi + 0x38]
cdq
and edx, 0xffff
add eax, edx
sar eax, 0x10
cdq
and edx, 0x1f
add eax, edx
mov ecx, eax
xor eax, eax
mov al, byte [esi + 0x4b]
sar ecx, 5
mov edx, eax
mov eax, ecx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jle 0x49433a
xor eax, eax
mov al, byte [esi + 0x4d]
mov edx, eax
mov eax, ecx
sub eax, edx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jle 0x49433a
push str.Invalid_pos.y
push str.MoveUnit
call fcn.0042b590
add esp, 8
cmp byte [esp + 0x2c], 8
jb 0x494353
push str.Invalid_Side
push str.MoveUnit
call fcn.0042b590
add esp, 8
mov eax, dword [0x517de8]
xor ecx, ecx
mov cl, byte [esi + 0x48]
cmp ecx, eax
jg 0x494370
mov edx, dword [0x517dec]
xor eax, eax
mov al, byte [esi + 0x49]
cmp eax, edx
jle 0x49439f
xor eax, eax
mov al, byte [esi + 0x18]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*8]
lea eax, [edx*2 + 0x7891b0]
xor edx, edx
mov dl, byte [esi + 0x49]
push eax
push edx
push ecx
push str.targetX___d__targetY___d__unit__s_
push str.MoveUnit
call fcn.0042b590
add esp, 0x14
mov al, byte [esi + 0x18]
mov cl, byte [0x795538]
cmp al, cl
jb 0x4943c4
and eax, 0xff
push eax
push str.Invalid_unit_type__d
push str.MoveUnit
call fcn.0042b590
add esp, 0xc
xor eax, eax
mov al, byte [esi + 0x18]
shl eax, 8
mov cl, byte [eax + 0x77e261]
mov dl, byte [eax + 0x77e27d]
mov al, byte [esi + 0x4f]
mov byte [esp + 0x28], cl
xor ecx, ecx
cmp dl, 5
sete cl
test al, al
mov byte [esp + 0x13], cl
jne 0x49482e
cmp word [esi + 0x78], 0
mov edi, dword [esp + 0x30]
je 0x49445a
mov eax, edi
and eax, 0xffff
cdq
xor eax, edx
sub eax, edx
and eax, 7
xor eax, edx
sub eax, edx
mov edx, dword [0x5173f4]
and edx, 7
cmp eax, edx
je 0x494426
cmp word [esi + 0xc], 0xffff
je 0x49445a
push esi
call fcn.0049f5f0
add esp, 4
test al, al
jne 0x49445a
cmp dword [esi + 0x10], 0xa
je 0x49445a
mov al, byte [esp + 0x13]
test al, al
jne 0x49445a
mov ebp, dword [esp + 0x2c]
lea eax, [esi + 0xc]
lea ecx, [esi + 0x26]
push eax
push ecx
push edi
push ebp
push esi
call fcn.00496480
add esp, 0x14
jmp 0x49445e
mov ebp, dword [esp + 0x2c]
mov al, byte [esi + 0x4a]
mov cl, byte [esi + 0x4c]
cmp al, cl
jne 0x4944c6
mov dl, byte [esi + 0x4b]
mov bl, byte [esi + 0x4d]
cmp dl, bl
jne 0x4944c6
push edi
push ebp
push esi
call fcn.004936a0
add esp, 0xc
push edi
push ebp
push esi
call fcn.0049ebf0
add esp, 0xc
test al, al
je 0x49449d
push edi
push ebp
push esi
mov byte [esi + 0x74], 0
call fcn.004936a0
add esp, 0xc
jmp 0x4944a7
cmp dword [esi + 0x10], 0x11
je 0x494b18
mov al, byte [esi + 0x4a]
mov cl, byte [esi + 0x4c]
cmp al, cl
jne 0x4944bf
mov dl, byte [esi + 0x4b]
mov bl, byte [esi + 0x4d]
cmp dl, bl
je 0x494b18
and dword [esi + 8], 0xefffffff
xor edx, edx
and ecx, 0xff
mov dl, byte [esi + 0x4d]
and eax, 0xff
push edx
push ecx
xor ecx, ecx
mov cl, byte [esi + 0x4b]
push ecx
push eax
call fcn.0045e020
mov byte [esp + 0x28], al
xor eax, eax
mov edx, dword [esp + 0x28]
mov al, byte [esi + 0x54]
and edx, 0xff
add esp, 0x10
sub eax, edx
add eax, 0x20
cdq
xor eax, edx
sub eax, edx
and eax, 0x1f
xor eax, edx
sub eax, edx
test al, al
jne 0x494513
and dword [esi + 8], 0xffffffdf
test byte [esi + 8], 0x20
jne 0x49482e
cmp al, 7
jb 0x494529
cmp al, 0x18
jbe 0x49482e
mov ebp, dword [esp + 0x2c]
xor ecx, ecx
mov cl, byte [esi + 0x4d]
xor eax, eax
mov al, byte [esi + 0x4c]
push 0
push ebp
push esi
push ecx
push eax
call fcn.0045d990
add esp, 0x14
test eax, eax
je 0x494c27
mov eax, dword [esi + 8]
test eax, 0x40000000
jne 0x494c27
or eax, 0x10000000
mov dword [esi + 8], eax
mov al, byte [esp + 0x28]
test al, al
je 0x49462f
xor eax, eax
xor ecx, ecx
mov al, byte [esi + 0x4d]
mov cl, byte [esi + 0x4c]
mov bl, 4
mov ebp, 0x200
mov eax, dword [eax*4 + 0x547df0]
mov byte [esp + 0x30], 0
add eax, ecx
mov cl, byte [esi + 0x53]
mov byte [esp + 0x14], bl
lea edx, [eax + eax*2]
mov eax, 0x20
shl eax, cl
mov edi, dword [edx*4 + 0x517df4]
and edi, 0x3f8
test edi, eax
jne 0x4945b4
mov bl, cl
jmp 0x4945e2
test ebp, edi
jne 0x4945bf
mov byte [esp + 0x30], 1
jmp 0x4945c3
shr ebp, 1
dec bl
cmp ebp, 0x20
jae 0x4945da
push str.Cant_find_a_free_slot_for_a_soldier
push str.unit.cpp
call fcn.0042b590
add esp, 8
mov al, byte [esp + 0x30]
test al, al
je 0x4945b4
mov cl, byte [esi + 0x4c]
mov byte [esp + 0x14], bl
mov eax, dword [esp + 0x14]
mov edx, ecx
and eax, 0xff
and edx, 0xff
shl eax, 3
shl edx, 5
mov edi, dword [eax + 0x4d7028]
add edi, edx
mov dl, byte [esi + 0x4d]
shl edi, 0x10
mov dword [esi + 0x40], edi
mov eax, dword [eax + 0x4d702c]
mov edi, edx
mov byte [esi + 0x52], bl
and edi, 0xff
shl edi, 5
add eax, edi
shl eax, 0x10
mov dword [esi + 0x44], eax
jmp 0x49465b
mov cl, byte [esi + 0x4c]
mov edx, ecx
and edx, 0xff
shl edx, 0x15
add edx, 0x100000
mov dword [esi + 0x40], edx
mov dl, byte [esi + 0x4d]
mov eax, edx
and eax, 0xff
shl eax, 0x15
add eax, 0x100000
mov dword [esi + 0x44], eax
cmp byte [esi + 0x4a], cl
jne 0x494677
cmp byte [esi + 0x4b], dl
jne 0x494677
push str.blockFrom__blockTo
push str.MoveUnit
call fcn.0042b590
add esp, 8
xor eax, eax
mov al, byte [esi + 0x18]
shl eax, 8
mov cl, byte [eax + 0x77e261]
test cl, cl
je 0x4946ab
cmp dword [esi + 0x20], 5
jne 0x4946a4
mov ecx, dword [esp + 0x2c]
push ecx
push esi
call fcn.0049f3b0
add esp, 8
shr eax, 1
jmp 0x494725
mov edx, dword [esp + 0x2c]
push edx
jmp 0x49471c
mov ecx, dword [esi + 4]
mov eax, dword [eax + 0x77e254]
lea edx, [ecx + ecx*2]
cmp edx, eax
jge 0x4946e6
mov eax, dword [esp + 0x2c]
push eax
push esi
call fcn.0049f3b0
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], 0
fild qword [esp + 0x24]
add esp, 8
fmul dword [0x4d7020]
call fcn.004b1840
jmp 0x494725
add ecx, ecx
cmp ecx, eax
jge 0x494717
mov edx, dword [esp + 0x2c]
push edx
push esi
call fcn.0049f3b0
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], 0
fild qword [esp + 0x24]
add esp, 8
fmul dword [0x4d7024]
call fcn.004b1840
jmp 0x494725
mov eax, dword [esp + 0x2c]
push eax
push esi
call fcn.0049f3b0
add esp, 8
mov ebx, dword [esi + 0x40]
mov dword [esi], eax
mov eax, dword [esi + 0x34]
mov ebp, dword [esi + 0x44]
sub eax, ebx
cdq
mov ecx, eax
mov eax, dword [esi + 0x38]
xor ecx, edx
sub eax, ebp
sub ecx, edx
cdq
xor eax, edx
sub eax, edx
cmp ecx, eax
jle 0x494749
mov eax, ecx
xor edx, edx
div dword [esi]
mov ebx, eax
cmp ebx, 0xff
jbe 0x494769
push str.unit__pos.steps___255
push str.MoveUnit
call fcn.0042b590
add esp, 8
mov al, byte [esp + 0x28]
mov byte [esi + 0x4f], bl
shr bl, 1
test al, al
mov byte [esi + 0x4e], bl
je 0x494b22
xor ecx, ecx
xor edx, edx
mov cl, byte [esi + 0x4d]
mov dl, byte [esi + 0x4c]
mov eax, dword [ecx*4 + 0x547df0]
xor ecx, ecx
add eax, edx
lea eax, [eax + eax*2]
mov edi, dword [eax*4 + 0x517df4]
and edi, 0xfffffff8
mov dword [eax*4 + 0x517df4], edi
mov cl, byte [esi + 0x4c]
xor eax, eax
mov edi, 0x20
mov al, byte [esi + 0x4d]
mov eax, dword [eax*4 + 0x547df0]
add eax, ecx
mov cl, byte [esp + 0x14]
shl edi, cl
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x2c]
and eax, 0xff
xor ecx, ecx
mov ebx, dword [edx*4 + 0x517df4]
or edi, eax
or ebx, edi
mov dword [edx*4 + 0x517df4], ebx
mov cl, byte [esi + 0x4c]
xor edx, edx
mov edi, ecx
mov dl, byte [esi + 0x4d]
shl eax, 0x19
mov ecx, dword [edx*4 + 0x547df0]
xor edx, edx
add ecx, edi
lea ecx, [ecx + ecx*2]
mov ebp, dword [ecx*4 + 0x517df4]
and ebp, 0xf1ffffff
mov dword [ecx*4 + 0x517df4], ebp
mov dl, byte [esi + 0x4d]
xor ecx, ecx
mov cl, byte [esi + 0x4c]
mov edi, ecx
mov ecx, dword [edx*4 + 0x547df0]
add ecx, edi
lea ecx, [ecx + ecx*2]
or dword [ecx*4 + 0x517df4], eax
mov al, byte [esi + 0x4a]
mov cl, byte [esi + 0x4c]
cmp al, cl
jne 0x494847
mov dl, byte [esi + 0x4b]
mov bl, byte [esi + 0x4d]
cmp dl, bl
jne 0x494847
mov al, byte [esi + 0x54]
jmp 0x494868
xor edx, edx
and ecx, 0xff
mov dl, byte [esi + 0x4d]
and eax, 0xff
push edx
push ecx
xor ecx, ecx
mov cl, byte [esi + 0x4b]
push ecx
push eax
call fcn.0045e020
add esp, 0x10
mov byte [esp + 0x18], al
xor eax, eax
mov edi, dword [esp + 0x18]
mov al, byte [esi + 0x54]
mov edx, edi
xor bl, bl
and edx, 0xff
sub eax, edx
add eax, 0x20
cdq
xor eax, edx
sub eax, edx
and eax, 0x1f
xor eax, edx
sub eax, edx
test al, al
jne 0x494898
and dword [esi + 8], 0xffffffdf
mov ecx, dword [esi + 8]
test cl, 0x20
jne 0x4948ac
cmp al, 7
jb 0x4948a8
cmp al, 0x18
jbe 0x4948ac
mov bl, 1
jmp 0x4948cb
test ecx, 0x80000000
je 0x4948c3
and ecx, 0x3fffffff
or ecx, 0x40000000
mov dword [esi + 8], ecx
mov eax, dword [esi + 8]
or al, 0x20
mov dword [esi + 8], eax
push edi
push esi
call fcn.00493eb0
xor eax, eax
add esp, 8
mov al, byte [esi + 0x18]
shl eax, 8
mov cl, byte [eax + 0x77e276]
test cl, cl
je 0x49492c
mov al, byte [esi + 0x4a]
mov cl, byte [esi + 0x48]
cmp al, cl
jne 0x4948f9
mov dl, byte [esi + 0x4b]
cmp dl, byte [esi + 0x49]
je 0x49492c
xor edx, edx
and ecx, 0xff
mov dl, byte [esi + 0x49]
and eax, 0xff
push edx
push ecx
xor ecx, ecx
mov cl, byte [esi + 0x4b]
push ecx
push eax
call fcn.0045e020
mov byte [esp + 0x3c], al
add esp, 0x10
mov edx, dword [esp + 0x2c]
push edx
push esi
call fcn.00493f40
add esp, 8
test bl, bl
je 0x494b18
mov ecx, dword [esi + 8]
and ecx, 0x3fffffff
mov eax, ecx
mov dword [esi + 8], ecx
test eax, 0x10000000
jne 0x494962
mov al, byte [esi + 0x4e]
test al, al
je 0x494962
push str.Move_unit_but_UFLAGS_BLOCKTOMARKED_not_set
push str.MoveUnit
call fcn.0042b590
add esp, 8
xor eax, eax
mov al, byte [esi + 0x18]
shl eax, 8
mov cl, byte [eax + 0x77e261]
test cl, cl
je 0x49497f
push 1
push esi
call fcn.00494050
add esp, 8
mov edi, dword [esi + 0x34]
mov ebx, dword [esi]
mov ebp, dword [esi + 0x40]
mov eax, edi
cdq
and edx, 0xffff
mov ecx, ebx
add eax, edx
mov edx, ebp
shr ecx, 1
sub edx, ecx
sar eax, 0x10
shr edx, 0x10
cmp eax, edx
jge 0x4949ac
lea eax, [ebx + edi]
mov dword [esi + 0x34], eax
jmp 0x4949bb
lea edx, [ecx + ebp]
shr edx, 0x10
cmp eax, edx
jle 0x4949bb
sub edi, ebx
mov dword [esi + 0x34], edi
mov edi, dword [esi + 0x38]
mov ebp, dword [esi + 0x44]
mov eax, edi
cdq
and edx, 0xffff
add eax, edx
mov edx, ebp
sub edx, ecx
sar eax, 0x10
shr edx, 0x10
cmp eax, edx
jge 0x4949e1
add ebx, edi
mov dword [esi + 0x38], ebx
jmp 0x4949ef
add ecx, ebp
shr ecx, 0x10
cmp eax, ecx
jle 0x4949ef
sub edi, ebx
mov dword [esi + 0x38], edi
mov dl, byte [esi + 0x4f]
mov cl, byte [esi + 0x4e]
dec dl
mov al, dl
mov byte [esi + 0x4f], dl
cmp al, cl
jae 0x494b18
mov al, byte [esp + 0x28]
mov byte [esi + 0x4e], 0
test al, al
je 0x494a4d
xor eax, eax
xor ecx, ecx
mov al, byte [esi + 0x4b]
mov cl, byte [esi + 0x4a]
mov edx, 0x20
mov eax, dword [eax*4 + 0x547df0]
add eax, ecx
mov cl, byte [esi + 0x53]
shl edx, cl
lea eax, [eax + eax*2]
mov ecx, dword [eax*4 + 0x517df4]
not edx
and ecx, edx
mov dword [eax*4 + 0x517df4], ecx
mov al, byte [esi + 0x52]
mov byte [esi + 0x53], al
jmp 0x494b01
mov al, byte [esp + 0x13]
test al, al
je 0x494a7b
xor ecx, ecx
xor edx, edx
mov cl, byte [esi + 0x4b]
mov dl, byte [esi + 0x4a]
mov eax, dword [ecx*4 + 0x547df0]
add eax, edx
lea eax, [eax + eax*2]
and dword [eax*4 + 0x517df4], 0xfeffffff
jmp 0x494b01
xor eax, eax
xor ecx, ecx
mov al, byte [esi + 0x4b]
mov cl, byte [esi + 0x4a]
xor edx, edx
mov eax, dword [eax*4 + 0x547df0]
add eax, ecx
lea eax, [eax + eax*2]
mov ebx, dword [eax*4 + 0x517df4]
and ebx, 0xfffffff7
mov dword [eax*4 + 0x517df4], ebx
mov dl, byte [esi + 0x4b]
xor eax, eax
mov al, byte [esi + 0x4a]
mov ecx, eax
mov eax, dword [edx*4 + 0x547df0]
add eax, ecx
lea ecx, [eax + eax*2]
mov eax, dword [ecx*4 + 0x517df4]
test eax, 0x3e0
je 0x494b01
and al, 0xf8
xor edx, edx
mov dword [ecx*4 + 0x517df4], eax
mov dl, byte [esi + 0x4b]
xor eax, eax
mov al, byte [esi + 0x4a]
mov ecx, eax
mov eax, dword [edx*4 + 0x547df0]
add eax, ecx
lea eax, [eax + eax*2]
mov ecx, dword [eax*4 + 0x517df4]
mov edx, ecx
shr edx, 0x19
and edx, 7
or edx, ecx
mov dword [eax*4 + 0x517df4], edx
mov al, byte [esi + 0x4c]
mov cl, byte [esi + 0x4d]
mov byte [esi + 0x4a], al
mov eax, dword [esi + 8]
and eax, 0xefffffff
mov byte [esi + 0x4b], cl
mov dword [esi + 8], eax
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov al, byte [esp + 0x13]
test al, al
je 0x494b52
xor edx, edx
xor eax, eax
mov dl, byte [esi + 0x4d]
mov al, byte [esi + 0x4c]
mov ecx, eax
mov eax, dword [edx*4 + 0x547df0]
add eax, ecx
lea eax, [eax + eax*2]
or dword [eax*4 + 0x517df4], 0x1000000
jmp 0x49482e
xor edx, edx
xor eax, eax
mov dl, byte [esi + 0x4d]
mov al, byte [esi + 0x4c]
mov ecx, eax
mov eax, dword [edx*4 + 0x547df0]
add eax, ecx
lea edx, [eax + eax*2]
mov eax, dword [edx*4 + 0x517df4]
test eax, 0x3e0
je 0x494b97
mov ecx, dword [esp + 0x2c]
and eax, 7
cmp al, cl
jne 0x494bd5
push str.Invalid_blockTo__since_already_occupied_by_infantry_of_same_side
push str.MoveUnit
call fcn.0042b590
add esp, 8
jmp 0x494bd1
test al, 8
je 0x494bd1
push eax
xor eax, eax
mov al, byte [esi + 0x18]
xor ecx, ecx
shl eax, 8
push 0
mov cl, byte [eax + 0x77e251]
mov edx, dword [ecx*4 + 0x517408]
push edx
call fcn.0048dcc0
add esp, 8
push eax
push str.Invalid_blockTo_by__s__since_tile_already_marked___X_
push str.MoveUnit
call fcn.0042b590
add esp, 0x10
mov ecx, dword [esp + 0x2c]
xor eax, eax
xor edx, edx
mov al, byte [esi + 0x4d]
mov dl, byte [esi + 0x4c]
and ecx, 0xff
mov eax, dword [eax*4 + 0x547df0]
or ecx, 8
add eax, edx
lea eax, [eax + eax*2]
mov edx, dword [eax*4 + 0x517df4]
and edx, 0xfffffff8
mov dword [eax*4 + 0x517df4], edx
xor eax, eax
mov al, byte [esi + 0x4d]
xor edx, edx
mov dl, byte [esi + 0x4c]
mov eax, dword [eax*4 + 0x547df0]
add eax, edx
lea eax, [eax + eax*2]
or dword [eax*4 + 0x517df4], ecx
jmp 0x49482e
mov eax, dword [esi + 8]
test eax, 0x40000000
je 0x494c8a
and eax, 0xbfffffff
xor bl, bl
mov dword [esi + 8], eax
mov al, byte [esi + 0x74]
xor edi, edi
test al, al
jbe 0x494c72
test bl, bl
jne 0x494c76
xor ecx, ecx
xor eax, eax
mov cl, byte [edi + esi + 0x68]
mov al, byte [edi + esi + 0x5c]
push 0
push ebp
push esi
push ecx
push eax
call fcn.0045d990
add esp, 0x14
test eax, eax
jne 0x494c68
mov bl, 1
xor eax, eax
inc edi
mov al, byte [esi + 0x74]
cmp edi, eax
jb 0x494c44
test bl, bl
je 0x494c80
mov byte [esi + 0x75], 1
mov byte [esi + 0x4f], 0
jmp 0x494c92
mov byte [esi + 0x75], 0
mov byte [esi + 0x4f], 0
jmp 0x494c92
mov byte [esi + 0x4f], 0
mov byte [esi + 0x75], 1
mov eax, dword [esi + 8]
mov byte [esi + 0x74], 0
test eax, 0x10000000
je 0x494cb2
push str.Error_with_routefind_logic
push str.MoveUnit
call fcn.0042b590
add esp, 8
mov cl, byte [esi + 0x4a]
mov dl, byte [esi + 0x4b]
mov byte [esi + 0x4c], cl
mov byte [esi + 0x4d], dl
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x14
ret