Function at 0x140298b00
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 0x140298b41
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 0x140298b98
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 0x140298b80
mov qword [rax], rdx
lea rax, [r11 + 0x108]
cmp r8, rax
je 0x140298b92
nop
mov qword [rax], rdx
add rax, 0xd0
mov qword [rax - 0x68], rdx
cmp r8, rax
jne 0x140298b80
cmp r9b, 1
jne 0x140298ba0
xor r14d, r14d
jmp 0x140298bc6
mov qword [rsp + 0xf0], r11
call sym.vdbeMergeEngineNew
test rax, rax
mov r14, rax
je 0x140299208
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 0x140298c0d
add r10, 1
add r15, 0x68
movzx ecx, byte [r13 + 0x5b]
cmp ecx, r10d
jle 0x140298f70
mov edx, dword [r15 + 0x38]
test edx, edx
je 0x140298c00
cmp edx, 0x10
movsxd rcx, edx
jle 0x140298e78
xor r8d, r8d
mov eax, 0x10
nop word [rax + rax]
shl rax, 4
mov r14d, r8d
add r8d, 1
cmp rax, rcx
jl 0x140298c38
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 0x140298f60
mov edx, dword [r15 + 0x38]
mov r10, qword [rsp + 0x30]
test edx, edx
jle 0x140298eb0
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 0x140298d50
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 0x140298f08
lea edx, [r14 - 1]
mov r13d, 0x10
mov ecx, edx
mov edx, 1
and ecx, 1
cmp r14d, 1
jle 0x140298dbc
test ecx, ecx
je 0x140298db0
cmp r14d, 2
mov r13d, 0x100
mov edx, 2
jle 0x140298dbc
nop dword [rax + rax]
add edx, 2
shl r13d, 8
cmp r14d, edx
jg 0x140298db0
test eax, eax
jne 0x140298e53
mov rcx, rbp
xor esi, esi
jmp 0x140298df1
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 0x140299212
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 0x140298dd0
mov ecx, 0x10
mov qword [rsp + 0x40], r9
call sym.vdbeMergeEngineNew
test rax, rax
je 0x140298ef0
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 0x1402991e8
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 0x140298d06
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 0x140298d00
test rdi, rdi
je 0x140298f50
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 0x1402991a0
mov r10, qword [rsp + 0x30]
jmp 0x140298c00
mov rcx, qword [rsp + 0x98]
mov rbx, rbp
mov r14, rdi
mov eax, 7
jmp 0x140298e61
mov rdx, qword [rsp + 0x98]
test eax, eax
mov rcx, rdx
jne 0x140299341
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 0x140299325
mov r12d, dword [rsp + 0x60]
jmp 0x140298cd8
add r10, 1
add r15, 0x68
mov rdi, rbp
jmp 0x140298c08
mov rbx, rax
mov r14, rdi
mov eax, 7
jmp 0x140298d06
cmp byte [r13 + 0x59], 0
mov rbp, rbx
mov r14, rdi
mov r11, r13
je 0x1402991b0
movzx ebx, byte [r11 + 0x5b]
sub ebx, 1
movsxd rbx, ebx
imul rax, rbx, 0x68
add rax, r11
cmp qword [rax + 0x78], 0
je 0x14029921f
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 0x1402991fe
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 0x1402991da
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 0x140299063
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 0x14029905a
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 0x140299040
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 0x140299158
mov rax, qword [rax]
mov qword [rsp + 0x30], rax
mov qword [rax], 0
mov eax, dword [0x1402b90a0]
test eax, eax
je 0x1402992f3
mov rcx, qword [0x1402b8d40]
test rcx, rcx
je 0x1402990b8
call qword [0x1402b9120]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov r9, rax
test r9, r9
je 0x14029931d
cmp byte [0x1402b90a4], 0
je 0x1402992a2
mov rax, qword [0x1402b9230]
test rax, rax
je 0x140299100
mov qword [rsp + 0x40], r9
mov ecx, 0xc8
call rax
mov r9, qword [rsp + 0x40]
test eax, eax
jne 0x1402992a2
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 0x1402992a2
cmp qword [r9 + 0x10], 0
je 0x1402992c9
mov rax, qword [rsp + 0x30]
mov qword [rax], r9
add esi, 1
add rdi, 0x50
movzx r8d, byte [rbx + 0x5b]
cmp r8d, esi
jle 0x140299306
mov r15, qword [r14 + 0x18]
add r15, rdi
mov rax, qword [r15 + 0x48]
test rax, rax
je 0x14029914c
mov edx, dword [rax + 0x20]
test edx, edx
jne 0x140299089
mov edx, 1
mov rcx, r15
add esi, 1
call sym.vdbePmaReaderIncrMergeInit
add rdi, 0x50
test eax, eax
je 0x140299153
jmp 0x1402991da
mov r14, rdi
jmp 0x140298d16
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 0x140298d39
xor r14d, r14d
jmp 0x140298d29
mov rax, qword [r9 + 0x48]
jmp 0x140298dd0
imul rbx, rbx, 0x68
mov qword [r11 + rbx + 0x78], 0
mov eax, 7
jmp 0x140298d29
mov eax, 7
jmp 0x140298d16
mov rdx, qword [rsp + 0x98]
jmp 0x140298f1e
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 0x140299290
call sym.sqlite3DbMallocRawNN
mov r11, qword [rsp + 0xf0]
test rax, rax
je 0x1402991f1
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 0x140298fa1
mov rcx, rdx
call sym.sqlite3Malloc
mov r11, qword [rsp + 0xf0]
jmp 0x140299252
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 0x140299144
mov ecx, 0x28
call qword [0x1402b90c0]
mov r9, rax
jmp 0x1402990c5
mov rsi, qword [rsp + 0x38]
mov edx, 2
mov rcx, rsi
call sym.vdbePmaReaderIncrMergeInit
jmp 0x1402991d2
xor r14d, r14d
jmp 0x1402991fe
mov rbx, qword [rsp + 0x68]
mov r10, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
mov r13, qword [rsp + 0xf0]
jmp 0x140298eb0
mov rbx, rbp
mov r14, rdi
jmp 0x140298e61