// File: /workspace/github_c_makefile_star2_O0/RodionGork[P]tinyscheme/scheme.c
// Function: scheme_deinit
void scheme_deinit(scheme * sc) {
  int i;

#if SHOW_ERROR_LINE
  char *fname;
#endif

  sc->oblist = sc->NIL;
  sc->global_env = sc->NIL;
  dump_stack_free(sc);
  sc->envir = sc->NIL;
  sc->code = sc->NIL;
  sc->args = sc->NIL;
  sc->value = sc->NIL;
  if (is_port(sc->inport)) {
    typeflag(sc->inport) = T_ATOM;
  }
  sc->inport = sc->NIL;
  sc->outport = sc->NIL;
  if (is_port(sc->save_inport)) {
    typeflag(sc->save_inport) = T_ATOM;
  }
  sc->save_inport = sc->NIL;
  if (is_port(sc->loadport)) {
    typeflag(sc->loadport) = T_ATOM;
  }
  sc->loadport = sc->NIL;
  sc->free(sc->strbuff);
  sc->gc_verbose = 0;
  gc(sc, sc->NIL, sc->NIL);

  for (i = 0; i <= sc->last_cell_seg; i++) {
    sc->free(sc->alloc_seg[i]);
  }
  sc->free(sc->cell_seg);
  sc->free(sc->alloc_seg);

#if SHOW_ERROR_LINE
  for (i = 0; i <= sc->file_i; i++) {
    if (sc->load_stack[i].kind & port_file) {
      fname = sc->load_stack[i].rep.stdio.filename;
      if (fname)
        sc->free(fname);
    }
  }
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0xf8(%rax)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x100(%rax)
movq 0x10(%rsp), %rdi
callq 0x6a50
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0xec0(%rax)
movq 0x10(%rsp), %rax
movq 0x170(%rax), %rdi
callq 0x4650
cmpl $0x0, %eax
je 0x6862
movq 0x10(%rsp), %rax
movq 0x170(%rax), %rax
movl $0x4000, (%rax)         # imm = 0x4000
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x170(%rax)
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x178(%rax)
movq 0x10(%rsp), %rax
movq 0x180(%rax), %rdi
callq 0x4650
cmpl $0x0, %eax
je 0x68ba
movq 0x10(%rsp), %rax
movq 0x180(%rax), %rax
movl $0x4000, (%rax)         # imm = 0x4000
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x180(%rax)
movq 0x10(%rsp), %rax
movq 0x188(%rax), %rdi
callq 0x4650
cmpl $0x0, %eax
je 0x68fa
movq 0x10(%rsp), %rax
movq 0x188(%rax), %rax
movl $0x4000, (%rax)         # imm = 0x4000
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x188(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0xea0(%rcx), %rdi
callq *%rax
movq 0x10(%rsp), %rax
movb $0x0, 0xa98(%rax)
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rsi
movq 0x10(%rsp), %rax
movq 0x90(%rax), %rdx
callq 0x6a70
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jg 0x6997
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rcx
movslq 0xc(%rsp), %rdx
movq (%rcx,%rdx,8), %rdi
callq *%rax
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x695f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rdi
callq *%rax
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0xa90(%rcx), %eax
jg 0x6a40
movq 0x10(%rsp), %rax
addq $0x190, %rax            # imm = 0x190
movslq 0xc(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6a31
movq 0x10(%rsp), %rax
addq $0x190, %rax            # imm = 0x190
movslq 0xc(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x6a2f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rsp), %rdi
callq *%rax
jmp 0x6a31
jmp 0x6a33
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x69c7
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)