Function at 0x1401e73e0
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, 0x148
cmp dword [rcx + 0x20], 0
mov rbx, rcx
jne 0x1401e7406
cmp dword [rcx + 0x34], 0
je 0x1401e7b75
mov rax, qword [rbx + 0x18]
xor r9d, r9d
mov rcx, rbx
mov dword [rsp + 0x9c], r9d
mov qword [rsp + 0x28], rax
call sym.fts5StructureRead
mov rcx, rbx
mov qword [rsp + 0x58], rax
mov qword [rsp + 0xa8], rax
call sym.fts5StructureInvalidate
mov rax, qword [rsp + 0x28]
cmp dword [rax + 0x10], 0
je 0x1401e7a59
mov rdx, qword [rsp + 0x58]
mov rcx, rbx
call sym.fts5AllocateSegid
mov dword [rsp + 0x60], eax
test eax, eax
je 0x1401e7a59
mov rax, qword [rbx]
mov r8d, dword [rsp + 0x60]
mov rcx, rbx
mov edi, dword [rax + 0x88]
mov dword [rsp + 0x40], edi
mov edi, dword [rax + 0x5c]
mov eax, dword [rax + 0xb0]
mov dword [rsp + 0x64], edi
mov dword [rsp + 0x44], eax
lea rax, [rsp + 0xc8]
mov rdx, rax
mov qword [rsp + 0x30], rax
call sym.fts5WriteInit
cmp dword [rbx + 0x3c], 0
jne 0x1401e79a2
mov rax, qword [rsp + 0x28]
xor r8d, r8d
xor edx, edx
lea r9, [rax + 0x18]
mov rcx, rax
call sym.fts5HashEntrySort
mov dword [rbx + 0x3c], eax
mov r12d, dword [rbx + 0x3c]
test r12d, r12d
jne 0x1401e79a2
mov rax, qword [rsp + 0x28]
cmp qword [rax + 0x18], 0
je 0x1401e79a2
mov rcx, qword [rsp + 0x28]
lea r8, [rsp + 0xb8]
lea rdx, [rsp + 0xb0]
lea r9, [rsp + 0xa0]
call sym.sqlite3Fts5HashScanEntry
mov rax, qword [rsp + 0xb0]
mov rcx, rax
mov qword [rsp + 0x48], rax
call sym.strlen
cmp dword [rsp + 0x44], 0
mov dword [rsp + 0x88], eax
mov r8, rax
jne 0x1401e7593
mov r9, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x30]
mov rcx, rbx
call sym.fts5WriteAppendTerm
cmp dword [rbx + 0x3c], 0
jne 0x1401e79a2
mov eax, dword [rsp + 0xe0]
mov edx, dword [rsp + 0xf0]
mov r8d, dword [rsp + 0xa0]
add edx, eax
add edx, r8d
cmp dword [rsp + 0x40], edx
jle 0x1401e7593
movsxd rdx, eax
add rdx, qword [rsp + 0xd8]
movsxd rcx, r8d
add eax, r8d
mov rsi, qword [rsp + 0xb8]
mov rdi, rdx
mov dword [rsp + 0xe0], eax
rep movsb byte [rdi], byte [rsi]
cmp dword [rbx + 0x3c], 0
je 0x1401e7987
jmp 0x1401e74bd
xor eax, eax
cmp dword [rsp + 0x44], 0
sete al
xor r8d, r8d
xor r14d, r14d
mov dword [rsp + 0x68], eax
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x50], r8
mov qword [rsp + 0x80], rax
cmp dword [rbx + 0x3c], 0
mov rdi, qword [rsp + 0xa8]
jne 0x1401e74bd
mov r13d, dword [rsp + 0xa0]
cmp r12d, r13d
jge 0x1401e7987
mov r15, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0x80]
movsxd rcx, r12d
add rcx, r15
call sym.sqlite3Fts5GetVarint
movzx ebp, al
mov rax, qword [rsp + 0x50]
add rax, qword [rsp + 0xc0]
add ebp, r12d
cmp dword [rsp + 0x44], 0
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x50], rax
je 0x1401e76aa
cmp dword [rsp + 0x64], 1
jne 0x1401e7676
cmp ebp, r13d
jge 0x1401e76aa
movsxd rax, ebp
cmp byte [r15 + rax], 0
jne 0x1401e76aa
mov r9, qword [rsp + 0x50]
mov r8, qword [rsp + 0x48]
mov rdx, rdi
mov rcx, rbx
lea r12d, [rbp + 1]
call sym.fts5FlushSecureDelete
cmp r13d, r12d
jle 0x1401e75bc
movsxd rax, r12d
cmp byte [r15 + rax], 0
jne 0x1401e75bc
xor ecx, ecx
add ebp, 2
mov dword [rsp + 0xa0], ecx
jmp 0x1401e76aa
movsxd rsi, ebp
add rsi, r15
test byte [rsi], 1
je 0x1401e76aa
mov r9, qword [rsp + 0x50]
mov r8, qword [rsp + 0x48]
mov rdx, rdi
mov rcx, rbx
call sym.fts5FlushSecureDelete
cmp dword [rbx + 0x3c], 0
jne 0x1401e76a1
cmp byte [rsi], 1
jne 0x1401e76aa
lea r12d, [rbp + 1]
jmp 0x1401e75bc
mov eax, dword [rsp + 0x68]
or eax, dword [rbx + 0x3c]
jne 0x1401e76d8
mov r9, qword [rsp + 0xb0]
mov r8d, dword [rsp + 0x88]
mov rcx, rbx
mov rdx, qword [rsp + 0x30]
call sym.fts5WriteAppendTerm
mov dword [rsp + 0x68], 1
movsxd rcx, dword [rsp + 0xe0]
mov rdx, qword [rsp + 0xd8]
mov eax, dword [rsp + 0xe0]
mov r10, rcx
add rcx, rdx
xchg al, ah
cmp byte [rsp + 0x111], 0
je 0x1401e7734
mov word [rdx], ax
mov rdx, qword [rsp + 0x38]
call sym.sqlite3PutVarint
mov r8, qword [rsp + 0x38]
mov rcx, rbx
mov rdx, qword [rsp + 0x30]
add eax, r10d
mov byte [rsp + 0x111], 0
mov dword [rsp + 0xe0], eax
call sym.fts5WriteDlidxAppend
jmp 0x1401e774b
mov rdx, qword [rsp + 0x38]
sub rdx, r14
call sym.sqlite3PutVarint
add eax, r10d
mov dword [rsp + 0xe0], eax
mov r13d, dword [rbx + 0x3c]
test r13d, r13d
jne 0x1401e74bd
cmp dword [rsp + 0x64], 1
jne 0x1401e77f0
mov r9d, dword [rsp + 0xa0]
cmp r9d, ebp
jle 0x1401e77c7
movsxd rax, ebp
cmp byte [r15 + rax], 0
jne 0x1401e77c7
movsxd rdx, dword [rsp + 0xe0]
mov r8, qword [rsp + 0xd8]
lea ecx, [rdx + 1]
mov byte [r8 + rdx], 0
mov rax, rdx
lea edx, [rbp + 1]
mov dword [rsp + 0xe0], ecx
cmp r9d, edx
jle 0x1401e77c5
movsxd r9, edx
cmp byte [r15 + r9], 0
jne 0x1401e77c5
add eax, 2
movsxd rcx, ecx
add ebp, 2
mov dword [rsp + 0xe0], eax
mov byte [r8 + rcx], 0
jmp 0x1401e77c7
mov ebp, edx
mov eax, dword [rsp + 0xf0]
add eax, dword [rsp + 0xe0]
cmp dword [rsp + 0x40], eax
jg 0x1401e77e8
mov rdx, qword [rsp + 0x30]
mov rcx, rbx
call sym.fts5WriteFlushLeaf
mov r12d, ebp
jmp 0x1401e797d
movsxd rcx, ebp
mov esi, 1
add rcx, r15
movzx edx, byte [rcx]
mov dword [rsp + 0xa4], edx
test dl, dl
jns 0x1401e7818
lea rdx, [rsp + 0xa4]
call sym.sqlite3Fts5GetVarint32
mov esi, eax
mov ecx, dword [rsp + 0xa4]
mov r8d, 2
mov eax, ecx
cdq
idiv r8d
cmp dword [rsp + 0x44], 0
mov r12d, eax
je 0x1401e7855
and cl, 1
je 0x1401e7855
cdqe
lea rdx, [rsp + 0xd8]
lea rcx, [rbx + 0x3c]
add ebp, esi
lea r8, [rax + rax]
call sym.sqlite3Fts5BufferAppendVarint
jmp 0x1401e7859
lea r12d, [rax + rsi]
mov eax, dword [rsp + 0xe0]
mov edx, dword [rsp + 0xf0]
movsxd rdi, ebp
mov qword [rsp + 0x78], rdi
add edx, eax
add edx, r12d
cmp dword [rsp + 0x40], edx
jge 0x1401e788c
lea rax, [rsp + 0xa4]
mov qword [rsp + 0x70], rax
jmp 0x1401e7929
movsxd rdx, eax
movsxd rsi, ebp
add eax, r12d
movsxd rcx, r12d
add rdx, qword [rsp + 0xd8]
add rsi, r15
mov dword [rsp + 0xe0], eax
mov rdi, rdx
rep movsb byte [rdi], byte [rsi]
jmp 0x1401e797a
mov r14d, dword [rsp + 0xe0]
mov edi, dword [rsp + 0x40]
mov r8d, r12d
movsxd rsi, r13d
mov eax, dword [rsp + 0xf0]
sub r8d, r13d
sub edi, r14d
mov dword [rsp + 0x6c], eax
sub edi, eax
mov rax, qword [rsp + 0x78]
add rsi, rax
add rsi, r15
cmp edi, r8d
jl 0x1401e7931
movsxd rax, r14d
add r14d, r8d
movsxd rcx, r8d
add r13d, r8d
add rax, qword [rsp + 0xd8]
mov dword [rsp + 0xe0], r14d
mov rdi, rax
mov eax, dword [rsp + 0x6c]
rep movsb byte [rdi], byte [rsi]
add eax, r14d
cmp dword [rsp + 0x40], eax
jg 0x1401e7924
mov rdx, qword [rsp + 0x30]
mov rcx, rbx
call sym.fts5WriteFlushLeaf
cmp r12d, r13d
jle 0x1401e797a
cmp dword [rbx + 0x3c], 0
je 0x1401e78b4
jmp 0x1401e797a
mov rdx, qword [rsp + 0x70]
mov rcx, rsi
call sym.sqlite3Fts5GetVarint32
mov r8d, eax
cmp edi, eax
jle 0x1401e78e9
movsxd rcx, r8d
mov rdx, qword [rsp + 0x70]
mov dword [rsp + 0x8c], r8d
add rcx, rsi
call sym.sqlite3Fts5GetVarint32
mov r8d, dword [rsp + 0x8c]
mov edx, eax
mov eax, r8d
add r8d, edx
cmp edi, r8d
jge 0x1401e7945
mov r8d, eax
jmp 0x1401e78e9
add r12d, ebp
mov r14, qword [rsp + 0x38]
jmp 0x1401e75bc
mov rax, qword [rsp + 0x28]
mov rsi, qword [rsp + 0x28]
mov rax, qword [rax + 0x18]
mov rax, qword [rax + 8]
mov qword [rsi + 0x18], rax
jmp 0x1401e74bd
lea rdx, [rsp + 0xc8]
lea r8, [rsp + 0x9c]
mov rcx, rbx
call sym.fts5WriteFinish
mov esi, dword [rsp + 0x9c]
test esi, esi
jle 0x1401e7a59
mov rax, qword [rsp + 0x58]
lea rbp, [rbx + 0x3c]
cmp dword [rax + 0x1c], 0
jne 0x1401e79e8
lea rdx, [rsp + 0xa8]
mov rcx, rbp
call sym.fts5StructureAddLevel
mov rdi, qword [rsp + 0xa8]
xor r9d, r9d
xor r8d, r8d
mov rcx, rbp
mov rdx, rdi
call sym.fts5StructureExtendLevel.constprop.0
cmp dword [rbx + 0x3c], 0
jne 0x1401e7a4c
movsxd rax, dword [rdi + 0x24]
mov ecx, dword [rsp + 0x60]
lea edx, [rax + 1]
mov dword [rdi + 0x24], edx
mov rdx, qword [rdi + 0x10]
imul rax, rax, 0x38
add rax, qword [rdi + 0x28]
mov dword [rax], ecx
mov dword [rax + 4], 1
mov dword [rax + 8], esi
test rdx, rdx
je 0x1401e7a49
movsxd rcx, dword [rbx + 0x38]
mov qword [rax + 0x10], rdx
mov qword [rax + 0x18], rdx
inc rdx
mov qword [rax + 0x30], rcx
mov qword [rdi + 0x10], rdx
inc dword [rdi + 0x18]
mov r8, rdi
xor edx, edx
mov rcx, rbx
call sym.fts5StructurePromote
cmp dword [rbx + 0x3c], 0
jne 0x1401e7ac8
mov rax, qword [rbx]
mov r9d, dword [rax + 0x8c]
test r9d, r9d
jle 0x1401e7ac8
mov r10, qword [rsp + 0xa8]
test r10, r10
je 0x1401e7ac8
mov rcx, qword [r10 + 8]
mov r8d, dword [rsp + 0x9c]
xor edx, edx
add r8d, dword [rbx + 0x34]
movsxd r11, dword [rbx + 0x10]
movsxd r8, r8d
add r8, rcx
mov rax, r8
mov qword [r10 + 8], r8
div r11
xor edx, edx
mov r8, rax
mov rax, rcx
mov rcx, rbx
div r11
lea rdx, [rsp + 0xa8]
sub r8d, eax
imul r8d, r11d
imul r8d, dword [r10 + 0x1c]
call sym.fts5IndexMerge
mov rax, qword [rbx]
mov edi, dword [rax + 0x90]
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0xc8], rax
test rax, rax
je 0x1401e7b40
xor esi, esi
cmp dword [rax + 0x1c], 0
lea rbp, [rsp + 0xc8]
jle 0x1401e7b40
cmp dword [rbx + 0x3c], 0
mov rdx, qword [rsp + 0xc8]
jne 0x1401e7b38
movsxd rax, esi
shl rax, 4
cmp edi, dword [rax + rdx + 0x24]
jg 0x1401e7b38
mov r8d, esi
mov rdx, rbp
mov rcx, rbx
xor r9d, r9d
call sym.fts5IndexMergeLevel
inc esi
mov r8, qword [rsp + 0xc8]
mov rcx, rbx
mov edx, esi
call sym.fts5StructurePromote
jmp 0x1401e7af6
mov qword [rsp + 0xa8], rdx
mov rsi, qword [rsp + 0xa8]
mov rcx, rbx
mov rdx, rsi
call sym.fts5StructureWrite
mov rcx, rsi
call sym.fts5StructureRelease
cmp dword [rbx + 0x3c], 0
jne 0x1401e7b75
mov rcx, qword [rbx + 0x18]
call sym.sqlite3Fts5HashClear
xor eax, eax
xor edx, edx
mov dword [rbx + 0x20], eax
mov qword [rbx + 0x34], rdx
add rsp, 0x148
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret