Function at 0x140291830
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 0x140291871
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 0x1402918c8
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 0x1402918b0
mov qword [rax], rdx
lea rax, [r11 + 0x108]
cmp r8, rax
je 0x1402918c2
nop
mov qword [rax], rdx
add rax, 0xd0
mov qword [rax - 0x68], rdx
cmp r8, rax
jne 0x1402918b0
cmp r9b, 1
jne 0x1402918d0
xor r14d, r14d
jmp 0x1402918f6
mov qword [rsp + 0xf0], r11
call sym.vdbeMergeEngineNew
test rax, rax
mov r14, rax
je 0x140291f38
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 0x14029193d
add r10, 1
add r15, 0x68
movzx ecx, byte [r13 + 0x5b]
cmp ecx, r10d
jle 0x140291ca0
mov edx, dword [r15 + 0x38]
test edx, edx
je 0x140291930
cmp edx, 0x10
movsxd rcx, edx
jle 0x140291ba8
xor r8d, r8d
mov eax, 0x10
nop word [rax + rax]
shl rax, 4
mov r14d, r8d
add r8d, 1
cmp rax, rcx
jl 0x140291968
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 0x140291c90
mov edx, dword [r15 + 0x38]
mov r10, qword [rsp + 0x30]
test edx, edx
jle 0x140291be0
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 0x140291a80
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 0x140291c38
lea edx, [r14 - 1]
mov r13d, 0x10
mov ecx, edx
mov edx, 1
and ecx, 1
cmp r14d, 1
jle 0x140291aec
test ecx, ecx
je 0x140291ae0
cmp r14d, 2
mov r13d, 0x100
mov edx, 2
jle 0x140291aec
nop dword [rax + rax]
add edx, 2
shl r13d, 8
cmp r14d, edx
jg 0x140291ae0
test eax, eax
jne 0x140291b83
mov rcx, rbp
xor esi, esi
jmp 0x140291b21
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 0x140291f42
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 0x140291b00
mov ecx, 0x10
mov qword [rsp + 0x40], r9
call sym.vdbeMergeEngineNew
test rax, rax
je 0x140291c20
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 0x140291f18
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 0x140291a36
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 0x140291a30
test rdi, rdi
je 0x140291c80
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 0x140291ed0
mov r10, qword [rsp + 0x30]
jmp 0x140291930
mov rcx, qword [rsp + 0x98]
mov rbx, rbp
mov r14, rdi
mov eax, 7
jmp 0x140291b91
mov rdx, qword [rsp + 0x98]
test eax, eax
mov rcx, rdx
jne 0x140292071
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 0x140292055
mov r12d, dword [rsp + 0x60]
jmp 0x140291a08
add r10, 1
add r15, 0x68
mov rdi, rbp
jmp 0x140291938
mov rbx, rax
mov r14, rdi
mov eax, 7
jmp 0x140291a36
cmp byte [r13 + 0x59], 0
mov rbp, rbx
mov r14, rdi
mov r11, r13
je 0x140291ee0
movzx ebx, byte [r11 + 0x5b]
sub ebx, 1
movsxd rbx, ebx
imul rax, rbx, 0x68
add rax, r11
cmp qword [rax + 0x78], 0
je 0x140291f4f
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 0x140291f2e
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 0x140291f0a
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 0x140291d93
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 0x140291d8a
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 0x140291d70
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 0x140291e88
mov rax, qword [rax]
mov qword [rsp + 0x30], rax
mov qword [rax], 0
mov eax, dword [0x1402b2060]
test eax, eax
je 0x140292023
mov rcx, qword [0x1402b1d00]
test rcx, rcx
je 0x140291de8
call qword [0x1402b20e0]
mov ecx, 0x28
call sym.sqlite3Malloc.part.0
mov r9, rax
test r9, r9
je 0x14029204d
cmp byte [0x1402b2064], 0
je 0x140291fd2
mov rax, qword [0x1402b21f0]
test rax, rax
je 0x140291e30
mov qword [rsp + 0x40], r9
mov ecx, 0xc8
call rax
mov r9, qword [rsp + 0x40]
test eax, eax
jne 0x140291fd2
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 0x140291fd2
cmp qword [r9 + 0x10], 0
je 0x140291ff9
mov rax, qword [rsp + 0x30]
mov qword [rax], r9
add esi, 1
add rdi, 0x50
movzx r8d, byte [rbx + 0x5b]
cmp r8d, esi
jle 0x140292036
mov r15, qword [r14 + 0x18]
add r15, rdi
mov rax, qword [r15 + 0x48]
test rax, rax
je 0x140291e7c
mov edx, dword [rax + 0x20]
test edx, edx
jne 0x140291db9
mov edx, 1
mov rcx, r15
add esi, 1
call sym.vdbePmaReaderIncrMergeInit
add rdi, 0x50
test eax, eax
je 0x140291e83
jmp 0x140291f0a
mov r14, rdi
jmp 0x140291a46
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 0x140291a69
xor r14d, r14d
jmp 0x140291a59
mov rax, qword [r9 + 0x48]
jmp 0x140291b00
imul rbx, rbx, 0x68
mov qword [r11 + rbx + 0x78], 0
mov eax, 7
jmp 0x140291a59
mov eax, 7
jmp 0x140291a46
mov rdx, qword [rsp + 0x98]
jmp 0x140291c4e
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 0x140291fc0
call sym.sqlite3DbMallocRawNN
mov r11, qword [rsp + 0xf0]
test rax, rax
je 0x140291f21
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 0x140291cd1
mov rcx, rdx
call sym.sqlite3Malloc
mov r11, qword [rsp + 0xf0]
jmp 0x140291f82
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 0x140291e74
mov ecx, 0x28
call qword [0x1402b2080]
mov r9, rax
jmp 0x140291df5
mov rsi, qword [rsp + 0x38]
mov edx, 2
mov rcx, rsi
call sym.vdbePmaReaderIncrMergeInit
jmp 0x140291f02
xor r14d, r14d
jmp 0x140291f2e
mov rbx, qword [rsp + 0x68]
mov r10, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
mov r13, qword [rsp + 0xf0]
jmp 0x140291be0
mov rbx, rbp
mov r14, rdi
jmp 0x140291b91