Function at 0x5b2f2b0
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x14]
and eax, 8
push edi
push 0x60
push 0
push esi
mov dword [esp + 0x1c], edx
mov edi, ecx
mov dword [esp + 0x18], 1
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], 0
call fcn.05b02790
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [esi], eax
cmp dword [edi + 0x3c], 0
jne 0x5b2f31d
mov eax, dword [edi]
push dword [eax + 8]
push dword [eax + 4]
push str.SELECT_pgno_FROM__q._q_idx_WHERE_segid__AND_term___ORDER_BY_term_DESC_LIMIT_1
call sym.SQLite.Interop.dll_SI5ea70b9767a9e9ce
add esp, 0xc
lea edx, [edi + 0x3c]
mov ecx, edi
push eax
call fcn.05b32260
mov eax, dword [ebp + 0x10]
add esp, 4
cmp dword [edi + 0x24], 0
mov ebx, dword [edi + 0x3c]
jne 0x5b2f4c9
mov eax, dword [eax]
cdq
push edx
push eax
push 1
push ebx
call sym.SQLite.Interop.dll_SI35b071367928739e
add esp, 0x10
cmp dword [ebp + 8], 0
jge 0x5b2f360
push 0x5c40e4c
push 0x15fd7
push str.misuse
push str._s_at_line__d_of___.10s_
push 0x15
call sym.SQLite.Interop.dll_SI350ef657c32efd79
add esp, 0x14
jmp 0x5b2f3c2
mov edx, 1
mov ecx, ebx
call fcn.05bf1cc0
test eax, eax
jne 0x5b2f3c2
cmp dword [esp + 0x10], eax
je 0x5b2f3af
mov ecx, dword [ebx + 0x64]
push eax
push eax
mov eax, dword [ebp + 8]
add ecx, 0x28
cdq
push edx
mov edx, dword [esp + 0x1c]
push eax
call fcn.05bfac70
add esp, 0x10
mov dword [esp + 0x1c], eax
test eax, eax
je 0x5b2f3af
mov ecx, dword [ebx]
mov edx, eax
mov dword [ecx + 0x40], eax
call fcn.05c1c900
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebx]
call fcn.05c20250
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x5b2f3c2
push eax
call dword [0x5c52640]
add esp, 4
push ebx
call sym.SQLite.Interop.dll_SI5d045c2b9d9b73fa
add esp, 4
cmp eax, 0x64
jne 0x5b2f3ef
push 0
push ebx
call sym.SQLite.Interop.dll_SI02ba66995d97a90f
cdq
add esp, 8
mov ecx, eax
shrd eax, edx, 1
sar edx, 1
and ecx, 1
mov dword [esp + 0xc], eax
mov dword [esp + 0x14], ecx
push ebx
call fcn.05bf3e00
add esp, 4
mov dword [edi + 0x24], eax
mov edx, 1
mov ecx, ebx
call fcn.05bf1cc0
test eax, eax
jne 0x5b2f41e
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x5b2f41e
push eax
call dword [0x5c52640]
add esp, 4
mov eax, dword [ebp + 0x10]
mov eax, dword [eax + 4]
cmp dword [esp + 0xc], eax
jge 0x5b2f434
mov dword [esp + 0x14], 0
jmp 0x5b2f438
mov eax, dword [esp + 0xc]
dec eax
mov edx, esi
mov ecx, edi
mov dword [esi + 8], eax
call fcn.05b307a0
cmp dword [esi + 0xc], 0
mov ebx, dword [esp + 0x18]
je 0x5b2f463
push dword [ebp + 8]
mov edx, ebx
mov ecx, edi
push dword [esp + 0x14]
push esi
call fcn.05b2f510
add esp, 0xc
cmp dword [edi + 0x24], 0
jne 0x5b2f49f
test ebx, ebx
jne 0x5b2f49f
or dword [esi + 4], 1
cmp dword [esi + 0xc], ebx
je 0x5b2f49f
mov ebx, dword [ebp + 0xc]
and ebx, 2
je 0x5b2f482
or dword [esi + 4], 2
cmp dword [esp + 0x14], 0
je 0x5b2f492
mov edx, esi
mov ecx, edi
call fcn.05b2f8e0
test ebx, ebx
je 0x5b2f49f
mov edx, esi
mov ecx, edi
call fcn.05b2f930
test byte [esi + 4], 2
je 0x5b2f4b3
mov dword [esi + 0x20], 0x5b30060
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi]
mov ecx, 0x5b2fbc0
mov edx, 0x5b2fea0
cmp dword [eax + 0x30], 1
cmove ecx, edx
mov dword [esi + 0x20], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret