// File: /workspace/github_cpp_makefile_star2_O1/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 0x7cd6(%rip), %ebx      # 0x14220
movq 0x7cef(%rip), %rdx      # 0x14240
movl 0x7d28(%rip), %r15d     # 0x14280
addl %edx, %r15d
addl 0x8(%rsi), %r15d
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x7cc7(%rip), %rsi      # 0x14238
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x802a
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 0xc5d1
xorl %r13d, %r13d
leaq -0x98(%rbp), %r12
movq 0x7c9e(%rip), %rsi      # 0x14258
movq 0x7c9f(%rip), %rdx      # 0x14260
movq %r12, %rdi
callq 0x30d0
incl %r13d
cmpl %r15d, %r13d
jl 0xc5b3
leaq 0x2a44(%rip), %rsi      # 0xf01c
leaq -0x70(%rbp), %rdi
movq %r14, %rdx
callq 0xd337
leaq 0x2a31(%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 0xc618
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0xc61e
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 0xc65f
callq 0x3260
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc671
callq 0x3260
cmpl $0x2, -0xb4(%rbp)
jl 0xc69b
leaq -0x98(%rbp), %r14
movq 0x7bd0(%rip), %rsi      # 0x14258
movq 0x7bd1(%rip), %rdx      # 0x14260
movq %r14, %rdi
callq 0x30d0
decl %ebx
jne 0xc681
movq 0x7bd6(%rip), %rsi      # 0x14278
movq 0x7bd7(%rip), %rdx      # 0x14280
leaq -0x98(%rbp), %rdi
callq 0x30d0
leaq -0xb0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xd488
movl 0x7b52(%rip), %ecx      # 0x14220
movl 0x7bec(%rip), %eax      # 0x142c0
addl 0x7bc6(%rip), %eax      # 0x142a0
subl %eax, %ecx
movl %ecx, -0x50(%rbp)
leaq 0x34f3(%rip), %rsi      # 0xfbd9
movq %r12, %rdi
callq 0x30c0
testl %eax, %eax
je 0xc7fe
leaq -0x108(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x802a
movsbl 0x7afc(%rip), %edx      # 0x1421c
leaq -0x70(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movl -0x50(%rbp), %ecx
callq 0xce7f
movq -0x118(%rbp), %rdi
cmpq %rbx, %rdi
je 0xc744
callq 0x3260
movq -0x68(%rbp), %rax
cmpq -0x70(%rbp), %rax
je 0xc7f5
movl $0x1, %ebx
xorl %r15d, %r15d
leaq -0x48(%rbp), %r13
leaq -0xb0(%rbp), %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x7b24(%rip), %rsi      # 0x14298
movq 0x7b25(%rip), %rdx      # 0x142a0
addq %rsi, %rdx
movq %r13, %rdi
callq 0x802a
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 0xc7be
movq 0x7b09(%rip), %rsi      # 0x142b8
movq 0x7b0a(%rip), %rdx      # 0x142c0
movq %r13, %rdi
callq 0x30d0
movq %r14, %rdi
movq %r13, %rsi
callq 0xd488
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc7db
callq 0x3260
movq -0x68(%rbp), %rax
subq -0x70(%rbp), %rax
movl %ebx, %r15d
sarq $0x5, %rax
incl %ebx
cmpq %r15, %rax
ja 0xc765
leaq -0x70(%rbp), %rdi
callq 0x7d36
cmpl $0x0, 0x7d7b(%rip)      # 0x14580
jne 0xc81e
leaq 0x33cb(%rip), %rsi      # 0xfbd9
movq %r12, %rdi
callq 0x30c0
testl %eax, %eax
je 0xc8b9
cmpl $0x0, 0x7d5b(%rip)      # 0x14580
je 0xc8cc
xorl %ebx, %ebx
leaq -0x48(%rbp), %r14
leaq 0x27e4(%rip), %r15      # 0xf01c
leaq -0xb0(%rbp), %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x7a4a(%rip), %rsi      # 0x14298
movq 0x7a4b(%rip), %rdx      # 0x142a0
addq %rsi, %rdx
movq %r14, %rdi
callq 0x802a
movl -0x50(%rbp), %eax
movl %eax, %r12d
testl %eax, %eax
jle 0xc87a
movq %r14, %rdi
movq %r15, %rsi
callq 0x33e0
decl %r12d
jne 0xc86a
movq 0x7a37(%rip), %rsi      # 0x142b8
movq 0x7a38(%rip), %rdx      # 0x142c0
movq %r14, %rdi
callq 0x30d0
movq %r13, %rdi
movq %r14, %rsi
callq 0xd488
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc8ad
callq 0x3260
incl %ebx
cmpl 0x7ccb(%rip), %ebx      # 0x14580
jb 0xc83f
jmp 0xc8cc
leaq 0x79d8(%rip), %rsi      # 0x14298
leaq -0xb0(%rbp), %rdi
callq 0xd488
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
movq %rax, (%rdi)
movq 0x79fa(%rip), %rsi      # 0x142d8
movq 0x79fb(%rip), %rdx      # 0x142e0
addq %rsi, %rdx
callq 0x802a
movl 0x792d(%rip), %ebx      # 0x14220
movl 0x7a27(%rip), %eax      # 0x14320
addl 0x79e1(%rip), %eax      # 0x142e0
subl %eax, %ebx
testl %ebx, %ebx
jle 0xc923
leaq -0x48(%rbp), %r14
movq 0x79e8(%rip), %rsi      # 0x142f8
movq 0x79e9(%rip), %rdx      # 0x14300
movq %r14, %rdi
callq 0x30d0
decl %ebx
jne 0xc909
movq 0x79ee(%rip), %rsi      # 0x14318
movq 0x79ef(%rip), %rdx      # 0x14320
leaq -0x48(%rbp), %rdi
callq 0x30d0
leaq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xd488
movq -0x78(%rbp), %rdi
leaq 0x10(%rdi), %rax
movq %rax, -0x50(%rbp)
movq %rax, (%rdi)
leaq 0x3279(%rip), %rdx      # 0xfbd9
movq %rdx, %rsi
callq 0x7590
movq -0xb0(%rbp), %rax
cmpq %rax, -0xa8(%rbp)
je 0xca80
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 0x802a
movq %r15, %rdi
movq %r14, %rsi
callq 0x9853
movq %r15, %rdi
leaq 0x320f(%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 0xc9f2
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0xc9f8
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 0xca32
callq 0x3260
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xca4a
callq 0x3260
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xca5b
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 0xc999
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xca92
callq 0x3260
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xcaaa
callq 0x3260
leaq -0xb0(%rbp), %rdi
callq 0x7d36
movq -0x78(%rbp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcb9f
movq %rax, %r14
movq -0x118(%rbp), %rdi
cmpq %rbx, %rdi
jne 0xcbd6
jmp 0xcbdb
jmp 0xcb9f
jmp 0xcbc6
jmp 0xcb9f
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcb12
callq 0x3260
jmp 0xcb12
movq %rax, %r14
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xcbd1
jmp 0xcb9f
movq %rax, %r14
jmp 0xcbf3
jmp 0xcbc6
jmp 0xcb9f
movq %rax, %r14
jmp 0xcbb9
jmp 0xcb9f
jmp 0xcb9f
movq %rax, %r14
jmp 0xcb89
movq %rax, %r14
jmp 0xcb78
movq %rax, %r14
jmp 0xcb60
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xcb60
callq 0x3260
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xcb78
callq 0x3260
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xcb89
callq 0x3260
movq -0x78(%rbp), %rax
movq (%rax), %rdi
cmpq -0x50(%rbp), %rdi
je 0xcbc9
callq 0x3260
jmp 0xcbc9
jmp 0xcbc6
movq %rax, %r14
jmp 0xcbdb
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcbb9
callq 0x3260
leaq -0x70(%rbp), %rdi
callq 0x7d36
jmp 0xcbdb
jmp 0xcbc6
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xcbdb
callq 0x3260
leaq -0x88(%rbp), %rax
movq -0x98(%rbp), %rdi
cmpq %rax, %rdi
je 0xcbf3
callq 0x3260
leaq -0xb0(%rbp), %rdi
callq 0x7d36
movq %r14, %rdi
callq 0x3390