// File: /workspace/github_cpp_makefile_star2_O3/AsherGlick[P]CommentHeader/source/main.cpp
// Function: headder(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
string headder(string input, string extendedInput, char outputRightWallFlag) {

  bool fillRightWall = true;
  if (outputRightWallFlag == 'g') {
    fillRightWall = false;
  }


  vector<string> output;

  // Print Top Line
  int fillWidth = titleWidth - 2 - globalHeaderStyle._TOP_LEFT.size() - globalHeaderStyle._TOP_RIGHT.size() - input.size();
  int halfFillWidth = fillWidth/2;
  string topLine = globalHeaderStyle._TOP_LEFT;
  for (int i = 0; i < fillWidth - halfFillWidth; i++) {
    topLine+=globalHeaderStyle._TOP_FILL;
  }
  topLine += " " + input + " ";
  for (int i = 0; i < halfFillWidth; i ++) {
    topLine += globalHeaderStyle._TOP_FILL;
  }
  topLine += globalHeaderStyle._TOP_RIGHT;
  // output += "\n";
  output.push_back(topLine);

  // Print Text filled Rows
  int whitespaceLength = titleWidth - globalHeaderStyle._LEFT_COLUMN.size() - globalHeaderStyle._RIGHT_COLUMN.size();
  if (extendedInput != "") {
    vector<string> textLines = align(extendedInput, outputAlignmentFlag, whitespaceLength);
    for (unsigned int i = 0; i < textLines.size(); i++) {
      string middleLine = globalHeaderStyle._LEFT_COLUMN;
      middleLine += textLines[i];
      if (fillRightWall) {
        middleLine += globalHeaderStyle._RIGHT_COLUMN;
      }
      // output += "\n";
      output.push_back(middleLine);
    }
  }

  // Print blank rows
  if (titleLength == 0 && extendedInput == "") {
    output.push_back(globalHeaderStyle._LEFT_COLUMN);
  }
  else {
    for (unsigned int i = 0; i < titleLength; i++) {
      string blankLine = globalHeaderStyle._LEFT_COLUMN;
      for (int j = 0; j < whitespaceLength; j++) {
        blankLine += " ";
      }
      blankLine += globalHeaderStyle._RIGHT_COLUMN;
      output.push_back(blankLine);
    }
  }

  // Print Bottom Line
  string bottomLine = globalHeaderStyle._BOTTOM_LEFT;
  int bottomWidth = titleWidth - globalHeaderStyle._BOTTOM_LEFT.size() - globalHeaderStyle._BOTTOM_RIGHT.size();
  for (int i = 0; i < bottomWidth; i++) {
    bottomLine += globalHeaderStyle._BOTTOM_FILL;
  }
  bottomLine += globalHeaderStyle._BOTTOM_RIGHT;

  output.push_back(bottomLine);



  string textOutput = "";

  for (int i = 0; i < output.size(); i++) {
    textOutput += stripTrailingSpaces(output[i]) + "\n";
  }

  // Return the result
  return textOutput;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %ecx, -0xb8(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, %r14
movq %rdi, -0x78(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movq $0x0, -0xa0(%rbp)
movl 0x7d7d(%rip), %ebx      # 0x14220
movq 0x7d96(%rip), %rdx      # 0x14240
movl 0x7dcf(%rip), %r15d     # 0x14280
addl %edx, %r15d
addl 0x8(%rsi), %r15d
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x7d6e(%rip), %rsi      # 0x14238
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x7faa
movl %ebx, %eax
subl %r15d, %eax
negl %r15d
addl %ebx, %r15d
addl $-0x2, %r15d
movl %r15d, %ecx
shrl $0x1f, %ecx
leal (%rcx,%rax), %ebx
addl $-0x2, %ebx
sarl %ebx
movl %r15d, -0xb4(%rbp)
subl %ebx, %r15d
jle 0xc52a
xorl %r13d, %r13d
leaq -0x98(%rbp), %r12
movq 0x7d45(%rip), %rsi      # 0x14258
movq 0x7d46(%rip), %rdx      # 0x14260
movq %r12, %rdi
callq 0x30d0
incl %r13d
cmpl %r15d, %r13d
jl 0xc50c
leaq 0x2aeb(%rip), %rsi      # 0xf01c
leaq -0x70(%rbp), %rdi
movq %r14, %rdx
callq 0xd2c3
leaq 0x2ad8(%rip), %rsi      # 0xf01c
leaq -0x70(%rbp), %rdi
callq 0x33e0
leaq -0x38(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc571
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0xc577
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq -0x50(%rbp), %r12
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x30d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc5b8
callq 0x3260
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc5ca
callq 0x3260
cmpl $0x2, -0xb4(%rbp)
jl 0xc5f4
leaq -0x98(%rbp), %r14
movq 0x7c77(%rip), %rsi      # 0x14258
movq 0x7c78(%rip), %rdx      # 0x14260
movq %r14, %rdi
callq 0x30d0
decl %ebx
jne 0xc5da
movq 0x7c7d(%rip), %rsi      # 0x14278
movq 0x7c7e(%rip), %rdx      # 0x14280
leaq -0x98(%rbp), %rdi
callq 0x30d0
leaq -0xb0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xd414
movl 0x7bf9(%rip), %ecx      # 0x14220
movl 0x7c93(%rip), %eax      # 0x142c0
addl 0x7c6d(%rip), %eax      # 0x142a0
subl %eax, %ecx
movl %ecx, -0x50(%rbp)
leaq 0x359a(%rip), %rsi      # 0xfbd9
movq %r12, %rdi
callq 0x30c0
testl %eax, %eax
je 0xc757
leaq -0x108(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x7faa
movsbl 0x7ba3(%rip), %edx      # 0x1421c
leaq -0x70(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movl -0x50(%rbp), %ecx
callq 0xce0b
movq -0x118(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc69d
callq 0x3260
movq -0x68(%rbp), %rax
cmpq -0x70(%rbp), %rax
je 0xc74e
movl $0x1, %ebx
xorl %r15d, %r15d
leaq -0x48(%rbp), %r13
leaq -0xb0(%rbp), %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x7bcb(%rip), %rsi      # 0x14298
movq 0x7bcc(%rip), %rdx      # 0x142a0
addq %rsi, %rdx
movq %r13, %rdi
callq 0x7faa
movq -0x70(%rbp), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r13, %rdi
callq 0x30d0
cmpb $0x67, -0xb8(%rbp)
je 0xc717
movq 0x7bb0(%rip), %rsi      # 0x142b8
movq 0x7bb1(%rip), %rdx      # 0x142c0
movq %r13, %rdi
callq 0x30d0
movq %r14, %rdi
movq %r13, %rsi
callq 0xd414
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc734
callq 0x3260
movq -0x68(%rbp), %rax
subq -0x70(%rbp), %rax
movl %ebx, %r15d
sarq $0x5, %rax
incl %ebx
cmpq %r15, %rax
ja 0xc6be
leaq -0x70(%rbp), %rdi
callq 0x7c92
cmpl $0x0, 0x7e22(%rip)      # 0x14580
je 0xc9f3
xorl %ebx, %ebx
leaq -0x48(%rbp), %r14
leaq 0x28ab(%rip), %r15      # 0xf01c
leaq -0xb0(%rbp), %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x7b11(%rip), %rsi      # 0x14298
movq 0x7b12(%rip), %rdx      # 0x142a0
addq %rsi, %rdx
movq %r14, %rdi
callq 0x7faa
movl -0x50(%rbp), %eax
movl %eax, %r12d
testl %eax, %eax
jle 0xc7b3
movq %r14, %rdi
movq %r15, %rsi
callq 0x33e0
decl %r12d
jne 0xc7a3
movq 0x7afe(%rip), %rsi      # 0x142b8
movq 0x7aff(%rip), %rdx      # 0x142c0
movq %r14, %rdi
callq 0x30d0
movq %r13, %rdi
movq %r14, %rsi
callq 0xd414
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc7e6
callq 0x3260
incl %ebx
cmpl 0x7d92(%rip), %ebx      # 0x14580
jb 0xc778
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
movq 0x7ad6(%rip), %rsi      # 0x142d8
movq 0x7ad7(%rip), %rdx      # 0x142e0
addq %rsi, %rdx
callq 0x7faa
movl 0x7a09(%rip), %ebx      # 0x14220
movq 0x7b02(%rip), %rdx      # 0x14320
movl 0x7abc(%rip), %eax      # 0x142e0
addl %edx, %eax
subl %eax, %ebx
testl %ebx, %ebx
jle 0xc851
leaq -0x48(%rbp), %r14
movq 0x7ac1(%rip), %rsi      # 0x142f8
movq 0x7ac2(%rip), %rdx      # 0x14300
movq %r14, %rdi
callq 0x30d0
decl %ebx
jne 0xc830
movq 0x7acf(%rip), %rdx      # 0x14320
movq 0x7ac0(%rip), %rsi      # 0x14318
leaq -0x48(%rbp), %rdi
callq 0x30d0
leaq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xd414
movq -0x78(%rbp), %rdi
leaq 0x10(%rdi), %rax
movq %rax, -0x50(%rbp)
movq %rax, (%rdi)
leaq 0x3352(%rip), %rdx      # 0xfbd9
movq %rdx, %rsi
callq 0x750c
movq -0xb0(%rbp), %rax
cmpq %rax, -0xa8(%rbp)
je 0xc9a7
leaq -0xc8(%rbp), %r13
movl $0x8, %ebx
xorl %r12d, %r12d
leaq -0xd8(%rbp), %r14
leaq -0xf8(%rbp), %r15
movq %r13, -0xd8(%rbp)
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x7faa
movq %r15, %rdi
movq %r14, %rsi
callq 0x97bb
movq %r15, %rdi
leaq 0x32e8(%rip), %rsi      # 0xfbd8
callq 0x33e0
leaq -0x60(%rbp), %rsi
movq %rsi, -0x70(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc919
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0xc91f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x68(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x78(%rbp), %rdi
callq 0x30d0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc959
callq 0x3260
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xc971
callq 0x3260
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xc982
callq 0x3260
incq %r12
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %rbx
cmpq %r12, %rcx
ja 0xc8c0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc9b9
callq 0x3260
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc9d1
callq 0x3260
leaq -0xb0(%rbp), %rdi
callq 0x7c92
movq -0x78(%rbp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31df(%rip), %rsi      # 0xfbd9
movq %r12, %rdi
callq 0x30c0
testl %eax, %eax
je 0xca18
cmpl $0x0, 0x7b73(%rip)      # 0x14580
jne 0xc764
jmp 0xc7f0
leaq 0x7879(%rip), %rsi      # 0x14298
leaq -0xb0(%rbp), %rdi
callq 0xd414
jmp 0xc7f0
jmp 0xcb03
movq %rax, %r14
movq -0x118(%rbp), %rdi
cmpq %rbx, %rdi
jne 0xcb3a
jmp 0xcb3f
jmp 0xcb03
jmp 0xcb2a
jmp 0xcb03
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xca76
callq 0x3260
jmp 0xca76
movq %rax, %r14
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xcb35
jmp 0xcb03
movq %rax, %r14
jmp 0xcb57
jmp 0xcb2a
jmp 0xcb03
movq %rax, %r14
jmp 0xcb1d
jmp 0xcb03
movq %rax, %r14
jmp 0xcaeb
movq %rax, %r14
jmp 0xcada
movq %rax, %r14
jmp 0xcac2
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xcac2
callq 0x3260
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xcada
callq 0x3260
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xcaeb
callq 0x3260
movq -0x78(%rbp), %rax
movq (%rax), %rdi
cmpq -0x50(%rbp), %rdi
je 0xcb2d
callq 0x3260
jmp 0xcb2d
jmp 0xcb2a
jmp 0xcb03
movq %rax, %r14
jmp 0xcb3f
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcb1d
callq 0x3260
leaq -0x70(%rbp), %rdi
callq 0x7c92
jmp 0xcb3f
jmp 0xcb2a
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcb3f
callq 0x3260
leaq -0x88(%rbp), %rax
movq -0x98(%rbp), %rdi
cmpq %rax, %rdi
je 0xcb57
callq 0x3260
leaq -0xb0(%rbp), %rdi
callq 0x7c92
movq %r14, %rdi
callq 0x3390