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

Disassembly:
sub esp, 0x4c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x64]
mov eax, 0x60000
mov ebp, dword [esp + 0x60]
cmp eax, esi
push edi
sbb eax, eax
neg eax
test al, al
mov byte [esp + 0x68], al
jne 0x49d394
mov edi, dword [esp + 0x60]
mov esi, ebp
lea ecx, [esp + 0x1c]
shr esi, 5
shr edi, 5
push ecx
push esi
push edi
call fcn.0044e970
and eax, 0xff
add esp, 0xc
sub eax, 8
je 0x49d373
dec eax
je 0x49d352
dec eax
jne 0x49d394
push 6
push esi
push edi
call fcn.0044ef10
mov edx, dword [esp + 0x28]
add esp, 0xc
push edx
call fcn.0044f110
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push 5
push esi
push edi
call fcn.0044ef10
mov eax, dword [esp + 0x28]
add esp, 0xc
push eax
call fcn.0044f110
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
push 4
push esi
push edi
call fcn.0044ef10
mov ecx, dword [esp + 0x28]
add esp, 0xc
push ecx
call fcn.0044f110
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov ebx, dword [esp + 0x6c]
mov al, byte [0x795540]
cmp bl, al
jb 0x49d3bc
mov edx, ebx
and edx, 0xff
push edx
push str.Invalid_bulletType__d
push str.DamageTiles
call fcn.0042b590
add esp, 0xc
mov eax, ebx
and eax, 0xff
mov ecx, eax
shl ecx, 3
sub ecx, eax
xor eax, eax
shl ecx, 2
mov dword [esp + 0x24], ecx
mov al, byte [ecx + 0x78207d]
lea eax, [eax + eax*4]
mov ecx, dword [eax*4 + 0x79055c]
mov eax, dword [esp + 0x60]
mov dword [esp + 0x18], ecx
mov ecx, ebp
shr eax, 5
shr ecx, 5
test eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], ecx
jl 0x49d413
cmp eax, dword [0x517de8]
jge 0x49d413
test ecx, ecx
jl 0x49d413
cmp ecx, dword [0x517dec]
jl 0x49d427
push ecx
push eax
push str.DamageTiles___out_of_range___d___d_
push str.Unit.cpp
call fcn.0042b590
add esp, 0x10
mov al, byte [0x798628]
xor ebp, ebp
test al, al
mov dword [esp + 0x14], ebp
jbe 0x49dc7e
mov ebx, dword [esp + 0x70]
push ebp
call fcn.004a4660
mov cl, byte [esp + 0x6c]
add esp, 4
test cl, cl
mov dword [esp + 0x20], eax
jne 0x49d7c2
mov esi, dword [eax + 0x10]
test esi, esi
je 0x49d7c2
cmp dword [esi + 0x30], 0x11
je 0x49d7b3
test byte [esi + 0x28], 6
jne 0x49d7b3
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x34]
lea eax, [esp + 0x30]
push edx
mov edx, dword [esp + 0x30]
push eax
push ecx
push edx
push esi
call fcn.0049d170
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x48]
mov edi, dword [esp + 0x78]
shl eax, 5
sub ecx, eax
add esp, 0x14
sub ecx, 0x10
shl edx, 5
mov eax, ecx
sub edi, edx
cdq
xor eax, edx
sub edi, 0x10
sub eax, edx
mov edx, dword [esp + 0x18]
cmp eax, edx
jge 0x49d7b3
mov eax, edi
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x18]
cmp eax, edx
jge 0x49d7b3
mov eax, ecx
mov dword [esp + 0x3c], edx
imul eax, ecx
mov ecx, edi
mov dword [esp + 0x38], eax
imul ecx, edi
fild dword [esp + 0x38]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x40], 0
fiadd dword [esp + 0x38]
fsqrt
fild qword [esp + 0x3c]
fld st(1)
fcomp st(1)
fnstsw ax
test ah, 1
je 0x49d7af
xor eax, eax
mov dword [esp + 0x48], 0
mov al, byte [esi + 0x34]
mov ecx, eax
shl ecx, 5
add ecx, eax
lea edx, [eax + ecx*2]
mov ecx, dword [esp + 0x24]
xor eax, eax
mov al, byte [edx*4 + 0x6dc545]
mov edx, eax
xor eax, eax
mov al, byte [ecx + 0x78207d]
lea edi, [eax + eax*4]
xor eax, eax
mov al, byte [edx + edi*4 + 0x790550]
mov edx, eax
mov eax, 0x51eb851f
imul edx, dword [ecx + 0x78206c]
mul edx
shr edx, 5
mov dword [esp + 0x44], edx
fild qword [esp + 0x44]
fld st(1)
fsub st(3)
fdiv st(2)
fmulp st(1)
call fcn.004b1840
mov edi, eax
mov al, byte [esi + 0x40]
fstp st(0)
cmp al, bl
fstp st(0)
je 0x49d5d6
mov eax, dword [esi + 0x28]
test al, 6
jne 0x49d5d6
or ah, 0x10
mov dword [esi + 0x28], eax
xor eax, eax
mov al, byte [0x798544]
cmp ebp, eax
jne 0x49d5d6
push 0
push 0x12c
push 1
push str.H_UNDERATTACK
call fcn.0048dd90
add esp, 4
push eax
push str.O_UNDERATTACK
call fcn.0048dd90
add esp, 4
push eax
push str.S_UNDERATTACK
call fcn.0048dd90
add esp, 4
push eax
call fcn.0046f900
add esp, 0x18
cmp edi, dword [esi + 0x24]
jb 0x49d6e4
mov al, byte [esi + 0x3b]
test al, al
jne 0x49d6e4
xor ecx, ecx
mov cl, byte [0x798544]
cmp ebp, ecx
jne 0x49d647
xor eax, eax
mov al, byte [esi + 0x34]
mov edx, eax
shl edx, 5
add edx, eax
lea eax, [eax + edx*2]
cmp byte [eax*4 + 0x6dc59c], 0xe
je 0x49d647
push 0
push 0
push 1
push str.H_BUILDINGLOST
call fcn.0048dd90
add esp, 4
push eax
push str.O_BUILDINGLOST
call fcn.0048dd90
add esp, 4
push eax
push str.S_BUILDINGLOST
call fcn.0048dd90
add esp, 4
push eax
call fcn.0046f900
add esp, 0x18
mov cl, byte [esp + 0x6c]
mov al, byte [0x6d610a]
cmp cl, al
je 0x49d6bb
cmp bl, 0xff
je 0x49d675
mov edx, ebx
and edx, 0xff
cmp byte [edx + ebp*8 + 0x798830], 2
jne 0x49d675
push ebx
push ebp
call fcn.0049f870
add esp, 8
mov ax, word [esp + 0x74]
push ebx
mov word [esi + 0x52], ax
mov byte [esi + 0x50], bl
call fcn.004a4660
xor ecx, ecx
add esp, 4
mov cl, byte [esi + 0x34]
push ebx
lea edx, [ebp + ecx*8]
mov ecx, dword [eax + edx*4 + 0x25418]
inc ecx
lea eax, [eax + edx*4 + 0x25418]
mov dword [eax], ecx
call fcn.004a4660
mov ecx, dword [eax + 0x24c94]
add eax, 0x24c94
add esp, 4
inc ecx
mov dword [eax], ecx
mov eax, dword [esp + 0x20]
push 0
mov ecx, dword [eax + 0x24a0c]
inc ecx
mov dword [eax + 0x24a0c], ecx
mov ax, word [esi + 0x8c]
push eax
push ebp
call fcn.0049ca10
add esp, 0xc
jmp 0x49d7b3
cmp bl, 0xff
je 0x49d712
mov cl, byte [esp + 0x6c]
mov al, byte [0x6d610a]
cmp cl, al
je 0x49d712
mov edx, ebx
and edx, 0xff
cmp byte [edx + ebp*8 + 0x798830], 2
jne 0x49d712
push ebx
push ebp
call fcn.0049f870
add esp, 8
cmp word [esi + 0x52], 0xffff
jne 0x49d73f
mov al, byte [0x6d610a]
mov cl, byte [esp + 0x6c]
cmp cl, al
je 0x49d73f
mov ecx, ebx
and ecx, 0xff
cmp ecx, ebp
je 0x49d73f
mov dx, word [esp + 0x74]
mov byte [esi + 0x50], bl
mov word [esi + 0x52], dx
mov eax, dword [esi + 0x24]
xor ecx, ecx
sub eax, edi
test eax, eax
setle cl
dec ecx
and ecx, eax
xor eax, eax
mov al, byte [esi + 0x34]
mov dword [esi + 0x24], ecx
mov edx, eax
shl edx, 5
add edx, eax
lea eax, [eax + edx*2]
shl eax, 2
mov edx, dword [eax + 0x6dc540]
shr edx, 1
cmp ecx, edx
jge 0x49d7b3
mov ecx, dword [eax + 0x6dc598]
test ch, 2
je 0x49d7b3
push 0x1d1a
push str.C:MsDevProjectsJuly2000codeunit.cpp
call fcn.00448460
add esp, 8
and al, 0x7f
add al, 0x40
push 0x1d1b
push str.C:MsDevProjectsJuly2000codeunit.cpp
mov byte [esi + 0x3d], al
call fcn.00448460
mov ecx, dword [esi + 0x4c]
add esp, 8
or ecx, eax
mov dword [esi + 0x4c], ecx
jmp 0x49d7b3
fstp st(0)
fstp st(0)
mov esi, dword [esi + 0x7c]
test esi, esi
jne 0x49d462
mov eax, dword [esp + 0x20]
mov esi, dword [eax + 8]
test esi, esi
je 0x49dc6a
xor ecx, ecx
mov ebx, dword [esi + 8]
mov cl, byte [esi + 0x18]
mov al, 1
mov ebp, ecx
xor ecx, ecx
shl ebp, 8
cmp byte [ebp + 0x77e27d], 5
sete cl
test bl, 0x40
mov byte [esp + 0x13], cl
je 0x49d7fc
mov al, byte [esp + 0x68]
test al, al
setne al
jmp 0x49d806
mov cl, byte [esp + 0x68]
test cl, cl
je 0x49d806
xor al, al
test ebx, 0x8000000
jne 0x49d813
test bh, 1
je 0x49d815
xor al, al
mov ecx, dword [esi + 0x10]
cmp ecx, 8
jne 0x49d81f
xor al, al
cmp ecx, 0x11
jne 0x49d826
xor al, al
cmp ecx, 0x17
jne 0x49d82d
xor al, al
test al, al
je 0x49dc57
mov eax, dword [esi + 0x34]
mov ecx, dword [esp + 0x60]
cdq
and edx, 0xffff
mov edi, dword [esp + 0x64]
add eax, edx
sar eax, 0x10
sub ecx, eax
mov eax, dword [esi + 0x38]
cdq
and edx, 0xffff
add eax, edx
sar eax, 0x10
sub edi, eax
mov eax, ecx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x18]
cmp eax, edx
jge 0x49dc57
mov eax, edi
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x18]
cmp eax, edx
jge 0x49dc57
mov edx, ecx
mov eax, edi
imul edx, ecx
imul eax, edi
mov dword [esp + 0x38], edx
mov ecx, dword [esp + 0x18]
fild dword [esp + 0x38]
mov dword [esp + 0x38], eax
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x50], 0
fiadd dword [esp + 0x38]
fsqrt
fild qword [esp + 0x4c]
fld st(1)
fcomp st(1)
fnstsw ax
test ah, 1
je 0x49dc53
mov edi, dword [esp + 0x24]
xor eax, eax
xor edx, edx
xor ecx, ecx
mov al, byte [edi + 0x78207d]
mov dl, byte [ebp + 0x77e252]
mov dword [esp + 0x58], 0
lea eax, [eax + eax*4]
mov cl, byte [edx + eax*4 + 0x790550]
mov eax, 0x51eb851f
imul ecx, dword [edi + 0x78206c]
mul ecx
shr edx, 5
mov dword [esp + 0x54], edx
fild qword [esp + 0x54]
fld st(1)
fsub st(3)
fdiv st(2)
fmulp st(1)
call fcn.004b1840
mov ecx, dword [esi + 4]
or ebx, 1
fstp st(0)
cmp eax, ecx
mov dword [esi + 8], ebx
fstp st(0)
jl 0x49daa9
mov dl, byte [esp + 0x6c]
mov al, byte [0x6d610a]
cmp dl, al
je 0x49d9a2
mov ebx, dword [esp + 0x70]
cmp bl, 0xff
je 0x49d95e
mov ebp, dword [esp + 0x14]
mov eax, ebx
and eax, 0xff
cmp byte [eax + ebp*8 + 0x798830], 2
jne 0x49d962
push ebx
push ebp
call fcn.0049f870
add esp, 8
jmp 0x49d962
mov ebp, dword [esp + 0x14]
mov cx, word [esp + 0x74]
push ebx
mov word [esi + 0x32], cx
mov byte [esi + 0x30], bl
call fcn.004a4660
xor edx, edx
add esp, 4
mov dl, byte [esi + 0x18]
push ebx
lea ecx, [ebp + edx*8]
lea eax, [eax + ecx*4 + 0x24c98]
inc dword [eax]
call fcn.004a4660
mov ecx, dword [eax + 0x24c90]
add eax, 0x24c90
add esp, 4
inc ecx
mov dword [eax], ecx
jmp 0x49d9a6
mov ebp, dword [esp + 0x14]
xor edx, edx
mov dl, byte [esi + 0x18]
shl edx, 8
mov al, byte [edx + 0x77e261]
test al, al
je 0x49d9dd
xor eax, eax
mov al, byte [edi + 0x78207d]
lea eax, [eax + eax*4]
mov cl, byte [eax*4 + 0x790560]
add cl, 9
and ecx, 0xff
push ecx
push esi
call fcn.00494050
add esp, 8
mov al, byte [esp + 0x13]
test al, al
je 0x49d9f1
mov dword [esi + 4], 1
jmp 0x49dc57
xor edx, edx
mov dl, byte [0x798544]
cmp ebp, edx
jne 0x49da35
push 0
push 0
push 1
push str.H_UNITLOST
call fcn.0048dd90
add esp, 4
push eax
push str.O_UNITLOST
call fcn.0048dd90
add esp, 4
push eax
push str.S_UNITLOST
call fcn.0048dd90
add esp, 4
push eax
call fcn.0046f900
add esp, 0x18
mov eax, dword [esi + 8]
test ah, 0x10
je 0x49da71
mov al, byte [esi + 0x2d]
push eax
call fcn.004a4660
mov ebx, dword [eax + 0x24a08]
add eax, 0x24a08
add esp, 4
inc ebx
mov dword [eax], ebx
mov cl, byte [esi + 0x2d]
push ecx
call fcn.004a4660
add esp, 4
xor edx, edx
mov dl, byte [esi + 0x18]
lea eax, [eax + edx*4 + 0x24a10]
jmp 0x49da8e
mov eax, dword [esp + 0x20]
mov edx, dword [eax + 0x24a08]
inc edx
xor ecx, ecx
mov dword [eax + 0x24a08], edx
mov cl, byte [esi + 0x18]
lea eax, [eax + ecx*4 + 0x24a10]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov dx, word [esi + 0x8c]
push edx
push ebp
call fcn.0049cde0
add esp, 8
jmp 0x49dc57
mov ebx, dword [esp + 0x70]
sub ecx, eax
cmp bl, 0xff
mov dword [esi + 4], ecx
je 0x49dae7
mov al, byte [esp + 0x6c]
mov cl, byte [0x6d610a]
cmp al, cl
je 0x49dae7
mov edi, dword [esp + 0x14]
mov ecx, ebx
and ecx, 0xff
cmp byte [ecx + edi*8 + 0x798830], 2
jne 0x49daeb
push ebx
push edi
call fcn.0049f870
add esp, 8
jmp 0x49daeb
mov edi, dword [esp + 0x14]
mov eax, dword [esi + 8]
test eax, 0x2000000
jne 0x49db57
xor edx, edx
mov dl, byte [esi + 0x18]
shl edx, 8
cmp byte [edx + 0x77e27d], 1
jne 0x49db5f
xor eax, eax
mov al, byte [0x798544]
cmp edi, eax
jne 0x49db5f
cmp word [esp + 0x74], 0xffff
je 0x49db5f
push 0
push 0x12c
push 1
push str.H_HARVATTACK
call fcn.0048dd90
add esp, 4
push eax
push str.O_HARVATTACK
call fcn.0048dd90
add esp, 4
push eax
push str.S_HARVATTACK
call fcn.0048dd90
add esp, 4
push eax
call fcn.0046f900
add esp, 0x18
jmp 0x49db5f
and eax, 0xfdffffff
mov dword [esi + 8], eax
mov al, byte [esp + 0x13]
test al, al
jne 0x49db97
xor ecx, ecx
mov eax, dword [esi + 4]
mov cl, byte [esi + 0x18]
shl ecx, 8
mov edx, dword [ecx + 0x77e254]
shr edx, 1
cmp eax, edx
jge 0x49db97
push 0x1dba
push str.C:MsDevProjectsJuly2000codeunit.cpp
call fcn.00448460
and al, 0x7f
add esp, 8
add al, 0x40
mov byte [esi + 0x27], al
cmp word [esi + 0x32], 0xffff
jne 0x49dbc4
mov al, byte [0x6d610a]
mov cl, byte [esp + 0x6c]
cmp cl, al
je 0x49dbc4
mov ecx, ebx
and ecx, 0xff
cmp ecx, edi
je 0x49dbc4
mov dx, word [esp + 0x74]
mov byte [esi + 0x30], bl
mov word [esi + 0x32], dx
mov al, byte [esp + 0x78]
test al, al
je 0x49dc57
mov al, byte [esp + 0x13]
test al, al
jne 0x49dc57
mov edi, dword [esi + 8]
mov ebx, dword [esp + 0x14]
and edi, 0xfffffffe
mov dword [esi + 8], edi
mov edi, dword [esp + 0x70]
mov eax, edi
and eax, 0xff
cmp eax, ebx
je 0x49dc4d
xor ecx, ecx
mov cl, byte [esi + 0x18]
shl ecx, 8
mov al, byte [ecx + 0x77e261]
test al, al
jne 0x49dc4d
push esi
call fcn.0049d280
add esp, 4
test al, al
je 0x49dc19
mov byte [esi + 0x2a], 1
jmp 0x49dc57
mov eax, dword [esi + 8]
test ah, 0x10
jne 0x49dc24
mov byte [esi + 0x2d], bl
xor edx, edx
push 0
mov dx, word [esi + 0x8c]
push edx
push edi
push ebx
call fcn.0046d2e0
add esp, 0x10
test eax, eax
je 0x49dc57
mov ecx, dword [eax + 8]
mov byte [eax + 0x2e], 0xf0
or ch, 0x10
mov dword [eax + 8], ecx
jmp 0x49dc57
mov byte [esi + 0x2a], 1
jmp 0x49dc57
fstp st(0)
fstp st(0)
mov esi, dword [esi + 0x7c]
test esi, esi
jne 0x49d7cd
mov ebx, dword [esp + 0x70]
mov ebp, dword [esp + 0x14]
xor eax, eax
inc ebp
mov al, byte [0x798628]
mov dword [esp + 0x14], ebp
cmp ebp, eax
jl 0x49d43e
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov eax, dword [ecx*4 + 0x547df0]
add eax, edx
lea esi, [eax + eax*2]
mov al, byte [esp + 0x68]
shl esi, 2
test al, al
jne 0x49dd6b
mov ebx, dword [esi + 0x517df4]
test bh, 0x40
je 0x49dd6b
test ebx, 0x700000
jne 0x49dd6b
test bl, 0x10
jne 0x49dd6b
mov edx, dword [esp + 0x24]
xor eax, eax
xor ecx, ecx
mov al, byte [edx + 0x78207d]
lea eax, [eax + eax*4]
mov cl, byte [eax*4 + 0x790550]
mov eax, 0x51eb851f
imul ecx, dword [edx + 0x78206c]
imul ecx
sar edx, 5
mov ecx, edx
mov eax, 0xcccccccd
shr ecx, 0x1f
add edx, ecx
mov cl, byte [esi + 0x517df9]
mul edx
shr edx, 5
mov eax, ecx
mov edi, edx
and eax, 0xff
add edi, eax
cmp edi, 0xff
jae 0x49dd64
add cl, dl
cmp cl, 0x10
mov byte [esi + 0x517df9], cl
jbe 0x49dd6b
test bh, 8
je 0x49dd6b
test bh, 0x80
je 0x49dd6b
and bh, 0xf7
push 0x1e08
push str.C:MsDevProjectsJuly2000codeunit.cpp
mov dword [esi + 0x517df4], ebx
call fcn.00448460
add esp, 8
and eax, 7
mov cx, word [eax*2 + 0x4e0af0]
mov word [esi + 0x517df0], cx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov byte [esi + 0x517df9], 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret