Function at 0x140197960
Capabilities:
Reference sql statements
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, 0xb8
xor ebx, ebx
mov rax, qword [rsp + 0x120]
cmp dword [rcx + 0x34], 0
movsxd rsi, dword [rsp + 0x130]
mov qword [rsp + 0x30], rax
mov rbp, rdx
mov r12, rcx
mov rdi, r9
mov eax, dword [rsp + 0x128]
mov dword [rsp + 0x44], r8d
mov edx, dword [rsp + 0x138]
mov dword [rsp + 0x40], eax
mov rax, qword [rsp + 0x140]
mov qword [rsp + 0x70], rax
jne 0x1401979e6
test esi, esi
jns 0x1401979d0
xor ebx, ebx
cmp qword [rcx + 0x18], 0
setne bl
add ebx, dword [rbp + 0x10]
jmp 0x1401979e6
movsxd rax, esi
mov ebx, edx
inc rax
shl rax, 4
add rax, rbp
cmp dword [rax + 0xc], edx
cmovle ebx, dword [rax + 0xc]
mov edx, ebx
mov rcx, r12
call fcn.140197700
mov r13, rax
mov rax, qword [rsp + 0x70]
mov qword [rax], r13
test r13, r13
je 0x14019850e
mov eax, dword [rsp + 0x44]
mov qword [r13 + 0x30], rdi
and eax, 2
mov dword [rsp + 0x58], eax
setne al
movzx eax, al
mov dword [r13 + 0x44], eax
mov eax, dword [rsp + 0x44]
shr eax, 4
and eax, 1
mov byte [r13 + 0x48], al
test byte [rsp + 0x44], 0x20
jne 0x140197a3f
lea rcx, [r12 + 0x34]
mov rdx, r13
call fcn.1401969c0
mov eax, dword [r12 + 0x34]
mov dword [rsp + 0x38], eax
test eax, eax
jne 0x1401984c2
test esi, esi
jns 0x1401983ab
movsxd rax, dword [rbp + 0x14]
mov r10, qword [r12 + 0x18]
shl rax, 4
lea rax, [rbp + rax + 0x18]
mov qword [rsp + 0x80], rax
test r10, r10
je 0x140197cf1
cmp qword [rsp + 0x30], 0
lea r15, [r13 + 0x60]
mov dword [rsp + 0x9c], 0
mov qword [rsp + 0xa0], 0
je 0x140197aab
mov esi, dword [rsp + 0x44]
and esi, 8
je 0x140197b44
mov r8d, dword [rsp + 0x40]
mov rdx, qword [rsp + 0x30]
lea r9, [r10 + 0x18]
mov rcx, r10
mov qword [rsp + 0xa8], 0
call fcn.140194d00
mov rcx, qword [r12 + 0x18]
lea rdx, [rsp + 0xa0]
lea r9, [rsp + 0x9c]
mov dword [r12 + 0x34], eax
lea r8, [rsp + 0xa8]
call fcn.1401d3580
mov rcx, qword [rsp + 0xa0]
test rcx, rcx
je 0x140197b0a
call sub.msvcrt.dll_strlen
mov dword [rsp + 0x38], eax
cmp qword [rsp + 0xa8], 0
je 0x140197cde
lea rcx, [r12 + 0x34]
mov edx, 0x10
call fcn.1401d4950
mov rbx, rax
test rax, rax
je 0x140197cde
mov rax, qword [rsp + 0xa8]
mov qword [rbx], rax
jmp 0x140197c63
mov eax, dword [rsp + 0x40]
mov r8d, dword [r10 + 0x14]
lea edx, [rax - 1]
mov eax, 0xd
movsxd rdx, edx
test edx, edx
js 0x140197b76
mov rdi, qword [rsp + 0x30]
lea ecx, [rax*8]
movzx r9d, byte [rdi + rdx]
dec rdx
xor ecx, r9d
xor eax, ecx
jmp 0x140197b57
xor edx, edx
movsxd rdi, dword [rsp + 0x40]
div r8d
mov rax, qword [r10 + 0x20]
mov r14, qword [rax + rdx*8]
test r14, r14
je 0x140197bbe
mov ebx, dword [r14 + 0x1c]
lea eax, [rbx + 1]
cmp dword [rsp + 0x40], eax
jne 0x140197bb9
mov rdx, qword [rsp + 0x30]
lea rcx, [r14 + 0x30]
mov r8, rdi
mov qword [rsp + 0x38], r10
call sub.msvcrt.dll_memcmp
mov r10, qword [rsp + 0x38]
test eax, eax
je 0x140197bc2
mov r14, qword [r14]
jmp 0x140197b88
xor ebx, ebx
jmp 0x140197c38
mov eax, dword [r14 + 0x18]
lea edx, [rbx + 0x32]
mov qword [rsp + 0x50], r10
mov dword [rsp + 0x48], edx
sub eax, edx
lea ecx, [rax + 0x1a]
mov dword [rsp + 0x38], eax
movsxd rcx, ecx
call fcn.1402076e0
mov edx, dword [rsp + 0x48]
mov r10, qword [rsp + 0x50]
test rax, rax
mov rbx, rax
je 0x1401984f9
lea rax, [rbx + 0x10]
movsxd rsi, edx
movsxd rcx, dword [rsp + 0x38]
mov r8d, 0x10
add rsi, r14
mov rdi, rax
sub r8d, edx
mov rdx, r14
rep movsb byte [rdi], byte [rsi]
movsxd r8, r8d
mov rcx, r10
xor esi, esi
add r8, rbx
call fcn.140194b90
mov edi, dword [rsp + 0x38]
lea r14d, [rdi + rax]
mov dword [rsp + 0x9c], r14d
mov dword [r12 + 0x34], esi
test rbx, rbx
je 0x140197c49
lea rax, [rbx + 0x10]
mov qword [rbx], rax
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0xa0], rax
mov eax, dword [rsp + 0x40]
or dword [r13 + 0x68], 1
mov dword [rsp + 0x38], eax
test rbx, rbx
je 0x140197cde
mov r9, qword [rsp + 0xa0]
mov r8d, dword [rsp + 0x38]
lea rcx, [r12 + 0x34]
lea rdx, [r13 + 0xb8]
call fcn.1401d2170
mov eax, dword [rsp + 0x9c]
mov rcx, qword [rbx]
lea rdx, [r13 + 0xc8]
mov dword [rbx + 0xc], eax
mov dword [rbx + 8], eax
mov qword [r13 + 0x70], rbx
call fcn.1401d3320
cmp dword [rsp + 0x58], 0
movzx eax, al
mov qword [r13 + 0x80], rax
mov eax, dword [rbx + 8]
mov dword [r13 + 0x9c], eax
je 0x140197cd3
or dword [r13 + 0x68], 2
mov rdx, r15
mov rcx, r12
call fcn.14019ace0
jmp 0x140197cde
mov rdx, r15
mov rcx, r12
call fcn.14019a4e0
mov rdx, r15
mov rcx, r12
call fcn.14019af60
mov dword [rsp + 0x38], 1
lea rax, [rbp + 0x18]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x98]
mov qword [rsp + 0x78], rax
mov rdi, qword [rsp + 0x80]
cmp qword [rsp + 0x48], rdi
jae 0x1401983c3
mov rax, qword [rsp + 0x48]
mov eax, dword [rax + 4]
mov dword [rsp + 0x5c], eax
dec eax
mov dword [rsp + 0x60], eax
movsxd rax, dword [rsp + 0x38]
imul rax, rax, 0x78
lea rbp, [r13 + rax + 0x60]
movsxd rax, dword [rsp + 0x60]
imul rax, rax, 0xc
mov qword [rsp + 0x68], rax
cmp dword [rsp + 0x60], 0
js 0x14019838d
mov rax, qword [rsp + 0x48]
mov r14, qword [rsp + 0x68]
add r14, qword [rax + 8]
cmp qword [rsp + 0x30], 0
jne 0x140197d87
cmp dword [r14 + 4], 0
je 0x14019837a
mov r8, rbp
mov rdx, r14
mov rcx, r12
call fcn.14019a450
jmp 0x14019837a
lea rdx, [rbp + 8]
xor eax, eax
mov ecx, 0x1c
mov rdi, rdx
rep stosd dword [rdi], eax
mov qword [rbp], r14
cmp qword [r12 + 0x60], 0
jne 0x140197dcb
mov rax, qword [r12]
lea rcx, str.SELECT_pgno_FROM__q._q_idx_WHERE_segid__AND_term___ORDER_BY_term_DESC_LIMIT_1
mov rdx, qword [rax + 8]
mov r8, qword [rax + 0x10]
call fcn.140207780
lea rdx, [r12 + 0x60]
mov rcx, r12
mov r8, rax
call fcn.140195c70
cmp dword [r12 + 0x34], 0
jne 0x14019837a
mov r15, qword [r12 + 0x60]
mov r8d, dword [r14]
mov edx, 1
mov rcx, r15
call fcn.140203600
mov r9d, dword [rsp + 0x40]
mov r8, qword [rsp + 0x30]
mov qword [rsp + 0x20], 0
mov rcx, r15
mov edx, 2
call fcn.140203520
mov rcx, r15
call fcn.140208fb0
cmp eax, 0x64
jne 0x140197e32
xor edx, edx
mov rcx, r15
call fcn.1402044b0
movsxd rbx, eax
and eax, 1
mov dword [rsp + 0x50], eax
sar rbx, 1
jmp 0x140197e3f
mov dword [rsp + 0x50], 0
mov ebx, 1
mov rcx, r15
call fcn.140208230
mov edx, 2
mov rcx, r15
mov dword [r12 + 0x34], eax
call fcn.140203670
mov eax, dword [r14 + 4]
cmp eax, ebx
jle 0x140197e6b
mov dword [rsp + 0x50], 0
mov ebx, eax
dec ebx
mov eax, dword [rsp + 0x44]
mov rdx, rbp
mov rcx, r12
mov dword [rbp + 0xc], ebx
and eax, 8
mov dword [rsp + 0x64], eax
call fcn.14019a9f0
mov rax, qword [rbp + 0x10]
test rax, rax
je 0x140198199
mov rsi, qword [rax]
mov edi, dword [rax + 8]
lea rdx, [rsp + 0xa0]
mov dword [rsp + 0x9c], 0
mov dword [rsp + 0x98], 0
mov ecx, dword [rax + 0xc]
mov rbx, rcx
add rcx, rsi
call fcn.1401d34b0
mov edx, dword [rsp + 0xa0]
mov dword [rsp + 0x94], edx
cmp edi, edx
jb 0x140197fd5
add ebx, eax
lea rax, [rsp + 0x9c]
xor r15d, r15d
mov qword [rsp + 0x88], rax
jmp 0x140197f19
mov ecx, eax
lea edx, [rax + 1]
add rcx, rsi
mov dword [rsp + 0x94], edx
movzx r8d, byte [rcx]
mov dword [rsp + 0x98], r8d
test r8b, r8b
js 0x140198023
mov r15d, r14d
mov ecx, dword [rsp + 0x94]
lea edx, [rcx + 1]
mov rax, rcx
add rcx, rsi
mov dword [rsp + 0x94], edx
movzx r8d, byte [rcx]
mov dword [rsp + 0x9c], r8d
test r8b, r8b
jns 0x140197f5c
mov rdx, qword [rsp + 0x88]
mov dword [rsp + 0x94], eax
call fcn.1401d34b0
add dword [rsp + 0x94], eax
cmp dword [rsp + 0x98], r15d
jb 0x1401984d8
mov r14d, r15d
jne 0x140197f9f
mov ecx, dword [rsp + 0x40]
mov edx, dword [rsp + 0x9c]
mov r9d, dword [rsp + 0x94]
sub ecx, r15d
cmp ecx, edx
cmova ecx, edx
xor eax, eax
lea r14d, [r15 + rax]
cmp ecx, eax
jne 0x140197fe3
cmp dword [rsp + 0x40], r14d
je 0x140197ffd
cmp edx, eax
ja 0x14019800a
cmp edi, ebx
jbe 0x140198040
mov ecx, ebx
mov rdx, qword [rsp + 0x78]
add rcx, rsi
call fcn.1401d34b0
add ebx, eax
mov eax, dword [rsp + 0x98]
add eax, dword [rsp + 0xa0]
mov dword [rsp + 0xa0], eax
cmp edi, eax
ja 0x140197ef2
mov dword [r12 + 0x34], 0x10b
jmp 0x140198199
mov r10, qword [rsp + 0x30]
mov r11d, r14d
lea r8d, [r9 + rax]
mov r11b, byte [r10 + r11]
cmp byte [rsi + r8], r11b
jne 0x140197f94
inc eax
jmp 0x140197f8c
cmp edx, eax
jne 0x1401984d8
jmp 0x1401980d2
mov rcx, qword [rsp + 0x30]
lea edx, [r9 + rax]
mov eax, r14d
mov al, byte [rcx + rax]
cmp byte [rsi + rdx], al
jbe 0x140197f9f
jmp 0x1401984d8
mov rdx, qword [rsp + 0x78]
mov dword [rsp + 0x94], eax
call fcn.1401d34b0
add dword [rsp + 0x94], eax
jmp 0x140197f16
cmp dword [rsp + 0x64], 0
je 0x1401984e3
mov rdx, rbp
mov rcx, r12
call fcn.14019a9f0
mov rax, qword [rbp + 0x10]
test rax, rax
je 0x140198199
mov ebx, dword [rax + 0xc]
cmp ebx, dword [rax + 8]
jge 0x14019804b
mov rsi, qword [rax]
mov ecx, ebx
lea rdx, [rsp + 0x94]
add rcx, rsi
call fcn.1401d34b0
mov edx, dword [rsp + 0x94]
cmp edx, 3
jbe 0x140197fd5
mov r8, qword [rbp + 0x10]
mov ecx, edx
movsxd r9, dword [r8 + 0xc]
cmp rcx, r9
jge 0x140197fd5
mov dword [rsp + 0xa0], edx
add rcx, rsi
lea rdx, [rsp + 0x9c]
add ebx, eax
mov dword [rsp + 0x98], 0
mov edi, dword [r8 + 8]
call fcn.1401d34b0
add dword [rsp + 0x94], eax
mov r8d, dword [rsp + 0x9c]
mov ecx, dword [rsp + 0x94]
mov rdx, r8
mov rax, rcx
add rcx, r8
mov r8d, edi
cmp rcx, r8
jg 0x140197fd5
test edx, edx
je 0x140197fd5
add edx, eax
mov eax, dword [rbp + 0xc]
mov r9, qword [rsp + 0x30]
lea r15, [rbp + 0x58]
mov dword [rbp + 0x34], edx
mov r8d, dword [rsp + 0x98]
lea r14, [r12 + 0x34]
mov qword [rbp + 0x20], rdx
mov rcx, r14
mov rdx, r15
mov dword [rbp + 0x30], eax
call fcn.1401d2170
mov eax, dword [rsp + 0x94]
mov rdx, r15
mov rcx, r14
mov r8d, dword [rsp + 0x9c]
lea r9, [rsi + rax]
call fcn.1401d2040
cmp edi, ebx
ja 0x14019815b
mov rax, qword [rbp + 0x10]
mov eax, dword [rax + 8]
inc eax
jmp 0x14019817d
mov ecx, ebx
lea rdx, [rsp + 0xa8]
add rcx, rsi
call fcn.1401d34b0
add ebx, eax
mov eax, dword [rsp + 0xa8]
add eax, dword [rsp + 0xa0]
mov dword [rbp + 0x3c], eax
mov rdx, rbp
mov rcx, r12
mov dword [rbp + 0x38], ebx
call fcn.14019a590
mov rdx, rbp
mov rcx, r12
call fcn.14019a4e0
mov esi, dword [rsp + 0x64]
or esi, dword [r12 + 0x34]
jne 0x14019836f
mov eax, dword [rbp + 8]
mov rcx, qword [rbp + 0x10]
mov edx, eax
or edx, 1
mov dword [rbp + 8], edx
test rcx, rcx
je 0x14019836f
cmp dword [rsp + 0x58], 0
je 0x140198202
or eax, 3
cmp dword [rsp + 0x50], 0
mov dword [rbp + 8], eax
jne 0x14019820d
mov r14, qword [rbp + 0x50]
test r14, r14
je 0x140198245
mov rax, qword [rbp]
mov esi, dword [r14 + 0x1c]
mov rcx, r12
movsxd rdx, dword [rax]
movsxd rax, esi
shl rdx, 0x25
add rdx, rax
call fcn.140196d50
mov r14, rax
jmp 0x1401982f9
cmp dword [rsp + 0x50], 0
je 0x14019836f
mov rax, qword [rbp]
mov edx, dword [rbp + 8]
mov r9d, dword [rbp + 0x30]
mov r8d, dword [rax]
and edx, 2
cmp r9d, dword [rbp + 0xc]
jne 0x14019822c
mov eax, dword [rcx + 0xc]
cmp dword [rbp + 0x3c], eax
jl 0x140198238
mov rcx, r12
call fcn.140191fb0
mov qword [rbp + 0x50], rax
cmp dword [rsp + 0x58], 0
je 0x14019836f
jmp 0x1401981d4
mov r9, qword [rbp + 0x10]
mov ebx, dword [rbp + 0xc]
mov eax, 4
cmp dword [rbp + 0x30], ebx
jne 0x140198259
mov eax, dword [rbp + 0x34]
lea edi, [rax + 9]
mov r8, qword [r9]
inc eax
cdqe
mov cl, byte [r8 + rax - 1]
movsxd rdx, eax
shr cl, 7
cmp edi, eax
setg r11b
inc rax
test cl, r11b
jne 0x140198263
mov qword [rbp + 0x20], rdx
mov eax, dword [r9 + 0xc]
cmp dword [rbp + 0x3c], eax
jl 0x140198364
inc ebx
mov r15, qword [rbp]
movsxd rdi, ebx
cmp dword [r12 + 0x34], 0
jne 0x1401982f9
cmp ebx, dword [r15 + 8]
jg 0x1401982f9
movsxd rdx, dword [r15]
mov rcx, r12
shl rdx, 0x25
add rdx, rdi
call fcn.140196d50
mov rcx, rax
test rax, rax
je 0x1401982f2
mov rdx, qword [rax]
mov eax, dword [rax + 0xc]
mov dword [rsp + 0x50], eax
mov eax, dword [rcx + 8]
mov dword [rsp + 0x64], eax
movzx eax, byte [rdx]
movzx edx, byte [rdx + 1]
shl eax, 8
add ax, dx
je 0x1401982e3
mov esi, ebx
xchg r14, rcx
call fcn.1402067c0
mov edx, dword [rsp + 0x64]
cmp dword [rsp + 0x50], edx
jl 0x1401982f9
inc ebx
inc rdi
jmp 0x140198296
test r14, r14
je 0x140198364
mov rcx, qword [rbp + 0x10]
call fcn.1402067c0
mov rax, qword [r14]
mov qword [rbp + 0x10], r14
mov dword [rbp + 0xc], esi
movzx ecx, byte [rax]
movzx edx, byte [rax + 1]
shl ecx, 8
add ecx, edx
movzx ebx, cx
cmp ebx, dword [r14 + 0xc]
jle 0x140198331
mov dword [r12 + 0x34], 0x10b
jmp 0x14019836f
movzx ecx, cx
lea rdx, [rbp + 0x68]
add rcx, rax
call fcn.1401d3320
movzx eax, al
add eax, ebx
cdqe
mov qword [rbp + 0x20], rax
mov eax, dword [r14 + 8]
cmp dword [r14 + 0xc], eax
jl 0x140198359
inc eax
jmp 0x140198361
mov rcx, r14
call fcn.140196d20
mov dword [rbp + 0x3c], eax
mov rdx, rbp
mov rcx, r12
call fcn.14019ace0
mov rdx, rbp
mov rcx, r12
call fcn.14019af60
dec dword [rsp + 0x60]
add rbp, 0x78
sub qword [rsp + 0x68], 0xc
jmp 0x140197d48
cmp dword [rsp + 0x5c], 0
mov eax, 0
cmovns eax, dword [rsp + 0x5c]
add qword [rsp + 0x48], 0x10
add dword [rsp + 0x38], eax
jmp 0x140197d07
dec ebx
inc rsi
lea r14, [r13 + 0x60]
movsxd rdi, ebx
shl rsi, 4
imul rdi, rdi, 0xc
test ebx, ebx
jns 0x1401983d8
cmp dword [r12 + 0x34], 0
jne 0x1401984c2
mov eax, dword [r13 + 0x40]
lea ebx, [rax - 1]
jmp 0x14019840f
mov rdx, qword [rbp + rsi + 0x10]
add rdx, rdi
cmp dword [rdx + 4], 0
je 0x1401983f1
mov r8, r14
mov rcx, r12
call fcn.14019a450
dec ebx
add r14, 0x78
sub rdi, 0xc
jmp 0x1401983bf
mov edx, ebx
mov rcx, r13
call fcn.140197770
mov esi, eax
test eax, eax
jne 0x140198415
dec ebx
test ebx, ebx
jg 0x1401983fd
jmp 0x140198449
cmp dword [r12 + 0x34], 0
jne 0x140198436
cdqe
xor r8d, r8d
mov rcx, r12
imul rax, rax, 0x78
lea rdx, [r13 + rax + 0x60]
call qword [r13 + rax + 0x88]
mov r9d, ebx
mov r8d, esi
mov rdx, r13
mov rcx, r12
call fcn.140197680
jmp 0x14019840d
mov rcx, r13
call fcn.1401988c0
cmp byte [r13 + 0x48], 0
je 0x14019848d
mov ecx, dword [r12 + 0x34]
mov rdx, r13
call fcn.140197930
test eax, eax
je 0x14019848d
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, r12
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.140198530
cmp byte [r13 + 0x14], 0
jne 0x14019850e
mov rax, qword [r13 + 0x58]
mov rcx, r13
movzx eax, word [rax + 4]
imul rax, rax, 0x78
lea rdx, [r13 + rax + 0x60]
mov rax, qword [r13 + 0x38]
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp rax
mov rcx, r13
call fcn.1401978a0
mov rax, qword [rsp + 0x70]
mov qword [rax], 0
jmp 0x14019850e
cmp dword [rsp + 0x64], 0
jne 0x1401980d2
mov rcx, qword [rbp + 0x10]
call fcn.1402067c0
mov qword [rbp + 0x10], 0
jmp 0x140198199
mov dword [rsp + 0x9c], 0
mov esi, 7
jmp 0x140197c38
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret