// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: resize_heap_to
static void resize_heap_to(s7_scheme *sc, int64_t size)
    {
        int64_t old_size, old_free, k;
        s7_cell *cells;
        s7_pointer p;
        heap_block_t *hp;

        old_size = sc->heap_size;
        old_free = sc->free_heap_top - sc->free_heap;
        if (size == 0)
        {
            if (sc->heap_size < 8192000)
                sc->heap_size *= 4;          /* *8 if < 1M (or whatever) doesn't make much difference */
            else sc->heap_size *= 2;
        }
        else
        {
            if (size > sc->heap_size)
                while (sc->heap_size < size) sc->heap_size *= 2;
        }
        /* do not call new_cell here! */

        sc->heap = (s7_cell **)realloc(sc->heap, sc->heap_size * sizeof(s7_cell *));
        if (!(sc->heap))
            s7_warn(sc, 256, "heap reallocation failed! tried to get %" print_s7_int " bytes\n", (int64_t)(sc->heap_size * sizeof(s7_cell *)));

        sc->free_heap = (s7_cell **)realloc(sc->free_heap, sc->heap_size * sizeof(s7_cell *));
        if (!(sc->free_heap))
            s7_warn(sc, 256, "free heap reallocation failed! tried to get %" print_s7_int " bytes\n", (int64_t)(sc->heap_size * sizeof(s7_cell *)));

        sc->free_heap_trigger = (s7_cell **)(sc->free_heap + GC_TRIGGER_SIZE);
        sc->free_heap_top = sc->free_heap + old_free; /* incremented below, added old_free 21-Aug-12?!? */

        cells = (s7_cell *)calloc(sc->heap_size - old_size, sizeof(s7_cell));
        for (p = cells, k = old_size; k < sc->heap_size;)
        {
            LOOP_8(sc->heap[k++] = p; (*sc->free_heap_top++) = p++);
            LOOP_8(sc->heap[k++] = p; (*sc->free_heap_top++) = p++);
            LOOP_8(sc->heap[k++] = p; (*sc->free_heap_top++) = p++);
            LOOP_8(sc->heap[k++] = p; (*sc->free_heap_top++) = p++);
        }
        hp = (heap_block_t *)malloc(sizeof(heap_block_t));
        hp->start = (intptr_t)cells;
        hp->end = (intptr_t)cells + ((sc->heap_size - old_size) * sizeof(s7_cell));
        hp->offset = old_size;
        hp->next = sc->heap_blocks;
        sc->heap_blocks = hp;

        sc->previous_free_heap_top = sc->free_heap_top;

        if (show_heap_stats(sc))
            s7_warn(sc, 256, "heap grows to %" print_s7_int " (old free/size: %" print_s7_int "/%" print_s7_int ")\n", sc->heap_size, old_free, old_size);

        if (sc->heap_size >= sc->max_heap_size)
            s7_error(sc, make_symbol(sc, "heap-too-big"), set_elist_1(sc, wrap_string(sc, "heap has grown past (*s7* 'max-heap-size)", 41)));
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x90(%rdi), %r15
movq 0xa8(%rdi), %r14
testq %rsi, %rsi
je 0x92906
cmpq %rsi, %r14
jge 0x92924
movq %r14, %rax
addq %rax, %rax
cmpq %rsi, %rax
jl 0x928fc
jmp 0x9291d
cmpq $0x7cffff, %r14         # imm = 0x7CFFFF
jg 0x92919
leaq (,%r14,4), %rax
jmp 0x9291d
leaq (%r14,%r14), %rax
movq %rax, 0xa8(%rbx)
subq 0x88(%rbx), %r15
movq 0x80(%rbx), %rdi
movq 0xa8(%rbx), %rsi
shlq $0x3, %rsi
callq 0x9510
movq %rax, 0x80(%rbx)
testq %rax, %rax
jne 0x9296f
movq 0xa8(%rbx), %rcx
shlq $0x3, %rcx
leaq 0x8cae0(%rip), %rdx     # 0x11f440
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfc3d
movq 0x88(%rbx), %rdi
movq 0xa8(%rbx), %rsi
shlq $0x3, %rsi
callq 0x9510
movq %rax, 0x88(%rbx)
testq %rax, %rax
jne 0x929b3
movq 0xa8(%rbx), %rcx
shlq $0x3, %rcx
leaq 0x8ca97(%rip), %rdx     # 0x11f43b
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfc3d
movq 0x88(%rbx), %rax
movq 0xa8(%rbx), %r13
leaq 0x200(%rax), %rcx
movq %rcx, 0x98(%rbx)
addq %r15, %rax
movq %rax, 0x90(%rbx)
movq %r13, %rdi
subq %r14, %rdi
movl $0x30, %esi
callq 0x9360
movq %rax, %r12
movq %r13, %rbp
subq %r14, %rbp
jle 0x92f34
movq %r14, %rax
movq %r12, %rcx
movq 0x80(%rbx), %rdx
movq %rcx, (%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq %rcx, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x30(%rcx), %rsi
movq %rsi, 0x8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x60(%rcx), %rsi
movq %rsi, 0x10(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x90(%rcx), %rsi
movq %rsi, 0x18(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0xc0(%rcx), %rsi
movq %rsi, 0x20(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0xf0(%rcx), %rsi
movq %rsi, 0x28(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x120(%rcx), %rsi
movq %rsi, 0x30(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x150(%rcx), %rsi
movq %rsi, 0x38(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x180(%rcx), %rsi
movq %rsi, 0x40(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x1b0(%rcx), %rsi
movq %rsi, 0x48(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x1e0(%rcx), %rsi
movq %rsi, 0x50(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x210(%rcx), %rsi
movq %rsi, 0x58(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x240(%rcx), %rsi
movq %rsi, 0x60(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x270(%rcx), %rsi
movq %rsi, 0x68(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x2a0(%rcx), %rsi
movq %rsi, 0x70(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x2d0(%rcx), %rsi
movq %rsi, 0x78(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x300(%rcx), %rsi
movq %rsi, 0x80(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x330(%rcx), %rsi
movq %rsi, 0x88(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x360(%rcx), %rsi
movq %rsi, 0x90(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x390(%rcx), %rsi
movq %rsi, 0x98(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x3c0(%rcx), %rsi
movq %rsi, 0xa0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x3f0(%rcx), %rsi
movq %rsi, 0xa8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x420(%rcx), %rsi
movq %rsi, 0xb0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x450(%rcx), %rsi
movq %rsi, 0xb8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x480(%rcx), %rsi
movq %rsi, 0xc0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x4b0(%rcx), %rsi
movq %rsi, 0xc8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x4e0(%rcx), %rsi
movq %rsi, 0xd0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x510(%rcx), %rsi
movq %rsi, 0xd8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x540(%rcx), %rsi
movq %rsi, 0xe0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x570(%rcx), %rsi
movq %rsi, 0xe8(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x5a0(%rcx), %rsi
movq %rsi, 0xf0(%rdx,%rax,8)
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
movq 0x80(%rbx), %rdx
leaq 0x5d0(%rcx), %rsi
movq %rsi, 0xf8(%rdx,%rax,8)
addq $0x20, %rax
movq 0x90(%rbx), %rdx
leaq 0x8(%rdx), %rdi
movq %rdi, 0x90(%rbx)
movq %rsi, (%rdx)
addq $0x600, %rcx            # imm = 0x600
cmpq %r13, %rax
jl 0x929fe
movl $0x20, %edi
callq 0x9480
movq %r12, (%rax)
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
shlq $0x4, %rcx
addq %r12, %rcx
movq %rcx, 0x8(%rax)
movq %r14, 0x10(%rax)
movq 0x2a68(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x2a68(%rbx)
movq 0x90(%rbx), %rax
movq %rax, 0xa0(%rbx)
testb $0x2, 0x21c(%rbx)
je 0x92fab
sarq $0x3, %r15
movq 0xa8(%rbx), %rcx
leaq 0x8c4dc(%rip), %rdx     # 0x11f472
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0xfc3d
movq 0xa8(%rbx), %rax
cmpq 0xb8(%rbx), %rax
jge 0x92fca
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x6f6f742dd7cac795, %rcx # imm = 0x6F6F742DD7CAC795
movq 0x148(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x3b978(%rax), %rax
cmpb $0x1, (%rax)
jne 0x9303b
leaq 0x8c4ac(%rip), %rdx     # 0x11f49e
leaq -0x6769622d(%rcx), %rsi
cmpq %rcx, 0x18(%rax)
jne 0x93032
cmpl $0xc, 0x2c(%rax)
jne 0x93032
movq 0x20(%rax), %rdi
cmpq %rsi, (%rdi)
jne 0x93032
xorl %r8d, %r8d
movb 0x8(%r8,%rdx), %r9b
movb 0x8(%rdi,%r8), %r10b
cmpb %r10b, %r9b
jne 0x9302d
leaq 0x1(%r8), %r11
cmpq $0x3, %r8
movq %r11, %r8
jne 0x93011
cmpb %r10b, %r9b
je 0x930b0
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0x92ff9
leaq 0x8c45c(%rip), %rsi     # 0x11f49e
movl $0xc, %edx
movq %rbx, %rdi
movl $0x772f, %r8d           # imm = 0x772F
callq 0xa5ef
movq %rax, %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x8c42f(%rip), %rcx     # 0x11f4ab
movq %rcx, 0x10(%rax)
movq $0x29, 0x8(%rax)
movq 0x6d8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6d8(%rbx), %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b366
movq 0x8(%rax), %rsi
jmp 0x93058