// File: /workspace/github_c_makefile_star2_O1/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 0x6e6f0
movq %rdi, %r15
testb %cl, %cl
je 0x6e5ea
movq (%r15), %r13
cmpq %r15, %r13
je 0x6e5bf
leaq 0x18(%rsp), %r12
movl $0x1, %ebx
leaq 0x8(%rsp), %r14
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq (%rsp), %rdi
callq 0x8470
movq %rax, %rbp
cmpq 0x38(%r15), %rbx
jae 0x6e57b
movq %r12, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x68e74
jmp 0x6e592
movq %r12, 0x8(%rsp)
movq %r14, %rdi
leaq 0xfdd6(%rip), %rdx      # 0x7e360
movq %rdx, %rsi
callq 0x68de4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x8470
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e5b3
callq 0x8390
movq (%r13), %r13
incq %rbx
cmpq %r15, %r13
jne 0x6e543
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 0x6e6f0
leaq 0x18(%rsp), %r12
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x38(%r15)
je 0x6e6ae
movl $0x8, %r13d
movq 0x28(%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
jae 0x6e666
movq %r12, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x68e74
jmp 0x6e67f
movq %r12, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0xfce9(%rip), %rdx      # 0x7e360
movq %rdx, %rsi
callq 0x68de4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x8470
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e6a0
callq 0x8390
addq $0x20, %r13
cmpq 0x38(%r15), %r14
jb 0x6e620
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 0x28(%rsp), %rcx
incq %rcx
movq %rcx, 0x28(%rsp)
cmpq 0x30(%r15), %rcx
jb 0x6e603
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6e703
jmp 0x6e708
movq %rax, %rbx
jmp 0x6e71a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6e71a
callq 0x8390
movq %rbx, %rdi
callq 0x8720