Function at 0x1403738b0
Capabilities:
Create thread

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x30
movzx ebp, byte [rcx + 0x5b]
sub ebp, 1
mov r12, rcx
mov byte [rcx + 0x58], 1
test ebp, ebp
jle 0x140373bbc
movzx ecx, byte [rcx + 0x5a]
mov r8d, ebp
xor edi, edi
add ecx, 1
lea eax, [rcx + rdi]
cdq
idiv ebp
movsxd rsi, edx
imul rax, rsi, 0x68
add rax, r12
mov edx, dword [rax + 0x68]
mov r13, qword [rax + 0x60]
test edx, edx
je 0x140373980
test r13, r13
je 0x1403739c8
cmp qword [r13 + 0x10], 0
je 0x1403739a0
mov r14, qword [r13]
nop word [rax + rax]
mov r8d, 1
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.WaitForSingleObjectEx]
cmp eax, 0xc0
mov ebx, eax
je 0x140373920
mov rcx, qword [r13]
call qword [sym.imp.kernel32.dll_CloseHandle]
test ebx, ebx
je 0x1403739a0
imul rsi, rsi, 0x68
mov rcx, r13
call sym.sqlite3_free
mov edx, 1
add rsi, r12
mov dword [rsi + 0x68], 0
mov qword [rsi + 0x60], 0
mov eax, edx
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
test r13, r13
je 0x140373bc5
add edi, 1
cmp edi, ebp
jne 0x1403738e0
mov edi, r8d
jmp 0x1403739c8
mov rcx, r13
mov rbx, qword [r13 + 0x20]
call sym.sqlite3_free
imul rax, rsi, 0x68
mov edx, ebx
add rax, r12
test ebx, ebx
mov dword [rax + 0x68], 0
mov qword [rax + 0x60], 0
jne 0x14037396e
imul rsi, rsi, 0x68
lea rsi, [r12 + rsi + 0x60]
cmp ebp, edi
je 0x140373b14
lea rdx, [r12 + 0x60]
mov rax, rsi
mov rcx, qword [rsi + 0x28]
sub rax, rdx
movabs rdx, 0x4ec4ec4ec4ec4ec5
sar rax, 3
imul rax, rdx
test rcx, rcx
mov byte [r12 + 0x5a], al
mov rax, qword [r12 + 0x38]
mov qword [rsi + 0x20], rax
mov rax, qword [r12 + 0x40]
mov qword [rsi + 0x28], rax
mov rax, qword [r12 + 0x48]
mov qword [rsi + 0x30], rax
mov qword [r12 + 0x38], 0
mov dword [r12 + 0x48], 0
je 0x140373b8e
mov qword [r12 + 0x40], rcx
call qword [0x140395158]
mov dword [r12 + 0x54], eax
mov eax, dword [0x140395120]
mov qword [rsi], 0
test eax, eax
jne 0x140373af0
mov ecx, 0x28
call qword [0x140395140]
mov rbx, rax
test rbx, rbx
je 0x140373bb2
cmp byte [0x140395124], 0
je 0x140373b40
mov rax, qword [0x1403952b0]
test rax, rax
je 0x140373a99
mov ecx, 0xc8
call rax
test eax, eax
jne 0x140373b40
lea rax, [sym.vdbeSorterFlushThread]
mov qword [rbx + 0x18], rsi
xor edx, edx
xor ecx, ecx
mov qword [rbx + 0x10], rax
lea rax, [rbx + 8]
mov r9, rbx
mov qword [rsp + 0x28], rax
lea r8, [sym.sqlite3ThreadProc]
mov dword [rsp + 0x20], 0
call qword [sym.imp.msvcrt.dll__beginthreadex]
test rax, rax
mov qword [rbx], rax
je 0x140373b40
cmp qword [rbx + 0x10], 0
je 0x140373b67
mov qword [rsi], rbx
xor edx, edx
jmp 0x14037396e
mov rcx, qword [0x140394dc0]
test rcx, rcx
je 0x140373b02
call qword [0x1403951a0]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov rbx, rax
jmp 0x140373a68
lea rdx, [r12 + 0x38]
movsxd rax, ebp
imul rax, rax, 0x68
lea rcx, [r12 + rax + 0x60]
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
jmp sym.vdbeSorterListToPMA
mov qword [rbx], 0
mov qword [rbx + 8], 0
mov qword [rbx + 0x10], 0
mov qword [rbx + 0x18], 0
mov qword [rbx + 0x20], 0
call qword [sym.imp.kernel32.dll_GetCurrentThreadId]
lea rdx, [rsi + 0x20]
mov rcx, rsi
mov dword [rbx + 8], eax
call sym.vdbeSorterListToPMA
mov dword [rsi + 8], 1
cdqe
mov qword [rbx + 0x20], rax
jmp 0x140373ae0
cmp qword [r12 + 0x40], 0
je 0x140373a45
movsxd rcx, dword [r12 + 0x54]
call sym.sqlite3Malloc
test rax, rax
mov qword [r12 + 0x40], rax
jne 0x140373a45
mov edx, 7
jmp 0x14037396e
xor edi, edi
xor esi, esi
jmp 0x1403739d1
mov r8d, edi
jmp 0x140373994