Function at 0x140023190
Capabilities:
Reference sql statements

Disassembly:
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x58
mov qword [rsp + 0x40], 0
cmp qword [rsp + 0x68], 0
jne 0x1400231cf
mov r8d, 0x559e
lea rdx, [0x14019fed0]
lea rcx, [0x14019fee0]
call fcn.14016410c
xor eax, eax
cmp qword [rsp + 0x60], 0
je 0x1400232ea
mov rax, qword [rsp + 0x68]
cmp qword [rax], 0
jne 0x140023232
mov rdx, qword [rsp + 0x68]
mov rcx, qword [0x14019fec8]
call sym.sqlite3.exe_sqlite3_open
test eax, eax
je 0x140023202
xor eax, eax
jmp 0x140023578
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [str.CREATE_TABLE_ColNames__cpos_INTEGER_PRIMARY_KEY__name_TEXT__nlen_INT__chop_INT__reps_INT__suff_TEXT__CREATE_VIEW_RepeatedNames_AS_SELECT_DISTINCT_t.name_FROM_ColNames_t_WHERE_t.name_COLLATE_NOCASE_IN___SELECT_o.name_FROM_ColNames_o_WHERE_o.cpos__t.cpos__]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_exec
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov rax, qword [rsp + 0x68]
cmp qword [rax], 0
jne 0x140023258
mov r8d, 0x55ab
lea rdx, [0x14019fef0]
lea rcx, str.pDb_0
call fcn.14016410c
xor eax, eax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, 0xffffffff
mov rdx, qword [str.INSERT_INTO_ColNames_name_nlen_chop_reps_suff__VALUES_iif_length__1__0__1____max_length__1__1__0_0__]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_prepare_v2
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov qword [rsp + 0x20], 0
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x60]
mov edx, 1
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_bind_text
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_step
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_finalize
xor eax, eax
jmp 0x140023578
mov rax, qword [rsp + 0x68]
cmp qword [rax], 0
jne 0x140023301
xor eax, eax
jmp 0x140023578
mov qword [rsp + 0x48], 0
mov rdx, qword [str.SELECT_count_DISTINCT__substring_name_1_nlen_chop_suff__COLLATE_NOCASE___count_name__FROM_ColNames]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call fcn.140021d30
mov dword [rsp + 0x34], eax
cmp dword [rsp + 0x34], 0
je 0x140023343
mov rdx, qword [str.SELECT_CASE_WHEN__nc___10__THEN_1_WHEN__nc___100__THEN_2__WHEN__nc___1000__THEN_3_WHEN__nc___10000__THEN_4__ELSE_5_FROM__SELECT_count___AS_nc_FROM_ColNames_]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call fcn.140021d30
mov dword [rsp + 0x38], eax
jmp 0x14002334b
mov dword [rsp + 0x38], 0
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x3c], eax
cmp dword [rsp + 0x34], 0
je 0x140023411
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [str.UPDATE_ColNames_AS_t_SET_reps_SELECT_count___FROM_ColNames_d__WHERE_substring_t.name_1_t.nlen_t.chop_substring_d.name_1_d.nlen_d.chop__COLLATE_NOCASE_]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_exec
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, 0xffffffff
mov rdx, qword [str.WITH_Lzn_nlz__AS____SELECT_0_AS_nlz__UNION__SELECT_nlz1_AS_nlz_FROM_Lzn__WHERE_EXISTS____SELECT_1___FROM_ColNames_t__ColNames_o___WHERE____iif_t.name_IN__SELECT__FROM_RepeatedNames_______printf__s__s_______t.name__substring_printf__.c_0.d_nlz1_0__1_t.cpos__2________t.name_____________iif_o.name_IN__SELECT__FROM_RepeatedNames_______printf__s__s_______o.name__substring_printf__.c_0.d_nlz1_0__1_o.cpos__2________o.name_________COLLATE_NOCASE____AND_o.cpos__t.cpos___GROUP_BY_t.cpos_____UPDATE_Colnames_AS_t_SET_chop__0__suff__iif_name_IN__SELECT__FROM_RepeatedNames____printf___s__substring____printf__.c_0.d__SELECT_max_nlz__FROM_Lzn_1_0_1_t.cpos__2_______]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_prepare_v2
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov r8d, dword [rsp + 0x3c]
mov edx, 1
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_bind_int
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_step
mov dword [rsp + 0x30], eax
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_finalize
cmp dword [rsp + 0x30], 0x65
je 0x140023411
mov r8d, 0x55c7
lea rdx, [0x14019ff10]
lea rcx, str.rcSQLITE_DONE
call fcn.14016410c
xor eax, eax
mov rdx, qword [str.SELECT_count_DISTINCT__substring_name_1_nlen_chop_suff__COLLATE_NOCASE___count_name__FROM_ColNames]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call fcn.140021d30
test eax, eax
je 0x140023444
mov r8d, 0x55c9
lea rdx, [0x14019ff40]
lea rcx, str.db_int_pDb__zHasDupes_0
call fcn.14016410c
xor eax, eax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, 0xffffffff
mov rdx, qword [str.SELECT__x0a__group_concat___cname_TEXT____iif__cpos_1__4_0_____x0a______AS_ColsSpec_FROM___SELECT_cpos__printf___w__printf___.s_s__nlen_chop_name_suff___AS_cname__FROM_ColNames_ORDER_BY_cpos_]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_prepare_v2
mov dword [rsp + 0x30], eax
mov ecx, dword [rsp + 0x30]
call fcn.140023140
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_step
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0x64
jne 0x1400234b0
xor edx, edx
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_column_text
mov rdx, rax
lea rcx, [0x14019f604]
call sym.sqlite3.exe_sqlite3_mprintf
mov qword [rsp + 0x48], rax
jmp 0x1400234b9
mov qword [rsp + 0x48], 0
cmp qword [rsp + 0x70], 0
je 0x140023550
cmp dword [rsp + 0x34], 0
jne 0x1400234da
mov rax, qword [rsp + 0x70]
mov qword [rax], 0
jmp 0x140023550
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_finalize
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, 0xffffffff
mov rdx, qword [str.SELECT_group_concat__printf___w__to___w__name_printf___.s_s__nlen_chop__name__suff_____x0a_FROM_ColNames_WHERE_suff___OR_chop_0]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_prepare_v2
test eax, eax
jne 0x140023544
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_step
cmp eax, 0x64
jne 0x140023544
xor edx, edx
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_column_text
mov rdx, rax
lea rcx, [0x14019f684]
call sym.sqlite3.exe_sqlite3_mprintf
mov rcx, qword [rsp + 0x70]
mov qword [rcx], rax
jmp 0x140023550
mov rax, qword [rsp + 0x70]
mov qword [rax], 0
mov rcx, qword [rsp + 0x40]
call sym.sqlite3.exe_sqlite3_finalize
mov rax, qword [rsp + 0x68]
mov rcx, qword [rax]
call sym.sqlite3.exe_sqlite3_close
mov rax, qword [rsp + 0x68]
mov qword [rax], 0
mov rax, qword [rsp + 0x48]
add rsp, 0x58
ret