Function at 0x180021130
Capabilities:
Link many functions at runtime

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
push rdi
sub rsp, 0x80
xor ebp, ebp
movzx esi, r8w
mov rbx, rdx
cmp qword [0x180033c68], rbp
mov rdi, rcx
mov dword [rax + 0x20], ebp
jne 0x180021184
mov ecx, 0x1994
call fcn.1800251fc
test rax, rax
je 0x18002117d
mov dword [rax + 0x1990], ebp
mov qword [0x180033c68], rax
jmp 0x180021184
mov qword [0x180033c68], rbp
lea rdx, [rsp + 0xa8]
mov rcx, rbx
call fcn.18001ff60
test eax, eax
je 0x1800211b0
lea rdx, [rsp + 0xa8]
mov rcx, rbx
call fcn.18001f4c0
test eax, eax
jne 0x18002142f
mov eax, 2
mov word [rsp + 0x70], ax
mov eax, dword [rsp + 0xa8]
mov dword [rsp + 0x74], eax
mov rax, qword [0x1800378c8]
test rax, rax
jne 0x180021208
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x1800211f1
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, str.htons
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1800378c8], rax
movzx ecx, si
call rax
mov rbx, qword [rdi + 0x88]
mov word [rsp + 0x72], ax
mov rax, qword [0x180037c00]
test rax, rax
jne 0x18002125c
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x180021245
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, str.connect
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x180037c00], rax
lea rdx, [rsp + 0x70]
mov r8d, SQLNumResultCols
mov rcx, rbx
call rax
test eax, eax
je 0x1800212ba
mov rax, qword [0x180037ba8]
test rax, rax
jne 0x1800212b3
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x18002129c
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, str.WSAGetLastError
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x180037ba8], rax
call rax
jmp 0x18002142f
mov rax, qword [0x180037bf0]
mov rbx, qword [rdi + 0x88]
mov esi, 1
mov dword [rsp + 0x54], esi
test rax, rax
jne 0x18002130d
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x1800212f6
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, str.setsockopt
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x180037bf0], rax
lea r9, [rsp + 0x54]
mov edx, 0xffff
mov r8d, 8
mov rcx, rbx
mov dword [rsp + 0x20], 4
call rax
mov rax, qword [0x180037c20]
mov rbx, qword [rdi + 0x88]
mov dword [rsp + 0x60], esi
mov dword [rsp + 0x64], 0xea60
mov dword [rsp + 0x68], 0x1388
mov dword [rsp + 0x58], ebp
test rax, rax
jne 0x18002138c
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x180021375
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, [0x18002e2d0]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x180037c20], rax
mov qword [rsp + 0x40], rbp
mov qword [rsp + 0x38], rbp
lea rcx, [rsp + 0x58]
mov qword [rsp + 0x30], rcx
lea r8, [rsp + 0x60]
mov r9d, SQLFetch
mov rcx, rbx
mov edx, 0x98000004
mov dword [rsp + 0x28], ebp
mov qword [rsp + 0x20], rbp
call rax
mov rax, qword [0x180037bf0]
mov rbx, qword [rdi + 0x88]
mov dword [rsp + 0x50], 0xa0001
test rax, rax
jne 0x180021410
mov rax, qword [0x1800378b0]
test rax, rax
jne 0x1800213f9
lea rcx, str.ws2_32
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov qword [0x1800378b0], rax
lea rdx, str.setsockopt
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x180037bf0], rax
lea r9, [rsp + 0x50]
mov edx, 0xffff
mov r8d, 0x80
mov rcx, rbx
mov dword [rsp + 0x20], 4
call rax
xor eax, eax
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x10]
mov rbp, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rsp, r11
pop rdi
ret