Function at 0x14022ad20
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, 0xd8
xor ebx, ebx
mov rax, qword [rcx]
mov qword [rsp + 0x38], rdx
mov edx, 1
mov rsi, rcx
mov rdi, r8
mov qword [rsp + 0xb0], rbx
mov qword [rsp + 0x78], rax
call sym.fts5StorageLoadTotals
mov ebx, eax
test eax, eax
jne 0x14022b497
mov rcx, qword [rsi + 8]
mov r8, qword [rsp + 0x38]
mov edx, 1
call sym.sqlite3Fts5IndexBeginWrite
mov ebx, eax
test eax, eax
jne 0x14022b497
mov rbp, qword [rsi]
cmp dword [rbp + 0x44], 0
je 0x14022b2d1
xor r9d, r9d
lea r8, [rsp + 0xc0]
mov edx, 8
mov rcx, rsi
call sym.fts5StorageGetStmt
mov ebx, eax
test eax, eax
jne 0x14022b497
mov rbx, qword [rsp + 0xc0]
mov r8, qword [rsp + 0x38]
mov edx, 1
mov rcx, rbx
call sym.sqlite3_bind_int64
mov rcx, rbx
call sym.sqlite3_step
xor r11d, r11d
mov qword [rsp + 0x58], r11
cmp eax, 0x64
jne 0x14022adf1
mov edx, 1
mov rcx, rbx
call sym.sqlite3_column_int64
mov qword [rsp + 0x58], rax
mov rcx, rbx
call sym.sqlite3_reset
mov ebx, eax
test eax, eax
jne 0x14022b43d
cmp qword [rsp + 0x58], 0
je 0x14022b43d
mov rdi, qword [rsi + 8]
mov rcx, rdi
call sym.fts5StructureRead
mov qword [rsp + 0x48], rax
test rax, rax
je 0x14022b2c4
mov eax, dword [rax + 0x1c]
mov dword [rsp + 0x40], eax
dec eax
cdqe
mov qword [rsp + 0x70], rax
xor eax, eax
cmp dword [rsp + 0x70], 0
js 0x14022b2ba
mov rbx, qword [rsp + 0x70]
shl rbx, 4
mov qword [rsp + 0xa0], rbx
mov rbx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0xa0]
mov ebx, dword [rbx + rcx + 0x24]
lea ecx, [rbx - 1]
mov dword [rsp + 0x40], ebx
movsxd rdx, ecx
mov dword [rsp + 0x68], ecx
imul rbx, rdx, 0x38
mov qword [rsp + 0x98], rbx
cmp dword [rsp + 0x68], 0
js 0x14022b2b0
mov rcx, qword [rsp + 0x48]
mov rbx, qword [rsp + 0xa0]
mov r12, qword [rsp + 0x98]
add r12, qword [rcx + rbx + 0x28]
mov rcx, qword [rsp + 0x58]
cmp rcx, qword [r12 + 0x10]
jb 0x14022b29e
cmp qword [r12 + 0x18], rcx
jb 0x14022b29e
test eax, eax
jne 0x14022aecb
inc qword [r12 + 0x28]
mov edx, dword [r12 + 0x20]
inc dword [rdi + 0x34]
test edx, edx
jle 0x14022af76
mov rax, qword [rsp + 0x38]
movsxd rbx, edx
xor edx, edx
mov rcx, rdi
div rbx
mov eax, dword [r12]
mov dword [rsp + 0xa8], edx
mov rbx, rdx
lea edx, [rax + 0x10000]
shl rdx, 0x25
add rdx, rbx
call sym.fts5DataRead
mov r14, rax
test rax, rax
je 0x14022af53
mov r9, qword [rsp + 0x38]
mov r8d, dword [r12 + 0x20]
xor edx, edx
mov rcx, rax
call sym.fts5IndexTombstoneAddToPage
test eax, eax
jne 0x14022af5d
mov edx, dword [r12]
mov r9d, dword [r14 + 8]
mov rcx, rdi
mov r8, qword [r14]
add edx, 0x10000
shl rdx, 0x25
add rdx, rbx
call sym.fts5DataWrite
mov rcx, r14
call sym.sqlite3_free
mov eax, 1
jmp 0x14022b29e
mov rax, qword [r14]
cmp byte [rax], 4
setne al
movzx eax, al
lea eax, [rax*4 + 4]
mov dword [rsp + 0x40], eax
jmp 0x14022af8c
mov dword [rsp + 0xa8], 0xffffffff
xor r14d, r14d
mov dword [rsp + 0x40], 4
mov rcx, qword [rsp + 0x38]
mov eax, 0xffffffff
mov ebx, dword [r12 + 0x20]
cmp rax, rcx
mov eax, 8
cmovae eax, dword [rsp + 0x40]
mov dword [rsp + 0x40], eax
mov rax, qword [rdi]
mov eax, dword [rax + 0x88]
sub eax, 8
cdq
idiv dword [rsp + 0x40]
mov edx, 0x20
cmp eax, edx
cmovge edx, eax
mov dword [rsp + 0x6c], edx
test ebx, ebx
je 0x14022b004
cmp ebx, 1
jne 0x14022aff9
mov rax, qword [r14]
lea rcx, [rax + 4]
call sym.fts5GetU32
lea r13d, [rax*4]
mov eax, 0x20
cmp r13d, eax
cmovl r13d, eax
cmp edx, r13d
jge 0x14022b00f
mov r13d, dword [rsp + 0x6c]
lea ebx, [rbx + rbx + 1]
jmp 0x14022b00f
mov ebx, 1
mov r13d, 0x20
lea rax, [rdi + 0x3c]
mov qword [rsp + 0x88], rax
movsxd rax, ebx
mov rcx, qword [rsp + 0x88]
xor r15d, r15d
lea rdx, [rax*8]
mov qword [rsp + 0x80], rax
call sym.sqlite3Fts5MallocZero
mov rbp, rax
mov eax, dword [rsp + 0x40]
imul r13d, eax
add r13d, 8
movsxd rax, r13d
add rax, 0x10
mov qword [rsp + 0x50], rax
cmp ebx, r15d
jle 0x14022b08a
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x88]
call sym.sqlite3Fts5MallocZero
test rax, rax
je 0x14022b085
lea rdx, [rax + 0x10]
mov dword [rax + 8], r13d
mov qword [rax], rdx
mov qword [rbp + r15*8], rax
inc r15
jmp 0x14022b059
cmp dword [rdi + 0x3c], 0
jne 0x14022b20b
xor eax, eax
cmp ebx, eax
jle 0x14022b0bc
mov rdx, qword [rbp + rax*8]
mov cl, byte [rsp + 0x40]
xor r10d, r10d
mov rdx, qword [rdx]
mov byte [rdx], cl
mov rdx, qword [rbp + rax*8]
inc rax
mov rdx, qword [rdx]
mov dword [rdx + 4], r10d
jmp 0x14022b096
xor r13d, r13d
cmp dword [r12 + 0x20], r13d
jle 0x14022b205
cmp dword [rsp + 0xa8], r13d
je 0x14022b0fa
mov eax, dword [r12]
mov rcx, rdi
lea edx, [rax + 0x10000]
shl rdx, 0x25
add rdx, r13
call sym.fts5DataRead
mov qword [rsp + 0x90], rax
mov r15, rax
jmp 0x14022b108
xor r9d, r9d
mov r15, r14
mov qword [rsp + 0x90], r9
xor eax, eax
test r15, r15
je 0x14022b1cd
mov rax, qword [r15]
cmp byte [rax], 4
setne al
xor r8d, r8d
movzx eax, al
mov qword [rsp + 0x50], r8
lea eax, [rax*4 + 4]
mov dword [rsp + 0x64], eax
mov eax, dword [r15 + 8]
sub eax, 8
cdq
idiv dword [rsp + 0x64]
mov dword [rsp + 0xac], eax
mov edx, dword [rsp + 0x50]
cmp dword [rsp + 0xac], edx
jle 0x14022b1b6
cmp dword [rsp + 0x64], 4
mov rax, qword [r15]
mov rdx, qword [rsp + 0x50]
jne 0x14022b17c
lea rcx, [rax + rdx*4 + 8]
cmp dword [rcx], 0
jne 0x14022b172
inc qword [rsp + 0x50]
jmp 0x14022b145
call sym.fts5GetU32
mov r9d, eax
jmp 0x14022b18f
lea rcx, [rax + rdx*8 + 8]
cmp qword [rcx], 0
je 0x14022b16b
call sym.fts5GetU64
mov r9, rax
test r9, r9
je 0x14022b16b
xor edx, edx
mov rax, r9
mov r8d, ebx
div qword [rsp + 0x80]
mov rcx, qword [rbp + rdx*8]
xor edx, edx
call sym.fts5IndexTombstoneAddToPage
test eax, eax
je 0x14022b16b
jmp 0x14022b1b8
xor eax, eax
test r13, r13
jne 0x14022b1cd
mov rdx, qword [rbp]
mov rcx, qword [r15]
mov rdx, qword [rdx]
mov cl, byte [rcx + 1]
mov byte [rdx + 1], cl
mov rcx, qword [rsp + 0x90]
mov dword [rsp + 0x50], eax
inc r13
call sym.sqlite3_free
mov eax, dword [rsp + 0x50]
test eax, eax
je 0x14022b0bf
mov edx, ebx
mov rcx, rbp
lea ebx, [rbx + rbx + 1]
call sym.fts5IndexFreeArray
mov r13d, dword [rsp + 0x6c]
jmp 0x14022b01b
cmp dword [rdi + 0x3c], 0
je 0x14022b21b
mov edx, ebx
mov rcx, rbp
xor ebx, ebx
xor ebp, ebp
call sym.fts5IndexFreeArray
jmp 0x14022b287
mov rax, qword [rsp + 0x38]
xor edx, edx
mov r9, qword [rsp + 0x38]
mov r8d, ebx
xor r13d, r13d
div qword [rsp + 0x80]
mov rcx, qword [rbp + rdx*8]
mov edx, 1
call sym.fts5IndexTombstoneAddToPage
cmp ebx, r13d
jle 0x14022b273
mov edx, dword [r12]
mov rax, qword [rbp + r13*8]
mov rcx, rdi
add edx, 0x10000
mov r9d, dword [rax + 8]
mov r8, qword [rax]
shl rdx, 0x25
add rdx, r13
inc r13
call sym.fts5DataWrite
jmp 0x14022b244
mov dword [r12 + 0x20], ebx
mov rdx, qword [rdi + 0x90]
mov rcx, rdi
call sym.fts5StructureWrite
mov rcx, r14
call sym.sqlite3_free
mov edx, ebx
mov rcx, rbp
call sym.fts5IndexFreeArray
jmp 0x14022af53
dec dword [rsp + 0x68]
sub qword [rsp + 0x98], 0x38
jmp 0x14022ae82
dec qword [rsp + 0x70]
jmp 0x14022ae3b
mov rcx, qword [rsp + 0x48]
call sym.fts5StructureRelease
xor ecx, ecx
mov ebx, dword [rdi + 0x3c]
mov dword [rdi + 0x3c], ecx
jmp 0x14022b43d
xor edx, edx
mov qword [rsp + 0xb8], rdx
test rdi, rdi
jne 0x14022b336
xor r9d, r9d
lea r8, [rsp + 0xb8]
mov edx, 2
mov rcx, rsi
call sym.fts5StorageGetStmt
mov ebx, eax
test eax, eax
jne 0x14022b497
mov rbx, qword [rsp + 0xb8]
mov r8, qword [rsp + 0x38]
mov edx, 1
mov rcx, rbx
call sym.sqlite3_bind_int64
mov rcx, rbx
call sym.sqlite3_step
cmp eax, 0x64
je 0x14022b336
mov rcx, rbx
call sym.sqlite3_reset
jmp 0x14022b43b
mov qword [rsp + 0xc0], rsi
xor r14d, r14d
lea r12, [sym.fts5StorageInsertCallback]
lea r13, [rsp + 0xc0]
mov dword [rsp + 0xc8], 0xffffffff
mov rcx, qword [rsp + 0xb8]
lea r15d, [r14 + 1]
cmp dword [rbp + 0x18], r15d
jl 0x14022b409
mov rax, qword [rbp + 0x28]
cmp byte [rax + r14], 0
jne 0x14022b3a5
test rcx, rcx
je 0x14022b3a0
mov edx, r15d
mov qword [rsp + 0x40], rcx
call sym.sqlite3_column_text
mov rcx, qword [rsp + 0x40]
mov edx, r15d
mov rbx, rax
call sym.sqlite3_column_bytes
jmp 0x14022b3bf
test rdi, rdi
jne 0x14022b3aa
inc r14
jmp 0x14022b35b
mov rcx, qword [rdi + r14*8]
call sym.sqlite3_value_text
mov rcx, qword [rdi + r14*8]
mov rbx, rax
call sym.sqlite3_value_bytes
mov qword [rsp + 0x28], r12
mov r9d, eax
mov r8, rbx
xor eax, eax
mov qword [rsp + 0x20], r13
mov edx, 4
mov rcx, rbp
mov dword [rsp + 0xcc], eax
call sym.sqlite3Fts5Tokenize
movsxd rcx, dword [rsp + 0xcc]
mov ebx, eax
mov rax, qword [rsi + 0x20]
lea rdx, [rax + r14*8]
sub qword [rdx], rcx
js 0x14022b41a
inc r14
test ebx, ebx
je 0x14022b35b
jmp 0x14022b40b
xor ebx, ebx
mov rax, qword [rsi + 0x18]
test ebx, ebx
jne 0x14022b41f
test rax, rax
jg 0x14022b41f
jmp 0x14022b425
mov ebx, 0x10b
dec qword [rsi + 0x18]
jmp 0x14022b42a
mov ebx, 0x10b
mov rcx, qword [rsp + 0xb8]
call sym.sqlite3_reset
test ebx, ebx
jne 0x14022b497
mov ebx, eax
test ebx, ebx
jne 0x14022b497
mov rax, qword [rsp + 0x78]
mov ebx, dword [rax + 0x58]
test ebx, ebx
je 0x14022b497
xor r9d, r9d
lea r8, [rsp + 0xb0]
mov edx, 7
mov rcx, rsi
call sym.fts5StorageGetStmt
mov ebx, eax
test eax, eax
jne 0x14022b497
mov rbx, qword [rsp + 0xb0]
mov r8, qword [rsp + 0x38]
mov edx, 1
mov rcx, rbx
call sym.sqlite3_bind_int64
mov rcx, rbx
call sym.sqlite3_step
mov rcx, rbx
call sym.sqlite3_reset
mov ebx, eax
mov rax, qword [rsp + 0x78]
mov edi, ebx
or edi, dword [rax + 0x40]
jne 0x14022b4fe
xor r9d, r9d
lea r8, [rsp + 0xb0]
mov edx, 5
mov rcx, rsi
call sym.fts5StorageGetStmt
mov ebx, eax
test eax, eax
jne 0x14022b4fe
mov rbx, qword [rsp + 0xb0]
mov r8, qword [rsp + 0x38]
mov edx, 1
mov rcx, rbx
call sym.sqlite3_bind_int64
mov rcx, rbx
call sym.sqlite3_step
mov rcx, rbx
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.sqlite3_reset
mov eax, ebx
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret