Function at 0x4057d0
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 8
push ebx
push ebp
push esi
mov esi, dword [0x4561d4]
mov eax, dword [esi + 0x64]
xor ebx, ebx
cmp eax, ebx
mov ebp, 1
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x54], ebp
je 0x40580a
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esi + 0x64]
push eax
call edi
mov dword [esi + 0x64], ebx
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x405878
push 0x2710
mov dword [esi + 0x54], ebp
mov ebp, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push eax
call ebp
cmp eax, ebx
je 0x405839
push eax
push str.in_CHttpDownTaskManage::Uninitialize____::WaitForSingleObject_m_hWorkThread__10__1000__failed__ret_d
mov edi, 1
call fcn.00415780
add esp, 8
mov ecx, dword [esi + 0x50]
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
test eax, eax
jne 0x40585e
push str.CHttpDownTaskManage::Uninitialize_____Force_kill_work_thread
lea edi, [eax + 1]
call fcn.00415780
add esp, 4
mov byte [esp + 0x17], bl
jmp 0x405880
mov edx, dword [esi + 0x50]
push 0x2710
push edx
mov byte [esp + 0x1f], 1
call ebp
test eax, eax
je 0x405880
mov byte [esp + 0x17], bl
jmp 0x405880
push ebx
mov byte [esp + 0x1b], 1
call edi
mov dword [esi + 0x50], ebx
mov ecx, dword [esi + 0x18]
cmp ecx, ebx
jne 0x40588e
xor eax, eax
jmp 0x405896
mov eax, dword [esi + 0x1c]
sub eax, ecx
sar eax, 2
lea edi, [eax - 1]
cmp edi, ebx
jl 0x4058f7
lea ecx, [ecx]
mov ecx, dword [esi + 0x18]
cmp ecx, ebx
je 0x4058b3
mov eax, dword [esi + 0x1c]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x4058b8
call fcn.004269df
mov eax, dword [esi + 0x18]
mov ecx, dword [eax + edi*4]
mov edx, dword [ecx]
mov eax, dword [edx + 0x2c]
call eax
cmp byte [esp + 0x17], bl
je 0x4058f2
mov ecx, dword [esi + 0x18]
cmp ecx, ebx
je 0x4058de
mov eax, dword [esi + 0x1c]
sub eax, ecx
sar eax, 2
cmp edi, eax
jb 0x4058e3
call fcn.004269df
mov ecx, dword [esi + 0x18]
mov edx, dword [ecx + edi*4]
push edx
call fcn.00419273
add esp, 4
sub edi, 1
jns 0x4058a0
mov ebp, dword [esi + 0x1c]
cmp dword [esi + 0x18], ebp
jbe 0x405904
call fcn.004269df
mov edi, dword [esi + 0x18]
cmp edi, dword [esi + 0x1c]
jbe 0x405911
call fcn.004269df
cmp edi, ebp
je 0x40593a
mov eax, dword [esi + 0x1c]
sub eax, ebp
sar eax, 2
test eax, eax
lea ecx, [eax*4]
lea ebx, [ecx + edi]
jle 0x405937
push ecx
push ebp
push ecx
push edi
call fcn.0042685a
add esp, 0x10
mov dword [esi + 0x1c], ebx
mov eax, dword [esi + 0x28]
mov ebp, dword [eax]
lea edi, [esi + 0x24]
cmp edi, edi
mov ebx, dword [edi + 4]
je 0x40594e
call fcn.004269df
cmp ebp, ebx
je 0x40597e
cmp byte [esp + 0x17], 0
je 0x40596f
cmp ebp, dword [edi + 4]
jne 0x405963
call fcn.004269df
mov ecx, dword [ebp + 8]
push ecx
call fcn.00419273
add esp, 4
cmp ebp, dword [edi + 4]
jne 0x405979
call fcn.004269df
mov ebp, dword [ebp]
jmp 0x405942
mov ecx, dword [edi + 4]
mov eax, dword [ecx]
mov dword [ecx], ecx
mov ecx, dword [edi + 4]
mov dword [ecx + 4], ecx
xor ebx, ebx
cmp eax, dword [edi + 4]
mov dword [edi + 8], ebx
je 0x4059a7
mov ebp, dword [eax]
push eax
call fcn.00419273
add esp, 4
cmp ebp, dword [edi + 4]
mov eax, ebp
jne 0x405995
add esi, 0x88
call fcn.0040cc90
pop edi
mov dword [0x4561dc], ebx
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret