// File: CoinXu[P]reviser-compiler/src/command_line_interface.cpp
// Function: reviser::CommandLineInterface::ParseArgument(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool CommandLineInterface::ParseArgument(const char* arg, string* name, string* value) {
    bool parsed_value = false;

    if (arg[0] != '-') {
      name->clear();
      parsed_value = false;
      *value = arg;
      return false;
    } else if (arg[1] == '-') {
      const char* equals_post = strchr(arg, '=');
      if (equals_post != NULL) {
        *name = string(arg, equals_post - arg);
        *value = equals_post + 1;
        parsed_value = true;
      } else {
        *name = arg;
      }
    } else {
      if (arg[1] == '\0') {
        name->clear();
        *value = arg;
        parsed_value = true;
      } else {
        *name = string(arg, 2);
        *value = arg + 2;
        parsed_value = !value->empty();
      }
    }

    if (parsed_value) {
      return false;
    }

    // these are only flags that don't take a value
    if (*name == "-h" || *name == "--help" || *name == "--version") {
      return false;
    }

    return true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0xa04ee
movq -0x20(%rbp), %rdi
callq 0x99610
movb $0x0, -0x29(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x99630
movb $0x0, -0x1(%rbp)
jmp 0xa06ef
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0xa05c7
movq -0x18(%rbp), %rdi
movl $0x3d, %esi
callq 0x99160
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xa05b5
movq -0x18(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xa8(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x99850
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xa0(%rbp), %rcx
leaq -0x58(%rbp), %rdi
callq 0x99530
jmp 0xa0565
movq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x99590
leaq -0x58(%rbp), %rdi
callq 0x992c0
leaq -0x59(%rbp), %rdi
callq 0x994f0
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
movq -0x28(%rbp), %rdi
callq 0x99630
movb $0x1, -0x29(%rbp)
jmp 0xa05c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x994f0
jmp 0xa06fd
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdi
callq 0x99630
jmp 0xa0699
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xa05f3
movq -0x20(%rbp), %rdi
callq 0x99610
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x99630
movb $0x1, -0x29(%rbp)
jmp 0xa0697
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x99850
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rcx
leaq -0x90(%rbp), %rdi
movl $0x2, %edx
callq 0x99530
jmp 0xa0632
movq -0x20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x99590
leaq -0x90(%rbp), %rdi
callq 0x992c0
leaq -0x91(%rbp), %rdi
callq 0x994f0
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
movq -0x28(%rbp), %rdi
callq 0x99630
movq -0x28(%rbp), %rdi
callq 0x997b0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0xa0697
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x994f0
jmp 0xa06fd
jmp 0xa0699
jmp 0xa069b
testb $0x1, -0x29(%rbp)
je 0xa06a7
movb $0x0, -0x1(%rbp)
jmp 0xa06ef
movq -0x20(%rbp), %rdi
leaq 0x5e9c5(%rip), %rsi     # 0xff077
callq 0xa1040
testb $0x1, %al
jne 0xa06e5
movq -0x20(%rbp), %rdi
leaq 0x5e9b4(%rip), %rsi     # 0xff07a
callq 0xa1040
testb $0x1, %al
jne 0xa06e5
movq -0x20(%rbp), %rdi
leaq 0x5e9a7(%rip), %rsi     # 0xff081
callq 0xa1040
testb $0x1, %al
jne 0xa06e5
jmp 0xa06eb
movb $0x0, -0x1(%rbp)
jmp 0xa06ef
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x99840
nopw %cs:(%rax,%rax)