Function at 0x18001e538
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x50
xor r15d, r15d
mov r12, rdx
mov rsi, rcx
mov r13d, r15d
test rdx, rdx
je 0x18001e92b
lea eax, [r15 + 2]
cmp word [rdx], ax
jne 0x18001e92b
mov rbx, qword [0x18002a9b8]
lea edi, [rax + 0x3e]
test rbx, rbx
jne 0x18001e5bc
mov ecx, edi
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
mov rbx, rax
test rax, rax
je 0x18001e5b2
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea r11, [rbx + 0x28]
mov dword [r11 + 0x10], r15d
mov qword [r11], r11
mov qword [r11 + 8], r11
jmp 0x18001e5b5
mov rbx, r15
mov qword [0x18002a9b8], rbx
mov rcx, rbx
call fcn.18001e278
mov r14, rax
mov rcx, qword [rax + 0x10]
mov qword [rbp - 0x10], r15
mov qword [rbp - 8], rcx
test rcx, rcx
je 0x18001e639
call qword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x18001e639
mov rbx, qword [0x18002a9b8]
test rbx, rbx
jne 0x18001e623
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
mov rbx, rax
test rax, rax
je 0x18001e619
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea r11, [rbx + 0x28]
mov dword [r11 + 0x10], r15d
mov qword [r11], r11
mov qword [r11 + 8], r11
jmp 0x18001e61c
mov rbx, r15
mov qword [0x18002a9b8], rbx
mov rdx, r14
mov rcx, rbx
call fcn.18001e300
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x18001e930
mov eax, 0xffffffff
lea rcx, [rsi + 0x4120]
mov qword [rbp - 0x18], r15
mov qword [rbp - 0x20], rax
mov edi, r15d
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rsi + 0x408c], 1
jne 0x18001e68b
xor eax, eax
lea rdx, [rbp - 0x30]
mov rcx, rsi
mov qword [rbp - 0x2e], rax
mov dword [rbp - 0x26], eax
mov word [rbp - 0x22], ax
movzx eax, word [r12]
mov word [rbp - 0x30], ax
call fcn.18001f8f4
mov edi, eax
test eax, eax
jne 0x18001e85f
cmp dword [rsi + 0x408c], 2
je 0x18001e6ab
mov edi, 0x139f
lea rcx, [rsi + 0x4120]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x18001e8b2
lea rcx, [rsi + 0x19420]
mov edx, 0x30
call fcn.180022964
mov r13, rax
test rax, rax
jne 0x18001e6cb
mov edi, 0x718
jmp 0x18001e699
mov qword [rax + 0x10], r15
mov qword [rax + 0x18], r14
lea rax, [rbp - 0x20]
mov qword [r13 + 0x20], rax
xor eax, eax
mov qword [r13 + 0x28], r15
lea rcx, [rsi + 0x40bc]
mov rdx, r12
cmp word [rsi + 0x40cc], ax
je 0x18001e70c
lea r8d, [rax + 0x10]
call fcn.18001ca04
mov r8d, SQLNumResultCols
lea rdx, [rsi + 0x40cc]
jmp 0x18001e720
mov r15d, SQLNumResultCols
mov r8d, r15d
call fcn.18001ca04
mov r8d, r15d
mov rdx, r12
lea rcx, [rsi + 0x40ac]
call fcn.18001ca04
xor r15d, r15d
lea r12, [0x18002a9d0]
cmp qword [0x18002a9d0], r15
jne 0x18001e76e
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
movabs rax, 0x20c49ba5e353f7cf
imul qword [0x18002a9d0]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov qword [0x18002a9d0], rdx
lea rcx, [rbp + 0x38]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbp + 0x38]
xor edx, edx
div qword [0x18002a9d0]
mov dword [rsi + 0x4114], eax
cmp qword [0x18002a9d0], r15
jne 0x18001e7c3
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
movabs rax, 0x20c49ba5e353f7cf
imul qword [0x18002a9d0]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov qword [0x18002a9d0], rdx
lea rcx, [rbp + 0x38]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbp + 0x38]
xor edx, edx
div qword [0x18002a9d0]
mov dword [rsi + 0x4114], eax
cmp qword [0x18002a9d0], r15
jne 0x18001e818
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
movabs rax, 0x20c49ba5e353f7cf
imul qword [0x18002a9d0]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov qword [0x18002a9d0], rdx
lea rcx, [rbp + 0x38]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbp + 0x38]
xor edx, edx
div qword [0x18002a9d0]
mov rcx, rsi
mov dword [rsi + 0x4114], eax
call fcn.1800226bc
mov rcx, rsi
call fcn.18001f800
mov rcx, rsi
call fcn.18001f800
mov rcx, rsi
call fcn.18001f800
mov dword [rsi + 0x408c], 4
lea rcx, [rsi + 0x4120]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
jne 0x18001e8b2
mov edx, dword [rsi + 0x4110]
mov rcx, qword [r14 + 0x10]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x18001e892
cmp eax, 0x102
jne 0x18001e8db
mov edi, 0x274c
jmp 0x18001e8b2
mov eax, 0xffffffff
cmp qword [rbp - 0x20], rax
je 0x18001e8a9
mov edi, dword [rbp - 0x10]
test edi, edi
jne 0x18001e8b2
mov edi, r15d
jmp 0x18001e8db
mov edi, 0x3e4
test edi, edi
je 0x18001e8db
lea rcx, [rsi + 0x4120]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rcx, [rsi + 0x19420]
mov rdx, r13
call fcn.180022a80
lea rcx, [rsi + 0x4120]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rbx, qword [0x18002a9b8]
test rbx, rbx
jne 0x18001e91c
lea ecx, [rbx + 0x40]
call qword [sym.imp.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__]
mov rbx, rax
test rax, rax
je 0x18001e912
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea r11, [rbx + 0x28]
mov dword [r11 + 0x10], r15d
mov qword [r11], r11
mov qword [r11 + 8], r11
jmp 0x18001e915
mov rbx, r15
mov qword [0x18002a9b8], rbx
mov rdx, r14
mov rcx, rbx
call fcn.18001e300
mov eax, edi
jmp 0x18001e930
mov eax, 0x57
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret