// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: make_sharp_constant
static s7_pointer make_sharp_constant(s7_scheme *sc, char *name, bool with_error)
    {
        /* name is the stuff after the '#', return sc->nil if not a recognized #... entity */

        if ((name[0] == 't') &&
                ((name[1] == '\0') || (strings_are_equal(name, "true"))))
            return(sc->T);

        if ((name[0] == 'f') &&
                ((name[1] == '\0') || (strings_are_equal(name, "false"))))
            return(sc->F);

        if (is_not_null(slot_value(sc->sharp_readers)))
        {
            s7_pointer x;
            x = check_sharp_readers(sc, name);
            if (x != sc->F)
                return(x);
        }

        if ((name[0] == '\0') || name[1] == '\0')
            return(unknown_sharp_constant(sc, name));

        switch (name[0])
        {
            /* -------- #< ... > -------- */
            case '<':
                if (strings_are_equal(name, "<unspecified>"))
                    return(sc->unspecified);

                if (strings_are_equal(name, "<undefined>"))
                    return(sc->undefined);

                if (strings_are_equal(name, "<eof>"))
                    return(eof_object);

                return(unknown_sharp_constant(sc, name));

                /* -------- #o #x #b -------- */
            case 'o':   /* #o (octal) */
            case 'x':   /* #x (hex) */
            case 'b':   /* #b (binary) */
                return(make_atom(sc, (char *)(name + 1), (name[0] == 'o') ? 8 : ((name[0] == 'x') ? 16 : 2), NO_SYMBOLS, with_error));

                /* -------- #_... -------- */
            case '_':
                {
                    s7_pointer sym;
                    sym = make_symbol(sc, (char *)(name + 1));
                    if ((!is_gensym(sym)) && (is_slot(initial_slot(sym))))
                        return(slot_value(initial_slot(sym)));
                    /* here we should not necessarily raise an error that *_... is undefined.  reader-cond, for example, needs to
                     *    read undefined #_ vals that it will eventually discard.
                     */
                    return(make_unknown(sc, name));    /* (define x (with-input-from-string "(#_asdf 1 2)" read)) (type-of (car x)) -> undefined? */
                }

                /* -------- #\... -------- */
            case '\\':
                if (name[2] == 0)                             /* the most common case: #\a */
                    return(chars[(uint8_t)(name[1])]);
                /* not uint32_t here!  (uint32_t)255 (as a char) returns -1!! */
                switch (name[1])
                {
                    case 'n':
                        if ((strings_are_equal(name + 1, "null")) ||
                                (strings_are_equal(name + 1, "nul")))
                            return(chars[0]);

                        if (strings_are_equal(name + 1, "newline"))
                            return(chars[(uint8_t)'\n']);
                        break;

                    case 's': if (strings_are_equal(name + 1, "space"))     return(chars[(uint8_t)' ']);  break;
                    case 'r': if (strings_are_equal(name + 1, "return"))    return(chars[(uint8_t)'\r']); break;
                    case 'l': if (strings_are_equal(name + 1, "linefeed"))  return(chars[(uint8_t)'\n']); break;
                    case 't': if (strings_are_equal(name + 1, "tab"))       return(chars[(uint8_t)'\t']); break;
                    case 'a': if (strings_are_equal(name + 1, "alarm"))     return(chars[7]);             break;
                    case 'b': if (strings_are_equal(name + 1, "backspace")) return(chars[8]);             break;
                    case 'e': if (strings_are_equal(name + 1, "escape"))    return(chars[0x1b]);          break;
                    case 'd': if (strings_are_equal(name + 1, "delete"))    return(chars[0x7f]);          break;

                    case 'x':
                                  /* #\x is just x, but apparently #\x<num> is int->char? #\x65 -> #\e, and #\xcebb is lambda? */
                              {
                                  /* sscanf here misses errors like #\x1.4, but make_atom misses #\x6/3,
                                   *   #\x#b0, #\x#e0.0, #\x-0, #\x#e0e100 etc, so we have to do it at an even lower level.
                                   * another problem: #\xbdca2cbec overflows so lval is -593310740 -> segfault unless caught
                                   */
                                  bool happy = true;
                                  char *tmp;
                                  int32_t lval = 0;

                                  tmp = (char *)(name + 2);
                                  while ((*tmp) && (happy) && (lval >= 0) && (lval < 256))
                                  {
                                      int32_t dig;
                                      dig = digits[(int32_t)(*tmp++)];
                                      if (dig < 16)
                                          lval = dig + (lval * 16);
                                      else happy = false;
                                  }
                                  if ((happy) &&
                                          (lval < 256) &&
                                          (lval >= 0))
                                      return(chars[lval]);
                              }
                              break;
                }
        }
        return(unknown_sharp_constant(sc, name));
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rsi), %ebp
cmpl $0x66, %ebp
je 0x757d0
cmpl $0x74, %ebp
jne 0x757f6
cmpb $0x0, 0x1(%r14)
je 0x757c4
leaq 0x607e1(%rip), %rsi     # 0xd5f99
movq %r14, %rdi
callq 0x70b07
testb %al, %al
je 0x757f6
movq 0x118(%rbx), %rax
jmp 0x758c1
cmpb $0x0, 0x1(%r14)
je 0x757ea
leaq 0x607c1(%rip), %rsi     # 0xd5f9f
movq %r14, %rdi
callq 0x70b07
testb %al, %al
je 0x757f6
movq 0x120(%rbx), %rax
jmp 0x758c1
movq 0x1e0(%rbx), %r13
movq 0x10(%r13), %rax
cmpq 0x110(%rbx), %rax
je 0x758d3
movq 0x120(%rbx), %rax
movq 0x170(%rbx), %rcx
movq (%rcx), %r12
btl $0x12, %r12d
jae 0x7583a
movq %r12, %rdx
andq $-0x40001, %rdx         # imm = 0xFFFBFFFF
movq %rdx, (%rcx)
movq 0x1e0(%rbx), %r13
movq %rax, %r15
movq 0x110(%rbx), %rdx
movq 0x10(%r13), %r13
cmpq %rdx, %r13
je 0x758a3
movsbl (%r14), %esi
movq 0x8(%r13), %rcx
movq 0x8(%rcx), %rdi
movzbl 0x8(%rdi), %edi
cmpl %edi, %esi
jne 0x75844
cmpq 0x120(%rbx), %r15
jne 0x7588b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd1ba
movq 0x700(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %r15
movq 0x8(%r13), %rcx
movq 0x10(%rcx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xa34c
cmpq 0x120(%rbx), %rax
je 0x7583d
btl $0x12, %r12d
jae 0x758b8
movq 0x170(%rbx), %rcx
orq $0x40000, (%rcx)        # imm = 0x40000
cmpq 0x120(%rbx), %rax
je 0x758d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb (%r14), %bpl
testb %bpl, %bpl
je 0x75bff
movzbl 0x1(%r14), %ecx
testq %rcx, %rcx
je 0x75bff
leaq 0x1(%r14), %r15
cmpb $0x78, %bpl
je 0x75939
movzbl %bpl, %eax
cmpl $0x5c, %eax
je 0x75996
cmpl $0x5f, %eax
je 0x7596b
cmpl $0x62, %eax
je 0x75939
cmpl $0x6f, %eax
je 0x75939
cmpl $0x3c, %eax
jne 0x75bff
leaq 0x624b4(%rip), %rsi     # 0xd7dd4
movq %r14, %rdi
callq 0x70b07
testb %al, %al
je 0x759fa
movq 0x130(%rbx), %rax
jmp 0x758c1
cmpb $0x78, %bpl
pushq $0x10
popq %rax
pushq $0x2
popq %rcx
cmovel %eax, %ecx
cmpb $0x6f, %bpl
pushq $0x8
popq %rdx
cmovnel %ecx, %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x74d92
movq %rbx, %rdi
movq %r15, %rsi
callq 0x94d4
testb $0x20, 0x3(%rax)
jne 0x759e1
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpb $0x20, (%rax)
jne 0x759e1
movq 0x10(%rax), %rax
jmp 0x758c1
movb 0x2(%r14), %al
testb %al, %al
je 0x75a19
addl $-0x61, %ecx
cmpl $0x17, %ecx
ja 0x75bff
leaq 0x5e607(%rip), %rdx     # 0xd3fb8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x71230(%rip), %rsi     # 0xe6bf1
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa4080(%rip), %rax     # 0x119a58
movq 0x38(%rax), %rax
jmp 0x758c1
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x768b5
leaq 0x60584(%rip), %rsi     # 0xd5f85
movq %r14, %rdi
callq 0x70b07
testb %al, %al
je 0x75a29
movq 0x128(%rbx), %rax
jmp 0x758c1
movq 0xa4038(%rip), %rax     # 0x119a58
movq (%rax,%rcx,8), %rax
jmp 0x758c1
leaq 0x60562(%rip), %rsi     # 0xd5f92
movq %r14, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0x9fd19(%rip), %rax     # 0x115760
jmp 0x758c1
leaq 0x6ceb4(%rip), %rsi     # 0xe2907
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3fee(%rip), %rax     # 0x119a58
movq 0x3f8(%rax), %rax
jmp 0x758c1
leaq 0x61f48(%rip), %rsi     # 0xd79c5
movq %r15, %rdi
callq 0x70b07
testb %al, %al
jne 0x75aa0
leaq 0x6ce5c(%rip), %rsi     # 0xe28ec
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bdc
movq 0xa3fb1(%rip), %rax     # 0x119a58
movq (%rax), %rax
jmp 0x758c1
leaq 0x71143(%rip), %rsi     # 0xe6bf9
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3f8b(%rip), %rax     # 0x119a58
movq 0x40(%rax), %rax
jmp 0x758c1
leaq 0x6ce13(%rip), %rsi     # 0xe28f0
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3f64(%rip), %rax     # 0x119a58
movq 0x68(%rax), %rax
jmp 0x758c1
leaq 0x710ce(%rip), %rsi     # 0xe6bd2
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3f3d(%rip), %rax     # 0x119a58
movq 0x100(%rax), %rax
jmp 0x758c1
leaq 0x6cdd2(%rip), %rsi     # 0xe2900
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3f13(%rip), %rax     # 0x119a58
movq 0xd8(%rax), %rax
jmp 0x758c1
leaq 0x6cd9f(%rip), %rsi     # 0xe28f7
jmp 0x75be3
leaq 0x3(%r14), %rdx
xorl %ecx, %ecx
movb $0x1, %dil
leaq 0xaeaf3(%rip), %rsi     # 0x124660
cmpl $0x100, %ecx            # imm = 0x100
setb %r8b
andb %dil, %r8b
testb %al, %al
je 0x75ba6
testb %r8b, %r8b
je 0x75ba6
movsbq %al, %rax
movl (%rsi,%rax,4), %eax
movl %ecx, %r8d
shll $0x4, %r8d
addl %eax, %r8d
cmpl $0x10, %eax
setl %dil
cmovll %r8d, %ecx
movb (%rdx), %al
incq %rdx
jmp 0x75b6d
testb %r8b, %r8b
je 0x75bff
movq 0xa3ea6(%rip), %rax     # 0x119a58
movl %ecx, %ecx
jmp 0x75a20
leaq 0x71024(%rip), %rsi     # 0xe6be4
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3e85(%rip), %rax     # 0x119a58
movq 0x48(%rax), %rax
jmp 0x758c1
leaq 0x70ff7(%rip), %rsi     # 0xe6bda
movq %r15, %rdi
callq 0x70b07
testb %al, %al
je 0x75bff
movq 0xa3e62(%rip), %rax     # 0x119a58
movq 0x50(%rax), %rax
jmp 0x758c1
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x767d8