Function at 0x14029dd40
Capabilities:
Create thread

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
xor ebp, ebp
movzx r12d, byte [rcx + 0x5b]
mov byte [rsp + 0x3f], r12b
sub r12d, 1
mov r13, rcx
mov byte [rcx + 0x58], 1
test r12d, r12d
jle 0x14029e059
movzx ecx, byte [rcx + 0x5a]
add ecx, 1
nop word [rax + rax]
lea eax, [rcx + rbp]
cdq
idiv r12d
lea eax, [rdx + 1]
movsxd rdx, edx
lea rbx, [rdx + rdx*2]
cdqe
shl rbx, 5
lea rdi, [rax + rax*2]
add rbx, r13
shl rdi, 5
mov edx, dword [rbx + 0x68]
mov r15, qword [rbx + 0x60]
add rdi, r13
test edx, edx
je 0x14029de30
test r15, r15
je 0x14029de41
cmp qword [r15 + 0x10], 0
je 0x14029df60
mov r14, qword [r15]
nop dword [rax + rax]
mov r8d, 1
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.WaitForSingleObjectEx]
mov esi, eax
cmp eax, 0xc0
je 0x14029ddd0
mov rcx, qword [r15]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x14029df60
mov rcx, r15
call sym.sqlite3_free
mov dword [rbx + 0x68], 0
mov eax, 1
mov qword [rbx + 0x60], 0
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test r15, r15
je 0x14029de41
add ebp, 1
cmp ebp, r12d
jne 0x14029dd80
cmp r12d, ebp
je 0x14029dfb4
nop word [rax + rax]
lea rdx, [r13 + 0x60]
mov rax, rdi
mov rcx, qword [rdi + 0x28]
movdqu xmm0, xmmword [r13 + 0x38]
sub rax, rdx
movabs rdx, 0xaaaaaaaaaaaaaaab
sar rax, 5
imul rax, rdx
mov byte [r13 + 0x5a], al
mov rax, qword [r13 + 0x48]
movups xmmword [rdi + 0x20], xmm0
mov qword [rdi + 0x30], rax
mov qword [r13 + 0x38], 0
mov qword [r13 + 0x48], 0
test rcx, rcx
je 0x14029e02e
mov qword [r13 + 0x40], rcx
call qword [0x1402ba6f8]
mov dword [r13 + 0x54], eax
mov eax, dword [0x1402ba6c0]
mov qword [rdi], 0
test eax, eax
jne 0x14029df90
mov ecx, 0x28
call qword [0x1402ba6e0]
mov rbx, rax
test rbx, rbx
je 0x14029e04f
cmp byte [0x1402ba6c4], 0
je 0x14029dfe0
mov rax, qword [0x1402ba850]
test rax, rax
je 0x14029df01
mov ecx, 0xc8
call rax
test eax, eax
jne 0x14029dfe0
lea rax, [sym.vdbeSorterFlushThread]
mov qword [rbx + 0x18], rdi
mov r9, rbx
xor edx, edx
mov qword [rbx + 0x10], rax
lea rax, [rbx + 8]
lea r8, [sym.sqlite3ThreadProc]
xor ecx, ecx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.msvcrt.dll__beginthreadex]
mov qword [rbx], rax
test rax, rax
je 0x14029dfe0
cmp qword [rbx + 0x10], 0
je 0x14029e007
mov qword [rdi], rbx
xor eax, eax
jmp 0x14029de1a
mov rsi, qword [r15 + 0x20]
mov rcx, r15
call sym.sqlite3_free
mov dword [rbx + 0x68], 0
mov qword [rbx + 0x60], 0
mov eax, esi
test esi, esi
jne 0x14029de1a
cmp r12d, ebp
jne 0x14029de50
jmp 0x14029dfb4
mov rcx, qword [0x1402ba340]
test rcx, rcx
je 0x14029dfa2
call qword [0x1402ba740]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov rbx, rax
jmp 0x14029ded0
movzx r15d, byte [rsp + 0x3f]
lea rdx, [r13 + 0x38]
lea rcx, [r15 + r15*2]
shl rcx, 5
add rcx, r13
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
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, [rdi + 0x20]
mov rcx, rdi
mov dword [rbx + 8], eax
call sym.vdbeSorterListToPMA
mov dword [rdi + 8], 1
cdqe
mov qword [rbx + 0x20], rax
jmp 0x14029df4c
cmp qword [r13 + 0x40], 0
je 0x14029dead
movsxd rcx, dword [r13 + 0x54]
call sym.sqlite3Malloc
mov qword [r13 + 0x40], rax
test rax, rax
jne 0x14029dead
mov eax, 7
jmp 0x14029de1a
xor edi, edi
jmp 0x14029de41