Function at 0x1403740d0
Capabilities:
Create thread

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
lea rdx, [sym.vdbeSorterCompareInt]
mov rax, qword [rcx + 0x70]
mov rbp, qword [rax + 0x20]
mov r11, rcx
movzx eax, byte [rcx + 0x5c]
cmp al, 1
je 0x140374111
lea rdx, [sym.vdbeSorterCompareText]
cmp al, 2
lea rax, [sym.vdbeSorterCompare]
cmovne rdx, rax
movzx ecx, byte [r11 + 0x5b]
test ecx, ecx
mov r9d, ecx
je 0x140374168
lea r8d, [rcx - 1]
imul r8, r8, 0x68
lea rax, [r11 + 0xa0]
lea r8, [r11 + r8 + 0x108]
mov r10, r8
sub r10, rax
and r10d, 8
je 0x140374150
mov qword [rax], rdx
lea rax, [r11 + 0x108]
cmp r8, rax
je 0x140374162
nop
mov qword [rax], rdx
add rax, 0xd0
mov qword [rax - 0x68], rdx
cmp r8, rax
jne 0x140374150
cmp r9b, 1
jne 0x140374170
xor r14d, r14d
jmp 0x140374196
mov qword [rsp + 0xf0], r11
call sym.vdbeMergeEngineNew
test rax, rax
mov r14, rax
je 0x1403747d8
mov r11, qword [rsp + 0xf0]
movzx ecx, byte [r11 + 0x5b]
lea rax, [rsp + 0x80]
xor edi, edi
mov rbx, rbp
lea rsi, [r11 + 0x60]
mov qword [rsp + 0x48], rax
mov r10, rdi
mov r13, r11
lea rax, [rsp + 0x88]
mov r15, rsi
mov rdi, r14
mov qword [rsp + 0x50], rax
jmp 0x1403741dd
add r10, 1
add r15, 0x68
movzx ecx, byte [r13 + 0x5b]
cmp ecx, r10d
jle 0x140374540
mov edx, dword [r15 + 0x38]
test edx, edx
je 0x1403741d0
cmp edx, 0x10
movsxd rcx, edx
jle 0x140374448
xor r8d, r8d
mov eax, 0x10
nop word [rax + rax]
shl rax, 4
mov r14d, r8d
add r8d, 1
cmp rax, rcx
jl 0x140374208
mov ecx, 0x10
mov qword [rsp + 0x30], r10
mov dword [rsp + 0x40], r8d
mov qword [rsp + 0x88], 0
call sym.vdbeMergeEngineNew
test rax, rax
mov rbp, rax
mov qword [rsp + 0x80], rax
je 0x140374530
mov edx, dword [r15 + 0x38]
mov r10, qword [rsp + 0x30]
test edx, edx
jle 0x140374480
mov r8d, dword [rsp + 0x40]
lea rax, [rsp + 0x88]
xor r12d, r12d
mov qword [rsp + 0x68], rbx
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x90]
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0x98]
mov qword [rsp + 0x58], rax
mov dword [rsp + 0x64], r8d
mov qword [rsp + 0x70], r10
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0xf0], r13
mov ebx, r12d
mov eax, 0x10
mov r9, qword [rsp + 0x38]
mov rcx, r15
shl ebx, 4
mov r8, qword [rsp + 0x30]
sub edx, ebx
cmp edx, eax
cmovg edx, eax
call sym.vdbeMergeEngineLevel0
test eax, eax
je 0x140374320
mov rbx, rbp
mov r14, rdi
mov rcx, rbx
mov dword [rsp + 0x30], eax
call sym.vdbeMergeEngineFree
mov eax, dword [rsp + 0x30]
mov rcx, r14
mov dword [rsp + 0x30], eax
xor r14d, r14d
call sym.vdbeMergeEngineFree
mov eax, dword [rsp + 0x30]
mov rcx, r14
mov dword [rsp + 0x30], eax
call sym.vdbeMergeEngineFree
mov eax, dword [rsp + 0x30]
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r8, qword [rsp + 0x58]
lea eax, [r12 + 1]
mov rcx, r15
mov rdx, qword [rsp + 0x90]
mov dword [rsp + 0x60], eax
call sym.vdbeIncrMergerNew
cmp dword [rsp + 0x64], 1
je 0x1403744d8
lea edx, [r14 - 1]
mov r13d, 0x10
mov ecx, edx
mov edx, 1
and ecx, 1
cmp r14d, 1
jle 0x14037438c
test ecx, ecx
je 0x140374380
cmp r14d, 2
mov r13d, 0x100
mov edx, 2
jle 0x14037438c
nop dword [rax + rax]
add edx, 2
shl r13d, 8
cmp r14d, edx
jg 0x140374380
test eax, eax
jne 0x140374423
mov rcx, rbp
xor esi, esi
jmp 0x1403743c1
test r13d, r13d
mov rcx, qword [rax + 8]
lea eax, [r13 + 0xf]
cmovns eax, r13d
add esi, 1
sar eax, 4
cmp r14d, esi
mov r13d, eax
jle 0x1403747e2
mov eax, r12d
cdq
idiv r13d
cdq
shr edx, 0x1c
add eax, edx
and eax, 0xf
sub eax, edx
cdqe
lea r9, [rax + rax*4]
shl r9, 4
add r9, qword [rcx + 0x18]
mov rax, qword [r9 + 0x48]
test rax, rax
jne 0x1403743a0
mov ecx, 0x10
mov qword [rsp + 0x40], r9
call sym.vdbeMergeEngineNew
test rax, rax
je 0x1403744c0
mov r9, qword [rsp + 0x40]
mov rdx, rax
mov rcx, r15
lea r8, [r9 + 0x48]
call sym.vdbeIncrMergerNew
mov r9, qword [rsp + 0x40]
test eax, eax
je 0x1403747b8
mov rcx, qword [rsp + 0x98]
mov rbx, rbp
mov r14, rdi
mov dword [rsp + 0x30], eax
call sym.vdbeIncrFree
mov eax, dword [rsp + 0x30]
jmp 0x1403742d6
mov r9, qword [rsp + 0x48]
mov rcx, r15
mov qword [rsp + 0x30], r10
mov r8, qword [rsp + 0x50]
mov qword [rsp + 0x88], 0
call sym.vdbeMergeEngineLevel0
mov rbp, qword [rsp + 0x80]
test eax, eax
mov r10, qword [rsp + 0x30]
jne 0x1403742d0
test rdi, rdi
je 0x140374520
lea r8, [r10 + r10*4]
mov rdx, rbp
mov rcx, r15
mov qword [rsp + 0x30], r10
shl r8, 4
add r8, qword [rdi + 0x18]
add r8, 0x48
call sym.vdbeIncrMergerNew
test eax, eax
jne 0x140374770
mov r10, qword [rsp + 0x30]
jmp 0x1403741d0
mov rcx, qword [rsp + 0x98]
mov rbx, rbp
mov r14, rdi
mov eax, 7
jmp 0x140374431
mov rdx, qword [rsp + 0x98]
test eax, eax
mov rcx, rdx
jne 0x140374911
mov rcx, rbp
and r12d, 0xf
add ebx, 0x10
lea rax, [r12 + r12*4]
shl rax, 4
add rax, qword [rcx + 0x18]
mov qword [rax + 0x48], rdx
mov edx, dword [r15 + 0x38]
cmp edx, ebx
jle 0x1403748f5
mov r12d, dword [rsp + 0x60]
jmp 0x1403742a8
add r10, 1
add r15, 0x68
mov rdi, rbp
jmp 0x1403741d8
mov rbx, rax
mov r14, rdi
mov eax, 7
jmp 0x1403742d6
cmp byte [r13 + 0x59], 0
mov rbp, rbx
mov r14, rdi
mov r11, r13
je 0x140374780
movzx ebx, byte [r11 + 0x5b]
sub ebx, 1
movsxd rbx, ebx
imul rax, rbx, 0x68
add rax, r11
cmp qword [rax + 0x78], 0
je 0x1403747ef
mov edx, 0x50
mov rcx, rbp
mov qword [rsp + 0xf0], r11
call sym.sqlite3DbMallocZero
mov r11, qword [rsp + 0xf0]
test rax, rax
mov rsi, rax
mov qword [r11 + 0x10], rax
je 0x1403747ce
imul rbx, rbx, 0x68
mov rdx, r14
mov qword [rsp + 0xf0], r11
lea r8, [rax + 0x48]
lea rcx, [r11 + rbx + 0x60]
call sym.vdbeIncrMergerNew
test eax, eax
jne 0x1403747aa
mov rdx, qword [rsi + 0x48]
mov r11, qword [rsp + 0xf0]
mov rcx, qword [rdx]
mov dword [rdx + 0x20], 1
movsxd rdx, dword [rdx + 0x18]
sub qword [rcx + 0x60], rdx
movzx r8d, byte [r11 + 0x5b]
cmp r8b, 1
jbe 0x140374633
mov r9, qword [r14 + 0x18]
lea edx, [r8 - 2]
lea rdx, [rdx + rdx*4]
shl rdx, 4
lea rcx, [r9 + 0x48]
lea r10, [r9 + rdx + 0x98]
nop dword [rax + rax]
mov rdx, qword [rcx]
test rdx, rdx
je 0x14037462a
mov r9, qword [rdx]
mov dword [rdx + 0x20], 1
movsxd rdx, dword [rdx + 0x18]
sub qword [r9 + 0x60], rdx
add rcx, 0x50
cmp rcx, r10
jne 0x140374610
mov qword [rsp + 0x38], rsi
xor edi, edi
mov esi, eax
mov rbx, r11
mov r13, qword [sym.imp.msvcrt.dll__beginthreadex]
lea r12, [sym.vdbePmaReaderBgIncrInit]
lea rbp, [sym.sqlite3ThreadProc]
jmp 0x140374728
mov rax, qword [rax]
mov qword [rsp + 0x30], rax
mov qword [rax], 0
mov eax, dword [0x140395120]
test eax, eax
je 0x1403748c3
mov rcx, qword [0x140394dc0]
test rcx, rcx
je 0x140374688
call qword [0x1403951a0]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov r9, rax
test r9, r9
je 0x1403748ed
cmp byte [0x140395124], 0
je 0x140374872
mov rax, qword [0x1403952b0]
test rax, rax
je 0x1403746d0
mov qword [rsp + 0x40], r9
mov ecx, 0xc8
call rax
mov r9, qword [rsp + 0x40]
test eax, eax
jne 0x140374872
lea rax, [r9 + 8]
mov qword [r9 + 0x10], r12
xor edx, edx
xor ecx, ecx
mov qword [r9 + 0x18], r15
mov r8, rbp
mov qword [rsp + 0x40], r9
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0
call r13
mov r9, qword [rsp + 0x40]
test rax, rax
mov qword [r9], rax
je 0x140374872
cmp qword [r9 + 0x10], 0
je 0x140374899
mov rax, qword [rsp + 0x30]
mov qword [rax], r9
add esi, 1
add rdi, 0x50
movzx r8d, byte [rbx + 0x5b]
cmp r8d, esi
jle 0x1403748d6
mov r15, qword [r14 + 0x18]
add r15, rdi
mov rax, qword [r15 + 0x48]
test rax, rax
je 0x14037471c
mov edx, dword [rax + 0x20]
test edx, edx
jne 0x140374659
mov edx, 1
mov rcx, r15
add esi, 1
call sym.vdbePmaReaderIncrMergeInit
add rdi, 0x50
test eax, eax
je 0x140374723
jmp 0x1403747aa
mov r14, rdi
jmp 0x1403742e6
xor r8d, r8d
mov rdx, r14
mov rcx, rsi
mov qword [rsp + 0xf0], r11
call sym.vdbeMergeEngineInit
mov r11, qword [rsp + 0xf0]
mov qword [r11 + 0x18], r14
test eax, eax
je 0x140374309
xor r14d, r14d
jmp 0x1403742f9
mov rax, qword [r9 + 0x48]
jmp 0x1403743a0
imul rbx, rbx, 0x68
mov qword [r11 + rbx + 0x78], 0
mov eax, 7
jmp 0x1403742f9
mov eax, 7
jmp 0x1403742e6
mov rdx, qword [rsp + 0x98]
jmp 0x1403744ee
mov rax, qword [rax + 0x70]
mov qword [rsp + 0xf0], r11
mov rsi, qword [rax + 0x28]
movzx edx, word [rsi + 6]
mov rcx, qword [rsi + 0x10]
add edx, 1
imul edx, edx, 0x38
add edx, 0x28
test rcx, rcx
je 0x140374860
call sym.sqlite3DbMallocRawNN
mov r11, qword [rsp + 0xf0]
test rax, rax
je 0x1403747c1
lea rdx, [rax + 0x28]
movq xmm0, rsi
movq xmm1, rdx
imul rdx, rbx, 0x68
punpcklqdq xmm0, xmm1
movups xmmword [rax], xmm0
add rdx, r11
mov qword [rdx + 0x78], rax
mov rdx, qword [rdx + 0x70]
mov rdx, qword [rdx + 0x28]
movzx edx, word [rdx + 6]
mov byte [rax + 0x1f], 0
mov word [rax + 0x1c], dx
jmp 0x140374571
mov rcx, rdx
call sym.sqlite3Malloc
mov r11, qword [rsp + 0xf0]
jmp 0x140374822
mov qword [r9], 0
mov qword [r9 + 8], 0
mov qword [r9 + 0x10], 0
mov qword [r9 + 0x18], 0
mov qword [r9 + 0x20], 0
mov qword [rsp + 0x40], r9
call qword [sym.imp.kernel32.dll_GetCurrentThreadId]
mov r9, qword [rsp + 0x40]
mov rcx, r15
mov dword [r9 + 8], eax
call sym.vdbePmaReaderBgIncrInit
mov r9, qword [rsp + 0x40]
mov qword [r9 + 0x20], rax
jmp 0x140374714
mov ecx, 0x28
call qword [0x140395140]
mov r9, rax
jmp 0x140374695
mov rsi, qword [rsp + 0x38]
mov edx, 2
mov rcx, rsi
call sym.vdbePmaReaderIncrMergeInit
jmp 0x1403747a2
xor r14d, r14d
jmp 0x1403747ce
mov rbx, qword [rsp + 0x68]
mov r10, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
mov r13, qword [rsp + 0xf0]
jmp 0x140374480
mov rbx, rbp
mov r14, rdi
jmp 0x140374431