Function at 0x51b530
Capabilities:
Reference sql statements

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
mov eax, dword [0x5da084]
xor eax, esp
mov dword [esp + 0x40], eax
cmp dword [ebp + 0x10], 0
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
mov edi, edx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [ebx + 0xc], edi
je 0x51b6cf
call fcn.004e4f50
test eax, eax
jne 0x51b5bc
push eax
push 0x18
call fcn.0043b050
mov esi, eax
add esp, 8
test esi, esi
je 0x51b5bc
test edi, edi
je 0x51b591
mov eax, dword [edi + 0x78]
jmp 0x51b596
mov eax, 0x3b9aca00
mov dword [esi + 4], 0
mov dword [esi], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], 0
mov word [esi + 0x14], 0
jmp 0x51b5c1
mov esi, 0x5dc840
push dword [esp + 0x10]
push dword [esp + 0x1c]
push str.CREATE_TABLE___w_.__w_rowid__rowid_INTEGER_PRIMARY_KEY_nodeno
push esi
call fcn.0043e320
add esp, 0x10
xor edi, edi
cmp byte [ebx + 0x19], 0
jbe 0x51b5f8
nop
push edi
push str._a_d
push esi
call fcn.0043e320
movzx eax, byte [ebx + 0x19]
inc edi
add esp, 0xc
cmp edi, eax
jl 0x51b5e0
push dword [esp + 0x10]
mov edi, dword [esp + 0x1c]
push edi
push str.__CREATE_TABLE___w_.__w_node__nodeno_INTEGER_PRIMARY_KEY_data__
push esi
call fcn.0043e320
push dword [esp + 0x20]
push edi
push str.CREATE_TABLE___w_.__w_parent__nodeno_INTEGER_PRIMARY_KEY_parentnode__
push esi
call fcn.0043e320
push dword [ebx + 0x10]
push dword [esp + 0x34]
push edi
push str.INSERT_INTO___w_.__w_node_VALUES_1_zeroblob__d__
push esi
call fcn.0043e320
add esp, 0x34
push esi
call fcn.0043ddc0
mov esi, eax
add esp, 4
test esi, esi
jne 0x51b656
lea eax, [esi + 7]
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x40]
xor ecx, esp
call fcn.0056eb71
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push esi
push dword [esp + 0x24]
call fcn.004a5190
add esp, 0x14
mov edi, eax
cmp dword [0x5dac30], 0
je 0x51b6b9
mov eax, dword [0x5dfe08]
test eax, eax
je 0x51b687
push eax
call dword [0x5dac80]
add esp, 4
push esi
call dword [0x5dac5c]
sub dword [0x5dfca8], eax
add esp, 4
dec dword [0x5dfccc]
push esi
call dword [0x5dac54]
mov eax, dword [0x5dfe08]
add esp, 4
test eax, eax
je 0x51b6c3
push eax
call dword [0x5dac88]
jmp 0x51b6c0
push esi
call dword [0x5dac54]
add esp, 4
test edi, edi
jne 0x51baa6
mov edi, dword [esp + 0x14]
movaps xmm1, xmmword [0x5cde40]
mov eax, 2
xor ecx, ecx
movd xmm2, eax
lea eax, [ebx + 0x50]
movd xmm0, eax
pshufd xmm3, xmm0, 0
nop dword [eax]
movd xmm0, ecx
pshufd xmm0, xmm0, 0
paddd xmm0, xmm1
pslld xmm0, xmm2
paddd xmm0, xmm3
movups xmmword [esp + ecx*4 + 0x2c], xmm0
add ecx, 4
cmp ecx, 8
jl 0x51b6f0
xor edx, edx
mov dword [esp + 0x1c], 0x64
push edx
push edx
push edx
push edx
push edx
push edx
push str.sqlite_stat1
push dword [ebx + 0x20]
mov dword [esp + 0x40], edx
push edi
call fcn.004e91a0
mov edi, eax
add esp, 0x24
test edi, edi
je 0x51b74f
xor eax, eax
cmp edi, 1
cmove edi, eax
mov eax, 0x100000
jmp 0x51b834
push dword [ebx + 0x24]
push dword [ebx + 0x20]
push str.SELECT_stat_FROM__Q.sqlite_stat1_WHERE_tbl___q_rowid
call fcn.0043e130
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x51b770
lea edi, [eax + 7]
jmp 0x51b82f
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x24]
push 0
push eax
push 0
push 0x80
push 0xffffffffffffffff
mov edx, esi
call fcn.004adf50
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x51b7c4
mov edi, dword [esp + 0x24]
push edi
call fcn.004669b0
add esp, 4
cmp eax, 0x64
jne 0x51b7b9
push 0
push edi
call fcn.004675c0
add esp, 8
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], edx
push edi
call fcn.00465840
add esp, 4
mov edi, eax
cmp dword [0x5dac30], 0
je 0x51b812
mov eax, dword [0x5dfe08]
test eax, eax
je 0x51b7e0
push eax
call dword [0x5dac80]
add esp, 4
push esi
call dword [0x5dac5c]
sub dword [0x5dfca8], eax
add esp, 4
dec dword [0x5dfccc]
push esi
call dword [0x5dac54]
mov eax, dword [0x5dfe08]
add esp, 4
test eax, eax
je 0x51b81c
push eax
call dword [0x5dac88]
jmp 0x51b819
push esi
call dword [0x5dac54]
add esp, 4
mov ecx, dword [esp + 0x20]
test ecx, ecx
jl 0x51b82f
mov eax, dword [esp + 0x1c]
jg 0x51b836
cmp eax, 0x64
ja 0x51b836
mov eax, 0x64
xor ecx, ecx
mov dword [ebx + 0x30], eax
xor esi, esi
mov dword [ebx + 0x34], ecx
nop
test edi, edi
jne 0x51b918
cmp esi, 3
jne 0x51b861
cmp byte [ebx + 0x19], 0
je 0x51b861
mov eax, str.INSERT_INTO__w_.__w_rowid__rowid_nodeno_VALUES__1__2_ON_CONFLICT_rowid_DO_UPDATE_SET_nodenoexcluded.nodeno
lea edi, [esi*4]
jmp 0x51b86e
lea edi, [esi*4]
mov eax, dword [edi + 0x5b09e4]
push dword [esp + 0x10]
push dword [esp + 0x1c]
push eax
call fcn.0043e130
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x51b905
mov ecx, dword [esp + 0x14]
mov edx, ebx
push 0
push dword [esp + edi + 0x30]
push 0
push 0x85
push 0xffffffffffffffff
call fcn.004adf50
add esp, 0x14
mov edi, eax
cmp dword [0x5dac30], 0
je 0x51b8f9
mov eax, dword [0x5dfe08]
test eax, eax
je 0x51b8c4
push eax
call dword [0x5dac80]
add esp, 4
push ebx
call dword [0x5dac5c]
sub dword [0x5dfca8], eax
add esp, 4
dec dword [0x5dfccc]
push ebx
call dword [0x5dac54]
mov eax, dword [0x5dfe08]
add esp, 4
test eax, eax
je 0x51b90a
push eax
call dword [0x5dac88]
add esp, 4
jmp 0x51b90a
push ebx
call dword [0x5dac54]
add esp, 4
jmp 0x51b90a
mov edi, 7
mov ebx, dword [esp + 0x28]
inc esi
cmp esi, 8
jl 0x51b840
cmp byte [ebx + 0x19], 0
je 0x51baa6
push dword [esp + 0x10]
mov edi, dword [esp + 0x1c]
push edi
push str.SELECT__FROM___w_.__w_rowid__WHERE_rowid_1
call fcn.0043e130
add esp, 0xc
mov dword [ebx + 0x40], eax
test eax, eax
je 0x51ba16
call fcn.004e4f50
test eax, eax
jne 0x51b995
push eax
push 0x18
call fcn.0043b050
mov esi, eax
add esp, 8
test esi, esi
je 0x51b995
mov eax, dword [esp + 0x14]
test eax, eax
je 0x51b96a
mov eax, dword [eax + 0x78]
jmp 0x51b96f
mov eax, 0x3b9aca00
mov dword [esi + 4], 0
mov dword [esi], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], 0
mov word [esi + 0x14], 0
jmp 0x51b99a
mov esi, 0x5dc840
push dword [esp + 0x10]
push edi
push str.UPDATE___w_.__w_rowid_SET
push esi
call fcn.0043e320
add esp, 0x10
xor edi, edi
cmp byte [ebx + 0x19], 0
jbe 0x51b9fc
test edi, edi
je 0x51b9e0
mov ecx, dword [esi + 0x10]
inc ecx
cmp ecx, dword [esi + 8]
jb 0x51b9d5
push 1
mov edx, 0x5bc78c
mov ecx, esi
call fcn.0043dbc0
add esp, 4
jmp 0x51b9e0
mov eax, dword [esi + 4]
mov dword [esi + 0x10], ecx
mov byte [eax + ecx - 1], 0x2c
lea eax, [edi + 2]
push eax
push edi
push str.a_d__d
push esi
call fcn.0043e320
movzx eax, byte [ebx + 0x19]
inc edi
add esp, 0x10
cmp edi, eax
jl 0x51b9b5
push str._WHERE_rowid_1
push esi
call fcn.0043e320
push esi
call fcn.0043ddc0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x51ba2f
mov edi, 7
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x40]
xor ecx, esp
call fcn.0056eb71
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x14]
lea eax, [ebx + 0x70]
push 0
push eax
push 0
push 0x85
push 0xffffffffffffffff
mov edx, esi
call fcn.004adf50
add esp, 0x14
mov edi, eax
cmp dword [0x5dac30], 0
je 0x51ba9c
mov eax, dword [0x5dfe08]
test eax, eax
je 0x51ba6a
push eax
call dword [0x5dac80]
add esp, 4
push esi
call dword [0x5dac5c]
sub dword [0x5dfca8], eax
add esp, 4
dec dword [0x5dfccc]
push esi
call dword [0x5dac54]
mov eax, dword [0x5dfe08]
add esp, 4
test eax, eax
je 0x51baa6
push eax
call dword [0x5dac88]
jmp 0x51baa3
push esi
call dword [0x5dac54]
add esp, 4
mov ecx, dword [esp + 0x4c]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0056eb71
mov esp, ebp
pop ebp
ret