Function at 0x10060640
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov eax, dword [ebp + 0x14]
push ebx
push esi
push edi
mov edi, dword [ebp + 0x1c]
and eax, 8
push 0x5c
mov dword [ebp - 0x10], eax
push 0
lea eax, [edi + 4]
mov dword [ebp - 8], 1
push eax
mov dword [ebp - 0xc], 0
call fcn.100fc010
mov ebx, dword [ebp + 8]
add esp, 0xc
mov ecx, dword [ebp + 0x18]
mov dword [edi], ecx
mov esi, dword [ebx + 0x3c]
mov dword [ebp - 4], esi
test esi, esi
jne 0x100606e0
mov eax, dword [ebx]
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.e_sqlite3.dll_sqlite3_mprintf
add esp, 0xc
mov esi, eax
cmp dword [ebx + 0x24], 0
jne 0x100606ce
test esi, esi
je 0x100606c7
mov eax, dword [ebx]
lea ecx, [ebx + 0x3c]
push 0
push ecx
push 0
push 0x85
push 0xffffffffffffffff
push esi
push dword [eax]
call fcn.100b3340
add esp, 0x1c
mov dword [ebx + 0x24], eax
jmp 0x100606ce
mov dword [ebx + 0x24], 7
push esi
call sym.e_sqlite3.dll_sqlite3_free
mov esi, dword [ebx + 0x3c]
add esp, 4
mov ecx, dword [ebp + 0x18]
mov dword [ebp - 4], esi
cmp dword [ebx + 0x24], 0
jne 0x10060894
mov eax, dword [ecx]
cdq
push edx
push eax
push 1
push esi
call sym.e_sqlite3.dll_sqlite3_bind_int64
push 1
push esi
call fcn.100e98e0
add esp, 0x18
test eax, eax
jne 0x10060767
cmp dword [ebp + 0xc], eax
je 0x10060747
mov ecx, dword [esi + 0x64]
push eax
push eax
mov eax, dword [ebp + 0x10]
add ecx, 0x28
cdq
push edx
push eax
push dword [ebp + 0xc]
push ecx
call fcn.100d3cb0
mov ecx, eax
add esp, 0x18
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x10060747
mov eax, dword [esi]
push ecx
push eax
mov dword [eax + 0x40], ecx
call fcn.10096500
push dword [ebp - 0x14]
push dword [esi]
call fcn.10025920
add esp, 0x10
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x10060767
mov esi, dword [0x10125150]
mov ecx, esi
push eax
call dword [0x1010a1d8]
call esi
mov esi, dword [ebp - 4]
add esp, 4
push esi
call sym.e_sqlite3.dll_sqlite3_step
add esp, 4
cmp eax, 0x64
jne 0x10060790
push 0
push esi
call sym.e_sqlite3.dll_sqlite3_column_int
cdq
add esp, 8
mov ecx, eax
shrd eax, edx, 1
and ecx, 1
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
push esi
call sym.e_sqlite3.dll_sqlite3_reset
push 1
push esi
mov dword [ebx + 0x24], eax
call fcn.100e98e0
add esp, 0xc
test eax, eax
jne 0x100607c5
mov eax, dword [esi]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x100607c5
mov esi, dword [0x10125150]
mov ecx, esi
push eax
call dword [0x1010a1d8]
call esi
add esp, 4
mov eax, dword [ebp + 0x18]
xor ecx, ecx
push edi
push ebx
mov eax, dword [eax + 4]
cmp dword [ebp - 8], eax
cmovge ecx, dword [ebp - 0xc]
cmovge eax, dword [ebp - 8]
dec eax
mov dword [ebp - 0x14], ecx
mov dword [edi + 8], eax
call fcn.1005f900
mov esi, dword [ebp - 0x10]
add esp, 8
cmp dword [edi + 0xc], 0
je 0x10060803
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push edi
push esi
push ebx
call fcn.1005a440
add esp, 0x14
cmp dword [ebx + 0x24], 0
jne 0x1006086a
test esi, esi
jne 0x1006086a
mov ecx, dword [edi + 4]
mov esi, dword [edi + 0xc]
or ecx, 1
mov dword [edi + 4], ecx
test esi, esi
je 0x1006086a
mov eax, dword [ebp + 0x14]
and eax, 2
mov dword [ebp + 0x14], eax
je 0x1006082e
or ecx, 2
mov dword [edi + 4], ecx
cmp dword [ebp - 0x14], 0
je 0x1006085c
mov edx, dword [edi + 0x24]
and ecx, 2
cmp edx, dword [edi + 8]
jne 0x10060847
mov eax, dword [edi + 0x30]
cmp eax, dword [esi + 8]
jl 0x10060859
mov eax, dword [edi]
push edx
push dword [eax]
push ecx
push ebx
call fcn.10052200
add esp, 0x10
mov dword [edi + 0x40], eax
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x1006086a
push edi
push ebx
call fcn.1005fc00
add esp, 8
test byte [edi + 4], 2
je 0x1006087e
mov dword [edi + 0x20], 0x1005fb80
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx]
mov ecx, 0x1005ecb0
mov edx, 0x1005f9c0
cmp dword [eax + 0x30], 1
cmove ecx, edx
mov dword [edi + 0x20], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret