// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/flags.cpp
// Function: flag::Flag::Flag(char const*, char, char const*, bool)
Flag::Flag(const char * ln, const char sn, const char * ds, const bool ha)
  : long_name(ln), short_name(sn), description(ds), has_arg(ha)
{
  Flag::instances().push_back(this);

  // Map the names to this Flag object (if names are valid).
  if (short_name && isgraph(short_name))
    safe_add(Flag::short_names(), short_name, this);
  if (all_isgraph(long_name)) {
    safe_add(Flag::long_names(), string(long_name), this);
  } else {
    cerr << "WARNING: Flag long name '" << long_name
         << "' is not legal and will be ignored." << endl;
  }

  // Keep track of the longest name for later help output formatting.
  string temp(long_name);
  if (has_arg) {
    temp += "=VALUE";
  }
  if (temp.length() > longest_long_name) {
    longest_long_name = temp.length();
  }

  // Create an option struct and add it to the list.
  struct option opt = {ln, has_arg ? 1 : 0, 0, sn};
  Flag::options().push_back(opt);

  // Add the short_name to a flag_code string.
  if (short_name) {
     if (isgraph(short_name)) {
      Flag::codes().push_back(short_name);
      if (has_arg) {
        Flag::codes().push_back(':');
      }
    } else {
      cerr << "WARNING: Flag short name character '" << short_name
           << "' is not legal and will be ignored." << endl;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x26c75(%rip), %rax     # 0x939d8
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movb %bpl, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movb %r8b, 0x20(%rdi)
callq 0x6d550
movq %rax, %r15
movl $0x18, %edi
callq 0x83f0
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x8070
incq 0x10(%r15)
movsbl 0x10(%rbx), %edi
testl %edi, %edi
je 0x6cdc0
callq 0x8380
testl %eax, %eax
je 0x6cdc0
callq 0x6d6a0
movsbl 0x10(%rbx), %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x6d725
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x6cde6
movq %r15, %r12
movsbl (%r12), %edi
testl %edi, %edi
je 0x6cde6
callq 0x8380
testl %eax, %eax
je 0x6ce2d
incq %r12
testq %r15, %r15
jne 0x6cdcc
callq 0x6d5aa
movq %rax, %r15
movq 0x8(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x8170
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6d862
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6cec0
callq 0x8390
jmp 0x6cec0
movq 0x271b4(%rip), %r15     # 0x93fe8
leaq 0x11138(%rip), %rsi     # 0x7df73
movl $0x19, %edx
movq %r15, %rdi
callq 0x8470
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x6ce6d
movq %r12, %rdi
callq 0x8190
movq 0x27188(%rip), %rdi     # 0x93fe8
movq %r12, %rsi
movq %rax, %rdx
callq 0x8470
jmp 0x6ce85
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0x86b0
leaq 0x11101(%rip), %rsi     # 0x7df8d
movl $0x23, %edx
movq %r15, %rdi
callq 0x8470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x83c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8250
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x8170
cmpb $0x1, 0x20(%rbx)
jne 0x6ceea
leaq 0x110d1(%rip), %rsi     # 0x7dfb1
leaq 0x10(%rsp), %rdi
callq 0x87c0
movq 0x18(%rsp), %rax
movl 0x29537(%rip), %ecx     # 0x9642c
cmpq %rcx, %rax
jbe 0x6cf00
movl %eax, 0x2952c(%rip)     # 0x9642c
movzbl 0x20(%rbx), %r12d
callq 0x6d56e
movq %rax, %r15
movl $0x30, %edi
callq 0x83f0
movsbl %bpl, %ecx
movq %r14, 0x10(%rax)
movl %r12d, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl %ecx, 0x28(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x8070
incq 0x10(%r15)
movsbl 0x10(%rbx), %edi
testl %edi, %edi
je 0x6cff2
callq 0x8380
testl %eax, %eax
je 0x6cf81
callq 0x6d58c
movsbl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x8310
cmpb $0x1, 0x20(%rbx)
jne 0x6cff2
callq 0x6d58c
movq %rax, %rdi
movl $0x3a, %esi
callq 0x8310
jmp 0x6cff2
movq 0x27060(%rip), %rdi     # 0x93fe8
leaq 0x11029(%rip), %rsi     # 0x7dfb8
movl $0x24, %edx
callq 0x8470
movb 0x10(%rbx), %al
leaq 0xf(%rsp), %rsi
movb %al, (%rsi)
movq 0x2703e(%rip), %rdi     # 0x93fe8
movl $0x1, %edx
callq 0x8470
movq %rax, %rbx
leaq 0x10fcf(%rip), %rsi     # 0x7df8d
movl $0x23, %edx
movq %rax, %rdi
callq 0x8470
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
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d005
callq 0x8390
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6d025
movq %rax, %rbx
leaq 0x40(%rsp), %rax
jmp 0x6d02d
jmp 0x6d020
movq %rax, %rbx
jmp 0x6d03b
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d03b
callq 0x8390
movq %rbx, %rdi
callq 0x8720
nop