// File: AsherGlick[P]CommentHeader/source/main.cpp
// Function: activateFlag(char)
bool activateFlag(char flag) {
  switch ( flag ) {
    // Chose one of these output flags
    case 'h':
    case 's':
    case 'b':
    case 't':
    case 'f':
      if(outputFormatFlagSet) {
        cout << "You have set multiple output format flags, only one is allowed" << endl;
        postArgParseHalt = true;
      }
      outputFormatFlag = flag;
      outputFormatFlagSet = true;
      return true;
    
    // Choose edge closed pattern
    case 'g':
    case 'e':
      if(outputRightWallFlagSet) {
        cout << "You have set multiple bounding box flags, only one is allowed" << endl;
        postArgParseHalt = true;
      }
      outputRightWallFlag = flag;
      outputRightWallFlagSet = true;
      return true;

    // Choose input location
    case 'i':
    case 'a':
    case 'c':
      if(inputLocationFlagSet) {
        cout << "You have set multiple input location flags, only one is allowed" << endl;
        postArgParseHalt = true;
      }
      inputLocationFlag = flag;
      inputLocationFlagSet = true;
      return true;

    // Choose output alignment
    case 'r':
    case 'm':
    case 'n':
      if (outputAlignmentFlagSet) {
        cout << "You have set multiple output alignment flags, only one is allowed" << endl;
        postArgParseHalt = true;
      }
      outputAlignmentFlag = flag;
      outputAlignmentFlagSet = true;
      return true;

    // Choose output location
    case 'o':   
    case 'v':
      if (outputLocationFlagSet) {
        cout << "You have set multiple output location flags, only one is allowed" << endl;
        postArgParseHalt = true;
      }
      outputLocationFlag = flag;
      outputLocationFlagSet = true;
      return true;
  }

  // Find the flag in the language map
  map<char, headerStyle>::iterator it = headerStyles.find(flag);
  if (it != headerStyles.end()) {
    globalHeaderStyle = headerStyles[flag];
    globalTitleStyle = titleStyles[flag];
    return true;
  }

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dil, %al
movb %al, -0x2(%rbp)
movsbl -0x2(%rbp), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x15, %eax
ja 0xf12c
movq -0x20(%rbp), %rax
leaq 0x91e5(%rip), %rcx      # 0x18194
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testb $0x1, 0x12621(%rip)     # 0x215e0
je 0xefea
movq 0x11ff8(%rip), %rdi     # 0x20fc0
leaq 0x9382(%rip), %rsi      # 0x18351
callq 0x32a0
movq %rax, %rdi
movq 0x11fd2(%rip), %rsi     # 0x20fb0
callq 0x32e0
movb $0x1, 0x12636(%rip)     # 0x21620
movb -0x2(%rbp), %al
movb %al, 0x1228d(%rip)      # 0x21280
movb $0x1, 0x125e6(%rip)     # 0x215e0
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
testb $0x1, 0x125d7(%rip)     # 0x215e1
je 0xf035
movq 0x11fad(%rip), %rdi     # 0x20fc0
leaq 0x9376(%rip), %rsi      # 0x18390
callq 0x32a0
movq %rax, %rdi
movq 0x11f87(%rip), %rsi     # 0x20fb0
callq 0x32e0
movb $0x1, 0x125eb(%rip)     # 0x21620
movb -0x2(%rbp), %al
movb %al, 0x12243(%rip)      # 0x21281
movb $0x1, 0x1259c(%rip)     # 0x215e1
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
testb $0x1, 0x1258d(%rip)     # 0x215e2
je 0xf080
movq 0x11f62(%rip), %rdi     # 0x20fc0
leaq 0x9369(%rip), %rsi      # 0x183ce
callq 0x32a0
movq %rax, %rdi
movq 0x11f3c(%rip), %rsi     # 0x20fb0
callq 0x32e0
movb $0x1, 0x125a0(%rip)     # 0x21620
movb -0x2(%rbp), %al
movb %al, 0x121f9(%rip)      # 0x21282
movb $0x1, 0x12552(%rip)     # 0x215e2
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
testb $0x1, 0x12544(%rip)     # 0x215e4
je 0xf0cb
movq 0x11f17(%rip), %rdi     # 0x20fc0
leaq 0x935e(%rip), %rsi      # 0x1840e
callq 0x32a0
movq %rax, %rdi
movq 0x11ef1(%rip), %rsi     # 0x20fb0
callq 0x32e0
movb $0x1, 0x12555(%rip)     # 0x21620
movb -0x2(%rbp), %al
movb %al, 0x121b0(%rip)      # 0x21284
movb $0x1, 0x12509(%rip)     # 0x215e4
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
testb $0x1, 0x124f8(%rip)     # 0x215e3
je 0xf116
movq 0x11ecc(%rip), %rdi     # 0x20fc0
leaq 0x9355(%rip), %rsi      # 0x18450
callq 0x32a0
movq %rax, %rdi
movq 0x11ea6(%rip), %rsi     # 0x20fb0
callq 0x32e0
movb $0x1, 0x1250a(%rip)     # 0x21620
movb -0x2(%rbp), %al
movb %al, 0x12164(%rip)      # 0x21283
movb $0x1, 0x124bd(%rip)     # 0x215e3
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
leaq 0x123ed(%rip), %rdi     # 0x21520
leaq -0x2(%rbp), %rsi
callq 0x13620
movq %rax, -0x10(%rbp)
leaq 0x123d9(%rip), %rdi     # 0x21520
callq 0x8850
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x13650
testb $0x1, %al
jne 0xf163
jmp 0xf1a7
leaq 0x123b6(%rip), %rdi     # 0x21520
leaq -0x2(%rbp), %rsi
callq 0x13680
movq %rax, %rsi
leaq 0x12123(%rip), %rdi     # 0x212a0
callq 0x8020
leaq 0x123c7(%rip), %rdi     # 0x21550
leaq -0x2(%rbp), %rsi
callq 0x13760
movq %rax, %rsi
leaq 0x12204(%rip), %rdi     # 0x213a0
callq 0x83c0
movb $0x1, -0x1(%rbp)
jmp 0xf1ab
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)