// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/formatter.cpp
// Function: insert_delimited(ash::ResultSet const*, std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void insert_delimited(const ResultSet * rs, ostream & out, const string & d,
                      const bool do_show_headings)
{
  if (!rs) return;

  const ResultSet::HeadersType & headers = rs -> headers;
  ResultSet::HeadersType::const_iterator i, e;

  if (do_show_headings) {
    size_t c = 0;
    for (i = headers.begin(), e = headers.end(); i != e; ++i, ++c)
      // Don't add a delimiter after the last column.
      out << *i << (c + 1 < rs -> columns ? d : "");
    out << endl;
  }

  // Loop ofer the rs.data inserting delimited text.
  for (size_t r = 0; r < rs -> rows; ++r) {
    for (size_t c = 0; c < rs -> columns; ++c) {
      out << rs -> data[r][c] << (c + 1 < rs -> columns ? d : "");
    }
    out << endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, (%rsp)
testq %rdi, %rdi
je 0x6e45a
movq %rdi, %r15
testb %cl, %cl
je 0x6e359
movq (%r15), %r12
cmpq %r15, %r12
je 0x6e32e
movl $0x1, %ebx
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %r14
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
movq (%rsp), %rdi
callq 0x8470
movq %rax, %rbp
cmpq 0x38(%r15), %rbx
movq %r13, 0x10(%rsp)
jae 0x6e2ef
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x68c64
jmp 0x6e301
movq %r14, %rdi
leaq 0x100b7(%rip), %rdx     # 0x7e3b0
movq %rdx, %rsi
callq 0x68bce
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbp, %rdi
callq 0x8470
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x6e322
callq 0x8390
movq (%r12), %r12
incq %rbx
cmpq %r15, %r12
jne 0x6e2b5
movq (%rsp), %rbx
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
cmpq $0x0, 0x30(%r15)
je 0x6e45a
leaq 0x20(%rsp), %r12
movq $0x0, 0x8(%rsp)
cmpq $0x0, 0x38(%r15)
je 0x6e418
movl $0x8, %r13d
movq 0x8(%rsp), %rax
leaq (%rax,%rax,2), %rbx
xorl %r14d, %r14d
movq 0x18(%r15), %rax
movq (%rax,%rbx,8), %rax
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
movq (%rsp), %rdi
callq 0x8470
movq %rax, %rbp
incq %r14
cmpq 0x38(%r15), %r14
movq %r12, 0x10(%rsp)
jae 0x6e3d5
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x68c64
jmp 0x6e3e9
leaq 0x10(%rsp), %rdi
leaq 0xffcf(%rip), %rdx      # 0x7e3b0
movq %rdx, %rsi
callq 0x68bce
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbp, %rdi
callq 0x8470
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e40a
callq 0x8390
addq $0x20, %r13
cmpq 0x38(%r15), %r14
jb 0x6e38f
movq (%rsp), %rbx
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
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, 0x8(%rsp)
cmpq 0x30(%r15), %rcx
jb 0x6e372
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6e47a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
jne 0x6e48c
jmp 0x6e491
movq %rax, %rbx
jmp 0x6e491
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e491
callq 0x8390
movq %rbx, %rdi
callq 0x8720
nop