Function at 0x14012db00
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, 0x158
mov r13d, dword [rcx + 0x40]
mov r15, rcx
test r13d, r13d
jne 0x14012dd20
mov esi, dword [rcx + 0x20]
test esi, esi
jne 0x14012db35
mov ebx, dword [rcx + 0x34]
test ebx, ebx
je 0x14012dd0a
mov rcx, r15
mov r14, qword [r15 + 0x18]
mov dword [rsp + 0xb8], 0
call sym.fts5StructureRead
mov rbx, qword [r15 + 0xa0]
mov qword [rsp + 0xc0], rax
mov r10, rax
test rbx, rbx
je 0x14012db7d
mov eax, dword [rbx]
sub eax, 1
mov dword [rbx], eax
test eax, eax
jle 0x14012dfcd
mov qword [r15 + 0xa0], 0
mov r12d, dword [r14 + 0x10]
test r12d, r12d
jne 0x14012dd58
mov eax, dword [r15 + 0x3c]
mov rdx, qword [r15]
test eax, eax
jne 0x14012dd30
mov r9d, dword [rdx + 0x94]
test r9d, r9d
jle 0x14012df90
mov edx, dword [r15 + 0x34]
test r10, r10
je 0x14012e050
mov r8, qword [r10 + 8]
add edx, r12d
movsxd r11, dword [r15 + 0x10]
movsxd rdx, edx
lea rax, [rdx + r8]
xor edx, edx
mov qword [r10 + 8], rax
div r11
xor edx, edx
mov rcx, rax
mov rax, r8
div r11
mov r8d, ecx
lea rdx, [rsp + 0xc0]
mov rcx, r15
sub r8d, eax
imul r8d, r11d
imul r8d, dword [r10 + 0x1c]
call sym.fts5IndexMerge
mov edx, dword [r15 + 0x3c]
mov rcx, qword [r15]
mov r10, qword [rsp + 0xc0]
mov ebx, dword [rcx + 0x98]
mov eax, edx
test r10, r10
je 0x14012e040
mov esi, dword [r10 + 0x1c]
mov qword [rsp + 0xd0], r10
test esi, esi
jle 0x14012e085
test edx, edx
jne 0x14012dd45
lea rsi, [rsp + 0xd0]
mov rdi, r10
nop word [rax + rax]
movsxd rax, r13d
shl rax, 4
cmp ebx, dword [rax + rdi + 0x24]
jg 0x14012e068
mov r8d, r13d
xor r9d, r9d
mov rdx, rsi
mov rcx, r15
call sym.fts5IndexMergeLevel
mov r11d, dword [r15 + 0x3c]
mov rdi, qword [rsp + 0xd0]
add r13d, 1
test r11d, r11d
je 0x14012e018
mov qword [rsp + 0xc0], rdi
mov r10, rdi
test rdi, rdi
je 0x14012df60
nop word [rax + rax]
mov eax, dword [r10]
sub eax, 1
mov dword [r10], eax
test eax, eax
jg 0x14012df60
mov r8d, dword [r10 + 0x1c]
xor ebx, ebx
mov rsi, r10
test r8d, r8d
jle 0x14012dcdd
nop
mov rax, rbx
add rbx, 1
shl rax, 4
mov rcx, qword [rsi + rax + 0x28]
call sym.sqlite3_free
cmp dword [rsi + 0x1c], ebx
jg 0x14012dcc0
mov r10, rsi
mov rcx, r10
call sym.sqlite3_free
mov eax, dword [r15 + 0x3c]
test eax, eax
jne 0x14012df6c
mov rcx, qword [r15 + 0x18]
call sym.sqlite3Fts5HashClear
mov dword [r15 + 0x20], 0
mov qword [r15 + 0x34], 0
add rsp, 0x158
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov dword [rcx + 0x3c], r13d
jmp 0x14012dd0a
test r10, r10
je 0x14012df60
mov edi, dword [r10 + 0x1c]
test edi, edi
jle 0x14012dca0
mov qword [rsp + 0xc0], r10
jmp 0x14012dca0
mov rdx, r10
mov rcx, r15
mov qword [rsp + 0x30], r10
call sym.fts5AllocateSegid
mov r10, qword [rsp + 0x30]
test eax, eax
mov r12d, eax
je 0x14012db8a
mov rax, qword [r15]
mov r8d, r12d
mov rcx, r15
mov qword [rsp + 0x38], r10
mov edi, dword [rax + 0x90]
mov dword [rsp + 0x30], edi
mov edi, dword [rax + 0x60]
mov eax, dword [rax + 0xb8]
mov dword [rsp + 0x50], edi
mov dword [rsp + 0x44], eax
lea rax, [rsp + 0xd0]
mov rdx, rax
mov qword [rsp + 0x48], rax
call sym.fts5WriteInit
mov eax, dword [r15 + 0x3c]
mov r10, qword [rsp + 0x38]
test eax, eax
je 0x14012e6e5
lea rdi, [rsp + 0xbc]
mov qword [rsp + 0x60], rdi
test eax, eax
jne 0x14012def7
mov rbx, qword [r14 + 0x18]
mov dword [rsp + 0xa8], r12d
mov dword [rsp + 0xac], r13d
mov qword [rsp + 0x98], r10
mov qword [rsp + 0x1a0], r15
test rbx, rbx
je 0x14012ded7
nop dword [rax]
mov esi, dword [rbx + 0x1c]
lea rdi, [rbx + 0x30]
xor r8d, r8d
mov rdx, rbx
mov rcx, r14
mov qword [rsp + 0x68], rdi
mov dword [rsp + 0x74], esi
call sym.fts5HashAddPoslistSize
movsxd rax, esi
mov r10d, dword [rsp + 0x44]
mov r9, rdi
lea r15, [rdi + rax]
mov eax, dword [rbx + 0x18]
sub eax, 0x30
sub eax, esi
mov edi, eax
test r10d, r10d
jne 0x14012e098
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x1a0]
mov r8d, esi
call sym.fts5WriteAppendTerm
mov rax, qword [rsp + 0x1a0]
mov eax, dword [rax + 0x3c]
test eax, eax
jne 0x14012ded7
mov ebx, dword [rsp + 0xe8]
mov edx, dword [rsp + 0xf8]
add edx, ebx
add edx, edi
cmp dword [rsp + 0x30], edx
jle 0x14012e0a3
movsxd rcx, ebx
movsxd r8, edi
add rcx, qword [rsp + 0xe0]
add ebx, edi
mov rdx, r15
call sym.memcpy
mov rax, qword [rsp + 0x1a0]
mov dword [rsp + 0xe8], ebx
mov eax, dword [rax + 0x3c]
test eax, eax
jne 0x14012ded7
mov rax, qword [r14 + 0x18]
mov rax, qword [rax + 8]
mov qword [r14 + 0x18], rax
mov rbx, qword [r14 + 0x18]
test rbx, rbx
jne 0x14012de10
mov r12d, dword [rsp + 0xa8]
mov r13d, dword [rsp + 0xac]
mov r10, qword [rsp + 0x98]
mov r15, qword [rsp + 0x1a0]
mov rdx, qword [rsp + 0x48]
lea r8, [rsp + 0xb8]
mov rcx, r15
mov qword [rsp + 0x30], r10
call sym.fts5WriteFinish
mov ebx, dword [rsp + 0xb8]
mov r10, qword [rsp + 0x30]
test ebx, ebx
jle 0x14012e6d9
mov eax, dword [r10 + 0x1c]
test eax, eax
je 0x14012e704
mov edx, dword [r15 + 0x3c]
test edx, edx
je 0x14012e722
mov rax, qword [r15]
mov r10, qword [rsp + 0xc0]
mov ebx, dword [rax + 0x98]
test r10, r10
jne 0x14012dc1b
nop word [rax + rax]
mov eax, dword [r15 + 0x3c]
test eax, eax
je 0x14012dcf1
mov ecx, dword [r15 + 0x20]
test ecx, ecx
je 0x14012df80
mov dword [r15 + 0x40], eax
jmp 0x14012dd0a
mov edx, dword [r15 + 0x34]
test edx, edx
je 0x14012dd0a
jmp 0x14012df74
mov qword [rsp + 0xd0], r10
mov ebx, dword [rdx + 0x98]
test r10, r10
je 0x14012e050
mov ebp, dword [r10 + 0x1c]
test ebp, ebp
jg 0x14012dc37
mov rdx, r10
mov rcx, r15
mov qword [rsp + 0x30], r10
call sym.fts5StructureWrite.part.0
mov r10, qword [rsp + 0x30]
jmp 0x14012dca0
mov r11d, dword [rbx + 0x1c]
xor esi, esi
mov rdi, r10
test r11d, r11d
jle 0x14012dffd
nop dword [rax + rax]
mov rax, rsi
add rsi, 1
shl rax, 4
mov rcx, qword [rbx + rax + 0x28]
call sym.sqlite3_free
cmp dword [rbx + 0x1c], esi
jg 0x14012dfe0
mov r10, rdi
mov rcx, rbx
mov qword [rsp + 0x30], r10
call sym.sqlite3_free
mov r10, qword [rsp + 0x30]
jmp 0x14012db72
mov r8, rdi
mov edx, r13d
mov rcx, r15
call sym.fts5StructurePromote.part.0
mov r10d, dword [r15 + 0x3c]
test r10d, r10d
je 0x14012dc48
jmp 0x14012dc83
test edx, edx
jne 0x14012df6c
nop dword [rax + rax]
xor edx, edx
mov rcx, r15
call sym.fts5StructureWrite.part.0
mov eax, dword [r15 + 0x3c]
jmp 0x14012df64
mov r9d, dword [r15 + 0x3c]
mov qword [rsp + 0xc0], rdi
mov r10, rdi
test r9d, r9d
jne 0x14012dca0
jmp 0x14012dfb3
test edx, edx
je 0x14012dfb3
jmp 0x14012dca0
mov rax, qword [rsp + 0x1a0]
mov eax, dword [rax + 0x3c]
mov r9d, dword [rsp + 0x44]
xor r8d, r8d
test r9d, r9d
sete r8b
test edi, edi
jle 0x14012deba
test eax, eax
jne 0x14012ded7
lea rax, [rsp + 0xc8]
xor r13d, r13d
xor ebx, ebx
xor esi, esi
mov qword [rsp + 0xa0], r14
mov r14, qword [rsp + 0x1a0]
mov qword [rsp + 0x58], rax
mov dword [rsp + 0x54], r8d
jmp 0x14012e1d9
mov word [rdx], ax
cmp r12, 0x7f
jbe 0x14012e510
cmp r12, 0x3fff
jbe 0x14012e590
mov rdx, r12
call sym.putVarint64
mov rdx, qword [rsp + 0x48]
add eax, ebp
mov r8, r12
mov rcx, r14
mov dword [rsp + 0xe8], eax
mov byte [rsp + 0x119], 0
call sym.fts5WriteDlidxAppend
mov ebp, dword [r14 + 0x3c]
test ebp, ebp
jne 0x14012e5f0
cmp dword [rsp + 0x50], 1
jne 0x14012e2a0
mov eax, dword [rsp + 0xe8]
cmp r13d, edi
jge 0x14012e1b0
movsxd rdx, r13d
cmp byte [r15 + rdx], 0
jne 0x14012e1b0
mov r8, qword [rsp + 0xe0]
movsxd rcx, eax
lea edx, [rax + 1]
mov dword [rsp + 0xe8], edx
mov byte [r8 + rcx], 0
lea ecx, [r13 + 1]
cmp ecx, edi
jge 0x14012e680
movsxd r9, ecx
cmp byte [r15 + r9], 0
jne 0x14012e680
add eax, 2
movsxd rdx, edx
add r13d, 2
mov dword [rsp + 0xe8], eax
mov byte [r8 + rdx], 0
nop word [rax + rax]
add eax, dword [rsp + 0xf8]
cmp dword [rsp + 0x30], eax
jle 0x14012e530
mov eax, dword [r14 + 0x3c]
mov rbx, r12
test eax, eax
jne 0x14012e5f0
cmp edi, r13d
jle 0x14012e6c0
movsxd rcx, r13d
mov rdx, qword [rsp + 0x58]
mov qword [rsp + 0xc8], 0
add rcx, r15
call sym.sqlite3Fts5GetVarint
mov r8d, dword [rsp + 0x44]
add rsi, qword [rsp + 0xc8]
movzx eax, al
mov r12, rsi
add r13d, eax
test r8d, r8d
je 0x14012e22b
cmp dword [rsp + 0x50], 1
je 0x14012e4b0
movsxd rbp, r13d
add rbp, r15
test byte [rbp], 1
jne 0x14012e5b0
mov edx, dword [r14 + 0x3c]
or edx, dword [rsp + 0x54]
je 0x14012e330
movsxd rcx, dword [rsp + 0xe8]
mov rdx, qword [rsp + 0xe0]
movzx eax, word [rsp + 0xe8]
mov rbp, rcx
add rcx, rdx
rol ax, 8
cmp byte [rsp + 0x119], 0
jne 0x14012e0f0
mov rdx, r12
sub rdx, rbx
cmp rdx, 0x7f
jbe 0x14012e520
cmp rdx, 0x3fff
jbe 0x14012e570
call sym.putVarint64
add eax, ebp
mov dword [rsp + 0xe8], eax
jmp 0x14012e133
movsxd r11, r13d
mov ebx, 1
add r11, r15
movzx edx, byte [r11]
mov dword [rsp + 0xbc], edx
test dl, dl
js 0x14012e548
mov eax, edx
mov ecx, dword [rsp + 0x44]
shr eax, 0x1f
add eax, edx
sar eax, 1
mov r9d, eax
test ecx, ecx
je 0x14012e2db
and edx, 1
jne 0x14012e690
lea r9d, [rax + rbx]
mov ebx, dword [rsp + 0xe8]
mov eax, dword [rsp + 0xf8]
add eax, ebx
add eax, r9d
cmp dword [rsp + 0x30], eax
jl 0x14012e358
movsxd rcx, ebx
movsxd r8, r9d
mov rdx, r11
mov dword [rsp + 0x38], r9d
add rcx, qword [rsp + 0xe0]
call sym.memcpy
mov r9d, dword [rsp + 0x38]
mov eax, dword [r14 + 0x3c]
add ebx, r9d
mov dword [rsp + 0xe8], ebx
add r13d, r9d
jmp 0x14012e1c5
mov r9, qword [rsp + 0x68]
mov r8d, dword [rsp + 0x74]
mov rcx, r14
mov rdx, qword [rsp + 0x48]
call sym.fts5WriteAppendTerm
mov dword [rsp + 0x54], 1
jmp 0x14012e239
mov qword [rsp + 0x78], r12
mov r12d, r9d
mov dword [rsp + 0x90], r13d
mov qword [rsp + 0x80], rsi
mov qword [rsp + 0x38], r11
mov qword [rsp + 0x88], r15
mov dword [rsp + 0x94], edi
mov qword [rsp + 0x1a0], r14
jmp 0x14012e3dc
movsxd rax, r13d
add rax, qword [rsp + 0xe0]
movsxd r8, ebx
mov rdx, r15
add ebx, r13d
mov rcx, rax
call sym.memcpy
mov dword [rsp + 0xe8], ebx
add ebx, edi
cmp r14d, ebx
jg 0x14012e648
mov ebp, r12d
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x1a0]
call sym.fts5WriteFlushLeaf
cmp ebp, r12d
jge 0x14012e648
mov rax, qword [rsp + 0x1a0]
mov eax, dword [rax + 0x3c]
test eax, eax
jne 0x14012e610
mov r14d, dword [rsp + 0x30]
mov rax, qword [rsp + 0x38]
mov ebx, r12d
movsxd rcx, ebp
mov r13d, dword [rsp + 0xe8]
mov edi, dword [rsp + 0xf8]
sub ebx, ebp
mov esi, r14d
lea r15, [rax + rcx]
sub esi, r13d
sub esi, edi
cmp esi, ebx
jge 0x14012e390
mov r14, qword [rsp + 0x60]
mov rcx, r15
mov rdx, r14
call sym.sqlite3Fts5GetVarint32
mov ebx, eax
cmp esi, eax
jle 0x14012e4a8
mov dword [rsp + 0x70], edi
nop
movsxd rdi, ebx
mov rdx, r14
lea rcx, [r15 + rdi]
call sym.sqlite3Fts5GetVarint32
mov r11d, ebx
add ebx, eax
cmp esi, ebx
jge 0x14012e440
mov r14, rdi
mov edi, dword [rsp + 0x70]
movsxd rax, r13d
mov r8, r14
mov rdx, r15
mov dword [rsp + 0x70], r11d
add rax, qword [rsp + 0xe0]
add ebp, r11d
mov rcx, rax
call sym.memcpy
mov r11d, dword [rsp + 0x70]
lea r9d, [r13 + r11]
mov dword [rsp + 0xe8], r9d
add edi, r9d
cmp dword [rsp + 0x30], edi
jg 0x14012e3d3
jmp 0x14012e3c1
movsxd r14, eax
mov r11d, eax
jmp 0x14012e45f
cmp r13d, edi
jge 0x14012e22b
movsxd rax, r13d
cmp byte [r15 + rax], 0
jne 0x14012e22b
mov qword [rsp + 0x20], rsi
mov r9d, dword [rsp + 0x74]
mov rcx, r14
mov r8, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x98]
call sym.fts5FlushSecureDelete
lea eax, [r13 + 1]
cmp eax, edi
jge 0x14012e6cd
movsxd rdx, eax
cmp byte [r15 + rdx], 0
jne 0x14012e6cd
mov edx, dword [r14 + 0x3c]
add r13d, 2
xor edi, edi
jmp 0x14012e22f
mov byte [rcx], r12b
mov eax, 1
jmp 0x14012e112
mov byte [rcx], dl
mov eax, 1
jmp 0x14012e28b
mov rdx, qword [rsp + 0x48]
mov rcx, r14
call sym.fts5WriteFlushLeaf
jmp 0x14012e1c1
mov rdx, qword [rsp + 0x60]
mov rcx, r11
mov qword [rsp + 0x38], r11
call sym.sqlite3Fts5GetVarint32
mov edx, dword [rsp + 0xbc]
mov r11, qword [rsp + 0x38]
mov ebx, eax
jmp 0x14012e2be
mov rax, rdx
and edx, 0x7f
shr rax, 7
mov byte [rcx + 1], dl
or eax, 0xffffff80
mov byte [rcx], al
mov eax, 2
jmp 0x14012e28b
mov rax, r12
shr rax, 7
or eax, 0xffffff80
mov byte [rcx], al
mov eax, r12d
and eax, 0x7f
mov byte [rcx + 1], al
mov eax, 2
jmp 0x14012e112
mov qword [rsp + 0x20], rsi
mov rdx, qword [rsp + 0x98]
mov rcx, r14
mov r9d, dword [rsp + 0x74]
mov r8, qword [rsp + 0x68]
call sym.fts5FlushSecureDelete
mov eax, dword [r14 + 0x3c]
mov edx, eax
test eax, eax
jne 0x14012e5e3
cmp byte [rbp], 1
jne 0x14012e22f
add r13d, 1
test eax, eax
je 0x14012e1d0
nop
mov r12d, dword [rsp + 0xa8]
mov r13d, dword [rsp + 0xac]
mov r15, r14
mov r10, qword [rsp + 0x98]
jmp 0x14012def7
mov r9d, r12d
mov r13d, dword [rsp + 0x90]
mov rsi, qword [rsp + 0x80]
mov r12, qword [rsp + 0x78]
mov r15, qword [rsp + 0x88]
mov edi, dword [rsp + 0x94]
mov r14, qword [rsp + 0x1a0]
jmp 0x14012e326
mov r14, qword [rsp + 0x1a0]
mov r9d, r12d
mov r13d, dword [rsp + 0x90]
mov rsi, qword [rsp + 0x80]
mov r12, qword [rsp + 0x78]
mov r15, qword [rsp + 0x88]
mov edi, dword [rsp + 0x94]
mov eax, dword [r14 + 0x3c]
jmp 0x14012e326
mov eax, edx
mov r13d, ecx
jmp 0x14012e1b0
cdqe
lea rcx, [r14 + 0x3c]
add r13d, ebx
mov dword [rsp + 0x38], r9d
lea rdx, [rsp + 0xe0]
lea r8, [rax + rax]
call sym.sqlite3Fts5BufferAppendVarint
movsxd r11, r13d
mov r9d, dword [rsp + 0x38]
add r11, r15
jmp 0x14012e2df
mov r14, qword [rsp + 0xa0]
jmp 0x14012deba
mov r13d, eax
mov eax, dword [r14 + 0x3c]
jmp 0x14012e1c8
mov eax, dword [r15 + 0x3c]
mov r12d, ebx
jmp 0x14012db8e
lea r9, [r14 + 0x18]
xor r8d, r8d
xor edx, edx
mov rcx, r14
call sym.fts5HashEntrySort
mov r10, qword [rsp + 0x38]
mov dword [r15 + 0x3c], eax
jmp 0x14012ddc7
lea rdx, [rsp + 0xc0]
lea rcx, [r15 + 0x3c]
call sym.fts5StructureAddLevel
mov r10, qword [rsp + 0xc0]
jmp 0x14012df31
mov r14d, dword [0x14014efd4]
mov esi, dword [r10 + 0x24]
mov rdi, qword [r10 + 0x28]
test r14d, r14d
jne 0x14012e851
mov qword [rsp + 0x30], r10
call sym.sqlite3MutexInit
test eax, eax
jne 0x14012e83f
call sym.sqlite3_initialize.part.0
mov r10, qword [rsp + 0x30]
test eax, eax
jne 0x14012e83f
lea eax, [rsi + 1]
mov rcx, rdi
mov qword [rsp + 0x30], r10
cdqe
lea rdx, [rax*8]
sub rdx, rax
shl rdx, 3
call sym.sqlite3Realloc
test rax, rax
je 0x14012e83f
mov r10, qword [rsp + 0x30]
pxor xmm0, xmm0
movsxd rcx, dword [r10 + 0x24]
lea rdx, [rcx*8]
sub rdx, rcx
lea rdx, [rax + rdx*8]
mov qword [rdx + 0x30], 0
movups xmmword [rdx], xmm0
movups xmmword [rdx + 0x10], xmm0
movups xmmword [rdx + 0x20], xmm0
mov edx, dword [r15 + 0x3c]
mov qword [r10 + 0x28], rax
test edx, edx
jne 0x14012df3d
movsxd rdx, dword [r10 + 0x24]
lea ecx, [rdx + 1]
mov dword [r10 + 0x24], ecx
lea rcx, [rdx*8]
sub rcx, rdx
lea rdx, [rax + rcx*8]
mov rax, qword [r10 + 0x10]
mov dword [rdx], r12d
mov dword [rdx + 4], 1
mov dword [rdx + 8], ebx
test rax, rax
je 0x14012e814
movsxd rcx, dword [r15 + 0x38]
movq xmm0, rax
add rax, 1
punpcklqdq xmm0, xmm0
mov qword [rdx + 0x30], rcx
movups xmmword [rdx + 0x10], xmm0
mov qword [r10 + 0x10], rax
add dword [r10 + 0x18], 1
mov r8, r10
xor edx, edx
mov rcx, r15
call sym.fts5StructurePromote.part.0
mov r12d, dword [rsp + 0xb8]
mov eax, dword [r15 + 0x3c]
mov r10, qword [rsp + 0xc0]
jmp 0x14012db8e
mov dword [r15 + 0x3c], 7
mov edx, 7
jmp 0x14012df3d
lock or qword [rsp], 0
jmp 0x14012e75e