// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r14
orl $-0x1, (%r8)
cmpq %rsi, 0x90(%rdi)
je 0xb154
movq %rdi, %r12
cmpq %rsi, 0xb0(%rdi)
je 0xb160
cmpq %rsi, 0xd0(%r12)
je 0xb169
cmpq %rsi, 0xf0(%r12)
je 0xb172
movl (%rsi), %eax
andl $0x1f, %eax
decl %eax
cmpl $0xe, %eax
ja 0xb2ce
leaq 0x13cf(%rip), %rcx      # 0xc3e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testl %edx, %edx
je 0xb2fb
movq 0xea0(%r12), %rax
movq %rax, (%r14)
andl $0x0, (%rbx)
movq 0x8(%rsi), %rbx
movl 0x10(%rsi), %ebp
pushq $0x22
popq %rsi
movq %r12, %rdi
callq 0x4b12
movzbl (%rbx), %eax
movl %eax, 0x1c(%rsp)
shrl $0x7, %eax
leaq (%rbx,%rax,4), %r15
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
xorl %ebx, %ebx
cmpl %ebp, %ebx
je 0xb2da
cmpb $0x0, 0x1c(%rsp)
js 0xb071
movzbl (%r15), %r13d
incq %r15
jmp 0xb078
movl (%r15), %r13d
addq $0x4, %r15
cmpl $0x20, %r13d
jl 0xb08a
cmpl $0x5c, %r13d
je 0xb08a
cmpl $0x22, %r13d
jne 0xb0c3
movq %r12, %rdi
pushq $0x5c
popq %rsi
callq 0x4b12
cmpl $0x9, %r13d
je 0xb138
cmpl $0x5c, %r13d
je 0xb13c
cmpl $0xd, %r13d
je 0xb101
cmpl $0x22, %r13d
je 0xb13c
cmpl $0xa, %r13d
jne 0xb105
pushq $0x6e
jmp 0xb13a
movl %r13d, %edi
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0xb5be
movl 0xc(%rsp), %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xb147
movsbl 0x10(%rsp,%r14), %esi
movq %r12, %rdi
callq 0x4b12
incq %r14
jmp 0xb0e9
pushq $0x72
jmp 0xb13a
movq %r12, %rdi
pushq $0x78
popq %rsi
callq 0x4b12
movl %r13d, %eax
cltd
pushq $0x10
popq %rcx
idivl %ecx
leal 0x30(%rax), %esi
movl %edx, %r13d
movq %r12, %rdi
callq 0x4b12
movl %r13d, 0xc(%rsp)
cmpl $0x9, %r13d
jg 0xb14e
addl $0x30, %r13d
jmp 0xb13c
pushq $0x74
popq %r13
movq %r12, %rdi
movl %r13d, %esi
callq 0x4b12
incl %ebx
jmp 0xb059
addl $0x37, %r13d
jmp 0xb13c
leaq 0x21c9(%rip), %r15      # 0xd324
movq %r15, (%r14)
jmp 0xb182
leaq 0x1ef7(%rip), %r15      # 0xd05e
jmp 0xb179
leaq 0x1ef1(%rip), %r15      # 0xd061
jmp 0xb179
leaq 0x1eeb(%rip), %r15      # 0xd064
movl (%rbx), %ebp
movq %r15, (%r14)
testl %ebp, %ebp
jns 0xb18c
movq %r15, %rdi
callq 0x40c0
movl %eax, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f3d(%rip), %r15      # 0xd0df
jmp 0xb179
movq 0x8(%rsi), %rax
movq 0x8(%rax), %r15
jmp 0xb179
leaq 0x1f4e(%rip), %r15      # 0xd103
jmp 0xb179
movq 0xea0(%r12), %r15
movl 0x10(%rsi), %edx
leaq 0x1f4a(%rip), %rsi      # 0xd113
movq %r15, %rdi
xorl %eax, %eax
callq 0x4290
jmp 0xb179
movq 0xea0(%r12), %r15
cmpl $0x2, %edx
setge %cl
cmpl $0xa, %edx
setne %dil
movb 0x8(%rsi), %al
testb %dil, %cl
jne 0xb2ea
testb %al, %al
je 0xb398
movq 0x10(%rsi), %rdx
leaq 0x1266(%rip), %rsi      # 0xc46f
movq %r15, %rdi
xorl %eax, %eax
callq 0x4290
jmp 0xb179
movq 0xea0(%r12), %r15
movslq 0xea8(%r12), %rax
cmpb $0x0, 0x8(%rsi)
je 0xb313
movq 0x10(%rsi), %rcx
jmp 0xb319
movl 0x10(%rsi), %eax
movq 0xea0(%r12), %r15
testl %edx, %edx
je 0xb332
cmpl $0x9, %eax
je 0xb49b
cmpl $0x20, %eax
je 0xb483
cmpl $0xd, %eax
je 0xb48f
cmpl $0xa, %eax
jne 0xb4a7
leaq 0x1e1a(%rip), %r15      # 0xd093
jmp 0xb179
movq 0xea0(%r12), %r15
movslq 0xea8(%r12), %rax
movb 0x8(%rsi), %dl
testb %dl, %dl
je 0xb344
movq 0x10(%rsi), %rsi
movq %rsi, %xmm0
movq %rsi, %rcx
jmp 0xb353
leaq 0x1e23(%rip), %r15      # 0xd0d4
jmp 0xb179
leaq 0x1e0e(%rip), %r15      # 0xd0cb
jmp 0xb179
leaq 0x1da2(%rip), %r15      # 0xd06b
jmp 0xb179
leaq 0x1e4a(%rip), %r15      # 0xd11f
jmp 0xb179
pushq $0x22
popq %rsi
movq %r12, %rdi
callq 0x4b12
jmp 0xb18c
testb %al, %al
je 0xb3d0
movq 0x10(%rsi), %rdi
jmp 0xb3d6
movq 0x8(%rsi), %r15
cmpb $0x0, (%r15)
movl 0x10(%rsi), %ebp
js 0xb3f1
movl %ebp, (%rbx)
jmp 0xb17b
cvttsd2si 0x10(%rsi), %rcx
leaq 0x1dca(%rip), %rdx      # 0xd0ea
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x40e0
jmp 0xb179
movl %eax, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xb5be
jmp 0xb179
movsd 0x10(%rsi), %xmm0
cvttsd2si %xmm0, %rcx
movq %xmm0, %rsi
movslq %ecx, %rcx
shlq $0x5, %rcx
leaq 0x51bf(%rip), %rdi      # 0x10520
movq 0x8(%rcx,%rdi), %rdi
testq %rdi, %rdi
leaq 0x1db8(%rip), %rcx      # 0xd128
cmovneq %rdi, %rcx
testb %dl, %dl
cvttsd2si %xmm0, %r8
cmovneq %rsi, %r8
leaq 0x1d31(%rip), %rdx      # 0xd0b7
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x40e0
jmp 0xb179
movsd 0x10(%rsi), %xmm0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm1, %xmm2
jne 0xb3b5
jnp 0xb4b8
ucomisd %xmm1, %xmm0
jbe 0xb4dc
movb $0x0, 0x4(%r15)
movl $0x666e692b, (%r15)     # imm = 0x666E692B
jmp 0xb4fc
cvttsd2si 0x10(%rsi), %rdi
cmpl $0x24, %edx
ja 0xb3e8
movq %r15, %rsi
callq 0x4b79
jmp 0xb179
movb $0x0, (%r15)
jmp 0xb179
movq 0xea0(%r12), %rax
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
xorl %r13d, %r13d
testl %ebp, %ebp
cmovlel %r13d, %ebp
cmpl %r13d, %ebp
je 0xb46e
movl 0x4(%r15,%r13,4), %eax
movl %eax, 0x1c(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0xb62c
testl %eax, %eax
je 0xb469
movq 0x10(%rsp), %rcx
movl 0x1c(%rsp), %edi
testl %edi, %edi
je 0xb459
movq %rcx, %rsi
movq %rcx, 0x20(%rsp)
leaq 0xc(%rsp), %rdx
callq 0xb5be
movslq 0xc(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0xb469
movb $-0x40, (%rcx)
leaq 0x2(%rcx), %rax
movq %rax, 0x10(%rsp)
movb $-0x80, 0x1(%rcx)
incq %r13
jmp 0xb40a
movq 0x10(%rsp), %rax
movb $0x0, (%rax)
movq 0xea0(%r12), %r15
jmp 0xb179
leaq 0x1c01(%rip), %r15      # 0xd08b
jmp 0xb179
leaq 0x1c07(%rip), %r15      # 0xd09d
jmp 0xb179
leaq 0x1c04(%rip), %r15      # 0xd0a6
jmp 0xb179
leal -0x80(%rax), %ecx
cmpl $-0x61, %ecx
ja 0xb4cb
leaq 0x1bf6(%rip), %rsi      # 0xd0ac
jmp 0xb4d2
leaq 0x1bc3(%rip), %rsi      # 0xd082
movq %r15, %rdi
movb $0x1, %al
callq 0x4290
jmp 0xb4fc
leaq 0x1be0(%rip), %rsi      # 0xd0b2
movq %r15, %rdi
movl %eax, %edx
jmp 0xb1cc
ucomisd %xmm0, %xmm1
jbe 0xb4f0
movb $0x0, 0x4(%r15)
movl $0x666e692d, (%r15)     # imm = 0x666E692D
jmp 0xb4fc
movb $0x0, 0x4(%r15)
movl $0x6e616e2b, (%r15)     # imm = 0x6E616E2B
leaq 0x1b85(%rip), %rsi      # 0xd088
movq %r15, %rdi
callq 0x4180
movslq %eax, %rcx
cmpb $0x0, (%r15,%rcx)
jne 0xb179
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 0xb179