Function at 0x10030480
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.10002790
mov eax, dword [ebp + 0x10]
add esp, 0xc
mov dword [esi], eax
cmp dword [edi + 0x3c], 0
jne 0x100304ed
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_SI1c7a7970970b9619
add esp, 0xc
lea edx, [edi + 0x3c]
mov ecx, edi
push eax
call fcn.100333c0
mov eax, dword [ebp + 0x10]
add esp, 4
cmp dword [edi + 0x24], 0
mov ebx, dword [edi + 0x3c]
jne 0x10030699
mov eax, dword [eax]
cdq
push edx
push eax
push 1
push ebx
call sym.SQLite.Interop.dll_SI46481015c7f49c68
add esp, 0x10
cmp dword [ebp + 8], 0
jge 0x10030530
push 0x10130974
push 0x15025
push str.misuse
push str._s_at_line__d_of___.10s_
push 0x15
call sym.SQLite.Interop.dll_SI950480ab972e108d
add esp, 0x14
jmp 0x10030592
mov edx, 2
mov ecx, ebx
call fcn.100e4840
test eax, eax
jne 0x10030592
cmp dword [esp + 0x10], eax
je 0x1003057f
mov ecx, dword [ebx + 0x6c]
push eax
push eax
mov eax, dword [ebp + 8]
add ecx, 0x28
cdq
push edx
mov edx, dword [esp + 0x1c]
push eax
call fcn.100ed630
add esp, 0x10
mov dword [esp + 0x1c], eax
test eax, eax
je 0x1003057f
mov ecx, dword [ebx]
mov edx, eax
mov dword [ecx + 0x40], eax
call fcn.1010e180
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebx]
call fcn.10111120
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x10030592
push eax
call dword [0x10142320]
add esp, 4
push ebx
call sym.SQLite.Interop.dll_SI9c6d7cd7b7d38055
add esp, 4
cmp eax, 0x64
jne 0x100305bf
push 0
push ebx
call sym.SQLite.Interop.dll_SIbff6307869d58daf
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.100e6880
add esp, 4
mov dword [edi + 0x24], eax
mov edx, 2
mov ecx, ebx
call fcn.100e4840
test eax, eax
jne 0x100305ee
mov eax, dword [ebx]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x100305ee
push eax
call dword [0x10142320]
add esp, 4
mov eax, dword [ebp + 0x10]
mov eax, dword [eax + 4]
cmp dword [esp + 0xc], eax
jge 0x10030604
mov dword [esp + 0x14], 0
jmp 0x10030608
mov eax, dword [esp + 0xc]
dec eax
mov edx, esi
mov ecx, edi
mov dword [esi + 8], eax
call fcn.100318b0
cmp dword [esi + 0xc], 0
mov ebx, dword [esp + 0x18]
je 0x10030633
push dword [ebp + 8]
mov edx, ebx
mov ecx, edi
push dword [esp + 0x14]
push esi
call fcn.100306e0
add esp, 0xc
cmp dword [edi + 0x24], 0
jne 0x1003066f
test ebx, ebx
jne 0x1003066f
or dword [esi + 4], 1
cmp dword [esi + 0xc], ebx
je 0x1003066f
mov ebx, dword [ebp + 0xc]
and ebx, 2
je 0x10030652
or dword [esi + 4], 2
cmp dword [esp + 0x14], 0
je 0x10030662
mov edx, esi
mov ecx, edi
call fcn.10030ab0
test ebx, ebx
je 0x1003066f
mov edx, esi
mov ecx, edi
call fcn.10030b00
test byte [esi + 4], 2
je 0x10030683
mov dword [esi + 0x20], 0x100311b0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi]
mov ecx, 0x10030d20
mov edx, 0x10031000
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