Function at 0x140278980
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x128
mov rdi, qword [rcx + 0x18]
mov dword [rsp + 0x84], 0
mov r15, rcx
call sym.fts5StructureRead
mov r14d, dword [r15 + 0x34]
mov r13, rax
mov qword [rsp + 0x88], rax
test r14d, r14d
je 0x140278a48
mov rsi, qword [r15 + 0x80]
test rsi, rsi
je 0x1402789e8
mov eax, dword [rsi]
sub eax, 1
test eax, eax
mov dword [rsi], eax
jle 0x140278c61
mov qword [r15 + 0x80], 0
test r13, r13
jne 0x140278a1b
add rsp, 0x128
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rdx, r13
mov rcx, r15
mov qword [rsp + 0x88], r13
call sym.fts5StructureWrite.part.0
mov eax, dword [r13]
sub eax, 1
test eax, eax
mov dword [r13], eax
jg 0x1402789ed
mov rcx, r13
add rsp, 0x128
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.fts5StructureRelease.part.0
cmp dword [rax + 0x10], 0x7cf
jle 0x140278e67
mov rsi, qword [r15 + 0x80]
mov dword [r15 + 0x34], 0xd
test rsi, rsi
je 0x140278a1b
mov eax, dword [rsi]
sub eax, 1
test eax, eax
mov dword [rsi], eax
jg 0x1402789dd
mov eax, dword [rsi + 0x14]
test eax, eax
jle 0x140278c6f
xor ebx, ebx
nop dword [rax]
mov rax, rbx
add rbx, 1
shl rax, 4
mov rcx, qword [rsi + rax + 0x20]
call sym.sqlite3_free
cmp dword [rsi + 0x14], ebx
jg 0x140278a88
mov rcx, rsi
call sym.sqlite3_free
mov qword [r15 + 0x80], 0
test r14d, r14d
je 0x140278c82
mov rax, qword [r15]
mov r8d, r14d
mov rcx, r15
mov r12d, dword [rax + 0x84]
mov eax, dword [rax + 0x5c]
mov dword [rsp + 0x5c], eax
lea rax, [rsp + 0xa0]
mov rdx, rax
mov qword [rsp + 0x40], rax
call sym.fts5WriteInit
mov eax, dword [r15 + 0x34]
test eax, eax
je 0x140278edd
nop word cs:[rax + rax]
mov rcx, rdi
call sym.sqlite3Fts5HashClear
mov rdx, qword [rsp + 0x40]
lea r8, [rsp + 0x84]
mov rcx, r15
call sym.fts5WriteFinish
mov esi, dword [r13 + 0x14]
test esi, esi
je 0x140278ebf
mov r11d, dword [r15 + 0x34]
test r11d, r11d
jne 0x1402789e8
mov ebx, dword [r13 + 0x1c]
mov rsi, qword [r13 + 0x20]
call sym.sqlite3_initialize
test eax, eax
jne 0x140278e5a
lea eax, [rbx + 1]
mov rcx, rsi
cdqe
lea rdx, [rax + rax*2]
shl rdx, 2
call sym.sqlite3Realloc
test rax, rax
je 0x140278e5a
movsxd rdx, dword [r13 + 0x1c]
movsxd rbx, dword [rsp + 0x84]
lea rdx, [rdx + rdx*2]
lea rdx, [rax + rdx*4]
mov qword [rdx], 0
mov dword [rdx + 8], 0
mov r10d, dword [r15 + 0x34]
mov qword [r13 + 0x20], rax
test r10d, r10d
jne 0x140278a1b
movsxd rdx, dword [r13 + 0x1c]
lea ecx, [rdx + 1]
lea rdx, [rdx + rdx*2]
mov dword [r13 + 0x1c], ecx
lea rax, [rax + rdx*4]
mov dword [rax], r14d
mov dword [rax + 4], 1
mov dword [rax + 8], ebx
add dword [r13 + 0x10], 1
test ecx, ecx
je 0x140278c90
mov ecx, dword [r13 + 0x18]
test ecx, ecx
jne 0x140278c90
cmp dword [r13 + 0x14], 1
jle 0x140278c90
lea rbp, [r13 + 0x28]
mov dword [rsp + 0x28], 1
mov r12, r13
mov r9d, dword [rbp]
test r9d, r9d
jne 0x140278e4f
movsxd rax, dword [rbp + 4]
mov edx, eax
sub edx, 1
js 0x140278e37
movsxd r8, edx
mov edx, edx
lea rsi, [r8 + r8*2]
sub rax, rdx
lea rax, [rax + rax*2]
shl rsi, 2
lea rdi, [rax*4 - 0x18]
nop word [rax + rax]
mov rdx, qword [rbp + 8]
add rdx, rsi
mov eax, dword [rdx + 8]
add eax, 1
sub eax, dword [rdx + 4]
cmp eax, ebx
jg 0x140278e4f
test ecx, ecx
je 0x140278d90
mov r13, r12
test r13, r13
je 0x1402789ed
jmp 0x140278a1b
mov eax, dword [rsi + 0x14]
xor r14d, r14d
test eax, eax
jg 0x140278a83
mov rcx, rsi
call sym.sqlite3_free
mov qword [r15 + 0x80], 0
mov ecx, dword [r15 + 0x34]
xor ebx, ebx
test ecx, ecx
jne 0x1402789e8
mov rax, qword [r15]
mov r9d, dword [rax + 0x88]
test r9d, r9d
jle 0x140278fdf
test r13, r13
je 0x140278ea8
mov r8, qword [r13 + 8]
xor edx, edx
movsxd r10, dword [r15 + 0x10]
lea rax, [rbx + r8]
mov qword [r13 + 8], rax
div r10
mov rcx, rax
xor edx, edx
mov rax, r8
mov r8d, ecx
mov rcx, r15
div r10
lea rdx, [rsp + 0x88]
sub r8d, eax
imul r8d, r10d
imul r8d, dword [r13 + 0x14]
call sym.fts5IndexMerge
mov ecx, dword [r15 + 0x34]
mov r13, qword [rsp + 0x88]
mov rax, qword [r15]
test ecx, ecx
mov esi, dword [rax + 0x8c]
mov qword [rsp + 0xa0], r13
jne 0x1402789e8
lea rdi, [rsp + 0xa0]
xor ebx, ebx
nop word [rax + rax]
movsxd rax, ebx
shl rax, 4
cmp dword [rax + r13 + 0x1c], esi
jl 0x140278a08
xor r9d, r9d
mov r8d, ebx
mov rdx, rdi
mov rcx, r15
add ebx, 1
call sym.fts5IndexMergeLevel
mov edx, dword [r15 + 0x34]
mov r13, qword [rsp + 0xa0]
test edx, edx
je 0x140278d70
test r13, r13
mov qword [rsp + 0x88], r13
je 0x1402789ed
jmp 0x140278a1b
mov r8, r13
mov edx, ebx
mov rcx, r15
call sym.fts5StructurePromote.part.0
mov eax, dword [r15 + 0x34]
test eax, eax
je 0x140278d20
jmp 0x140278d56
mov r14d, dword [r12 + 0x1c]
mov r13, qword [r12 + 0x20]
call sym.sqlite3_initialize
test eax, eax
jne 0x140278e57
lea eax, [r14 + 1]
mov rcx, r13
cdqe
lea rdx, [rax + rax*2]
shl rdx, 2
call sym.sqlite3Realloc
test rax, rax
mov r13, rax
je 0x140278e57
mov eax, dword [r12 + 0x1c]
lea rcx, [r13 + 0xc]
mov rdx, r13
lea r8d, [rax + rax*2]
shl r8d, 2
movsxd r8, r8d
call sub.msvcrt.dll_memmove
mov qword [r13], 0
mov dword [r13 + 8], 0
mov r8d, dword [r15 + 0x34]
mov qword [r12 + 0x20], r13
test r8d, r8d
jne 0x140278c50
mov rax, qword [rbp + 8]
add rax, rsi
sub rsi, 0xc
mov rdx, qword [rax]
mov qword [r13], rdx
mov eax, dword [rax + 8]
mov dword [r13 + 8], eax
mov ecx, dword [r15 + 0x34]
add dword [r12 + 0x1c], 1
sub dword [rbp + 4], 1
cmp rsi, rdi
jne 0x140278c30
add dword [rsp + 0x28], 1
add rbp, 0x10
mov eax, dword [rsp + 0x28]
cmp eax, dword [r12 + 0x14]
jl 0x140278bef
mov r13, r12
jmp 0x140278c88
mov r13, r12
mov dword [r15 + 0x34], 7
jmp 0x1402789e8
mov rcx, rax
call sym.fts5AllocateSegid.part.0
mov rsi, qword [r15 + 0x80]
mov r14d, eax
test rsi, rsi
je 0x140278ff2
mov eax, dword [rsi]
sub eax, 1
test eax, eax
mov dword [rsi], eax
jg 0x140278aaa
mov eax, dword [rsi + 0x14]
test eax, eax
jg 0x140278a83
jmp 0x140278aa2
mov esi, dword [rax + 0x8c]
mov qword [rsp + 0xa0], 0
jmp 0x140278d10
lea rdx, [rsp + 0x88]
lea rcx, [r15 + 0x34]
call sym.fts5StructureAddLevel
mov r13, qword [rsp + 0x88]
jmp 0x140278b29
xor r8d, r8d
xor edx, edx
mov rcx, rdi
lea r9, [rdi + 0x18]
call sym.fts5HashEntrySort
test eax, eax
mov dword [r15 + 0x34], eax
jne 0x140278b00
mov rbp, qword [rdi + 0x18]
mov dword [rsp + 0x74], r14d
mov qword [rsp + 0x78], r13
test rbp, rbp
je 0x140278fd0
nop dword [rax]
lea r13, [rbp + 0x30]
mov rcx, r13
call sym.strlen
xor r8d, r8d
mov rdx, rbp
mov rcx, rdi
mov r14, rax
call sym.fts5HashAddPoslistSize
movsxd rax, r14d
mov rcx, r13
lea rax, [r13 + rax + 1]
mov qword [rsp + 0x28], rax
mov eax, dword [rbp + 0x18]
sub eax, 0x31
sub eax, r14d
mov dword [rsp + 0x3c], eax
call sym.strlen
mov rdx, qword [rsp + 0x40]
mov r9, r13
mov rcx, r15
mov r8d, eax
call sym.fts5WriteAppendTerm
mov ebp, dword [r15 + 0x34]
test ebp, ebp
jne 0x140278fd0
mov ebp, dword [rsp + 0xb8]
mov eax, dword [rsp + 0xc8]
mov edx, dword [rsp + 0x3c]
add eax, ebp
add eax, edx
cmp r12d, eax
jle 0x140279008
mov esi, edx
movsxd rcx, ebp
movsxd r8, edx
add rcx, qword [rsp + 0xb0]
mov rdx, qword [rsp + 0x28]
add ebp, esi
call sym.memcpy
mov eax, dword [r15 + 0x34]
mov dword [rsp + 0xb8], ebp
test eax, eax
jne 0x140278fd0
mov rbp, qword [rdi + 0x18]
mov rbp, qword [rbp + 8]
test rbp, rbp
mov qword [rdi + 0x18], rbp
jne 0x140278f18
nop dword [rax]
mov r14d, dword [rsp + 0x74]
mov r13, qword [rsp + 0x78]
jmp 0x140278b00
mov esi, dword [rax + 0x8c]
mov qword [rsp + 0xa0], r13
jmp 0x140278d10
xor ebx, ebx
test eax, eax
jne 0x140278abe
jmp 0x140278c90
lea rax, [rsp + 0x90]
xor r13d, r13d
xor r14d, r14d
test edx, edx
mov qword [rsp + 0x50], rax
jle 0x140278fb8
mov qword [rsp + 0x68], rdi
jmp 0x140279130
mov edx, ebp
rol dx, 8
cmp rbx, 0x7f
mov word [rax], dx
jbe 0x140279410
cmp rbx, 0x3fff
jbe 0x1402794a0
mov rdx, rbx
call sym.putVarint64
mov rdx, qword [rsp + 0x40]
add eax, ebp
mov r8, rbx
mov rcx, r15
mov dword [rsp + 0xb8], eax
mov byte [rsp + 0xe9], 0
call sym.fts5WriteDlidxAppend
mov ebx, dword [r15 + 0x34]
test ebx, ebx
jne 0x14027954a
cmp dword [rsp + 0x5c], 1
mov ebx, dword [rsp + 0xb8]
jne 0x1402791a8
mov edi, dword [rsp + 0x3c]
cmp r13d, edi
jge 0x140279215
mov rsi, qword [rsp + 0x28]
movsxd rax, r13d
cmp byte [rsi + rax], 0
jne 0x140279100
mov rcx, qword [rsp + 0xb0]
lea eax, [rbx + 1]
movsxd rdx, ebx
mov dword [rsp + 0xb8], eax
mov byte [rcx + rdx], 0
lea edx, [r13 + 1]
cmp edx, edi
jge 0x140279210
movsxd r8, edx
cmp byte [rsi + r8], 0
jne 0x140279510
add ebx, 2
cdqe
add r13d, 2
mov dword [rsp + 0xb8], ebx
mov byte [rcx + rax], 0
nop dword [rax]
add ebx, dword [rsp + 0xc8]
cmp r12d, ebx
jle 0x140279225
mov eax, dword [r15 + 0x34]
test eax, eax
jne 0x14027954a
mov edi, dword [rsp + 0x3c]
cmp r13d, edi
jge 0x14027955e
mov ebp, dword [rsp + 0xb8]
mov rax, qword [rsp + 0x28]
movsxd rcx, r13d
mov rdx, qword [rsp + 0x50]
add rcx, rax
call sym.sqlite3Fts5GetVarint
mov rdx, qword [rsp + 0x90]
movsxd rcx, ebp
movzx eax, al
add r13d, eax
mov rax, qword [rsp + 0xb0]
lea rbx, [r14 + rdx]
mov r14, rbx
add rcx, rax
cmp byte [rsp + 0xe9], 0
jne 0x140279030
cmp rdx, 0x7f
jbe 0x140279400
cmp rdx, 0x3fff
jbe 0x140279478
call sym.putVarint64
mov ebx, eax
add ebx, ebp
cmp dword [rsp + 0x5c], 1
mov dword [rsp + 0xb8], ebx
je 0x140279097
mov rax, qword [rsp + 0x28]
movsxd r10, r13d
add r10, rax
mov eax, 1
movzx ebp, byte [r10]
test bpl, bpl
js 0x140279420
sar ebp, 1
add ebp, eax
mov eax, dword [rsp + 0xc8]
add eax, ebx
add eax, ebp
cmp r12d, eax
jl 0x140279240
movsxd rcx, ebx
add rcx, qword [rsp + 0xb0]
mov r8d, ebp
add ebx, ebp
and r8d, 0x7fffffff
mov rdx, r10
call sym.memcpy
mov eax, dword [r15 + 0x34]
mov dword [rsp + 0xb8], ebx
add r13d, ebp
jmp 0x140279114
mov ebx, eax
mov r13d, edx
add ebx, dword [rsp + 0xc8]
cmp r12d, ebx
jg 0x140279500
mov rdx, qword [rsp + 0x40]
mov rcx, r15
call sym.fts5WriteFlushLeaf
jmp 0x140279110
xor r9d, r9d
mov dword [rsp + 0x58], r13d
mov r13, r15
mov r15d, ebp
mov qword [rsp + 0x48], r14
mov edi, r9d
mov r14d, r12d
mov qword [rsp + 0x30], r10
nop
mov eax, dword [r13 + 0x34]
test eax, eax
jne 0x1402794c8
mov ebp, dword [rsp + 0xb8]
mov esi, r14d
mov ebx, r15d
movsxd rcx, edi
mov r12d, dword [rsp + 0xc8]
sub ebx, edi
mov rax, qword [rsp + 0x30]
sub esi, ebp
sub esi, r12d
lea r9, [rax + rcx]
cmp esi, ebx
jl 0x1402792f0
movsxd rcx, ebp
mov esi, r12d
movsxd r8, ebx
mov rdi, rcx
add rcx, qword [rsp + 0xb0]
mov r12d, r14d
mov rdx, r9
add edi, ebx
mov r14, qword [rsp + 0x48]
mov ebp, r15d
add esi, edi
mov r15, r13
mov r13d, dword [rsp + 0x58]
call sym.memcpy
cmp r12d, esi
mov dword [rsp + 0xb8], edi
jg 0x1402792e4
mov rdx, qword [rsp + 0x40]
mov rcx, r15
call sym.fts5WriteFlushLeaf
mov eax, dword [r15 + 0x34]
jmp 0x140279203
movzx eax, byte [r9]
test al, al
jns 0x1402793f0
cmp byte [r9 + 1], 0
jns 0x1402794e0
test byte [r9 + 2], 0x80
je 0x1402794f0
lea rdx, [rsp + 0x98]
mov rcx, r9
mov qword [rsp + 0x60], r9
call sym.sqlite3Fts5GetVarint
mov r9, qword [rsp + 0x60]
movzx ebx, al
movzx r8d, al
cmp esi, ebx
jle 0x1402793a0
mov dword [rsp + 0x60], ebp
mov rbp, r9
mov dword [rsp + 0x70], edi
mov edi, esi
jmp 0x140279352
mov ebx, eax
movsxd rsi, ebx
mov eax, 1
lea rcx, [rbp + rsi]
movzx edx, byte [rcx]
test dl, dl
jns 0x14027938c
cmp byte [rcx + 1], 0
mov eax, 2
jns 0x14027938c
test byte [rcx + 2], 0x80
mov eax, 3
je 0x14027938c
lea rdx, [rsp + 0x98]
call sym.sqlite3Fts5GetVarint
movzx eax, al
add eax, ebx
cmp edi, eax
jge 0x140279350
mov r9, rbp
mov edi, dword [rsp + 0x70]
mov r8, rsi
mov ebp, dword [rsp + 0x60]
movsxd rax, ebp
add rax, qword [rsp + 0xb0]
add edi, ebx
mov rdx, r9
add ebx, ebp
mov rcx, rax
call sym.memcpy
mov dword [rsp + 0xb8], ebx
add ebx, r12d
cmp r14d, ebx
jle 0x140279568
cmp r15d, edi
jg 0x140279260
mov r12d, r14d
mov ebp, r15d
mov r14, qword [rsp + 0x48]
mov r15, r13
mov r13d, dword [rsp + 0x58]
jmp 0x1402792e4
mov r8d, 1
mov ebx, 1
jmp 0x140279333
mov byte [rcx], dl
mov ebx, 1
jmp 0x140279194
mov byte [rcx], bl
mov eax, 1
jmp 0x140279058
movzx eax, byte [r10 + 1]
test al, al
jns 0x140279520
movzx edx, byte [r10 + 2]
shl ebp, 0xe
or ebp, edx
and edx, 0x80
je 0x140279532
lea rdx, [rsp + 0x98]
mov rcx, r10
mov qword [rsp + 0x30], r10
call sym.sqlite3Fts5GetVarint
mov ebp, dword [rsp + 0x98]
mov r10, qword [rsp + 0x30]
movzx eax, al
and ebp, 0x7fffffff
jmp 0x1402791c5
mov r8, rdx
xor eax, eax
and edx, 0x7f
shr r8, 7
mov ebx, 2
mov al, r8b
or al, 0x80
mov ah, dl
mov word [rcx], ax
jmp 0x140279194
mov rdx, rbx
xor eax, eax
shr rdx, 7
mov al, dl
mov edx, ebx
or al, 0x80
and edx, 0x7f
mov ah, dl
mov word [rcx], ax
mov eax, 2
jmp 0x140279058
mov r12d, r14d
mov ebp, r15d
mov r14, qword [rsp + 0x48]
mov r15, r13
mov r13d, dword [rsp + 0x58]
jmp 0x140279203
mov r8d, 2
mov ebx, 2
jmp 0x140279333
mov r8d, 3
mov ebx, 3
jmp 0x140279333
mov rdi, qword [rsp + 0x68]
mov eax, dword [r15 + 0x34]
jmp 0x140278fb4
mov ebx, eax
mov r13d, edx
jmp 0x140279100
and ebp, 0x7f
shl ebp, 7
or ebp, eax
mov eax, 2
jmp 0x1402791c5
and eax, 0x7f
and ebp, 0x1fc07f
shl eax, 7
or ebp, eax
mov eax, 3
jmp 0x1402791c5
mov rdi, qword [rsp + 0x68]
mov r14d, dword [rsp + 0x74]
mov r13, qword [rsp + 0x78]
jmp 0x140278b00
mov rdi, qword [rsp + 0x68]
jmp 0x140278fb4
mov rdx, qword [rsp + 0x40]
mov rcx, r13
call sym.fts5WriteFlushLeaf
jmp 0x1402793cd