// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
cmpb $0x2d, (%rsi)
jne 0x29a98
movzbl 0x1(%r15), %eax
testl %eax, %eax
je 0x29a98
cmpl $0x2d, %eax
jne 0x29ada
movq %r15, %rdi
movl $0x3d, %esi
callq 0x25130
testq %rax, %rax
je 0x29b44
movq %rax, %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2a2fe
movq %r14, %rdi
movq %r12, %rsi
callq 0x25420
movq (%r12), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x29a79
callq 0x25320
incq %r13
movq 0x8(%rbx), %r14
movq %r13, %rdi
callq 0x25180
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r13, %rcx
jmp 0x29ac0
movq $0x0, 0x8(%r14)
movq (%r14), %rax
movb $0x0, (%rax)
movq 0x8(%rbx), %r14
movq %r15, %rdi
callq 0x25180
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x25530
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movzwl (%r15), %eax
addq $0x2, %r15
movw %ax, (%r13)
movq $0x2, -0x8(%r13)
movb $0x0, 0x2(%r13)
leaq -0x48(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x25420
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x29b19
callq 0x25320
movq 0x8(%rbx), %r13
movq %r15, %rdi
callq 0x25180
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x25530
cmpq $0x0, 0x8(%rbx)
jne 0x29ac8
jmp 0x29b63
movq 0x8(%r14), %rbx
movq %r15, %rdi
callq 0x25180
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x25530
leaq 0x2650d(%rip), %rsi     # 0x50077
movq %r14, %rdi
callq 0x250e0
testl %eax, %eax
je 0x29ba3
leaq 0x264fd(%rip), %rsi     # 0x5007a
movq %r14, %rdi
callq 0x250e0
testl %eax, %eax
je 0x29ba3
leaq 0x264f1(%rip), %rsi     # 0x50081
movq %r14, %rdi
callq 0x250e0
testl %eax, %eax
setne %r12b
jmp 0x29ac8
xorl %r12d, %r12d
jmp 0x29ac8
nop