// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: LiteralToken::parse(AtomToken const&)
bool LiteralToken::parse(const AtomToken& token) {
  _lineNum = token.line();
  if (std::regex_match(token.str(), std::regex("^0[xX][0-9a-fA-F]+$"))) {
    // Matched hex
    _value = 0;
    for (size_t i = 2; i < token.str().size(); i++) {
      char c = token.str().at(i);
      uint8_t hexVal =
        ('0' <= c && c <= '9') ? (c - '0') :
        ('a' <= c && c <= 'f') ? (c - 'a' + 10) : (c - 'A' + 10);
      _value = (_value * 16) + hexVal;
    }
  } else if (std::regex_match(token.str(), std::regex("^0[bB][01]+$"))) {
    // Matched binary
    _value = 0;
    for (size_t i = 2; i < token.str().size(); i++) {
      _value = (_value * 2) + (token.str().at(i) - '0');
    }
  } else if (std::regex_match(token.str(), std::regex("^[0-9]+$"))) {
    // Matched decimal
    _value = 0;
    for (size_t i = 0; i < token.str().size(); i++) {
      char c = token.str().at(i);
      uint8_t decVal = c - '0';
      _value = (_value * 10) + decVal;
    }
  } else {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x10(%rsi), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xbd58
leaq 0x285a5(%rip), %rsi     # 0x355a8
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21736
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x48(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2d495
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd051
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x2179e
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd072
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd13d
movw $0x0, 0xc(%r14)
leaq 0x10(%rsp), %r13
movl $0x2, %r15d
movq %rsp, %r12
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd0c2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd3b7
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd3cc
movq (%rsp), %rdi
movb (%rdi,%r15), %bpl
cmpq %r13, %rdi
je 0xd10a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leal -0x30(%rbp), %eax
cmpb $0xa, %al
jb 0xd124
leal -0x61(%rbp), %eax
cmpb $0x5, %al
ja 0xd11e
addb $-0x57, %bpl
jmp 0xd122
addb $-0x37, %bpl
movl %ebp, %eax
movl 0xc(%r14), %ecx
shll $0x4, %ecx
movzbl %al, %eax
addl %ecx, %eax
movw %ax, 0xc(%r14)
incq %r15
jmp 0xd090
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
callq 0xbd58
leaq 0x28460(%rip), %rsi     # 0x355bc
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21736
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x48(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2d495
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd1aa
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x2179e
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd1cb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd27c
movw $0x0, 0xc(%r14)
leaq 0x10(%rsp), %r13
movl $0x2, %r15d
movq %rsp, %r12
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd21b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd3b7
movzwl 0xc(%r14), %ebp
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd3dd
movq (%rsp), %rdi
movsbl (%rdi,%r15), %eax
leal (%rax,%rbp,2), %eax
addl $-0x30, %eax
movw %ax, 0xc(%r14)
cmpq %r13, %rdi
je 0xd274
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
incq %r15
jmp 0xd1e9
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
callq 0xbd58
leaq 0x2832e(%rip), %rsi     # 0x355c9
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21736
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x48(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2d495
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd2e9
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x2179e
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd30a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd3c8
movw $0x0, 0xc(%r14)
leaq 0x10(%rsp), %r13
xorl %r15d, %r15d
movq %rsp, %r12
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd357
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd3b7
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbd58
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd3ee
movq (%rsp), %rdi
movb (%rdi,%r15), %bpl
cmpq %r13, %rdi
je 0xd397
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
addb $-0x30, %bpl
movl 0xc(%r14), %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
movzbl %bpl, %ecx
addl %eax, %ecx
movw %cx, 0xc(%r14)
incq %r15
jmp 0xd325
movb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xd3b9
leaq 0x2950d(%rip), %rdi     # 0x368e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
leaq 0x294fc(%rip), %rdi     # 0x368e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
leaq 0x294eb(%rip), %rdi     # 0x368e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
jmp 0xd407
jmp 0xd42c
jmp 0xd407
jmp 0xd42c
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd420
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x2179e
jmp 0xd42f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd45d
movq 0x38(%rsp), %rsi
jmp 0xd455
jmp 0xd444
jmp 0xd444
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xd45d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0
nop