Function at 0x140296550
Capabilities:
Create thread

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x40
movsxd rax, dword [rdx]
test eax, eax
mov rsi, rcx
mov rbx, rdx
mov qword [rdx + 8], rcx
jle 0x140296778
cmp r8d, 2
je 0x140296830
lea r12, [rax + rax*4]
xor edi, edi
shl r12, 4
nop word [rax + rax]
mov rbp, qword [rbx + 0x18]
add rbp, rdi
mov rax, qword [rbp + 0x48]
test rax, rax
je 0x140296670
mov edx, dword [rax + 0x20]
test edx, edx
je 0x140296750
mov r14, qword [rax]
mov eax, dword [0x1402b90a0]
mov qword [r14], 0
test eax, eax
je 0x140296800
mov rcx, qword [0x1402b8d40]
test rcx, rcx
je 0x1402965d9
call qword [0x1402b9120]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov r13, rax
test r13, r13
je 0x140296817
cmp byte [0x1402b90a4], 0
je 0x1402967a0
mov rax, qword [0x1402b9230]
test rax, rax
je 0x140296617
mov ecx, 0xc8
call rax
test eax, eax
jne 0x1402967a0
lea rax, [sym.vdbePmaReaderBgIncrInit]
mov qword [r13 + 0x18], rbp
xor edx, edx
xor ecx, ecx
mov qword [r13 + 0x10], rax
lea rax, [r13 + 8]
mov r9, r13
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 [r13], rax
je 0x1402967a0
cmp qword [r13 + 0x10], 0
je 0x1402967c8
mov qword [r14], r13
nop word cs:[rax + rax]
add rdi, 0x50
cmp rdi, r12
jne 0x140296590
mov edx, dword [rbx]
lea ebp, [rdx - 1]
test ebp, ebp
jle 0x140296778
lea rdi, [rsp + 0x3c]
movsxd r12, ebp
shl r12, 2
jmp 0x140296722
mov r13d, ebp
sub r13d, eax
add r13d, r13d
lea r14d, [r13 + 1]
mov rdx, qword [rbx + 0x18]
movsxd rax, r13d
lea rax, [rax + rax*4]
shl rax, 4
add rax, rdx
cmp qword [rax + 0x18], 0
je 0x14029670f
movsxd rcx, r14d
lea rcx, [rcx + rcx*4]
shl rcx, 4
add rdx, rcx
cmp qword [rdx + 0x18], 0
je 0x140296790
mov r9d, dword [rax + 0x14]
mov dword [rsp + 0x3c], 0
mov r8, qword [rax + 0x28]
mov eax, dword [rdx + 0x14]
mov rcx, qword [rbx + 8]
mov dword [rsp + 0x28], eax
mov rax, qword [rdx + 0x28]
mov rdx, rdi
mov qword [rsp + 0x20], rax
call qword [rcx + 0x40]
test eax, eax
cmovle r14d, r13d
mov rax, qword [rbx + 0x10]
mov dword [rax + r12], r14d
sub r12, 4
sub ebp, 1
je 0x140296778
mov edx, dword [rbx]
mov eax, edx
shr eax, 0x1f
add eax, edx
sar eax, 1
cmp eax, ebp
jle 0x1402966a0
mov rax, qword [rbx + 0x10]
lea edx, [rbp + rbp]
mov r13d, dword [rax + rdx*4]
mov r14d, dword [rax + rdx*4 + 4]
jmp 0x1402966ad
xor edx, edx
mov rcx, rbp
call sym.vdbePmaReaderIncrMergeInit
test eax, eax
je 0x140296670
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rax, qword [rsi + 0x18]
movzx eax, byte [rax + 0x1f]
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov r14d, r13d
jmp 0x14029670f
mov qword [r13], 0
mov qword [r13 + 8], 0
mov qword [r13 + 0x10], 0
mov qword [r13 + 0x18], 0
mov qword [r13 + 0x20], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, 1
mov rcx, rbp
mov dword [r13 + 8], eax
call sym.vdbePmaReaderIncrMergeInit
mov rdx, qword [rbp + 0x48]
cdqe
mov rdx, qword [rdx]
mov dword [rdx + 8], 1
mov qword [r13 + 0x20], rax
jmp 0x140296663
mov ecx, 0x28
call qword [0x1402b90c0]
mov r13, rax
test r13, r13
jne 0x1402965ef
mov eax, 7
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
lea rdi, [rax + rax*4]
shl rdi, 4
sub rdi, 0x50
jmp 0x14029684e
sub rdi, 0x50
cmp rdi, 0xffffffffffffffb0
je 0x14029667d
mov rcx, qword [rbx + 0x18]
add rcx, rdi
call sym.vdbePmaReaderNext
test eax, eax
je 0x140296840
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret