// File: /workspace/github_c_makefile_star2_O2/RodionGork[P]tinyscheme/scheme.c
// Function: mk_atom
static pointer mk_atom(scheme * sc, char *q) {
  char c, *p;
  int has_dec_point = 0;
  int has_fp_exp = 0;

#if USE_COLON_HOOK
  if ((p = strstr(q, "::")) != 0) {
    *p = 0;
    return cons(sc, sc->COLON_HOOK,
        cons(sc,
            cons(sc,
                sc->QUOTE,
                cons(sc, mk_atom(sc, p + 2), sc->NIL)),
            cons(sc, mk_symbol(sc, str_to_maybe_lower(q)), sc->NIL)));
  }
#endif

  p = q;
  c = *p++;
  if ((c == '+') || (c == '-')) {
    if (str_eq(p, "inf.0")) {
      return mk_real(sc, (c == '+' ? 1 : -1) / 0.0);
    } else if (str_eq(p, "nan.0")) {
      return mk_real(sc, 0 / 0.0);
    }
    c = *p++;
    if (c == '.') {
      has_dec_point = 1;
      c = *p++;
    }
    if (!isdigit(c)) {
      return (mk_symbol(sc, str_to_maybe_lower(q)));
    }
  } else if (c == '.') {
    has_dec_point = 1;
    c = *p++;
    if (!isdigit(c)) {
      return (mk_symbol(sc, str_to_maybe_lower(q)));
    }
  } else if (!isdigit(c)) {
    return (mk_symbol(sc, str_to_maybe_lower(q)));
  }

  for (; (c = *p) != 0; ++p) {
    if (!isdigit(c)) {
      if (c == '.') {
        if (!has_dec_point) {
          has_dec_point = 1;
          continue;
        }
      } else if ((c == 'e') || (c == 'E')) {
        if (!has_fp_exp) {
          has_fp_exp = 1;
          has_dec_point = 1;    /* decimal point illegal further */
          p++;
          if ((*p == '-') || (*p == '+') || isdigit(*p)) {
            continue;
          }
        }
      }
      return (mk_symbol(sc, str_to_maybe_lower(q)));
    }
  }
  if (has_dec_point) {
    return mk_real(sc, atof(q));
  }
  return (mk_integer(sc, atol(q)));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x22e7(%rip), %rsi      # 0xd04f
movq %r14, %rdi
callq 0x42d0
testq %rax, %rax
je 0xae0d
movb $0x0, (%rax)
movq 0x118(%rbx), %r12
movq 0x140(%rbx), %r15
addq $0x2, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0xad50
movq 0x90(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x45e8
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x45e8
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x484c
movq 0x90(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x45e8
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x45e8
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45e8
leaq 0x1(%r14), %r15
movzbl (%r14), %r12d
cmpl $0x2b, %r12d
je 0xae27
cmpl $0x2e, %r12d
je 0xae65
cmpl $0x2d, %r12d
jne 0xae84
leaq 0x2224(%rip), %rsi      # 0xd052
movq %r15, %rdi
callq 0x41a0
testl %eax, %eax
je 0xae9d
leaq 0x2217(%rip), %rsi      # 0xd058
movq %r15, %rdi
callq 0x41a0
testl %eax, %eax
je 0xaeb7
movb 0x1(%r14), %r13b
cmpb $0x2e, %r13b
jne 0xaec4
leaq 0x3(%r14), %r15
movb 0x2(%r14), %r13b
pushq $0x1
popq %r12
jmp 0xaecb
movsbq 0x1(%r14), %r15
callq 0x4300
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r15,2)
je 0xaede
leaq 0x2(%r14), %r15
pushq $0x1
popq %r12
jmp 0xaef7
movsbq %r12b, %r13
callq 0x4300
movq (%rax), %rax
xorl %r12d, %r12d
testb $0x8, 0x1(%rax,%r13,2)
je 0xaede
jmp 0xaef7
xorl %eax, %eax
cmpb $0x2b, %r12b
sete %al
leaq 0x15ab(%rip), %rcx      # 0xc458
movsd (%rcx,%rax,8), %xmm0
jmp 0xaf75
movsd 0x1591(%rip), %xmm0     # 0xc450
jmp 0xaf75
leaq 0x2(%r14), %r15
xorl %r12d, %r12d
callq 0x4300
movq (%rax), %rax
movsbq %r13b, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0xaef7
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x484c
xorl %r13d, %r13d
movsbq (%r15), %rbp
testq %rbp, %rbp
je 0xaf68
callq 0x4300
movq (%rax), %rax
testb $0x8, 0x1(%rax,%rbp,2)
jne 0xaf63
cmpb $0x2e, %bpl
jne 0xaf23
testl %r12d, %r12d
pushq $0x1
popq %r12
je 0xaf63
jmp 0xaede
andb $-0x21, %bpl
cmpb $0x45, %bpl
jne 0xaede
testl %r13d, %r13d
jne 0xaede
movzbl 0x1(%r15), %ecx
incq %r15
cmpl $0x2b, %ecx
je 0xaf44
cmpl $0x2d, %ecx
jne 0xaf4d
pushq $0x1
popq %r13
movl %r13d, %r12d
jmp 0xaf63
movsbq %cl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
pushq $0x1
popq %r13
movl %r13d, %r12d
je 0xaede
incq %r15
jmp 0xaefa
movq %r14, %rdi
testl %r12d, %r12d
je 0xaf8b
callq 0x4080
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x46c6
callq 0x4220
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x46a3