// File: /workspace/github_cpp_makefile_star2_O1/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 0xc014
leaq 0x292f9(%rip), %rsi     # 0x365a8
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21e72
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 0x2db7c
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd2fd
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x21eda
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd31e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd3e9
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 0xc014
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd36e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd663
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xc014
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd678
movq (%rsp), %rdi
movb (%rdi,%r15), %bpl
cmpq %r13, %rdi
je 0xd3b6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leal -0x30(%rbp), %eax
cmpb $0xa, %al
jb 0xd3d0
leal -0x61(%rbp), %eax
cmpb $0x5, %al
ja 0xd3ca
addb $-0x57, %bpl
jmp 0xd3ce
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 0xd33c
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x291b4(%rip), %rsi     # 0x365bc
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21e72
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 0x2db7c
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd456
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x21eda
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd477
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd528
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 0xc014
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd4c7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd663
movzwl 0xc(%r14), %ebp
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xc014
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd689
movq (%rsp), %rdi
movsbl (%rdi,%r15), %eax
leal (%rax,%rbp,2), %eax
addl $-0x30, %eax
movw %ax, 0xc(%r14)
cmpq %r13, %rdi
je 0xd520
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
incq %r15
jmp 0xd495
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x29082(%rip), %rsi     # 0x365c9
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x21e72
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 0x2db7c
movl %eax, %ebp
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd595
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x21eda
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd5b6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0xd674
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 0xc014
movq (%rsp), %rdi
movq 0x8(%rsp), %rbp
cmpq %r13, %rdi
je 0xd603
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpq %rbp, %r15
jae 0xd663
movq %r13, (%rsp)
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xc014
movq 0x8(%rsp), %rdx
cmpq %r15, %rdx
jbe 0xd69a
movq (%rsp), %rdi
movb (%rdi,%r15), %bpl
cmpq %r13, %rdi
je 0xd643
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 0xd5d1
movb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xd665
leaq 0x2a261(%rip), %rdi     # 0x378e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
leaq 0x2a250(%rip), %rdi     # 0x378e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
leaq 0x2a23f(%rip), %rdi     # 0x378e0
movq %r15, %rsi
xorl %eax, %eax
callq 0x7430
jmp 0xd6b3
jmp 0xd6d8
jmp 0xd6b3
jmp 0xd6d8
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xd6cc
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x72c0
leaq 0x48(%rsp), %rdi
callq 0x21eda
jmp 0xd6db
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xd709
movq 0x38(%rsp), %rsi
jmp 0xd701
jmp 0xd6f0
jmp 0xd6f0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xd709
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0
nop