// File: 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
subq $0x250, %rsp            # imm = 0x250
movq %rdx, -0x1f8(%rbp)
movq %rsi, -0x1f0(%rbp)
movq %rdi, -0x1e8(%rbp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, -0x1e0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movb $0x1, -0x1a(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x67, %eax
jne 0x123bc
movb $0x0, -0x1a(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc650
movl 0xeebd(%rip), %eax      # 0x21288
movl %eax, -0x210(%rbp)
leaq 0xeec8(%rip), %rdi      # 0x212a0
movq %rdi, -0x208(%rbp)
callq 0x31e0
movq %rax, %rcx
movl -0x210(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x20c(%rbp)
leaq 0xeee4(%rip), %rdi      # 0x212e0
callq 0x31e0
movq -0x1f0(%rbp), %rdi
movq %rax, %rcx
movl -0x20c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1fc(%rbp)
callq 0x31e0
movq -0x208(%rbp), %rsi
movq %rax, %rcx
movl -0x1fc(%rbp), %eax
subl %ecx, %eax
addl $-0x2, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x40(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3130
jmp 0x12450
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl -0x3c(%rbp), %ecx
subl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jge 0x124a5
leaq 0xee55(%rip), %rsi      # 0x212c0
leaq -0x60(%rbp), %rdi
callq 0x3370
jmp 0x12476
jmp 0x12478
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x12457
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12b70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12b67
movq -0x1f0(%rbp), %rdx
leaq 0x5b69(%rip), %rsi      # 0x1801c
leaq -0xb0(%rbp), %rdi
callq 0x13a20
jmp 0x124c1
leaq 0x5b54(%rip), %rdx      # 0x1801c
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x13d60
jmp 0x124dd
leaq -0x60(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3370
jmp 0x124ef
leaq -0x90(%rbp), %rdi
callq 0x31a0
leaq -0xb0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x12578
leaq 0xed9d(%rip), %rsi      # 0x212c0
leaq -0x60(%rbp), %rdi
callq 0x3370
jmp 0x1252e
jmp 0x12530
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x12511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12567
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x31a0
leaq -0xb0(%rbp), %rdi
callq 0x31a0
jmp 0x12b67
leaq 0xed61(%rip), %rsi      # 0x212e0
leaq -0x60(%rbp), %rdi
callq 0x3370
jmp 0x1258a
leaq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x13ec0
jmp 0x12599
movl 0xece9(%rip), %eax      # 0x21288
movl %eax, -0x21c(%rbp)
leaq 0xed54(%rip), %rdi      # 0x21300
callq 0x31e0
movq %rax, %rcx
movl -0x21c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x218(%rbp)
leaq 0xed57(%rip), %rdi      # 0x21320
callq 0x31e0
movq -0x1f8(%rbp), %rdi
movq %rax, %rcx
movl -0x218(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xb8(%rbp)
leaq 0x660c(%rip), %rsi      # 0x18bf9
callq 0x13e90
movb %al, -0x211(%rbp)
jmp 0x125fa
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0x12609
jmp 0x1276f
movq -0x1f8(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x3130
jmp 0x1261e
movsbl 0xec5f(%rip), %edx      # 0x21284
movl -0xb8(%rbp), %ecx
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x13030
jmp 0x12640
leaq -0xf0(%rbp), %rdi
callq 0x31a0
movl $0x0, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq %rax, -0x228(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xd0e0
movq %rax, %rcx
movq -0x228(%rbp), %rax
cmpq %rcx, %rax
jae 0x12750
leaq 0xec77(%rip), %rsi      # 0x21300
leaq -0x118(%rbp), %rdi
callq 0x3130
jmp 0x12697
movl -0xf4(%rbp), %eax
movl %eax, %esi
leaq -0xd0(%rbp), %rdi
callq 0x13920
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0x3370
jmp 0x126bc
testb $0x1, -0x1a(%rbp)
je 0x1271e
leaq 0xec57(%rip), %rsi      # 0x21320
leaq -0x118(%rbp), %rdi
callq 0x3370
jmp 0x126d7
jmp 0x1271e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x31a0
jmp 0x12b67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x1275e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x31a0
jmp 0x1275e
leaq -0x38(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x13ec0
jmp 0x12730
leaq -0x118(%rbp), %rdi
callq 0x31a0
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x12656
leaq -0xd0(%rbp), %rdi
callq 0xcae0
jmp 0x1276f
leaq -0xd0(%rbp), %rdi
callq 0xcae0
jmp 0x12b67
cmpl $0x0, 0xee72(%rip)      # 0x215e8
jne 0x127b6
movq -0x1f8(%rbp), %rdi
leaq 0x6473(%rip), %rsi      # 0x18bf9
callq 0x13840
movb %al, -0x229(%rbp)
jmp 0x12793
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x1279f
jmp 0x127b6
leaq 0xeb5a(%rip), %rsi      # 0x21300
leaq -0x38(%rbp), %rdi
callq 0x13ec0
jmp 0x127b1
jmp 0x1288d
movl $0x0, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
cmpl 0xee1c(%rip), %eax      # 0x215e8
jae 0x1288b
leaq 0xeb27(%rip), %rsi      # 0x21300
leaq -0x140(%rbp), %rdi
callq 0x3130
jmp 0x127e7
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0x12844
leaq 0x5816(%rip), %rsi      # 0x1801c
leaq -0x140(%rbp), %rdi
callq 0x3280
jmp 0x12814
jmp 0x12816
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x127f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x31a0
jmp 0x12b67
leaq 0xead5(%rip), %rsi      # 0x21320
leaq -0x140(%rbp), %rdi
callq 0x3370
jmp 0x12859
leaq -0x38(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x13ec0
jmp 0x1286b
leaq -0x140(%rbp), %rdi
callq 0x31a0
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x127c0
jmp 0x1288d
leaq 0xeaac(%rip), %rsi      # 0x21340
leaq -0x168(%rbp), %rdi
callq 0x3130
jmp 0x128a2
movl 0xe9e0(%rip), %eax      # 0x21288
movq %rax, -0x240(%rbp)
leaq 0xe9ea(%rip), %rdi      # 0x212a0
addq $0xa0, %rdi
callq 0x31e0
movq %rax, %rcx
movq -0x240(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x238(%rbp)
leaq 0xe9c3(%rip), %rdi      # 0x212a0
addq $0xe0, %rdi
callq 0x31e0
movq %rax, %rcx
movq -0x238(%rbp), %rax
subq %rcx, %rax
movl %eax, -0x16c(%rbp)
movl $0x0, -0x170(%rbp)
movl -0x170(%rbp), %eax
cmpl -0x16c(%rbp), %eax
jge 0x1294d
leaq 0xea45(%rip), %rsi      # 0x21360
leaq -0x168(%rbp), %rdi
callq 0x3370
jmp 0x12929
jmp 0x1292b
movl -0x170(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x170(%rbp)
jmp 0x12906
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12b5b
leaq 0xea2c(%rip), %rsi      # 0x21380
leaq -0x168(%rbp), %rdi
callq 0x3370
jmp 0x12962
leaq -0x38(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x13ec0
jmp 0x12974
movb $0x0, -0x171(%rbp)
leaq -0x172(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x3470
movq -0x1e8(%rbp), %rdi
movq -0x248(%rbp), %rdx
leaq 0x6256(%rip), %rsi      # 0x18bf9
callq 0x33a0
jmp 0x129aa
leaq -0x172(%rbp), %rdi
callq 0x3300
movl $0x0, -0x178(%rbp)
movslq -0x178(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xd0e0
movq %rax, %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
jae 0x12b05
movslq -0x178(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x13920
movq %rax, %rsi
leaq -0x1d8(%rbp), %rdi
callq 0x3130
jmp 0x12a0b
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xf350
jmp 0x12a20
leaq 0x61d1(%rip), %rdx      # 0x18bf8
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x13d60
jmp 0x12a3c
movq -0x1e8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x3370
jmp 0x12a51
leaq -0x198(%rbp), %rdi
callq 0x31a0
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
movl -0x178(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x129c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x172(%rbp), %rdi
callq 0x3300
jmp 0x12b5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12b4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12af7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x12aeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x31a0
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1d8(%rbp), %rdi
callq 0x31a0
jmp 0x12b4f
movb $0x1, -0x171(%rbp)
testb $0x1, -0x171(%rbp)
jne 0x12b21
movq -0x1e8(%rbp), %rdi
callq 0x31a0
leaq -0x168(%rbp), %rdi
callq 0x31a0
leaq -0x60(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0xcae0
movq -0x1e0(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq -0x1e8(%rbp), %rdi
callq 0x31a0
leaq -0x168(%rbp), %rdi
callq 0x31a0
leaq -0x60(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0xcae0
movq -0x68(%rbp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)