Function at 0x407a20
Capabilities:
Check mutex on windows
Create thread
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x538
push ebx
mov ebx, dword [esp + 0x540]
push ebp
mov ebp, dword [esp + 0x54c]
push esi
push edi
lea eax, [ebx + 0x1320]
push eax
lea ecx, [esp + 0xac]
xor esi, esi
push 0x5ab99c
push ecx
mov dword [esp + 0x38], esi
mov dword [esp + 0x48], esi
call fcn.004b70c5
add esp, 0xc
cmp dword [ebp + 0x444], esi
jne 0x407a76
lea edx, [esp + 0xa8]
push edx
call fcn.004b7dfa
add esp, 4
lea eax, [ebx + 0xec8]
push 2
push eax
call fcn.00457f70
add esp, 8
xor ecx, ecx
lea esp, [esp]
cmp eax, dword [ecx*8 + 0x5ab2e0]
jb 0x407aad
cmp eax, dword [ecx*8 + 0x5ab2e8]
jb 0x407aac
add ecx, 2
cmp ecx, 0xe
jb 0x407a90
jmp 0x407aad
inc ecx
cmp ecx, 0xe
jne 0x407abc
mov edi, 0x107ac0
jmp 0x407b5c
mov edx, dword [ecx*8 + 0x5ab2e0]
mov esi, dword [ecx*8 + 0x5ab2d8]
mov edi, edx
sub edi, eax
mov dword [esp + 0x24], edi
fild dword [esp + 0x24]
jns 0x407ade
fadd qword [0x5b4428]
mov edi, dword [ecx*8 + 0x5ab2dc]
fild dword [ecx*8 + 0x5ab2dc]
test edi, edi
jns 0x407af6
fadd qword [0x5b4428]
sub eax, esi
fmulp st(1)
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
jns 0x407b0a
fadd qword [0x5b4428]
mov eax, dword [ecx*8 + 0x5ab2e4]
fild dword [ecx*8 + 0x5ab2e4]
test eax, eax
jns 0x407b22
fadd qword [0x5b4428]
fmulp st(1)
sub edx, esi
mov dword [esp + 0x24], edx
faddp st(1)
fild dword [esp + 0x24]
jns 0x407b38
fadd qword [0x5b4428]
fdivp st(1)
fnstcw word [esp + 0x16]
movzx eax, word [esp + 0x16]
or eax, 0xc00
mov dword [esp + 0x38], eax
fldcw word [esp + 0x38]
fistp qword [esp + 0x78]
mov edi, dword [esp + 0x78]
fldcw word [esp + 0x16]
mov eax, dword [ebp + 0x440]
mov dword [esp + 0x20], edi
mov dword [esp + 0x40], 0
test eax, eax
je 0x407c36
cmp eax, edi
jb 0x407b98
push 1
push ebp
push ebx
call fcn.00406420
mov eax, ebx
add esp, 0xc
call fcn.00406a20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x538
ret
cmp dword [0x5d5f9c], 0
jle 0x407baf
push eax
push str.nfs:_resuming_poly_search:_reducing_deadline_by__u_seconds_n
call fcn.004b7f6d
add esp, 8
lea ecx, [ebx + 0x24]
push 0x51a9e0
push ecx
call fcn.004b80e6
mov esi, eax
add esp, 8
test esi, esi
jne 0x407bf3
push str.could_not_open_yafu_logfile_for_appending_n
call fcn.004b7f6d
add esp, 4
call fcn.004b7db1
mov edx, dword [eax]
push edx
call fcn.004b731f
add esp, 4
push eax
push str.fopen_error:__s_n
call fcn.004b7f6d
add esp, 8
jmp 0x407c26
mov eax, dword [ebp + 0x440]
push eax
push str.nfs:_resuming_poly_search__reducing_deadline_by__u_seconds_n
push esi
call fcn.00443960
mov ecx, dword [ebp + 0x444]
add esp, 0xc
push ecx
push str.nfs:_resuming_poly_search__starting_at_last_coefficient__u_n
push esi
call fcn.00443960
add esp, 0xc
push esi
call fcn.004b8276
add esp, 4
mov eax, dword [ebp + 0x440]
sub edi, eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x20], edi
cmp dword [ebx + 0x2324], 0
mov esi, dword [0x5d6980]
jne 0x407c51
mov eax, edi
xor edx, edx
div esi
mov edi, eax
mov dword [esp + 0x20], edi
cmp dword [0x5d5f9c], 0
jle 0x407c6e
push edi
push str.nfs:_setting_deadline_of__u_seconds_n
call fcn.004b7f6d
mov esi, dword [0x5d6980]
add esp, 8
lea edx, [esp + 0x44]
test edx, edx
je 0x407cd4
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov edx, dword [esp + 0x9c]
xor esi, esi
push esi
xor ecx, ecx
or ecx, dword [esp + 0x9c]
push 0xa
or edx, esi
push edx
push ecx
call fcn.004bdc20
mov esi, eax
push 0
add esi, 0xb779c000
push 0xf4240
adc edx, 0xffd6a169
push edx
push esi
call fcn.004bdc20
mov dword [esp + 0x44], eax
imul eax, eax, 0xf4240
sub esi, eax
mov dword [esp + 0x48], esi
mov esi, dword [0x5d6980]
lea ecx, [esi + esi*4]
shl ecx, 8
push ecx
call fcn.004b7263
lea edx, [esi*4]
add esp, 4
push edx
mov dword [esp + 0x2c], eax
call fcn.004b7263
add esp, 4
mov ebp, eax
push 4
mov dword [esp + 0x54], ebp
call fcn.004b7263
add esp, 4
mov dword [esp + 0x1c], eax
cmp esi, 1
jle 0x407d3a
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, dword [0x5d6980]
mov dword [esp + 0x4c], eax
lea eax, [esi*4]
push eax
call fcn.004b7263
add esp, 4
mov dword [esp + 0x3c], eax
xor ebx, ebx
cmp dword [0x5d5f9c], ebx
jle 0x407d49
mov ebx, 2
or ebx, 0x1c0
xor edi, edi
mov dword [esp + 0x24], ebx
test esi, esi
jle 0x407de8
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
add esi, 0x4d8
nop
mov eax, dword [esp + 0x55c]
mov edx, dword [esp + 0x54c]
mov ecx, dword [esp + 0x558]
push 0
push 0x3e9
push 0
push 1
push ebx
push edi
push eax
mov dword [esi - 4], edx
mov edx, dword [esp + 0x56c]
push ecx
push edx
lea eax, [esi - 0x4d8]
call fcn.00408770
mov eax, dword [esp + 0x40]
mov dword [esi + 0x10], eax
mov eax, dword [0x5d6980]
add esp, 0x24
mov dword [esi], edi
mov dword [esi + 4], 1
mov dword [esi + 0xc], ebp
cmp eax, 1
jle 0x407dd8
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x4c]
mov dword [esi + 0x24], ecx
mov dword [esi + 0x20], edx
add dword [esp + 0x18], 4
inc edi
add esi, 0x500
cmp edi, eax
jl 0x407d70
mov edi, dword [esp + 0x54c]
lea eax, [edi + 0x24]
push 0x51a9e0
push eax
call fcn.004b80e6
mov esi, eax
xor ebx, ebx
add esp, 8
cmp esi, ebx
jne 0x407e32
call fcn.004b7db1
mov eax, dword [eax]
push eax
call fcn.004b731f
add esp, 4
push eax
push str.fopen_error:__s_n
call fcn.004b7f6d
push str.could_not_open_yafu_logfile_for_appending_n
call fcn.004b7f6d
add esp, 0xc
jmp 0x407e63
mov ecx, dword [0x5d6980]
push ecx
push str.nfs:_commencing_poly_selection_with__d_threads_n
push esi
call fcn.00443960
mov edx, dword [esp + 0x2c]
add esp, 0xc
push edx
push str.nfs:_setting_deadline_of__u_seconds_n
push esi
call fcn.00443960
add esp, 0xc
push esi
call fcn.004b8276
add esp, 4
mov eax, dword [edi + 0x130c]
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x68], eax
cmp eax, ebx
ja 0x407e7d
mov dword [esp + 0x68], 1
mov eax, dword [edi + 0x1310]
cmp eax, ebx
jbe 0x407ea9
xor edx, edx
div dword [0x5d6980]
xor ecx, ecx
mov dword [esp + 0x80], eax
or eax, ecx
jne 0x407eb6
mov dword [esp + 0x80], 1
jmp 0x407eb6
mov eax, dword [edi + 0x232c]
mov dword [esp + 0x80], eax
mov eax, dword [0x5d6980]
cmp eax, 1
jle 0x407f4e
xor edi, edi
test eax, eax
jle 0x407f4e
mov esi, dword [esp + 0x28]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateEventA]
mov ebp, dword [sym.imp.KERNEL32.dll_CreateThread]
add esi, 0x4f0
push 0
push 0
push 0
push 0
mov dword [esi - 0x10], 0
call ebx
push 0
push 0
push 0
push 0
mov dword [esi], eax
call ebx
push 0
push 0
push 0
push 0
mov dword [esi + 4], eax
call ebx
mov ecx, dword [esi + 8]
push 0
push 0
lea edx, [esi - 0x4f0]
push edx
push 0x40a490
push 0
push 0
mov dword [ecx], eax
call ebp
mov dword [esi - 4], eax
mov eax, dword [esi + 4]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esp + 0x50]
mov dword [ecx + edi*4], edi
inc edi
add esi, 0x500
cmp edi, dword [0x5d6980]
jl 0x407ee4
mov eax, dword [esp + 0x1c]
mov edx, dword [0x5d6980]
mov dword [eax], edx
xor eax, eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x18], 1
mov dword [esp + 0x64], eax
lea esp, [esp]
mov ecx, dword [esp + 0x1c]
cmp dword [ecx], 0
jle 0x408447
cmp dword [esp + 0x18], 0
jne 0x407f88
dec dword [esp + 0x2c]
cmp dword [0x5d6980], 1
jle 0x407fbe
mov edx, dword [esp + 0x4c]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x1c]
dec dword [eax]
mov eax, dword [eax]
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x4c]
mov ebx, dword [ecx + eax*4]
push edx
mov dword [esp + 0x58], ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x407fc4
xor ebx, ebx
mov dword [esp + 0x54], ebx
lea ebp, [ebx + ebx*4]
shl ebp, 8
add ebp, dword [esp + 0x28]
lea edx, [esp + 0x30]
test edx, edx
je 0x408032
lea eax, [esp + 0x90]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov edx, dword [esp + 0x94]
xor esi, esi
push esi
xor ecx, ecx
or ecx, dword [esp + 0x94]
push 0xa
or edx, esi
push edx
push ecx
call fcn.004bdc20
mov esi, eax
push 0
add esi, 0xb779c000
push 0xf4240
adc edx, 0xffd6a169
push edx
push esi
call fcn.004bdc20
mov edi, eax
imul eax, eax, 0xf4240
sub esi, eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], esi
jmp 0x40803a
mov esi, dword [esp + 0x34]
mov edi, dword [esp + 0x30]
push 8
call fcn.004b7263
mov ecx, dword [esp + 0x48]
add esp, 4
cmp ecx, edi
jne 0x40805a
mov ecx, esi
sub ecx, dword [esp + 0x48]
mov dword [eax], 0
jmp 0x408081
mov edx, edi
sub edx, ecx
mov ecx, esi
sub ecx, dword [esp + 0x48]
dec edx
add ecx, 0xf4240
mov dword [eax], edx
mov dword [eax + 4], ecx
cmp ecx, 0xf4240
jl 0x408084
add ecx, 0xfff0bdc0
inc edx
mov dword [eax], edx
mov dword [eax + 4], ecx
fild dword [eax + 4]
push eax
fdiv qword [0x5b4430]
fiadd dword [eax]
fstp qword [esp + 0x5c]
call fcn.004b7229
add esp, 4
push 8
call fcn.004b7263
add esp, 4
mov ecx, eax
cmp dword [ebp + 0x4cc], edi
jne 0x4080c1
mov dword [ecx], 0
sub esi, dword [ebp + 0x4d0]
mov dword [ecx + 4], esi
jmp 0x4080ef
mov edx, 0xf4240
sub edx, dword [ebp + 0x4d0]
mov dword [ecx + 4], edx
sub edi, dword [ebp + 0x4cc]
add dword [ecx + 4], esi
mov eax, dword [ecx + 4]
dec edi
mov dword [ecx], edi
cmp eax, 0xf4240
jl 0x4080ef
add eax, 0xfff0bdc0
inc dword [ecx]
mov dword [ecx + 4], eax
fild dword [ecx + 4]
push ecx
fnstcw word [esp + 0x1a]
fdiv qword [0x5b4430]
movzx eax, word [esp + 0x1a]
or eax, 0xc00
mov dword [esp + 0x74], eax
fiadd dword [ecx]
fldcw word [esp + 0x74]
fistp qword [esp + 0x74]
mov esi, dword [esp + 0x74]
fldcw word [esp + 0x1a]
call fcn.004b7229
add esp, 4
cmp dword [esp + 0x18], 0
jne 0x408228
add dword [esp + 0x40], esi
inc dword [esp + 0x64]
lea eax, [esp + 0xa8]
push 0x51ac64
push eax
mov dword [esp + 0x40], esi
call fcn.004b80e6
add esp, 8
test eax, eax
jne 0x408187
lea ecx, [esp + 0xa8]
push 0x5ac544
push ecx
call fcn.004b80e6
mov esi, eax
mov eax, dword [esp + 0x554]
add eax, 0xec8
push eax
push str.n:__Zd_n
push esi
call fcn.00457f00
add esp, 0x14
push esi
jmp 0x408188
push eax
call fcn.004b8276
mov eax, dword [ebp + 0x4a4]
add esp, 4
lea edx, [esp + 0xa8]
push edx
push eax
lea ecx, [esp + 0x150]
push str.cat__s.p_____s_2__nul
push ecx
call fcn.004b70c5
lea edx, [esp + 0x158]
push edx
call fcn.004b7c92
add esp, 0x14
test eax, eax
je 0x4081f8
mov eax, dword [ebp + 0x4a4]
push eax
lea ecx, [esp + 0xfc]
push 0x5ab99c
push ecx
call fcn.004b70c5
lea edx, [esp + 0xb4]
add esp, 0xc
push edx
lea eax, [esp + 0xfc]
call fcn.00405600
add esp, 4
lea eax, [esp + 0xa8]
push 0x51a9e0
push eax
call fcn.004b80e6
mov ecx, dword [esp + 0x48]
push ecx
mov esi, eax
push str.time:__u_n
push esi
call fcn.004b80fd
add esp, 0x14
push esi
call fcn.004b8276
add esp, 4
mov edx, dword [ebp + 0x4a4]
push edx
lea eax, [esp + 0x14c]
push 0x5ab99c
push eax
call fcn.004b70c5
lea ecx, [esp + 0x154]
add esp, 0xc
push ecx
call fcn.004b7dfa
mov esi, dword [esp + 0x550]
add esp, 4
push ebx
lea eax, [esi + 0x1720]
push eax
lea edx, [esp + 0x150]
push 0x5acc78
push edx
call fcn.004b70c5
lea eax, [esp + 0x158]
push eax
call fcn.004b7dfa
add esp, 0x14
push ebx
lea eax, [esi + 0x1b20]
push eax
lea ecx, [esp + 0x150]
push 0x5acc78
push ecx
call fcn.004b70c5
lea edx, [esp + 0x158]
push edx
call fcn.004b7dfa
mov eax, dword [ebp + 0x4a8]
add esp, 0x14
push eax
call fcn.004b7229
mov ecx, dword [ebp + 0x4a4]
add esp, 4
push ecx
call fcn.004b7229
mov esi, dword [ebp + 0x4c0]
mov edi, dword [esi + 4]
add esp, 4
test edi, edi
je 0x4082fe
lea ebx, [ebx]
mov edx, dword [edi + 4]
mov ebx, dword [edi + 8]
push edx
call fcn.004b7229
add esp, 4
push edi
call fcn.004b7229
add esp, 4
mov edi, ebx
test ebx, ebx
jne 0x4082e0
mov eax, dword [esi + 0x18]
push eax
call fcn.004b7229
xor eax, eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov ecx, dword [esi + 0x48]
add esp, 4
push ecx
call fcn.004b7229
add esp, 4
push esi
call fcn.004b7229
add esp, 4
cmp dword [0x5d5d24], 0
jne 0x408447
fld qword [esp + 0x58]
fnstcw word [esp + 0x16]
movzx eax, word [esp + 0x16]
or eax, 0xc00
mov dword [esp + 0x70], eax
fldcw word [esp + 0x70]
fistp qword [esp + 0x58]
mov edx, dword [esp + 0x58]
add edx, dword [esp + 0x38]
fldcw word [esp + 0x16]
cmp edx, dword [esp + 0x20]
ja 0x408427
mov eax, dword [esp + 0x54c]
cmp dword [eax + 0x1310], 0
jbe 0x40839f
cmp dword [esp + 0x18], 0
jne 0x40839f
mov ecx, dword [esp + 0x54]
push ecx
push str.thread__d_finished_custom_range_search_n
call fcn.004b7f6d
add esp, 8
jmp 0x408427
mov eax, dword [esp + 0x68]
mov edi, dword [esp + 0x80]
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x24]
add edi, eax
mov ebx, 0
adc ebx, ecx
push ebx
push edi
push ecx
mov ecx, dword [esp + 0x568]
push eax
mov eax, dword [esp + 0x64]
push edx
mov edx, dword [esp + 0x56c]
push eax
mov eax, dword [esp + 0x568]
push ecx
push edx
push eax
mov eax, ebp
call fcn.00408770
mov ecx, dword [esp + 0x570]
add esp, 0x24
cmp dword [ecx + 0x2324], 2
je 0x4083ff
mov dword [esp + 0x68], edi
mov dword [esp + 0x6c], ebx
mov esi, 1
cmp dword [0x5d6980], esi
jle 0x408423
mov edx, dword [ebp + 0x4f0]
push edx
mov dword [ebp + 0x4e0], 3
call dword [sym.imp.KERNEL32.dll_SetEvent]
add dword [esp + 0x2c], esi
cmp dword [0x5d6980], 1
jne 0x40843a
mov eax, dword [esp + 0x1c]
mov dword [eax], 0
mov ecx, dword [esp + 0x1c]
cmp dword [ecx], 0
jg 0x407f7d
mov esi, dword [esp + 0x34]
xor ebp, ebp
cmp dword [esp + 0x18], ebp
je 0x408457
mov dword [esp + 0x18], ebp
cmp dword [esp + 0x2c], ebp
je 0x408527
mov eax, dword [0x5d6980]
cmp eax, 1
jle 0x40847f
mov edx, dword [esp + 0x3c]
push 0xffffffffffffffff
push ebp
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
jmp 0x407f70
mov esi, dword [esp + 0x28]
mov eax, dword [esi + 0x4a4]
push eax
call fcn.004b7dfa
add esp, 4
cmp dword [0x5d5f9c], ebp
jl 0x4084fc
mov eax, dword [esi + 0x4c0]
lea ecx, [esp + 0xa0]
push ecx
mov ecx, dword [eax + 0x4c]
lea edx, [esp + 0x8c]
push edx
push str.min_coeff_I64u_max_coeff_I64u
push ecx
call fcn.004b7207
mov edx, dword [esp + 0xb4]
mov eax, dword [esp + 0xb0]
mov ecx, dword [esp + 0x9c]
push edx
mov edx, dword [esp + 0x9c]
push eax
push ecx
push edx
push str.nfs:_commencing_polynomial_search_over_range:__I64u____I64u_n
call fcn.004b7f6d
add esp, 0x24
call fcn.004b7416
add eax, 0x20
push eax
call fcn.004b7c36
add esp, 4
mov eax, dword [esi + 0x4c8]
mov ecx, dword [esi + 0x4c0]
push eax
push ecx
mov ecx, dword [esi + 0x4c4]
call fcn.0050b0d0
mov edx, dword [esp + 0x24]
add esp, 8
mov dword [edx], 1
jmp 0x407f70
lea eax, [esp + 0x30]
test eax, eax
je 0x40857d
lea ecx, [esp + 0x78]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov eax, dword [esp + 0x7c]
push ebp
xor edx, edx
or edx, dword [esp + 0x7c]
xor esi, esi
push 0xa
or eax, esi
push eax
push edx
call fcn.004bdc20
mov esi, eax
push ebp
add esi, 0xb779c000
push 0xf4240
adc edx, 0xffd6a169
push edx
push esi
call fcn.004bdc20
mov edi, eax
imul eax, eax, 0xf4240
sub esi, eax
mov dword [esp + 0x34], esi
jmp 0x408581
mov edi, dword [esp + 0x30]
push 8
call fcn.004b7263
mov ecx, dword [esp + 0x48]
sub esi, dword [esp + 0x4c]
add esp, 4
cmp ecx, edi
jne 0x40859e
mov dword [eax], ebp
mov dword [eax + 4], esi
jmp 0x4085c2
sub edi, ecx
lea ecx, [esi + 0xf4240]
lea edx, [edi - 1]
mov dword [eax], edx
mov dword [eax + 4], ecx
cmp ecx, 0xf4240
jl 0x4085c2
add ecx, 0xfff0bdc0
inc edx
mov dword [eax + 4], ecx
mov dword [eax], edx
fild dword [eax + 4]
push eax
fdiv qword [0x5b4430]
fiadd dword [eax]
fstp qword [esp + 0x5c]
call fcn.004b7229
mov edi, dword [esp + 0x550]
add esp, 4
cmp dword [edi + 0x1310], ebp
jbe 0x408602
fld qword [esp + 0x58]
sub esp, 8
fstp qword [esp]
push str.custom_range_search_complete_in__6.4f_seconds_n
call fcn.004b7f6d
add esp, 0xc
jmp 0x408626
cmp dword [0x5d5f9c], ebp
jl 0x408626
mov edx, dword [esp + 0x20]
fld qword [esp + 0x58]
push edx
sub esp, 8
fstp qword [esp]
push str.elapsed_time_of__6.4f_seconds_exceeds__u_second_deadline__poly_select_done_n
call fcn.004b7f6d
add esp, 0x10
lea eax, [edi + 0x24]
push 0x51a9e0
push eax
call fcn.004b80e6
mov esi, eax
add esp, 8
cmp esi, ebp
jne 0x408667
call fcn.004b7db1
mov eax, dword [eax]
push eax
call fcn.004b731f
add esp, 4
push eax
push str.fopen_error:__s_n
call fcn.004b7f6d
push str.could_not_open_yafu_logfile_for_appending_n
call fcn.004b7f6d
add esp, 0xc
jmp 0x408698
fld qword [esp + 0x58]
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x64]
sub esp, 8
fstp qword [esp]
xor eax, eax
push eax
push ecx
push edx
push str.nfs:_completed__u_ranges_of_size__I64u_in__6.4f_seconds_n
push esi
call fcn.00443960
add esp, 0x1c
push esi
call fcn.004b8276
add esp, 4
mov ebx, dword [0x5d6980]
test ebx, ebx
jle 0x408704
mov esi, dword [esp + 0x28]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esi, 0x4ec
cmp ebx, 1
jle 0x4086f2
mov eax, dword [esi + 4]
push eax
mov dword [esi - 0xc], 4
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [esi]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esi]
push edx
call edi
mov eax, dword [esi + 4]
push eax
call edi
mov ecx, dword [esi + 8]
push ecx
call edi
mov edx, dword [esi + 0xc]
mov eax, dword [edx]
push eax
call edi
mov ebx, dword [0x5d6980]
inc ebp
add esi, 0x500
cmp ebp, ebx
jl 0x4086b2
mov edi, dword [esp + 0x54c]
mov ecx, dword [esp + 0x28]
push ecx
call fcn.004b7229
mov edx, dword [esp + 0x54]
add esp, 4
push edx
call fcn.004b7229
mov eax, dword [esp + 0x20]
add esp, 4
push eax
call fcn.004b7229
add esp, 4
cmp ebx, 1
jle 0x40873d
mov ecx, dword [esp + 0x3c]
push ecx
call fcn.004b7229
add esp, 4
cmp dword [0x5d5d24], 0
jne 0x408760
mov edx, dword [esp + 0x554]
push 1
push edx
push edi
call fcn.00406420
mov eax, edi
add esp, 0xc
call fcn.00406a20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x538