Function at 0x140371b20
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 0x140371d48
cmp r8d, 2
je 0x140371e00
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 0x140371c40
mov edx, dword [rax + 0x20]
test edx, edx
je 0x140371d20
mov r14, qword [rax]
mov eax, dword [0x140395120]
mov qword [r14], 0
test eax, eax
je 0x140371dd0
mov rcx, qword [0x140394dc0]
test rcx, rcx
je 0x140371ba9
call qword [0x1403951a0]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov r13, rax
test r13, r13
je 0x140371de7
cmp byte [0x140395124], 0
je 0x140371d70
mov rax, qword [0x1403952b0]
test rax, rax
je 0x140371be7
mov ecx, 0xc8
call rax
test eax, eax
jne 0x140371d70
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 0x140371d70
cmp qword [r13 + 0x10], 0
je 0x140371d98
mov qword [r14], r13
nop word cs:[rax + rax]
add rdi, 0x50
cmp rdi, r12
jne 0x140371b60
mov edx, dword [rbx]
lea ebp, [rdx - 1]
test ebp, ebp
jle 0x140371d48
lea rdi, [rsp + 0x3c]
movsxd r12, ebp
shl r12, 2
jmp 0x140371cf2
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 0x140371cdf
movsxd rcx, r14d
lea rcx, [rcx + rcx*4]
shl rcx, 4
add rdx, rcx
cmp qword [rdx + 0x18], 0
je 0x140371d60
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 0x140371d48
mov edx, dword [rbx]
mov eax, edx
shr eax, 0x1f
add eax, edx
sar eax, 1
cmp eax, ebp
jle 0x140371c70
mov rax, qword [rbx + 0x10]
lea edx, [rbp + rbp]
mov r13d, dword [rax + rdx*4]
mov r14d, dword [rax + rdx*4 + 4]
jmp 0x140371c7d
xor edx, edx
mov rcx, rbp
call sym.vdbePmaReaderIncrMergeInit
test eax, eax
je 0x140371c40
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 0x140371cdf
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 0x140371c33
mov ecx, 0x28
call qword [0x140395140]
mov r13, rax
test r13, r13
jne 0x140371bbf
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 0x140371e1e
sub rdi, 0x50
cmp rdi, 0xffffffffffffffb0
je 0x140371c4d
mov rcx, qword [rbx + 0x18]
add rcx, rdi
call sym.vdbePmaReaderNext
test eax, eax
je 0x140371e10
add rsp, 0x40
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret