Function at 0x40d0d0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x547d88
mov eax, dword fs:[0]
push eax
sub esp, 0x164
mov eax, dword [0x5a10e0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
xor ebx, ebx
mov dword [ebp - 0x130], esi
mov dword [ebp - 0x124], ebx
mov dword [ebp - 4], 1
mov eax, dword [esi + 0x2c]
xor ecx, ecx
mov word [ebp - 0xac], cx
mov ecx, eax
mov dword [ebp - 0x98], 7
mov dword [ebp - 0x9c], ebx
lea edi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x40d136
sub ecx, edi
sar ecx, 1
push ecx
lea ecx, [ebp - 0xac]
call fcn.00403230
push 0x14
mov eax, str._resources_setup.xml
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 2
call fcn.004089c0
mov eax, dword [ebp - 0xac]
mov edi, 8
cmp dword [ebp - 0x98], edi
jae 0x40d180
lea eax, [ebp - 0xac]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d1c1
mov eax, dword [esi + 0x50]
push str.Setup.xml_does_not_exist.
mov ebx, 0x576f68
call fcn.00416120
add esp, 4
cmp dword [ebp - 0x98], edi
jb 0x40d1b7
mov edx, dword [ebp - 0xac]
push edx
call fcn.004166f8
add esp, 4
mov eax, 0xfffffff7
jmp 0x40de95
mov ecx, dword [ebp - 0xac]
cmp dword [ebp - 0x98], edi
jae 0x40d1d5
lea ecx, [ebp - 0xac]
lea eax, [ebp - 0x124]
push eax
call fcn.00401e40
test al, al
jne 0x40d251
mov eax, dword [esi + 0x50]
push str.Could_not_initialize_ADXML_object
mov ebx, 0x576f68
call fcn.00416120
add esp, 4
cmp dword [ebp - 0x98], edi
jb 0x40d211
mov ecx, dword [ebp - 0xac]
push ecx
call fcn.004166f8
add esp, 4
xor edx, edx
mov dword [ebp - 0x98], 7
mov dword [ebp - 0x9c], 0
mov word [ebp - 0xac], dx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x124]
test eax, eax
je 0x40d247
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, 0xfffffff5
jmp 0x40de95
mov edi, 0x57ae24
lea ecx, [ebp - 0x124]
call fcn.00402190
test al, al
jne 0x40d2d7
mov eax, dword [esi + 0x50]
push str.__setup_info
push str._s_tag_not_found_in_setup_manifest
mov ebx, 0x576f68
call fcn.00416120
add esp, 8
cmp dword [ebp - 0x98], 8
jb 0x40d297
mov eax, dword [ebp - 0xac]
push eax
call fcn.004166f8
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x124]
xor ecx, ecx
mov dword [ebp - 0x98], 7
mov dword [ebp - 0x9c], 0
mov word [ebp - 0xac], cx
test eax, eax
je 0x40d2cd
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov eax, 0xfffffff5
jmp 0x40de95
mov edi, str.__setup_info_checks_os_version
lea ecx, [ebp - 0x124]
call fcn.00402190
test al, al
je 0x40d76e
lea ecx, [ebp - 0x15c]
push ecx
lea edx, [ebp - 0x128]
push edx
mov ecx, edi
lea edx, [ebp - 0x124]
mov dword [ebp - 0x15c], ebx
call fcn.004023c0
mov byte [ebp - 4], 3
mov dword [ebp - 0x154], ebx
cmp dword [ebp - 0x15c], ebx
jle 0x40d758
lea eax, [esi + 4]
add esi, 0xd4
mov dword [ebp - 0x134], eax
mov dword [ebp - 0x12c], esi
mov ecx, dword [ebp - 0x154]
mov edx, dword [ebp - 0x128]
push ecx
push ecx
mov eax, esp
mov dword [eax], edx
mov eax, dword [ebp - 0x128]
mov dword [ebp - 0x138], esp
cmp eax, ebx
je 0x40d365
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
push eax
call edx
lea eax, [ebp - 0x158]
push eax
lea ecx, [ebp - 0x124]
push ecx
call fcn.004024c0
mov byte [ebp - 4], 4
mov edx, dword [ebp - 0x158]
push ecx
mov eax, esp
mov dword [eax], edx
mov eax, dword [ebp - 0x158]
mov dword [ebp - 0x138], esp
cmp eax, ebx
je 0x40d39f
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
push eax
call edx
lea eax, [ebp - 0x124]
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402580
mov byte [ebp - 4], 5
mov esi, dword [ebp - 0x148]
push 5
push str.major
lea ecx, [ebp - 0x100]
mov dword [ebp - 0x168], ebx
mov dword [ebp - 0x164], ebx
mov dword [ebp - 0x138], ebx
mov dword [ebp - 0xec], 0xf
mov dword [ebp - 0xf0], ebx
mov byte [ebp - 0x100], bl
call fcn.00403080
lea ecx, [ebp - 0x170]
push ecx
lea edi, [ebp - 0x100]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 6
call fcn.00411690
mov edi, dword [eax]
cmp edi, esi
setne byte [ebp - 0x11d]
mov byte [ebp - 4], 5
cmp dword [ebp - 0xec], 0x10
jb 0x40d438
mov edx, dword [ebp - 0x100]
push edx
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xec], 0xf
mov dword [ebp - 0xf0], ebx
mov byte [ebp - 0x100], bl
cmp byte [ebp - 0x11d], bl
je 0x40d45f
add edi, 0x28
mov dword [ebp - 0x168], edi
push 5
push str.minor
lea ecx, [ebp - 0xe4]
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
call fcn.00403080
lea eax, [ebp - 0x16c]
push eax
lea edi, [ebp - 0xe4]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 7
call fcn.00411690
mov edi, dword [eax]
cmp edi, esi
setne byte [ebp - 0x11d]
mov byte [ebp - 4], 5
cmp dword [ebp - 0xd0], 0x10
jb 0x40d4ca
mov ecx, dword [ebp - 0xe4]
push ecx
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
cmp byte [ebp - 0x11d], bl
je 0x40d4f1
add edi, 0x28
mov dword [ebp - 0x164], edi
push 0xc
push str.service_pack
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
call fcn.00403080
lea edx, [ebp - 0x160]
push edx
lea edi, [ebp - 0xc8]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 8
call fcn.00411690
mov edi, dword [eax]
cmp edi, esi
setne byte [ebp - 0x11d]
mov byte [ebp - 4], 5
cmp dword [ebp - 0xb4], 0x10
jb 0x40d55c
mov eax, dword [ebp - 0xc8]
push eax
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
cmp byte [ebp - 0x11d], bl
je 0x40d583
add edi, 0x28
mov dword [ebp - 0x138], edi
mov eax, dword [ebp - 0x168]
xor esi, esi
xor edi, edi
mov dword [ebp - 0x150], ebx
cmp eax, ebx
je 0x40d5ae
cmp dword [eax + 0x14], 0x10
jb 0x40d59f
mov eax, dword [eax]
push eax
call fcn.00518184
add esp, 4
mov dword [ebp - 0x150], eax
mov eax, dword [ebp - 0x164]
cmp eax, ebx
je 0x40d5cb
cmp dword [eax + 0x14], 0x10
jb 0x40d5c0
mov eax, dword [eax]
push eax
call fcn.00518184
add esp, 4
mov esi, eax
mov eax, dword [ebp - 0x138]
cmp eax, ebx
je 0x40d5e8
cmp dword [eax + 0x14], 0x10
jb 0x40d5dd
mov eax, dword [eax]
push eax
call fcn.00518184
add esp, 4
mov edi, eax
mov eax, dword [ebp - 0x150]
mov edx, dword [ebp - 0x130]
mov ecx, eax
imul ecx, ecx, 0x64
add ecx, esi
imul ecx, ecx, 0x64
push edi
push esi
push eax
lea eax, [ebp - 0x90]
add ecx, edi
push str._ld._ld._ld
push eax
mov dword [edx], ecx
call fcn.00516945
lea eax, [ebp - 0x90]
add esp, 0x14
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d622
mov ecx, dword [ebp - 0x134]
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x90]
call fcn.00403230
xor ecx, ecx
mov dword [ebp - 0x108], 7
mov dword [ebp - 0x10c], ebx
mov word [ebp - 0x11c], cx
mov eax, dword [ebp - 0x150]
lea edx, [ebp - 0x11c]
push edx
push esi
push eax
mov ecx, edi
mov byte [ebp - 4], 9
call fcn.00410d60
mov eax, dword [ebp - 0x10c]
add esp, 0xc
push str.UNKNOWN
mov edi, 7
lea ecx, [ebp - 0x11c]
call fcn.00412760
test eax, eax
jne 0x40d6ae
mov ecx, dword [ebp - 0x134]
mov edi, dword [ebp - 0x12c]
push ebx
push ecx
or eax, 0xffffffff
call fcn.004015e0
mov edi, dword [ebp - 0x12c]
push ebx
lea edx, [ebp - 0x11c]
push edx
or eax, 0xffffffff
call fcn.004015e0
cmp dword [ebp - 0x108], 8
jb 0x40d6dc
mov eax, dword [ebp - 0x11c]
push eax
call fcn.004166f8
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x108], 7
mov dword [ebp - 0x10c], ebx
mov word [ebp - 0x11c], cx
mov byte [ebp - 4], 0xa
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax]
push eax
push ecx
lea edi, [ebp - 0x13c]
lea esi, [ebp - 0x14c]
call fcn.004034c0
mov edx, dword [ebp - 0x148]
push edx
call fcn.004166f8
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x158]
add esp, 4
cmp eax, ebx
je 0x40d739
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [ebp - 0x154]
inc eax
mov dword [ebp - 0x154], eax
cmp eax, dword [ebp - 0x15c]
jl 0x40d33b
mov esi, dword [ebp - 0x130]
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x128]
cmp eax, ebx
je 0x40d76e
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov edi, str.__setup_info_checks_scr_res
lea ecx, [ebp - 0x124]
call fcn.00402190
test al, al
je 0x40d99d
lea eax, [ebp - 0x128]
push eax
mov ecx, edi
lea edx, [ebp - 0x124]
call fcn.004022a0
mov byte [ebp - 4], 0xb
push ecx
mov ecx, dword [ebp - 0x128]
mov eax, esp
mov dword [eax], ecx
mov eax, dword [ebp - 0x128]
mov dword [ebp - 0x13c], esp
cmp eax, ebx
je 0x40d7c1
mov edx, dword [eax]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x124]
push ecx
lea ecx, [ebp - 0x14c]
call fcn.00402580
mov byte [ebp - 4], 0xc
mov edx, dword [ebp - 0x148]
push 0xa
push str.horizontal
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0x12c], edx
mov dword [ebp - 0x134], ebx
mov dword [ebp - 0x138], ebx
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
call fcn.00403080
lea eax, [ebp - 0x13c]
push eax
lea edi, [ebp - 0xc8]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0xd
call fcn.00411690
mov edi, dword [eax]
cmp edi, dword [ebp - 0x12c]
mov byte [ebp - 4], 0xc
setne byte [ebp - 0x11d]
cmp dword [ebp - 0xb4], 0x10
jb 0x40d85e
mov ecx, dword [ebp - 0xc8]
push ecx
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
cmp byte [ebp - 0x11d], bl
je 0x40d885
add edi, 0x28
mov dword [ebp - 0x134], edi
push 8
push str.vertical
lea ecx, [ebp - 0xe4]
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
call fcn.00403080
lea edx, [ebp - 0x160]
push edx
lea edi, [ebp - 0xe4]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0xe
call fcn.00411690
mov edi, dword [eax]
cmp edi, dword [ebp - 0x12c]
setne byte [ebp - 0x11d]
cmp dword [ebp - 0xd0], 0x10
jb 0x40d8f0
mov eax, dword [ebp - 0xe4]
push eax
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
cmp byte [ebp - 0x11d], bl
je 0x40d913
add edi, 0x28
jmp 0x40d919
mov edi, dword [ebp - 0x138]
mov eax, dword [ebp - 0x134]
cmp eax, ebx
je 0x40d937
cmp dword [eax + 0x14], 0x10
jb 0x40d92b
mov eax, dword [eax]
push eax
call fcn.00518184
add esp, 4
mov dword [esi + 0x24], eax
cmp edi, ebx
je 0x40d953
cmp dword [edi + 0x14], 0x10
jb 0x40d945
mov eax, dword [edi]
jmp 0x40d947
mov eax, edi
push eax
call fcn.00518184
add esp, 4
mov dword [esi + 0x28], eax
mov byte [ebp - 4], 0xf
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax]
push eax
push ecx
lea edi, [ebp - 0x13c]
lea esi, [ebp - 0x14c]
call fcn.004034c0
mov ecx, dword [ebp - 0x148]
push ecx
call fcn.004166f8
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x128]
add esp, 4
cmp eax, ebx
je 0x40d997
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov esi, dword [ebp - 0x130]
mov edi, 0x57af70
lea ecx, [ebp - 0x124]
call fcn.00402190
test al, al
je 0x40dce4
lea ecx, [ebp - 0x130]
push ecx
mov ecx, edi
lea edx, [ebp - 0x124]
call fcn.004022a0
mov byte [ebp - 4], 0x10
mov edx, dword [ebp - 0x130]
push ecx
mov eax, esp
mov dword [eax], edx
mov eax, dword [ebp - 0x130]
mov dword [ebp - 0x13c], esp
cmp eax, ebx
je 0x40d9f0
mov ecx, dword [eax]
mov edx, dword [ecx + 4]
push eax
call edx
lea eax, [ebp - 0x124]
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402580
mov byte [ebp - 4], 0x11
mov ecx, dword [ebp - 0x148]
push 0xd
mov dword [ebp - 0x128], ecx
push str.pimx_location
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
call fcn.00403080
lea edx, [ebp - 0x13c]
push edx
lea edi, [ebp - 0xc8]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0x12
call fcn.00411690
mov edi, dword [eax]
cmp edi, dword [ebp - 0x128]
mov byte [ebp - 4], 0x11
setne byte [ebp - 0x11d]
cmp dword [ebp - 0xb4], 0x10
jb 0x40da81
mov eax, dword [ebp - 0xc8]
push eax
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xb4], 0xf
mov dword [ebp - 0xb8], ebx
mov byte [ebp - 0xc8], bl
cmp byte [ebp - 0x11d], bl
je 0x40dc7d
push 0xf
add edi, 0x28
push str.target_location
lea ecx, [ebp - 0xe4]
mov dword [ebp - 0x12c], edi
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
call fcn.00403080
lea ecx, [ebp - 0x160]
push ecx
lea edi, [ebp - 0xe4]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0x14
call fcn.00411690
mov edi, dword [eax]
cmp edi, dword [ebp - 0x128]
mov byte [ebp - 4], 0x11
setne byte [ebp - 0x11d]
cmp dword [ebp - 0xd0], 0x10
jb 0x40db1b
mov edx, dword [ebp - 0xe4]
push edx
call fcn.004166f8
add esp, 4
mov dword [ebp - 0xd0], 0xf
mov dword [ebp - 0xd4], ebx
mov byte [ebp - 0xe4], bl
cmp byte [ebp - 0x11d], bl
je 0x40dc0b
add edi, 0x28
push str.executable
lea ecx, [ebp - 0x100]
mov dword [ebp - 0x134], edi
call fcn.00402dd0
lea eax, [ebp - 0x16c]
push eax
lea edi, [ebp - 0x100]
lea eax, [ebp - 0x14c]
mov byte [ebp - 4], 0x15
call fcn.00411690
mov edi, dword [eax]
cmp edi, dword [ebp - 0x128]
lea ecx, [ebp - 0x100]
setne byte [ebp - 0x11d]
mov byte [ebp - 4], 0x11
call fcn.00402e10
cmp byte [ebp - 0x11d], bl
je 0x40dbff
mov ecx, dword [ebp - 0x12c]
push ecx
mov ecx, dword [ebp - 0x134]
lea edx, [edi + 0x28]
push esi
call fcn.0040cdb0
test al, al
jne 0x40dbd0
mov eax, dword [esi + 0x50]
push str.Unable_to_set_core_package_parameters
mov ebx, 0x576f68
call fcn.00416120
add esp, 4
lea edx, [ebp - 0x14c]
push edx
jmp 0x40dc2c
lea eax, [ebp - 0x14c]
push eax
mov byte [ebp - 4], 0x10
call fcn.00402b00
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x130]
cmp eax, ebx
je 0x40dd36
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
jmp 0x40dd36
push str.__setup_info_package_core
push str.executable_not_found_in__s_tag
jmp 0x40dc15
push str.__setup_info_package_core
push str.target_location_not_found_in__s_tag
mov eax, dword [esi + 0x50]
mov ebx, 0x576f68
call fcn.00416120
add esp, 8
lea eax, [ebp - 0x14c]
push eax
mov byte [ebp - 4], 0x10
call fcn.00402b00
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x130]
test eax, eax
je 0x40dc4b
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
lea esi, [ebp - 0xac]
call fcn.004015b0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x124]
test eax, eax
je 0x40d247
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, 0xfffffff5
jmp 0x40de95
mov eax, dword [esi + 0x50]
push str.__setup_info_package_core
push str.pimx_location_not_found_in__s_tag
mov ebx, 0x576f68
call fcn.00416120
add esp, 8
mov byte [ebp - 4], 0x13
mov eax, dword [ebp - 0x148]
mov ecx, dword [eax]
push eax
push ecx
lea edi, [ebp - 0x13c]
lea esi, [ebp - 0x14c]
call fcn.004034c0
mov eax, dword [ebp - 0x148]
push eax
call fcn.004166f8
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x130]
add esp, 4
test eax, eax
je 0x40d27f
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
jmp 0x40d27f
mov eax, dword [esi + 0xac]
cmp eax, 2
je 0x40dd1a
cmp eax, 1
je 0x40dd1a
mov eax, dword [esi + 0x50]
push str.__setup_info_package_core
push str._s_tag_not_found_in_setup_manifest
mov ebx, 0x576f68
call fcn.00416120
add esp, 8
cmp dword [ebp - 0x98], 8
jmp 0x40d200
mov eax, dword [esi + 0x50]
push str.__setup_info_package_core
push str._s_tag_not_found_in_setup_manifest
mov ebx, 0x576f68
call fcn.004160c0
add esp, 8
xor ebx, ebx
mov edi, 0x57b110
lea ecx, [ebp - 0x124]
call fcn.00402190
test al, al
je 0x40dda9
lea eax, [esi + 0x3c]
push eax
lea ecx, [ebp - 0x12c]
lea edx, [ebp - 0x124]
mov dword [ebp - 0x12c], ebx
call fcn.00402b60
mov ebx, 0x576f68
test al, al
jne 0x40dd93
mov eax, dword [esi + 0x50]
push str.__setup_info_package_info_pimx_location
push str.Error_parsing__s_tag_in_setup_manifest
call fcn.00416120
add esp, 8
lea esi, [ebp - 0xac]
call fcn.004015b0
jmp 0x40d22e
mov eax, dword [ebp - 0x12c]
push eax
mov eax, dword [esi + 0x50]
push str.Found__d_packages_in_setup_manifest
call fcn.00416090
jmp 0x40ddc0
mov eax, dword [esi + 0x50]
push str.__setup_info_package_info_pimx_location
push str._s_tag_not_found_in_setup_manifest
mov ebx, 0x576f68
call fcn.004160c0
mov ecx, dword [esi + 0x40]
sub ecx, dword [esi + 0x3c]
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add esp, 8
xor edi, edi
add ecx, edx
je 0x40de45
mov dword [ebp - 0x128], edi
jmp 0x40ddf0
mov eax, dword [esi + 0x2c]
mov ecx, dword [esi + 0x3c]
add ecx, dword [ebp - 0x128]
mov edx, eax
lea ebx, [edx + 2]
mov dword [ebp - 0x12c], ebx
mov bx, word [edx]
add edx, 2
test bx, bx
jne 0x40de07
sub edx, dword [ebp - 0x12c]
sar edx, 1
push edx
call fcn.00412510
mov ecx, dword [esi + 0x40]
sub ecx, dword [esi + 0x3c]
add dword [ebp - 0x128], 0x1c
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
inc edi
add eax, edx
cmp edi, eax
jb 0x40ddf0
cmp dword [ebp - 0x98], 8
jb 0x40de5d
mov ecx, dword [ebp - 0xac]
push ecx
call fcn.004166f8
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x124]
xor edx, edx
mov dword [ebp - 0x98], 7
mov dword [ebp - 0x9c], 0
mov word [ebp - 0xac], dx
test eax, eax
je 0x40de93
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00515d64
mov esp, ebp
pop ebp
ret