Function at 0x140016760
Capabilities:
Set socket configuration

Disassembly:
push rbp
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x17]
sub rsp, 0x88
mov rax, qword [0x1400af210]
xor rax, rsp
mov qword [rbp - 1], rax
mov r12, qword [rbp + 0x7f]
mov r14, r9
mov dword [rbp - 0x3d], 1
mov r15, r8
mov qword [rbp - 0x39], 0
movzx r13d, dx
mov edi, ecx
bt ecx, 9
jae 0x1400167b1
xor eax, eax
jmp 0x140016a36
mov eax, edi
and eax, 2
test al, al
jne 0x1400167aa
bt edi, 0xe
jb 0x1400167aa
mov qword [rsp + 0x80], rsi
bt edi, 0xf
jae 0x1400167d4
or edi, 0x2400
mov rsi, qword [rbp + 0x6f]
test rsi, rsi
je 0x1400172ed
mov ecx, edi
and ecx, 0x240
cmp ecx, 0x240
je 0x1400172ed
mov eax, edi
and eax, 0x204
cmp eax, 0x204
je 0x1400172ed
mov eax, edi
and al, 0x4c
cmp al, 0x40
je 0x1400172ed
test ecx, ecx
setne cl
bt edi, 0x10
setb al
test al, cl
jne 0x1400172ed
mov qword [rsp + 0xd0], rbx
bt edi, 0x10
jae 0x14001684a
mov eax, edi
and eax, 4
test al, al
jne 0x140016847
mov eax, edi
and eax, 8
test al, al
je 0x14001684a
or edi, 0x40
mov edx, 0x1e0
mov ecx, 1
call fcn.14005a638
mov rbx, rax
test rax, rax
je 0x140016a24
mov qword [rax + 0x150], 0xffffffffffffffff
xor eax, eax
mov dword [rbx + 0x158], eax
mov eax, edi
shr eax, 5
and eax, 1
mov qword [rbx + 0x68], r14
mov dword [rbx + 0x194], eax
xor r14d, r14d
mov rax, qword [rbp + 0x77]
mov qword [rbx + 8], rax
lea rax, [0x1400161f0]
mov qword [rbx + 0x60], r15
mov r15d, 2
mov qword [rbx + 0xa0], rax
mov ecx, r15d
mov dword [rbx + 0x18c], edi
lea rax, [0x1400135e0]
mov word [rbx + 0x190], r13w
mov qword [rbx], rsi
mov dword [rbx + 0x178], r14d
mov dword [rbx + 0x17c], 0x7fe
mov qword [rbx + 0xd8], 0x8000
mov qword [rbx + 0xe0], 0x400
mov qword [rbx + 0x180], r14
mov qword [rbx + 0x168], 0xffffffffffffffff
mov qword [rbx + 0x160], 0xffffffffffffffff
mov qword [rbx + 0xb0], rax
mov dword [rbx + 0x1dc], 0x7fffffff
call fcn.14005b248
mov qword [rbx + 0xb8], rax
mov eax, dword [rbx + 0x18c]
and al, 0xc
cmp al, 4
jne 0x14001694b
lea rdx, str.Warning:_MHD_USE_THREAD_PER_CONNECTION_must_be_used_only_with_MHD_USE_INTERNAL_POLLING_THREAD._Flag_MHD_USE_INTERNAL_POLLING_THREAD_was_added._Consider_setting_MHD_USE_INTERNAL_POLLING_THREAD_explicitly._n
mov rcx, rbx
call fcn.14001d140
or dword [rbx + 0x18c], 8
mov ecx, dword [rbx + 0x18c]
mov eax, ecx
and eax, 8
test al, al
jne 0x140016960
btr ecx, 0xa
jmp 0x140016964
bts ecx, 0xa
mov dword [rbx + 0x18c], ecx
lea rdx, [rbp - 0x39]
mov rcx, rbx
mov qword [rbx + 0x1d0], r14
mov r8, r12
mov qword [rbx + 0x198], r14
mov dword [rbx + 0x1d8], 4
call fcn.140016260
cmp eax, 1
jne 0x140016a1c
test dword [rbx + 0x18c], 0x400
je 0x1400169e0
cmp dword [rbx + 0xf0], r14d
jne 0x1400169e0
lea rcx, [rbx + 0x160]
call fcn.14001cb70
test eax, eax
jne 0x1400169e0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
lea rdx, str.Failed_to_create_inter_thread_communication_channel:__s_n
mov r8, rax
mov rcx, rbx
call fcn.14001d140
jmp 0x140016a1c
mov eax, dword [rbx + 0x1d8]
test eax, eax
je 0x140016a88
imul r8, rax, 0x98
mov ecx, eax
movabs rax, 0xd79435e50d79435f
mul r8
shr rdx, 7
cmp rdx, rcx
je 0x140016a54
lea rdx, str.Specified_value_for_NC_SIZE_too_large_n
mov rcx, rbx
call fcn.14001d140
mov rcx, rbx
call fcn.140056c3c
xor eax, eax
mov rbx, qword [rsp + 0xd0]
mov rsi, qword [rsp + 0x80]
mov rcx, qword [rbp - 1]
xor rcx, rsp
call fcn.140052350
add rsp, 0x88
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rbp
ret
mov rcx, r8
call fcn.140056c44
mov qword [rbx + 0x1a0], rax
test rax, rax
jne 0x140016a88
call fcn.14005c18c
mov ecx, dword [rax]
call fcn.14005eb2c
lea rdx, str.Failed_to_allocate_memory_for_nonce_nc_map:__s_n
mov r8, rax
mov rcx, rbx
call fcn.14001d140
jmp 0x140016a1c
lea rcx, [rbx + 0x1a8]
mov edx, reloc.WS2_32.dll_recv
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x140016abe
lea rdx, str.MHD_failed_to_initialize_nonce_nc_mutex_n
mov rcx, rbx
call fcn.14001d140
mov rcx, qword [rbx + 0x1a0]
call fcn.140056c3c
jmp 0x140016a1c
mov ecx, dword [rbx + 0x18c]
mov eax, ecx
and eax, 8
test al, al
jne 0x140016aea
cmp dword [rbx + 0xf0], r14d
jbe 0x140016aea
lea rdx, str.MHD_thread_pooling_only_works_with_MHD_USE_INTERNAL_POLLING_THREAD_n
mov rcx, rbx
call fcn.14001d140
jmp 0x140017269
mov rsi, qword [rbx + 0x150]
cmp rsi, 0xffffffffffffffff
jne 0x140016d77
bt ecx, 8
jb 0x140016d6d
and ecx, 0x10
call fcn.14001ce80
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140016b3a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, str.Failed_to_create_socket_for_listening:__s_n
mov rcx, rbx
call fcn.14001d140
jmp 0x140017269
mov eax, dword [rbx + 0x158]
test eax, eax
je 0x140016bc2
mov dword [rsp + 0x20], 4
lea r9, [rbp - 0x3d]
mov edx, 0xffff
mov rcx, rsi
jle 0x140016b8e
mov r8d, 4
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140016bc2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, [0x1400b10d8]
mov rcx, rbx
call fcn.14001d140
jmp 0x140017269
mov r8d, 0xfffffffb
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140016bc2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, [0x1400b12b8]
mov rcx, rbx
call fcn.14001d140
jmp 0x140017269
mov eax, dword [rbx + 0x18c]
mov edi, reloc.WS2_32.dll_recv
and eax, 0x10
mov ecx, 0x1c
cmovne edi, ecx
cmp qword [rbp - 0x39], r14
jne 0x140016c31
movzx ecx, r13w
test eax, eax
je 0x140016c10
xor eax, eax
mov qword [rbp - 0x21], rax
mov qword [rbp - 0x19], rax
mov qword [rbp - 0x11], rax
mov dword [rbp - 9], eax
mov eax, reloc.WS2_32.dll_socket
mov word [rbp - 0x21], ax
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0x1f], ax
lea rax, [rbp - 0x21]
jmp 0x140016c2d
xor eax, eax
mov qword [rbp - 0x31], rax
mov word [rbp - 0x31], r15w
mov qword [rbp - 0x29], rax
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0x2f], ax
lea rax, [rbp - 0x31]
mov qword [rbp - 0x39], rax
mov qword [rbx + 0x150], rsi
mov ecx, dword [rbx + 0x18c]
mov eax, ecx
and eax, 0x10
test al, al
je 0x140016c9d
and ecx, 0x810
mov dword [rsp + 0x20], 4
cmp ecx, 0x810
lea r9, [rbp - 0x41]
mov eax, r14d
mov edx, 0x29
setne al
mov rcx, rsi
mov dword [rbp - 0x41], eax
lea r8d, [rdx - 0xe]
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140016c9d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, str.setsockopt_failed:__s_n
mov rcx, rbx
call fcn.14001d140
mov rdx, qword [rbp - 0x39]
mov r8d, edi
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x140016d08
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r9, rax
movzx r8d, r13w
lea rdx, str.Failed_to_bind_to_port__u:__s_n
mov rcx, rbx
call fcn.14001d140
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b13c8]
mov r8d, 0x16d3
lea rdx, [0x1400b2080]
call qword [0x1400b9400]
int3
mov edx, dword [rbx + 0x1dc]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_listen]
test eax, eax
jns 0x140016d6d
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, str.Failed_to_listen_for_connections:__s_n
mov rcx, rbx
call fcn.14001d140
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b14d8]
mov r8d, 0x16f1
lea rdx, [0x1400b20f0]
call qword [0x1400b9400]
int3
cmp rsi, 0xffffffffffffffff
je 0x140016e03
lea r8, [rbp - 0x41]
mov dword [rbp - 0x41], 1
mov edx, 0x8004667e
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x140016e03
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, str.Failed_to_set_nonblocking_mode_on_listening_socket:__s_n
mov rcx, rbx
call fcn.14001d140
test dword [rbx + 0x18c], 0x200
jne 0x140016dd0
cmp dword [rbx + 0xf0], r14d
jbe 0x140016e03
nop dword [rax + rax]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b15f8]
mov r8d, 0x1708
lea rdx, [0x1400b2160]
call qword [0x1400b9400]
int3
lea rdi, [rbx + 0x100]
mov edx, reloc.WS2_32.dll_recv
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x140016e68
lea rdx, [0x1400b17d8]
mov rcx, rbx
call fcn.14001d140
cmp rsi, 0xffffffffffffffff
je 0x140017269
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b1868]
mov r8d, 0x1734
lea rdx, [0x1400b22c0]
call qword [0x1400b9400]
int3
mov edx, reloc.WS2_32.dll_recv
lea rcx, [rbx + 0x128]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
jne 0x140016ed7
lea rdx, str.MHD_failed_to_initialize_IP_connection_limit_mutex_n
mov rcx, rbx
call fcn.14001d140
lea rcx, [rbx + 0x128]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
cmp rsi, 0xffffffffffffffff
je 0x140017269
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b19e8]
mov r8d, 0x173f
lea rdx, [0x1400b23a0]
call qword [0x1400b9400]
int3
mov ecx, dword [rbx + 0x18c]
mov eax, ecx
and eax, 8
test al, al
je 0x140016fbc
cmp dword [rbx + 0xf0], r14d
jne 0x140016fbc
bt ecx, 8
jb 0x140016fbc
test cl, 4
lea rax, str.MHD_listen
lea rdx, str.MHD_single
cmovne rdx, rax
test rdx, rdx
jne 0x140016f28
call fcn.14005c18c
mov dword [rax], reloc.WS2_32.dll_shutdown
jmp 0x140016f4b
mov r8, qword [rbx + 0xe8]
lea rcx, [rbx + 0xf8]
lea r9, [0x140016160]
mov qword [rsp + 0x20], rbx
call fcn.14001d590
test eax, eax
jne 0x140016fbc
call fcn.14005c18c
mov ecx, dword [rax]
call fcn.14005eb2c
mov r8, rax
lea rdx, str.Failed_to_create_listen_thread:__s_n
mov rcx, rbx
call fcn.14001d140
lea rcx, [rbx + 0x128]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
cmp rsi, 0xffffffffffffffff
je 0x140017269
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017269
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b1c68]
mov r8d, 0x1765
lea rdx, [0x1400b2590]
call qword [0x1400b9400]
int3
mov ecx, dword [rbx + 0xf0]
test ecx, ecx
je 0x1400172e5
test dword [rbx + 0x18c], 0x100
jne 0x1400172e5
mov eax, dword [rbx + 0x17c]
xor edx, edx
div ecx
imul rcx, rcx, 0x1e0
mov r13d, edx
mov r15d, eax
call fcn.140056c44
mov qword [rbx + 0xc8], rax
test rax, rax
je 0x14001720d
xor r8d, r8d
cmp dword [rbx + 0xf0], r8d
jbe 0x1400172e5
nop word [rax + rax]
mov eax, r14d
mov rcx, rbx
imul rdi, rax, 0x1e0
mov edx, 3
add rdi, qword [rbx + 0xc8]
mov rax, rdi
nop dword [rax]
lea rax, [rax + 0x80]
movups xmm0, xmmword [rcx]
lea rcx, [rcx + 0x80]
movups xmmword [rax - 0x80], xmm0
movups xmm1, xmmword [rcx - 0x70]
movups xmmword [rax - 0x70], xmm1
movups xmm0, xmmword [rcx - 0x60]
movups xmmword [rax - 0x60], xmm0
movups xmm1, xmmword [rcx - 0x50]
movups xmmword [rax - 0x50], xmm1
movups xmm0, xmmword [rcx - 0x40]
movups xmmword [rax - 0x40], xmm0
movups xmm1, xmmword [rcx - 0x30]
movups xmmword [rax - 0x30], xmm1
movups xmm0, xmmword [rcx - 0x20]
movups xmmword [rax - 0x20], xmm0
movups xmm1, xmmword [rcx - 0x10]
movups xmmword [rax - 0x10], xmm1
sub rdx, 1
jne 0x140017040
movups xmm0, xmmword [rcx]
movups xmmword [rax], xmm0
movups xmm1, xmmword [rcx + 0x10]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [rcx + 0x20]
movups xmmword [rax + 0x20], xmm0
movups xmm1, xmmword [rcx + 0x30]
movups xmmword [rax + 0x30], xmm1
movups xmm0, xmmword [rcx + 0x40]
movups xmmword [rax + 0x40], xmm0
movups xmm1, xmmword [rcx + 0x50]
movups xmmword [rax + 0x50], xmm1
mov qword [rdi + 0xc0], rbx
mov dword [rdi + 0xf0], r8d
mov qword [rdi + 0xc8], r8
test dword [rbx + 0x18c], 0x400
je 0x140017116
lea rcx, [rdi + 0x160]
call fcn.14001cb70
test eax, eax
jne 0x14001712c
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
call fcn.14001c600
mov r8, rax
lea rdx, str.Failed_to_create_worker_inter_thread_communication_channel:__s_n
mov rcx, rbx
call fcn.14001d140
jmp 0x1400171ed
mov qword [rdi + 0x168], 0xffffffffffffffff
mov qword [rdi + 0x160], 0xffffffffffffffff
mov dword [rdi + 0x17c], r15d
cmp r14d, r13d
jae 0x140017142
lea eax, [r15 + 1]
mov dword [rdi + 0x17c], eax
lea rcx, [rdi + 0x128]
mov edx, reloc.WS2_32.dll_recv
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
test eax, eax
je 0x1400171de
lea rax, str.MHD_worker
test rax, rax
je 0x1400171a6
mov r8, qword [rbx + 0xe8]
lea rcx, [rdi + 0xf8]
lea r9, [0x140016160]
mov qword [rsp + 0x20], rdi
mov rdx, rax
call fcn.14001d590
test eax, eax
je 0x1400171b1
inc r14d
cmp r14d, dword [rbx + 0xf0]
jae 0x1400172e5
xor r8d, r8d
jmp 0x140017020
call fcn.14005c18c
mov dword [rax], reloc.WS2_32.dll_shutdown
call fcn.14005c18c
mov ecx, dword [rax]
call fcn.14005eb2c
mov r8, rax
lea rdx, str.Failed_to_create_pool_thread:__s_n
mov rcx, rbx
call fcn.14001d140
lea rcx, [rdi + 0x128]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x1400171ed
lea rdx, str.MHD_failed_to_initialize_cleanup_connection_mutex_n
mov rcx, rbx
call fcn.14001d140
test r14d, r14d
je 0x140017206
mov rcx, rbx
mov dword [rbx + 0xf0], r14d
call fcn.1400175e0
jmp 0x140016a24
lea rdi, [rbx + 0x100]
cmp rsi, 0xffffffffffffffff
je 0x140017242
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
je 0x140017242
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b2068]
mov r8d, 0x17db
lea rdx, [0x1400b27d0]
call qword [0x1400b9400]
int3
lea rcx, [rbx + 0x128]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [rbx + 0xc8]
test rcx, rcx
je 0x140017269
call fcn.140056c3c
mov rcx, qword [rbx + 0x1a0]
call fcn.140056c3c
lea rcx, [rbx + 0x1a8]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [rbx + 0x160]
cmp rcx, 0xffffffffffffffff
je 0x140016a1c
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rbx + 0x168]
test eax, eax
jne 0x1400172bd
call qword [sym.imp.WS2_32.dll_closesocket]
test eax, eax
mov eax, 0
sete al
test eax, eax
je 0x1400172c3
jmp 0x140016a1c
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [0x1400b93f8]
lea r9, [0x1400b20d8]
mov r8d, 0x180a
lea rdx, [0x1400b29e0]
call qword [0x1400b9400]
int3
mov rax, rbx
jmp 0x140016a26
xor eax, eax
jmp 0x140016a2e