// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/ash_query.cpp
// Function: execute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int execute(const string & sql) {
  Config & config = Config::instance();

  // Get the filename backing the database we are about to query.
  string db_file(FLAGS_database);
  if (db_file == "") {
    if (config.get_string("HISTORY_DB") == "") {
      cerr << "Expected either --database or ASH_CFG_HISTORY_DB "
           << "to be defined." << endl;
      return 1;
    }
    db_file = config.get_string("HISTORY_DB");
  }

  // Prepare the DB for reading.
  Session::register_table();
  Command::register_table();
  Database db(db_file);

  // Get the intended Formatter before executing the query.
  string format = FLAGS_format == ""
    ? config.get_string("DEFAULT_FORMAT", "aligned")
    : FLAGS_format;
  Formatter * formatter = Formatter::lookup(format);
  if (!formatter) {
    cerr << "\nUnknown format: '" << format << "'" << endl;
    display(cerr << '\n', Formatter::get_desc(), "Format");
    return 1;
  }

  // Execute the query and display any results.
  ResultSet * rs = db.exec(sql, FLAGS_limit);
  formatter -> show_headings(!FLAGS_hide_headings);
  formatter -> insert(rs, cout);
  if (rs) delete rs;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
callq 0x69cd0
movq %rax, %r14
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x2e3f6(%rip), %rsi     # 0x960f8
movq 0x2e3f7(%rip), %rdx     # 0x96100
addq %rsi, %rdx
leaq 0x78(%rsp), %r15
movq %r15, %rdi
callq 0x68c64
leaq 0x16690(%rip), %rsi     # 0x7e3b0
movq %r15, %rdi
callq 0x80f0
testl %eax, %eax
je 0x67d8c
callq 0x704b0
callq 0x68cfc
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x69f7a
leaq 0x2e3f9(%rip), %rdi     # 0x96148
leaq 0x1665a(%rip), %rsi     # 0x7e3b0
callq 0x80f0
testl %eax, %eax
je 0x67ed6
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x2e3d5(%rip), %rsi     # 0x96148
movq 0x2e3d6(%rip), %rdx     # 0x96150
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x68c64
jmp 0x67f4e
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x158bc(%rip), %rsi     # 0x7d658
leaq 0x158bf(%rip), %rdx     # 0x7d662
leaq 0x28(%rsp), %rdi
callq 0x68bce
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x165f3(%rip), %rdx     # 0x7e3b0
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x68bce
leaq 0x98(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rsi
callq 0x69c78
leaq 0x165c5(%rip), %rsi     # 0x7e3b0
leaq 0x98(%rsp), %rdi
callq 0x80f0
movl %eax, %ebp
leaq 0xa8(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x67e11
callq 0x8390
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x67e20
callq 0x8390
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x67e2f
callq 0x8390
testl %ebp, %ebp
je 0x680e2
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x15812(%rip), %rsi     # 0x7d658
leaq 0x15815(%rip), %rdx     # 0x7d662
callq 0x68bce
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x1654f(%rip), %rdx     # 0x7e3b0
movq %rdx, %rsi
callq 0x68bce
leaq 0x98(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rsi
callq 0x69c78
leaq 0x78(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x81f0
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x67ea7
callq 0x8390
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x67eb6
callq 0x8390
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
leaq 0x88(%rsp), %r13
je 0x67d2c
callq 0x8390
jmp 0x67d2c
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x157be(%rip), %rsi     # 0x7d6a4
leaq 0x157c5(%rip), %rdx     # 0x7d6b2
leaq 0x28(%rsp), %rdi
callq 0x68bce
leaq 0x68(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x157ab(%rip), %rsi     # 0x7d6b3
leaq 0x157ab(%rip), %rdx     # 0x7d6ba
leaq 0x58(%rsp), %rdi
callq 0x68bce
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movq %r14, %rsi
callq 0x69c78
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x67f3f
callq 0x8390
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x67f4e
callq 0x8390
leaq 0x8(%rsp), %rdi
callq 0x6dc84
movq %rax, %r15
testq %rax, %rax
je 0x67fbe
movl 0x2e262(%rip), %edx     # 0x961c8
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x6a56e
movq %rax, %r14
movzbl 0x2e358(%rip), %esi     # 0x962d8
xorl $0x1, %esi
movq %r15, %rdi
callq 0x6de74
movq (%r15), %rax
movq 0x2c01b(%rip), %rdx     # 0x93fb0
movq %r15, %rdi
movq %r14, %rsi
callq *0x10(%rax)
xorl %ebx, %ebx
testq %r14, %r14
je 0x6809f
movq %r14, %rdi
callq 0x68a3c
movq %r14, %rdi
callq 0x8390
jmp 0x6809f
movq 0x2c023(%rip), %rdi     # 0x93fe8
leaq 0x156ef(%rip), %rsi     # 0x7d6bb
movl $0x12, %edx
callq 0x8470
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x2c001(%rip), %rdi     # 0x93fe8
callq 0x8470
movq %rax, %rbx
leaq 0x1639d(%rip), %rsi     # 0x7e393
movl $0x1, %edx
movq %rax, %rdi
callq 0x8470
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x83c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8250
leaq 0x28(%rsp), %rsi
movb $0xa, (%rsi)
movq 0x2bfaf(%rip), %rdi     # 0x93fe8
movl $0x1, %edx
callq 0x8470
leaq 0x28(%rsp), %rdi
callq 0x6dcbc
leaq 0x68(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x15671(%rip), %rsi     # 0x7d6ce
leaq 0x15670(%rip), %rdx     # 0x7d6d4
leaq 0x58(%rsp), %rdi
callq 0x68bce
leaq 0x28(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x67b14
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x6808c
callq 0x8390
leaq 0x28(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x68a76
movl $0x1, %ebx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x680b2
callq 0x8390
leaq 0x98(%rsp), %rdi
callq 0x6aec4
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x680ce
callq 0x8390
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2beff(%rip), %rdi     # 0x93fe8
leaq 0x15573(%rip), %rsi     # 0x7d663
movl $0x31, %edx
leaq 0x88(%rsp), %r13
callq 0x8470
movq 0x2bedf(%rip), %rbx     # 0x93fe8
leaq 0x15585(%rip), %rsi     # 0x7d695
movl $0xe, %edx
movq %rbx, %rdi
callq 0x8470
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x83c0
movsbl %al, %esi
movq 0x2bead(%rip), %rdi     # 0x93fe8
callq 0x8040
movl $0x1, %ebx
movq %rax, %rdi
callq 0x8250
jmp 0x680bf
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
jne 0x681ea
jmp 0x681f4
jmp 0x681f1
jmp 0x68205
jmp 0x6824d
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r14, %rdi
je 0x68191
callq 0x8390
jmp 0x68191
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
movq 0x10(%rdi), %rsi
callq 0x68a76
jmp 0x6822b
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x681bb
callq 0x8390
jmp 0x681bb
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
jne 0x68239
jmp 0x6823e
jmp 0x6821f
movq %rax, %rbx
movq %r14, %rdi
callq 0x8390
jmp 0x6822b
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x681f4
callq 0x8390
jmp 0x681f4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x68208
callq 0x8390
jmp 0x68208
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x68250
callq 0x8390
jmp 0x68250
jmp 0x6824d
jmp 0x6821f
jmp 0x68228
movq %rax, %rbx
jmp 0x6823e
jmp 0x68228
jmp 0x6824d
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6823e
callq 0x8390
leaq 0x98(%rsp), %rdi
callq 0x6aec4
jmp 0x68250
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x68267
callq 0x8390
movq %rbx, %rdi
callq 0x8720
movq %rax, %rdi
callq 0x68a31