Function at 0x180168250
Capabilities:
Create thread

Disassembly:
push rbx
push rbp
push rdi
push r15
sub rsp, 0x98
mov rax, qword [rcx]
mov r15d, r9d
movzx ebx, r8w
mov rbp, rdx
mov rdi, rcx
call qword [rax + 0x1c8]
test eax, eax
je 0x180168589
mov rcx, rdi
call fcn.180168630
test eax, eax
je 0x180168589
mov rax, qword [rdi]
mov qword [rsp + 0xc8], rsi
mov rcx, rdi
mov qword [rsp + 0xd0], r12
mov qword [rsp + 0x90], r14
call qword [rax + 0x1d0]
xor esi, esi
mov rcx, rbp
mov dword [rdi + 0x18], 1
mov qword [rdi + 0x1c], 5
mov dword [rdi + 0x24], 1
mov word [rsp + 0x30], si
mov word [rsp + 0x70], si
call fcn.18015d2e0
lea r14d, [rsi + 0x1c]
mov word [rsp + 0x30], ax
lea r12d, [rsi + 0x10]
test ax, ax
je 0x180168358
cmp ax, 2
je 0x18016830b
cmp ax, 0x17
je 0x180168306
mov ecx, 0x2741
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, esi
jmp 0x180168368
mov ecx, r14d
jmp 0x18016830e
mov ecx, r12d
movzx edx, ax
lea rax, [rsp + 0xc0]
mov dword [rsp + 0xc0], ecx
lea r9, [rsp + 0x30]
xor r8d, r8d
mov rcx, rbp
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_WSAStringToAddressW]
test eax, eax
je 0x18016833e
mov eax, esi
jmp 0x180168368
test bx, bx
je 0x180168351
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x32], ax
mov eax, 1
jmp 0x180168368
lea r8, [rsp + 0x30]
movzx edx, bx
mov rcx, rbp
call fcn.18015d620
test eax, eax
je 0x180168522
lea rax, [rsp + 0x70]
lea r8, [rsp + 0x30]
movzx r9d, bx
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0xe0]
mov rdx, rbp
mov rcx, rdi
mov qword [rsp + 0x20], rax
call fcn.180168780
test eax, eax
je 0x180168522
movzx eax, word [rsp + 0x70]
cmp ax, 2
je 0x1801683dd
cmp ax, 0x17
je 0x1801683dd
movzx ebx, word [rsp + 0xe8]
test bx, bx
je 0x180168447
cmp ax, 2
je 0x1801683f5
cmp ax, 0x17
je 0x1801683f5
movzx ecx, word [rsp + 0x30]
call fcn.180163980
jmp 0x1801683fa
movzx ebx, word [rsp + 0xe8]
test bx, bx
jne 0x1801683c5
cmp ax, 2
lea rdx, [rsp + 0x70]
jmp 0x18016842d
lea rax, [rsp + 0x70]
movups xmm0, xmmword [rax]
movzx ecx, bx
movups xmmword [rsp + 0x50], xmm0
movsd xmm1, qword [rax + 0x10]
movsd qword [rsp + 0x60], xmm1
mov eax, dword [rax + 0x18]
mov dword [rsp + 0x68], eax
call qword [sym.imp.WS2_32.dll_htons]
cmp word [rsp + 0x50], 2
mov word [rsp + 0x52], ax
lea rdx, [rsp + 0x50]
mov rcx, qword [rdi + 0x28]
cmove r14d, r12d
mov r8d, r14d
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x180168513
mov eax, 1
lock xadd qword [0x18026e3b8], rax
inc rax
jne 0x18016846b
mov eax, 1
lock xadd qword [0x18026e3b8], rax
inc rax
xor ecx, ecx
mov qword [rdi + 0x38], rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, qword [rdi]
mov rdx, qword [rdi + 0x28]
mov rcx, rdi
call qword [rax + 0x158]
cmp eax, 2
je 0x1801684fa
lea rdx, [rsp + 0x30]
mov r8d, r15d
mov rcx, rdi
call fcn.180168940
test eax, eax
je 0x1801684eb
lea rax, [rdi + 0x60]
lea r8, [0x180168a50]
mov r9, rdi
mov qword [rsp + 0x28], rax
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x20], esi
call fcn.18017b9a4
mov qword [rdi + 0x58], rax
test rax, rax
je 0x1801684dd
mov rcx, qword [rdi + 8]
mov esi, 1
call qword [sym.imp.KERNEL32.dll_ResetEvent]
jmp 0x180168562
mov dword [rdi + 0x64], 8
mov ecx, 0x65f
jmp 0x180168531
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rdi + 0x64], ntohs
jmp 0x18016852f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, 0x4c7
mov dword [rdi + 0x64], 5
test eax, eax
cmove eax, ecx
jmp 0x18016852f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rdi + 0x64], 4
jmp 0x18016852f
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rdi + 0x64], 3
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [rdi + 0x18], esi
mov qword [rdi + 0x1c], 5
mov dword [rdi + 0x24], 1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, qword [rdi]
mov rcx, rdi
mov ebx, eax
call qword [rdx + reloc.WS2_32.dll_htonl]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov r14, qword [rsp + 0x90]
mov r12, qword [rsp + 0xd0]
mov eax, esi
mov rsi, qword [rsp + 0xc8]
add rsp, 0x98
pop r15
pop rdi
pop rbp
pop rbx
ret
xor eax, eax
add rsp, 0x98
pop r15
pop rdi
pop rbp
pop rbx
ret