Function at 0x14018bbe0
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
xor r14d, r14d
xor eax, eax
mov rsi, qword [rdx]
movsxd rbp, r8d
mov rbx, rcx
mov r13, rdx
mov dword [rsp + 0x70], eax
mov r12, rbp
shl rbp, 4
test r9, r9
mov qword [rsp + 0x1a8], r9
lea r15, [rbp + 0x18]
mov qword [rsp + 0xa0], r14
je 0x14018bc2f
mov eax, dword [r9]
mov dword [rsp + 0x70], eax
mov rax, qword [rbx]
lea rdx, [rsp + 0xa8]
mov ecx, 0x1e
mov eax, dword [rax + 0x5c]
mov dword [rsp + 0x7c], eax
lea rax, [rsp + 0xc8]
mov qword [rsp + 0x50], rax
mov rdi, qword [rsp + 0x50]
xor eax, eax
rep stosd dword [rdi], eax
mov rdi, rdx
mov ecx, 4
rep stosd dword [rdi], eax
lea rdx, [rsi + rbp]
mov r14d, dword [rdx + 0x18]
test r14d, r14d
je 0x14018bcbd
lea rax, [rsi + rbp + 0x28]
mov rcx, rbx
xor edi, edi
mov qword [rsp + 0x60], rax
movsxd rax, dword [rdx + 0x2c]
add r15, rsi
mov rdx, qword [rdx + 0x30]
imul rax, rax, 0xc
lea r13, [rdx + rax - 0xc]
mov rdx, qword [rsp + 0x50]
mov r8d, dword [r13]
call sym.fts5WriteInit
mov eax, dword [r13 + 8]
mov dword [rsp + 0x138], edi
inc eax
mov dword [rsp + 0xd0], eax
jmp 0x14018bd4b
lea r14, [rbx + 0x34]
mov rdx, rsi
mov rcx, rbx
call sym.fts5AllocateSegid
mov edi, eax
mov eax, dword [rsi + 0x14]
dec eax
cmp eax, r12d
jne 0x14018bce7
mov rdx, r13
mov rcx, r14
call sym.fts5StructureAddLevel
mov rsi, qword [r13]
xor r9d, r9d
mov rdx, rsi
mov rcx, r14
lea r8d, [r12 + 1]
call sym.fts5StructureExtendLevel.constprop.0
cmp dword [rbx + 0x34], 0
jne 0x14018c3b2
mov rdx, qword [rsp + 0x50]
lea rax, [rsi + rbp + 0x28]
mov r8d, edi
add rbp, rsi
mov rcx, rbx
mov qword [rsp + 0x60], rax
add r15, rsi
call sym.fts5WriteInit
movsxd r13, dword [rbp + 0x2c]
mov rax, r13
imul r13, r13, 0xc
inc eax
add r13, qword [rbp + 0x30]
mov dword [rbp + 0x2c], eax
mov dword [r13 + 4], 1
mov dword [r13], edi
inc dword [rsi + 0x10]
mov r14d, dword [rbp + 0x1c]
mov rax, qword [rsp + 0x60]
xor r11d, r11d
mov dword [rsp + 0x78], r11d
cmp dword [rax + 4], 1
jne 0x14018bd70
lea eax, [r12 + 2]
cmp dword [rsi + 0x14], eax
sete al
movzx eax, al
mov dword [rsp + 0x78], eax
xor r9d, r9d
xor r10d, r10d
mov dword [rsp + 0x30], r12d
mov rdx, rsi
lea rax, [rsp + 0xa0]
mov dword [rsp + 0x28], r9d
mov rcx, rbx
xor r9d, r9d
mov qword [rsp + 0x40], rax
mov r8d, 0x20
xor r12d, r12d
mov dword [rsp + 0x38], r14d
mov qword [rsp + 0x20], r10
call sym.fts5MultiIterNew
lea rax, [rsp + 0xa8]
mov qword [rsp + 0x80], rax
lea rax, [rbx + 0x34]
mov qword [rsp + 0x50], rax
cmp dword [rbx + 0x34], 0
mov rbp, qword [rsp + 0xa0]
jne 0x14018c039
cmp byte [rbp + 0x14], 0
jne 0x14018c039
mov rax, qword [rbp + 0x58]
movzx eax, word [rax + 4]
mov word [rsp + 0x58], ax
mov dword [rsp + 0x68], eax
movzx eax, word [rsp + 0x58]
imul rax, rax, 0x78
add rax, rbp
mov edi, dword [rax + 0xc0]
cmp dword [rsp + 0xb0], edi
mov r9, qword [rax + 0xb8]
jne 0x14018be41
test edi, edi
jle 0x14018be85
mov rdx, qword [rsp + 0xa8]
mov rcx, r9
movsxd r8, edi
mov qword [rsp + 0x88], r9
call sub.msvcrt.dll_memcmp
mov r9, qword [rsp + 0x88]
test eax, eax
je 0x14018be85
cmp qword [rsp + 0x1a8], 0
je 0x14018be5d
mov eax, dword [rsp + 0x70]
cmp dword [rsp + 0x114], eax
jg 0x14018c039
mov rdx, qword [rsp + 0x80]
mov r8d, edi
xor r12d, r12d
mov qword [rsp + 0x88], r9
mov rcx, qword [rsp + 0x50]
call sym.sqlite3Fts5BufferSet
mov r9, qword [rsp + 0x88]
movsxd rax, dword [rsp + 0x68]
imul rax, rax, 0x78
add rax, rbp
cmp dword [rax + 0xd0], 0
jne 0x14018beb2
cmp dword [rsp + 0x78], 0
jne 0x14018c023
cmp byte [rax + 0xd4], 0
je 0x14018c023
mov eax, r12d
or eax, dword [rbx + 0x34]
jne 0x14018bed3
lea rdx, [rsp + 0xc8]
mov r8d, edi
mov rcx, rbx
call sym.fts5WriteAppendTerm
mov r12d, 1
cmp dword [rbx + 0x34], 0
jne 0x14018bf85
mov rax, qword [rbp + 0x58]
mov rdx, qword [rbx]
movzx eax, word [rax + 4]
imul rax, rax, 0x78
mov rdi, qword [rbp + rax + 0xc8]
mov eax, dword [rsp + 0xf0]
add eax, dword [rsp + 0xe0]
cmp eax, dword [rdx + 0x84]
jl 0x14018bf1a
lea rdx, [rsp + 0xc8]
mov rcx, rbx
call sym.fts5WriteFlushLeaf
cmp byte [rsp + 0x111], 0
je 0x14018bf4b
mov eax, dword [rsp + 0xe0]
mov r8, rdi
mov rcx, rbx
mov rdx, qword [rsp + 0xd8]
xchg al, ah
mov word [rdx], ax
lea rdx, [rsp + 0xc8]
call sym.fts5WriteDlidxAppend
cmp word [rsp + 0x110], 0
mov r8, rdi
lea rdx, [rsp + 0xd8]
jne 0x14018bf69
sub r8, qword [rsp + 0x108]
mov rcx, qword [rsp + 0x50]
call sym.sqlite3Fts5BufferAppendVarint
mov qword [rsp + 0x108], rdi
mov word [rsp + 0x110], 0
movsxd rax, dword [rsp + 0x68]
imul rax, rax, 0x78
cmp dword [rsp + 0x7c], 1
lea rdi, [rbp + rax]
movzx edx, byte [rdi + 0xd4]
jne 0x14018bfdc
test dl, dl
je 0x14018c023
mov rcx, qword [rsp + 0x50]
lea rdx, [rsp + 0xd8]
xor r8d, r8d
mov qword [rsp + 0x58], rdx
call sym.sqlite3Fts5BufferAppendVarint
cmp dword [rdi + 0xd0], 0
jle 0x14018c023
mov rdx, qword [rsp + 0x58]
xor r8d, r8d
mov rcx, qword [rsp + 0x50]
call sym.sqlite3Fts5BufferAppendVarint
jmp 0x14018c023
mov eax, dword [rdi + 0xd0]
lea rdi, [rsp + 0xc8]
mov rcx, qword [rsp + 0x50]
lea r8d, [rdx + rax*2]
lea rdx, [rsp + 0xd8]
movsxd r8, r8d
call sym.sqlite3Fts5BufferAppendVarint
movzx eax, word [rsp + 0x58]
mov r8, rdi
mov rcx, rbx
lea r9, [sym.fts5MergeChunkCallback]
imul rax, rax, 0x78
lea rdx, [rbp + rax + 0x60]
call sym.fts5ChunkIterate
xor r9d, r9d
xor r8d, r8d
mov rdx, rbp
mov rcx, rbx
call sym.fts5MultiIterNext
jmp 0x14018bdc7
lea rdx, [rsp + 0xc8]
mov rcx, rbx
lea r8, [r13 + 8]
call sym.fts5WriteFinish
mov r12d, dword [rbx + 0x34]
test r12d, r12d
je 0x14018c066
lea rax, [rbx + 0x58]
xor edi, edi
mov qword [rsp + 0x50], rax
jmp 0x14018c12f
cmp byte [rbp + 0x14], 0
jne 0x14018c056
lea rax, [rsp + 0xb8]
mov ecx, 4
mov qword [rsp + 0x50], rax
lea rsi, [rbp + 0x60]
mov rdi, rax
mov eax, r12d
rep stosd dword [rdi], eax
lea rax, [rbx + 0x34]
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x9c]
mov qword [rsp + 0x70], rax
jmp 0x14018c1a7
imul rax, rdi, 0xc
add rax, qword [r15 + 8]
cmp dword [rbx + 0x34], 0
mov r12d, dword [rax]
jne 0x14018c0d2
lea eax, [r12 + 1]
mov rdx, r12
mov rcx, rbx
shl rax, 0x25
shl rdx, 0x25
lea r8, [rax - 1]
call sym.fts5DataDelete.part.0
cmp qword [rbx + 0x58], 0
jne 0x14018c100
mov rax, qword [rbx]
lea rcx, str.DELETE_FROM__q._q_idx_WHERE_segid_
mov rdx, qword [rax + 8]
mov r8, qword [rax + 0x10]
call sym.sqlite3_mprintf
mov rdx, qword [rsp + 0x50]
mov rcx, rbx
mov r8, rax
call sym.fts5IndexPrepareStmt
cmp dword [rbx + 0x34], 0
jne 0x14018c12c
mov rcx, qword [rbx + 0x58]
mov r8d, r12d
mov edx, 1
call sym.sqlite3_bind_int
mov rcx, qword [rbx + 0x58]
call sym.sqlite3_step
mov rcx, qword [rbx + 0x58]
call sym.sqlite3_reset
mov dword [rbx + 0x34], eax
inc rdi
cmp r14d, edi
jg 0x14018c0a5
mov r8d, dword [r15 + 4]
cmp r8d, r14d
je 0x14018c15e
movsxd rdx, r14d
mov rcx, qword [r15 + 8]
sub r8d, r14d
imul rdx, rdx, 0xc
imul r8d, r8d, 0xc
movsxd r8, r8d
add rdx, rcx
call sub.msvcrt.dll_memmove
mov eax, dword [rsi + 0x10]
xor r8d, r8d
sub eax, r14d
mov dword [rsi + 0x10], eax
sub dword [r15 + 4], r14d
mov dword [r15], r8d
cmp dword [r13 + 8], 0
jne 0x14018c381
mov rbx, qword [rsp + 0x60]
dec eax
dec dword [rbx + 4]
mov dword [rsi + 0x10], eax
jmp 0x14018c381
cmp dword [rbx + 0x34], 0
jne 0x14018c371
mov rax, qword [rsi]
test rax, rax
jne 0x14018c1b2
inc r12d
add rsi, 0x78
cmp r12d, dword [rbp + 0x40]
jl 0x14018c18e
jmp 0x14018c371
cmp qword [rsi + 0x10], 0
jne 0x14018c1c1
xor ecx, ecx
mov qword [rax + 4], rcx
jmp 0x14018c1a0
mov r13d, dword [rax]
xor edx, edx
mov rcx, rbx
mov edi, dword [rsi + 0x34]
mov dword [rsp + 0x9c], edx
movsxd rax, dword [rsi + 0x30]
shl r13, 0x25
mov dword [rsp + 0x60], edi
add rax, r13
mov rdx, rax
mov qword [rsp + 0x68], rax
call sym.fts5LeafRead
test rax, rax
mov rdi, rax
je 0x14018c1a0
mov eax, dword [rsp + 0x60]
cmp eax, dword [rdi + 0xc]
jle 0x14018c20c
mov dword [rbx + 0x34], 0x10b
jmp 0x14018c364
xor eax, eax
mov r8d, dword [rdi + 8]
cmp dword [rsp + 0xc4], r8d
mov dword [rsp + 0xc0], eax
jae 0x14018c235
mov rcx, qword [rsp + 0x58]
lea rdx, [rsp + 0xb8]
call sym.sqlite3Fts5BufferSize
mov r9, qword [rsp + 0x70]
mov r8d, 4
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
call sym.sqlite3Fts5BufferAppendBlob
movsxd r8, dword [rsi + 0x60]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
call sym.sqlite3Fts5BufferAppendVarint
mov r9, qword [rsi + 0x58]
mov r8d, dword [rsi + 0x60]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
call sym.sqlite3Fts5BufferAppendBlob
mov r8d, dword [rdi + 0xc]
mov eax, dword [rsp + 0x60]
movsxd r9, dword [rsp + 0x60]
mov rdx, qword [rsp + 0x50]
add r9, qword [rdi]
mov rcx, qword [rsp + 0x58]
sub r8d, eax
call sym.sqlite3Fts5BufferAppendBlob
cmp dword [rbx + 0x34], 0
jne 0x14018c2b6
mov eax, dword [rsp + 0xc0]
mov rdx, qword [rsp + 0xb8]
xchg al, ah
mov word [rdx + 2], ax
mov rdx, qword [rsp + 0x50]
mov r8d, 4
mov rcx, qword [rsp + 0x58]
call sym.sqlite3Fts5BufferAppendVarint
mov eax, dword [rsi + 0x30]
cmp dword [rsi + 0xc], eax
jne 0x14018c327
mov ecx, dword [rsi + 0x3c]
mov eax, dword [rdi + 0xc]
cmp ecx, eax
jge 0x14018c327
mov edx, dword [rdi + 8]
cmp dword [rsi + 0x38], edx
jg 0x14018c327
movsxd rdx, dword [rsp + 0xc0]
sub eax, ecx
cdqe
mov rcx, qword [rsp + 0x58]
sub rdx, rax
lea r8, [rdx - 5]
mov rdx, qword [rsp + 0x50]
call sym.sqlite3Fts5BufferAppendVarint
movsxd r9, dword [rsi + 0x38]
mov r8d, dword [rdi + 8]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
mov rax, r9
add r9, qword [rdi]
sub r8d, eax
call sym.sqlite3Fts5BufferAppendBlob
mov rax, qword [rsi]
mov edx, dword [rsi + 0x30]
cmp dword [rbx + 0x34], 0
mov dword [rax + 4], edx
jne 0x14018c347
mov r8, qword [rsp + 0x68]
lea rdx, [r13 + 1]
mov rcx, rbx
call sym.fts5DataDelete.part.0
mov r9d, dword [rsp + 0xc0]
mov rcx, rbx
mov r8, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0x68]
call sym.fts5DataWrite
mov rcx, rdi
call sym.sqlite3_free
jmp 0x14018c1a0
lea rcx, [rsp + 0xb8]
call sym.sqlite3Fts5BufferFree
mov dword [r15], r14d
mov rcx, rbp
call sym.fts5MultiIterFree
lea rcx, [rsp + 0xa8]
call sym.sqlite3Fts5BufferFree
cmp qword [rsp + 0x1a8], 0
je 0x14018c3b2
mov rsi, qword [rsp + 0x1a8]
mov eax, dword [rsp + 0x114]
sub dword [rsi], eax
add rsp, 0x148
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret