// File: /workspace/github_c_makefile_star2_O1/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 0x98c0a
cmpl $0x74, %eax
jne 0x98c3f
cmpb $0x0, 0x1(%r14)
je 0x98bfa
xorl %ecx, %ecx
leaq 0x7a309(%rip), %rdx     # 0x112ee9
movb (%r14,%rcx), %sil
movb (%rcx,%rdx), %dil
testb %sil, %sil
je 0x98bf5
incq %rcx
cmpb %dil, %sil
je 0x98be0
cmpb %dil, %sil
jne 0x98c06
movq 0x118(%rbx), %rax
jmp 0x98d5b
cmpb $0x66, %al
jne 0x98c3f
cmpb $0x0, 0x1(%r14)
je 0x98c33
xorl %eax, %eax
leaq 0x7a2d5(%rip), %rcx     # 0x112eef
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x98c2e
incq %rax
cmpb %sil, %dl
je 0x98c1a
cmpb %sil, %dl
jne 0x98c3f
movq 0x120(%rbx), %rax
jmp 0x98d5b
movq 0x1e0(%rbx), %rax
movq 0x10(%rax), %rax
cmpq 0x110(%rbx), %rax
je 0x98d38
movq 0x120(%rbx), %r15
movq 0x170(%rbx), %rax
movq (%rax), %r12
btl $0x12, %r12d
jae 0x98c7c
movq %r12, %rcx
andq $-0x40001, %rcx         # imm = 0xFFFBFFFF
movq %rcx, (%rax)
movq 0x1e0(%rbx), %rax
movq 0x10(%rax), %r13
cmpq 0x110(%rbx), %r13
je 0x98d3a
movq %r15, %rax
movsbl (%r14), %ecx
movq 0x8(%r13), %rdx
movq 0x8(%rdx), %rdx
movzbl 0x8(%rdx), %edx
cmpl %edx, %ecx
jne 0x98d25
cmpq 0x120(%rbx), %r15
jne 0x98d09
testb %cl, %cl
je 0x98cd0
movq $-0x1, %rcx
leaq 0x1(%rcx), %rax
cmpb $0x0, 0x1(%r14,%rcx)
movq %rax, %rcx
jne 0x98cbf
jmp 0x98cd2
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), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xbd41
cmpq 0x120(%rbx), %rax
jne 0x98d3d
movq 0x10(%r13), %r13
cmpq 0x110(%rbx), %r13
jne 0x98c97
jmp 0x98d3d
jmp 0x98d65
movq %r15, %rax
btl $0x12, %r12d
jae 0x98d52
movq 0x170(%rbx), %rcx
orq $0x40000, (%rcx)        # imm = 0x40000
cmpq 0x120(%rbx), %rax
je 0x98d65
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movzbl (%r14), %ecx
testl %ecx, %ecx
je 0x991a5
movzbl 0x1(%r14), %edx
testq %rdx, %rdx
je 0x991a5
leaq 0x1(%r14), %rsi
cmpl $0x61, %ecx
jg 0x98de6
cmpl $0x3c, %ecx
je 0x98e27
cmpl $0x5c, %ecx
je 0x98e55
cmpl $0x5f, %ecx
jne 0x991a5
movq $-0x1, %rdx
cmpb $0x0, 0x2(%r14,%rdx)
leaq 0x1(%rdx), %rdx
jne 0x98daa
movq %rbx, %rdi
callq 0x9d9f
testb $0x20, 0x3(%rax)
jne 0x98eb1
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpb $0x20, (%rax)
jne 0x98eb1
movq 0x10(%rax), %rax
jmp 0x98d5b
cmpl $0x62, %ecx
je 0x98df9
cmpl $0x6f, %ecx
je 0x98df9
cmpl $0x78, %ecx
jne 0x991a5
cmpl $0x78, %ecx
movl $0x10, %eax
movl $0x2, %edi
cmovel %eax, %edi
cmpl $0x6f, %ecx
movl $0x8, %edx
cmovnel %edi, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x97c6d
xorl %eax, %eax
leaq 0x7bef4(%rip), %rcx     # 0x114d24
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x98e44
incq %rax
cmpb %sil, %dl
je 0x98e30
cmpb %sil, %dl
jne 0x98ec5
movq 0x130(%rbx), %rax
jmp 0x98d5b
cmpb $0x0, 0x2(%r14)
je 0x98ef3
addl $-0x61, %edx
cmpl $0x17, %edx
ja 0x991a5
leaq 0x780e5(%rip), %rcx     # 0x110f58
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
xorl %eax, %eax
leaq 0x8acbc(%rip), %rcx     # 0x123b41
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x98e98
incq %rax
cmpb %dil, %dl
je 0x98e85
cmpb %dil, %dl
jne 0x991a5
movq 0xb9bb0(%rip), %rax     # 0x152a58
movq 0x38(%rax), %rax
jmp 0x98d5b
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9a298
xorl %eax, %eax
leaq 0x7a007(%rip), %rcx     # 0x112ed5
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x98ee2
incq %rax
cmpb %sil, %dl
je 0x98ece
cmpb %sil, %dl
jne 0x98f03
movq 0x128(%rbx), %rax
jmp 0x98d5b
movq 0xb9b5e(%rip), %rax     # 0x152a58
movq (%rax,%rdx,8), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x79fd6(%rip), %rcx     # 0x112ee2
movb (%r14,%rax), %dl
movb (%rax,%rcx), %sil
testb %dl, %dl
je 0x98f20
incq %rax
cmpb %sil, %dl
je 0x98f0c
cmpb %sil, %dl
jne 0x991a5
movq 0xb5830(%rip), %rax     # 0x14e760
jmp 0x98d5b
xorl %eax, %eax
leaq 0x86919(%rip), %rcx     # 0x11f857
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x98f51
incq %rax
cmpb %dil, %dl
je 0x98f3e
cmpb %dil, %dl
jne 0x991a5
movq 0xb9af7(%rip), %rax     # 0x152a58
movq 0x3f8(%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x7b99f(%rip), %rcx     # 0x114915
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x98f89
incq %rax
cmpb %dil, %dl
je 0x98f76
cmpb %dil, %dl
je 0x98fb3
xorl %eax, %eax
leaq 0x868a5(%rip), %rcx     # 0x11f83c
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x98faa
incq %rax
cmpb %dil, %dl
je 0x98f97
cmpb %dil, %dl
jne 0x99174
movq 0xb9a9e(%rip), %rax     # 0x152a58
movq (%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x8ab7e(%rip), %rcx     # 0x123b49
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x98fde
incq %rax
cmpb %dil, %dl
je 0x98fcb
cmpb %dil, %dl
jne 0x991a5
movq 0xb9a6a(%rip), %rax     # 0x152a58
movq 0x40(%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x86840(%rip), %rcx     # 0x11f840
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99013
incq %rax
cmpb %dil, %dl
je 0x99000
cmpb %dil, %dl
jne 0x991a5
movq 0xb9a35(%rip), %rax     # 0x152a58
movq 0x68(%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x8aaed(%rip), %rcx     # 0x123b22
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99048
incq %rax
cmpb %dil, %dl
je 0x99035
cmpb %dil, %dl
jne 0x991a5
movq 0xb9a00(%rip), %rax     # 0x152a58
movq 0x100(%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x867e3(%rip), %rcx     # 0x11f850
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99080
incq %rax
cmpb %dil, %dl
je 0x9906d
cmpb %dil, %dl
jne 0x991a5
movq 0xb99c8(%rip), %rax     # 0x152a58
movq 0xd8(%rax), %rax
jmp 0x98d5b
xorl %eax, %eax
leaq 0x867a2(%rip), %rcx     # 0x11f847
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99190
incq %rax
cmpb %dil, %dl
je 0x990a5
jmp 0x99190
movb 0x2(%r14), %r10b
xorl %ecx, %ecx
testb %r10b, %r10b
je 0x99156
leaq 0x3(%r14), %rdx
movb $0x1, %sil
leaq 0xc4582(%rip), %rdi     # 0x15d660
xorl %r8d, %r8d
movsbq %r10b, %r9
movl (%rdi,%r9,4), %r9d
movl %r8d, %r10d
shll $0x4, %r10d
addl %r9d, %r10d
cmpl $0x10, %r9d
movzbl %sil, %esi
cmovgel %ecx, %esi
cmovll %r10d, %r8d
movb (%rdx), %r10b
cmpl $0x100, %r8d            # imm = 0x100
setb %r9b
andb %sil, %r9b
testb %r10b, %r10b
je 0x99120
incq %rdx
testb %r9b, %r9b
jne 0x990e1
movl %r8d, %ecx
jmp 0x99159
xorl %eax, %eax
leaq 0x8aa06(%rip), %rcx     # 0x123b34
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99141
incq %rax
cmpb %dil, %dl
je 0x9912e
cmpb %dil, %dl
jne 0x991a5
movq 0xb990b(%rip), %rax     # 0x152a58
movq 0x48(%rax), %rax
jmp 0x98d5b
movb $0x1, %r9b
testb %r9b, %r9b
je 0x99169
movq 0xb98f3(%rip), %rax     # 0x152a58
movq (%rax,%rcx,8), %rax
testb %r9b, %r9b
jne 0x98d5b
jmp 0x991a5
xorl %eax, %eax
leaq 0x8a9ad(%rip), %rcx     # 0x123b2a
movb (%rsi,%rax), %dl
movb (%rax,%rcx), %dil
testb %dl, %dl
je 0x99190
incq %rax
cmpb %dil, %dl
je 0x9917d
cmpb %dil, %dl
jne 0x991a5
movq 0xb98bc(%rip), %rax     # 0x152a58
movq 0x50(%rax), %rax
jmp 0x98d5b
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9a177