// File: /workspace/github_c_makefile_star2_O1/RodionGork[P]tinyscheme/scheme.c
// Function: atom2str
static void atom2str(scheme * sc, pointer l, int f, char **pp, int *plen) {
  char *p;

  *plen = -1;
  if (l == sc->NIL) {
    p = "()";
  } else if (l == sc->T) {
    p = "#t";
  } else if (l == sc->F) {
    p = "#f";
  } else if (l == sc->EOF_OBJ) {
    p = "#<EOF>";
  } else if (is_port(l)) {
    p = "#<PORT>";
  } else if (is_number(l)) {
    p = sc->strbuff;
    if (f <= 1 || f == 10) {    /* f is the base for numbers if > 1 */
      if (num_is_integer(l)) {
        sprintf(p, "%ld", ivalue_unchecked(l));
      } else {
        if (rvalue_unchecked(l) * 0.0 != 0.0) { // is +/-inf or nan
          if (rvalue_unchecked(l) > 0) {
            strcpy(p, "+inf");
          } else if (rvalue_unchecked(l) < 0) {
            strcpy(p, "-inf");
          } else {
            strcpy(p, "+nan");
          }
        } else {
          sprintf(p, "%.10g", rvalue_unchecked(l));
        }
        /* r5rs says there must be a '.' (unless 'e'?) */
        f = strcspn(p, ".e");
        if (p[f] == 0) {
          p[f] = '.';           /* not found, so add '.0' at the end */
          p[f + 1] = '0';
          p[f + 2] = 0;
        }
      }
    } else {
      long v = ivalue(l);
      if (f >= 2 && f <= 36) {
        long_to_str(v, p, f);
      } else {
        *p = '\0';
      }
    }
  } else if (is_string(l)) {
    if (!f) {
      p = strvalue(l);
      if (IS_ASCII(*p)) {
        *plen = strlength(l);
      } else {
        string_to_utf8(sc, strvalue(l), strlength(l));
        p = sc->strbuff;
      }
    } else {                    /* Hack, uses the fact that printing is needed */
      *pp = sc->strbuff;
      *plen = 0;
      printslashstring(sc, strvalue(l), strlength(l));
      return;
    }
  } else if (is_character(l)) {
    int c = charvalue(l);
    p = sc->strbuff;
    if (!f) {
      char_to_utf8(c, p, plen);
    } else {
      switch (c) {
      case ' ':
        p = "#\\space";
        break;
      case '\n':
        p = "#\\newline";
        break;
      case '\r':
        p = "#\\return";
        break;
      case '\t':
        p = "#\\tab";
        break;
      default:
        if (c < 32 || c >= 0x80) {
          sprintf(p, "#\\x%x", c);
          break;
        }
        sprintf(p, "#\\%c", c);
        break;
      }
    }
  } else if (is_symbol(l)) {
    p = symname(l);
  } else if (is_proc(l)) {
    p = sc->strbuff;
    snprintf(p, sc->strbuff_size, "#<%s PROCEDURE %ld>", procname(l), procnum(l));
  } else if (is_macro(l)) {
    p = "#<MACRO>";
  } else if (is_closure(l)) {
    p = "#<CLOSURE>";
  } else if (is_promise(l)) {
    p = "#<PROMISE>";
  } else if (is_foreign(l)) {
    p = sc->strbuff;
    snprintf(p, sc->strbuff_size, "#<FOREIGN PROCEDURE %ld>", procnum(l));
  } else if (is_continuation(l)) {
    p = "#<CONTINUATION>";
  } else if (is_bvector(l)) {
    p = sc->strbuff;
    sprintf(p, "#u8(len=%d)", strlength(l));
  } else {
    p = "#<ERROR>";
  }
  *pp = p;
  if (*plen < 0) {
    *plen = strlen(p);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
cmpq %rsi, 0x90(%rdi)
je 0xbe66
movq %rdi, %r12
cmpq %rsi, 0xb0(%rdi)
je 0xbe6f
cmpq %rsi, 0xd0(%r12)
je 0xbe78
cmpq %rsi, 0xf0(%r12)
je 0xbe81
movl (%rsi), %eax
andl $0x1f, %eax
decl %eax
cmpl $0xe, %eax
ja 0xbfb8
leaq 0x15a1(%rip), %rcx      # 0xd3c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testl %edx, %edx
je 0xbfd5
movq 0xea0(%r12), %rax
movq %rax, (%r14)
movl $0x0, (%rbx)
movq 0x8(%rsi), %rax
movl 0x10(%rsi), %edx
movq %r12, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc2e4
leaq 0x24ee(%rip), %r15      # 0xe35b
jmp 0xbe88
leaq 0x221f(%rip), %r15      # 0xe095
jmp 0xbe88
leaq 0x2219(%rip), %r15      # 0xe098
jmp 0xbe88
leaq 0x2213(%rip), %r15      # 0xe09b
movq %r15, (%r14)
cmpl $0x0, (%rbx)
jns 0xbe9a
movq %r15, %rdi
callq 0x40c0
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2269(%rip), %r15      # 0xe116
jmp 0xbe88
movq 0x8(%rsi), %rax
movq 0x8(%rax), %r15
jmp 0xbe88
leaq 0x227a(%rip), %r15      # 0xe13a
jmp 0xbe88
movq 0xea0(%r12), %r15
movl 0x10(%rsi), %edx
leaq 0x2276(%rip), %rsi      # 0xe14a
movq %r15, %rdi
xorl %eax, %eax
callq 0x4290
jmp 0xbe88
movq 0xea0(%r12), %r15
cmpl $0x2, %edx
setge %cl
cmpl $0xa, %edx
setne %dil
movb 0x8(%rsi), %al
testb %dil, %cl
jne 0xbfc4
testb %al, %al
je 0xc098
movq 0x10(%rsi), %rdx
leaq 0x158b(%rip), %rsi      # 0xd49f
movq %r15, %rdi
xorl %eax, %eax
callq 0x4290
jmp 0xbe88
movq 0xea0(%r12), %r15
movslq 0xea8(%r12), %rax
cmpb $0x0, 0x8(%rsi)
je 0xbfed
movq 0x10(%rsi), %rcx
jmp 0xbff3
movl 0x10(%rsi), %eax
movq 0xea0(%r12), %r15
testl %edx, %edx
je 0xc00c
cmpl $0xc, %eax
jg 0xc07e
cmpl $0x9, %eax
je 0xc116
cmpl $0xa, %eax
jne 0xc105
leaq 0x214f(%rip), %r15      # 0xe0ca
jmp 0xbe88
movb 0x8(%rsi), %dl
testb %dl, %dl
je 0xc01e
movq 0x10(%rsi), %rcx
jmp 0xc024
leaq 0x2170(%rip), %r15      # 0xe10b
jmp 0xbe88
leaq 0x215b(%rip), %r15      # 0xe102
jmp 0xbe88
leaq 0x20ef(%rip), %r15      # 0xe0a2
jmp 0xbe88
leaq 0x2197(%rip), %r15      # 0xe156
jmp 0xbe88
testb %al, %al
je 0xc0cc
movq 0x10(%rsi), %rdi
jmp 0xc0d2
movq 0x8(%rsi), %r15
cmpb $0x0, (%r15)
movl 0x10(%rsi), %edx
js 0xc0ed
movl %edx, (%rbx)
jmp 0xbe88
cvttsd2si 0x10(%rsi), %rcx
leaq 0x2127(%rip), %rdx      # 0xe121
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x40e0
jmp 0xbe88
movl %eax, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc466
jmp 0xbe88
cvttsd2si 0x10(%rsi), %rcx
movq 0xea0(%r12), %r15
movslq 0xea8(%r12), %rax
movslq %ecx, %rcx
shlq $0x5, %rcx
leaq 0x54de(%rip), %rdi      # 0x11520
movq 0x8(%rcx,%rdi), %rdi
testq %rdi, %rdi
leaq 0x210e(%rip), %rcx      # 0xe15f
cmovneq %rdi, %rcx
testb %dl, %dl
je 0xc05f
movq 0x10(%rsi), %r8
jmp 0xc065
cvttsd2si 0x10(%rsi), %r8
leaq 0x2082(%rip), %rdx      # 0xe0ee
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x40e0
jmp 0xbe88
cmpl $0xd, %eax
je 0xc122
cmpl $0x20, %eax
jne 0xc105
leaq 0x202f(%rip), %r15      # 0xe0c2
jmp 0xbe88
movsd 0x10(%rsi), %xmm0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm1, %xmm2
jne 0xc0b1
jnp 0xc12e
ucomisd %xmm1, %xmm0
jbe 0xc152
movb $0x0, 0x4(%r15)
movl $0x666e692b, (%r15)     # imm = 0x666E692B
jmp 0xc172
cvttsd2si 0x10(%rsi), %rdi
cmpl $0x24, %edx
jg 0xc0e4
movq %r15, %rsi
callq 0x4c95
jmp 0xbe88
movb $0x0, (%r15)
jmp 0xbe88
movq %r12, %rdi
movq %r15, %rsi
callq 0xc22b
movq 0xea0(%r12), %r15
jmp 0xbe88
leal -0x80(%rax), %ecx
cmpl $-0x61, %ecx
ja 0xc141
leaq 0x1fcf(%rip), %rsi      # 0xe0e3
jmp 0xc148
leaq 0x1fc0(%rip), %r15      # 0xe0dd
jmp 0xbe88
leaq 0x1fab(%rip), %r15      # 0xe0d4
jmp 0xbe88
leaq 0x1f84(%rip), %rsi      # 0xe0b9
movq %r15, %rdi
movb $0x1, %al
callq 0x4290
jmp 0xc172
leaq 0x1fa1(%rip), %rsi      # 0xe0e9
movq %r15, %rdi
movl %eax, %edx
jmp 0xbed7
ucomisd %xmm0, %xmm1
jbe 0xc166
movb $0x0, 0x4(%r15)
movl $0x666e692d, (%r15)     # imm = 0x666E692D
jmp 0xc172
movb $0x0, 0x4(%r15)
movl $0x6e616e2b, (%r15)     # imm = 0x6E616E2B
leaq 0x1f46(%rip), %rsi      # 0xe0bf
movq %r15, %rdi
callq 0x4180
movslq %eax, %rcx
cmpb $0x0, (%r15,%rcx)
jne 0xbe88
shlq $0x20, %rax
movb $0x2e, (%r15,%rcx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rax, %rcx
sarq $0x20, %rcx
movb $0x30, (%r15,%rcx)
movabsq $0x200000000, %rcx      # imm = 0x200000000
addq %rax, %rcx
sarq $0x20, %rcx
movb $0x0, (%r15,%rcx)
jmp 0xbe88