// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, 0x2d8(%rsp)
callq 0x90ab0
movq %rax, 0x2d0(%rsp)
leaq 0x469e5(%rip), %rsi     # 0xd2218
leaq 0x2b0(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x81a0
movq 0xa8(%rsp), %rdi
leaq 0x2759e(%rip), %rsi     # 0xb2df5
callq 0x8d0c0
movb %al, 0xb7(%rsp)
jmp 0x8b865
movb 0xb7(%rsp), %al
testb $0x1, %al
jne 0x8b875
jmp 0x8bc49
movq 0x2d0(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x25f(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x87f0
movq 0xa0(%rsp), %rdx
leaq 0x267cc(%rip), %rsi     # 0xb2075
leaq 0x260(%rsp), %rdi
callq 0x85b0
jmp 0x8b8b8
leaq 0x237(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x87f0
movq 0x90(%rsp), %rdx
leaq 0x27519(%rip), %rsi     # 0xb2df5
leaq 0x238(%rsp), %rdi
callq 0x85b0
jmp 0x8b8eb
movq 0x98(%rsp), %rsi
leaq 0x280(%rsp), %rdi
leaq 0x260(%rsp), %rdx
leaq 0x238(%rsp), %rcx
callq 0x909d0
jmp 0x8b912
leaq 0x274dc(%rip), %rsi     # 0xb2df5
leaq 0x280(%rsp), %rdi
callq 0x8d0c0
movb %al, 0x8f(%rsp)
jmp 0x8b92f
leaq 0x280(%rsp), %rdi
callq 0x88f8
jmp 0x8b93e
leaq 0x238(%rsp), %rdi
callq 0x88f8
jmp 0x8b94d
leaq 0x237(%rsp), %rdi
callq 0x84a0
leaq 0x260(%rsp), %rdi
callq 0x88f8
jmp 0x8b969
leaq 0x25f(%rsp), %rdi
callq 0x84a0
movb 0x8f(%rsp), %al
testb $0x1, %al
jne 0x8b986
jmp 0x8bab0
movq 0x44663(%rip), %rdi     # 0xcfff0
leaq 0x266ec(%rip), %rsi     # 0xb2080
callq 0x8400
movq %rax, 0x80(%rsp)
jmp 0x8b9a3
movq 0x80(%rsp), %rdi
leaq 0x26700(%rip), %rsi     # 0xb20b2
callq 0x8400
movq %rax, 0x78(%rsp)
jmp 0x8b9be
movq 0x78(%rsp), %rdi
movq 0x445be(%rip), %rsi     # 0xcff88
callq 0x8470
jmp 0x8b9d1
movl $0x1, 0x2e4(%rsp)
movl $0x1, 0x230(%rsp)
jmp 0x8c187
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8c1a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8ba9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8ba80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8ba6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
leaq 0x280(%rsp), %rdi
callq 0x88f8
jmp 0x8ba6d
jmp 0x8ba6f
leaq 0x238(%rsp), %rdi
callq 0x88f8
jmp 0x8ba7e
jmp 0x8ba80
leaq 0x237(%rsp), %rdi
callq 0x84a0
leaq 0x260(%rsp), %rdi
callq 0x88f8
jmp 0x8ba9c
jmp 0x8ba9e
leaq 0x25f(%rsp), %rdi
callq 0x84a0
jmp 0x8c1a3
movq 0x2d0(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x1ef(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x87f0
movq 0x70(%rsp), %rdx
leaq 0x2659a(%rip), %rsi     # 0xb2075
leaq 0x1f0(%rsp), %rdi
callq 0x85b0
jmp 0x8baea
leaq 0x1c7(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x87f0
movq 0x60(%rsp), %rdx
leaq 0x272ed(%rip), %rsi     # 0xb2df5
leaq 0x1c8(%rsp), %rdi
callq 0x85b0
jmp 0x8bb17
movq 0x68(%rsp), %rsi
leaq 0x210(%rsp), %rdi
leaq 0x1f0(%rsp), %rdx
leaq 0x1c8(%rsp), %rcx
callq 0x909d0
jmp 0x8bb3b
leaq 0x2b0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x8050
jmp 0x8bb52
leaq 0x210(%rsp), %rdi
callq 0x88f8
jmp 0x8bb61
leaq 0x1c8(%rsp), %rdi
callq 0x88f8
jmp 0x8bb70
leaq 0x1c7(%rsp), %rdi
callq 0x84a0
leaq 0x1f0(%rsp), %rdi
callq 0x88f8
jmp 0x8bb8c
leaq 0x1ef(%rsp), %rdi
callq 0x84a0
jmp 0x8bc49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8bc37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8bc19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8bc08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x88f8
jmp 0x8bc06
jmp 0x8bc08
leaq 0x1c8(%rsp), %rdi
callq 0x88f8
jmp 0x8bc17
jmp 0x8bc19
leaq 0x1c7(%rsp), %rdi
callq 0x84a0
leaq 0x1f0(%rsp), %rdi
callq 0x88f8
jmp 0x8bc35
jmp 0x8bc37
leaq 0x1ef(%rsp), %rdi
callq 0x84a0
jmp 0x8c1a3
callq 0xa2170
jmp 0x8bc50
callq 0x8df60
jmp 0x8bc57
leaq 0x190(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x91090
jmp 0x8bc6e
movb $0x0, 0x14e(%rsp)
movb $0x0, 0x14d(%rsp)
movb $0x0, 0x126(%rsp)
movb $0x0, 0x125(%rsp)
leaq 0x465d3(%rip), %rdi     # 0xd2268
leaq 0x27159(%rip), %rsi     # 0xb2df5
callq 0x8d0c0
movb %al, 0x5f(%rsp)
jmp 0x8bca7
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x8bcb4
jmp 0x8bd61
movq 0x2d0(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x14f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x87f0
movq 0x50(%rsp), %rdx
movb $0x1, 0x14e(%rsp)
leaq 0x263da(%rip), %rsi     # 0xb20c1
leaq 0x150(%rsp), %rdi
callq 0x85b0
jmp 0x8bcf6
movb $0x1, 0x14d(%rsp)
leaq 0x127(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x87f0
movq 0x40(%rsp), %rdx
movb $0x1, 0x126(%rsp)
leaq 0x263ac(%rip), %rsi     # 0xb20d0
leaq 0x128(%rsp), %rdi
callq 0x85b0
jmp 0x8bd33
movq 0x48(%rsp), %rsi
movb $0x1, 0x125(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rdx
leaq 0x128(%rsp), %rcx
callq 0x909d0
jmp 0x8bd5f
jmp 0x8bd79
leaq 0x46500(%rip), %rsi     # 0xd2268
leaq 0x170(%rsp), %rdi
callq 0x81a0
jmp 0x8bd77
jmp 0x8bd79
testb $0x1, 0x125(%rsp)
jne 0x8bd85
jmp 0x8bd96
leaq 0x128(%rsp), %rdi
callq 0x88f8
jmp 0x8bd94
jmp 0x8bd96
testb $0x1, 0x126(%rsp)
jne 0x8bda2
jmp 0x8bdaf
leaq 0x127(%rsp), %rdi
callq 0x84a0
testb $0x1, 0x14d(%rsp)
jne 0x8bdbb
jmp 0x8bdcc
leaq 0x150(%rsp), %rdi
callq 0x88f8
jmp 0x8bdca
jmp 0x8bdcc
testb $0x1, 0x14e(%rsp)
jne 0x8bdd8
jmp 0x8bde5
leaq 0x14f(%rsp), %rdi
callq 0x84a0
leaq 0x170(%rsp), %rdi
callq 0x9b9f0
movq %rax, 0x38(%rsp)
jmp 0x8bdf9
movq 0x38(%rsp), %rax
movq %rax, 0x118(%rsp)
cmpq $0x0, 0x118(%rsp)
jne 0x8c06f
movq 0x441d4(%rip), %rdi     # 0xcfff0
leaq 0x262b5(%rip), %rsi     # 0xb20d8
callq 0x8400
movq %rax, 0x30(%rsp)
jmp 0x8be2f
movq 0x30(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x8350
movq %rax, 0x28(%rsp)
jmp 0x8be48
movq 0x28(%rsp), %rdi
leaq 0x26f92(%rip), %rsi     # 0xb2de6
callq 0x8400
movq %rax, 0x20(%rsp)
jmp 0x8be60
movq 0x20(%rsp), %rdi
movq 0x4411c(%rip), %rsi     # 0xcff88
callq 0x8470
jmp 0x8be73
movq 0x44176(%rip), %rdi     # 0xcfff0
movl $0xa, %esi
callq 0x8500
movq %rax, 0x18(%rsp)
jmp 0x8be8b
leaq 0xe8(%rsp), %rdi
callq 0x9ba70
jmp 0x8be9a
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x87f0
movq 0x10(%rsp), %rdx
leaq 0x26233(%rip), %rsi     # 0xb20eb
leaq 0xc8(%rsp), %rdi
callq 0x85b0
jmp 0x8bec7
movq 0x18(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x8b410
jmp 0x8bee3
leaq 0xc8(%rsp), %rdi
callq 0x88f8
jmp 0x8bef2
leaq 0xc7(%rsp), %rdi
callq 0x84a0
leaq 0xe8(%rsp), %rdi
callq 0x8d0f0
jmp 0x8bf0e
movl $0x1, 0x2e4(%rsp)
movl $0x1, 0x230(%rsp)
jmp 0x8c145
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8c176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8bfdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8bfa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
testb $0x1, 0x125(%rsp)
jne 0x8bf91
jmp 0x8bfa2
leaq 0x128(%rsp), %rdi
callq 0x88f8
jmp 0x8bfa0
jmp 0x8bfa2
jmp 0x8bfa4
testb $0x1, 0x126(%rsp)
jne 0x8bfb0
jmp 0x8bfbd
leaq 0x127(%rsp), %rdi
callq 0x84a0
testb $0x1, 0x14d(%rsp)
jne 0x8bfc9
jmp 0x8bfda
leaq 0x150(%rsp), %rdi
callq 0x88f8
jmp 0x8bfd8
jmp 0x8bfda
jmp 0x8bfdc
testb $0x1, 0x14e(%rsp)
jne 0x8bfe8
jmp 0x8bff5
leaq 0x14f(%rsp), %rdi
callq 0x84a0
jmp 0x8c176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8c163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
jmp 0x8c04e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x88f8
jmp 0x8c04c
jmp 0x8c04e
leaq 0xc7(%rsp), %rdi
callq 0x84a0
leaq 0xe8(%rsp), %rdi
callq 0x8d0f0
jmp 0x8c06a
jmp 0x8c163
movq 0x2d8(%rsp), %rsi
movl 0x4626b(%rip), %edx     # 0xd22e8
leaq 0x190(%rsp), %rdi
callq 0x91b50
movq %rax, 0x8(%rsp)
jmp 0x8c091
movq 0x8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x118(%rsp), %rdi
movb 0x4634c(%rip), %al      # 0xd23f8
notb %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x9be80
jmp 0x8c0bb
movq 0x118(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq 0x43edf(%rip), %rdx     # 0xcffb8
callq *%rax
jmp 0x8c0dd
cmpq $0x0, 0xb8(%rsp)
je 0x8c12f
movq 0xb8(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x8c10e
movq (%rsp), %rdi
callq 0x8d100
jmp 0x8c105
movq (%rsp), %rdi
callq 0x83a0
jmp 0x8c12f
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a8(%rsp)
movl %eax, 0x2a4(%rsp)
callq 0x83a0
jmp 0x8c163
movl $0x0, 0x2e4(%rsp)
movl $0x1, 0x230(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x88f8
jmp 0x8c154
leaq 0x190(%rsp), %rdi
callq 0x92990
jmp 0x8c174
leaq 0x170(%rsp), %rdi
callq 0x88f8
jmp 0x8c172
jmp 0x8c176
jmp 0x8c187
leaq 0x190(%rsp), %rdi
callq 0x92990
jmp 0x8c185
jmp 0x8c1a3
leaq 0x2b0(%rsp), %rdi
callq 0x88f8
movl 0x2e4(%rsp), %eax
addq $0x2e8, %rsp            # imm = 0x2E8
retq
leaq 0x2b0(%rsp), %rdi
callq 0x88f8
jmp 0x8c1b2
jmp 0x8c1b4
movq 0x2a8(%rsp), %rdi
callq 0x87d0
movq %rax, %rdi
callq 0x8cf60
nopl (%rax)