// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rsi), %eax
cmpl $0x66, %eax
je 0x925c0
cmpl $0x74, %eax
jne 0x925f6
cmpb $0x0, 0x1(%r14)
je 0x925b4
xorl %ecx, %ecx
leaq 0x77a5f(%rip), %rdx     # 0x109ff9
movb (%r14,%rcx), %sil
movb (%rcx,%rdx), %dil
testb %sil, %sil
je 0x925af
incq %rcx
cmpb %dil, %sil
je 0x9259a
cmpb %dil, %sil
jne 0x925f6
movq 0x118(%rbx), %rax
jmp 0x92715
cmpb $0x0, 0x1(%r14)
je 0x925ea
xorl %ecx, %ecx
leaq 0x77a2f(%rip), %rdx     # 0x109fff
movb (%r14,%rcx), %sil
movb (%rcx,%rdx), %dil
testb %sil, %sil
je 0x925e5
incq %rcx
cmpb %dil, %sil
je 0x925d0
cmpb %dil, %sil
jne 0x925f6
movq 0x120(%rbx), %rax
jmp 0x92715
movq 0x110(%rbx), %rcx
movq 0x1e0(%rbx), %rdx
movq 0x10(%rdx), %r13
cmpq %rcx, %r13
je 0x92722
movq 0x120(%rbx), %r15
movq 0x170(%rbx), %rax
movq (%rax), %r12
btl $0x12, %r12d
jae 0x92648
movq %r12, %rcx
andq $-0x40001, %rcx         # imm = 0xFFFBFFFF
movq %rcx, (%rax)
movq 0x110(%rbx), %rcx
movq 0x1e0(%rbx), %rax
movq 0x10(%rax), %r13
cmpq %rcx, %r13
je 0x926f4
movq %r15, %rax
movsbl (%r14), %esi
movq 0x8(%r13), %rdx
movq 0x8(%rdx), %rdi
movzbl 0x8(%rdi), %edi
cmpl %edi, %esi
jne 0x926e5
cmpq 0x120(%rbx), %r15
jne 0x926c6
testb %sil, %sil
je 0x92689
xorl %ecx, %ecx
leaq 0x1(%rcx), %rax
cmpb $0x0, 0x1(%r14,%rcx)
movq %rax, %rcx
jne 0x92678
jmp 0x9268b
xorl %eax, %eax
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
movq %r14, 0x10(%rcx)
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %rax
movq %rcx, 0x8(%rax)
movq 0x700(%rbx), %r15
movq 0x8(%r13), %rdx
movq 0x10(%rdx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xaee6
cmpq 0x120(%rbx), %rax
jne 0x926f7
movq 0x110(%rbx), %rcx
movq 0x10(%r13), %r13
cmpq %rcx, %r13
jne 0x92654
jmp 0x926f7
movq %r15, %rax
btl $0x12, %r12d
jae 0x9270c
movq 0x170(%rbx), %rcx
orq $0x40000, (%rcx)        # imm = 0x40000
cmpq 0x120(%rbx), %rax
je 0x9271f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movb (%r14), %al
testb %al, %al
je 0x92b17
movzbl 0x1(%r14), %ecx
testq %rcx, %rcx
je 0x92b17
leaq 0x1(%r14), %rsi
movzbl %al, %edx
cmpl $0x61, %edx
jg 0x92788
cmpl $0x3c, %edx
je 0x927c7
cmpl $0x5c, %edx
je 0x927f5
cmpl $0x5f, %edx
jne 0x92b17
movq %rbx, %rdi
callq 0x9afc
testb $0x20, 0x3(%rax)
jne 0x92852
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpb $0x20, (%rax)
jne 0x92852
movq 0x10(%rax), %rax
jmp 0x92715
cmpl $0x62, %edx
je 0x9279b
cmpl $0x6f, %edx
je 0x9279b
cmpl $0x78, %edx
jne 0x92b17
cmpb $0x78, %al
movl $0x10, %ecx
movl $0x2, %edi
cmovel %ecx, %edi
cmpb $0x6f, %al
movl $0x8, %edx
cmovnel %edi, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x91b3a
xorl %eax, %eax
leaq 0x79664(%rip), %rcx     # 0x10be34
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x927e4
incq %rax
cmpb %sil, %dl
je 0x927d0
cmpb %sil, %dl
jne 0x92866
movq 0x130(%rbx), %rax
jmp 0x92715
movb 0x2(%r14), %al
testb %al, %al
je 0x92894
addl $-0x61, %ecx
cmpl $0x17, %ecx
ja 0x92b17
leaq 0x757b0(%rip), %rdx     # 0x107fc4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %eax, %eax
leaq 0x8842b(%rip), %rcx     # 0x11ac51
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x92839
incq %rax
cmpb %dil, %dl
je 0x92826
cmpb %dil, %dl
jne 0x92b17
movq 0xb820f(%rip), %rax     # 0x14aa58
movq 0x38(%rax), %rax
jmp 0x92715
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x93b94
xorl %eax, %eax
leaq 0x77776(%rip), %rcx     # 0x109fe5
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x92883
incq %rax
cmpb %sil, %dl
je 0x9286f
cmpb %sil, %dl
jne 0x928a4
movq 0x128(%rbx), %rax
jmp 0x92715
movq 0xb81bd(%rip), %rax     # 0x14aa58
movq (%rax,%rcx,8), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x77745(%rip), %rcx     # 0x109ff2
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x928c1
incq %rax
cmpb %sil, %dl
je 0x928ad
cmpb %sil, %dl
jne 0x92b17
movq 0xb3e8f(%rip), %rax     # 0x146760
jmp 0x92715
xorl %eax, %eax
leaq 0x84088(%rip), %rcx     # 0x116967
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x928f2
incq %rax
cmpb %dil, %dl
je 0x928df
cmpb %dil, %dl
jne 0x92b17
movq 0xb8156(%rip), %rax     # 0x14aa58
movq 0x3f8(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x7910e(%rip), %rcx     # 0x10ba25
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x9292a
incq %rax
cmpb %dil, %dl
je 0x92917
cmpb %dil, %dl
je 0x92954
xorl %eax, %eax
leaq 0x84014(%rip), %rcx     # 0x11694c
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x9294b
incq %rax
cmpb %dil, %dl
je 0x92938
cmpb %dil, %dl
jne 0x92ae6
movq 0xb80fd(%rip), %rax     # 0x14aa58
movq (%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x882ed(%rip), %rcx     # 0x11ac59
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x9297f
incq %rax
cmpb %dil, %dl
je 0x9296c
cmpb %dil, %dl
jne 0x92b17
movq 0xb80c9(%rip), %rax     # 0x14aa58
movq 0x40(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x83faf(%rip), %rcx     # 0x116950
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x929b4
incq %rax
cmpb %dil, %dl
je 0x929a1
cmpb %dil, %dl
jne 0x92b17
movq 0xb8094(%rip), %rax     # 0x14aa58
movq 0x68(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x8825c(%rip), %rcx     # 0x11ac32
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x929e9
incq %rax
cmpb %dil, %dl
je 0x929d6
cmpb %dil, %dl
jne 0x92b17
movq 0xb805f(%rip), %rax     # 0x14aa58
movq 0x100(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x83f52(%rip), %rcx     # 0x116960
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x92a21
incq %rax
cmpb %dil, %dl
je 0x92a0e
cmpb %dil, %dl
jne 0x92b17
movq 0xb8027(%rip), %rax     # 0x14aa58
movq 0xd8(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x83f11(%rip), %rcx     # 0x116957
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x92b02
incq %rax
cmpb %dil, %dl
je 0x92a46
jmp 0x92b02
leaq 0x3(%r14), %rcx
xorl %edx, %edx
leaq 0xc2bf1(%rip), %rsi     # 0x155660
movsbq %al, %rax
movl (%rsi,%rax,4), %eax
movl %edx, %edi
shll $0x4, %edi
addl %eax, %edi
cmpl $0x10, %eax
setl %r9b
cmovll %edi, %edx
movb (%rcx), %al
cmpl $0x100, %edx            # imm = 0x100
setb %r8b
andb %r9b, %r8b
testb %al, %al
je 0x92aa2
incq %rcx
testb %r8b, %r8b
jne 0x92a6f
testb %r8b, %r8b
je 0x92b17
movq 0xb7faa(%rip), %rax     # 0x14aa58
movl %edi, %ecx
jmp 0x9289b
xorl %eax, %eax
leaq 0x88186(%rip), %rcx     # 0x11ac44
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x92ad1
incq %rax
cmpb %dil, %dl
je 0x92abe
cmpb %dil, %dl
jne 0x92b17
movq 0xb7f7b(%rip), %rax     # 0x14aa58
movq 0x48(%rax), %rax
jmp 0x92715
xorl %eax, %eax
leaq 0x8814b(%rip), %rcx     # 0x11ac3a
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x92b02
incq %rax
cmpb %dil, %dl
je 0x92aef
cmpb %dil, %dl
jne 0x92b17
movq 0xb7f4a(%rip), %rax     # 0x14aa58
movq 0x50(%rax), %rax
jmp 0x92715
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x93a78