// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: resize_stack
static void resize_stack(s7_scheme *sc)
    {
        uint64_t loc;
        uint32_t new_size;
        block_t *ob, *nb;

        loc = s7_stack_top(sc);
        new_size = sc->stack_size * 2;

        /* how can we trap infinite recursion?  Is a warning in order here? I think I'll add 'max-stack-size */
        if (new_size > sc->max_stack_size)
            s7_error(sc, make_symbol(sc, "stack-too-big"), set_elist_1(sc, wrap_string(sc, "stack has grown past (*s7* 'max-stack-size)", 43)));

        ob = stack_block(sc->stack);
        nb = reallocate(sc, ob, new_size * sizeof(s7_pointer));
        block_info(nb) = NULL;
        stack_block(sc->stack) = nb;
        stack_elements(sc->stack) = (s7_pointer *)block_data(nb);
        if (!stack_elements(sc->stack))
        {
            s7_warn(sc, 32, "can't allocate additional stack\n");
#if S7_DEBUGGING
            abort();
#endif
            s7_error(sc, make_symbol(sc, "stack-too-big"), set_elist_1(sc, wrap_string(sc, "no room to expand stack?", 24)));
        }
        {
            s7_pointer *orig;
            s7_int i, left;
            i = sc->stack_size;
            left = new_size - i - 8;
            orig = stack_elements(sc->stack);
            while (i <= left)
                LOOP_8(orig[i++] = sc->nil);
            for (; i < new_size; i++)
                orig[i] = sc->nil;
        }
        vector_length(sc->stack) = new_size;
        sc->stack_size = new_size;

        sc->stack_start = stack_elements(sc->stack);
        sc->stack_end = (s7_pointer *)(sc->stack_start + loc);
        sc->stack_resize_trigger = (s7_pointer *)(sc->stack_start + sc->stack_size / 2);

        if (show_stack_stats(sc))
        {
            s7_warn(sc, 128, "stack grows to %u, %s\n", new_size, DISPLAY_80(sc->code));
            s7_show_let(sc);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x50(%rdi), %r15
subq 0x48(%rdi), %r15
movl 0x40(%rdi), %r14d
leal (%r14,%r14), %ebp
cmpl 0x7c(%rdi), %ebp
jbe 0x91d2b
leaq 0x51a02(%rip), %rsi     # 0xe36d8
movq %rbx, %rdi
callq 0x94d4
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x519e4(%rip), %rdx     # 0xe36e6
movq %rdx, 0x10(%rcx)
movq $0x2b, 0x8(%rcx)
movq 0x6d8(%rbx), %rdx
movq %rcx, 0x8(%rdx)
movq 0x6d8(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2cdc0
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rsi
movl %ebp, %r12d
leaq (,%r12,8), %rdx
movq %rbx, %rdi
callq 0x9859
andq $0x0, 0x20(%rax)
movq 0x38(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq (%rax), %rax
movq 0x38(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x91de3
leaq 0x519a0(%rip), %rdx     # 0xe3712
pushq $0x20
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xd5c7
leaq 0x51952(%rip), %rsi     # 0xe36d8
movq %rbx, %rdi
callq 0x94d4
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x51981(%rip), %rdx     # 0xe3733
movq %rdx, 0x10(%rcx)
movq $0x18, 0x8(%rcx)
movq 0x6d8(%rbx), %rdx
movq %rcx, 0x8(%rdx)
movq 0x6d8(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2cdc0
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
movl 0x40(%rbx), %ecx
movq %r12, %rdx
subq %rcx, %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
jg 0x91e4c
movq 0x110(%rbx), %rsi
movq %rsi, (%rax,%rcx,8)
movq %rsi, 0x8(%rax,%rcx,8)
movq 0x110(%rbx), %rsi
movq %rsi, 0x10(%rax,%rcx,8)
movq %rsi, 0x18(%rax,%rcx,8)
movq 0x110(%rbx), %rsi
movq %rsi, 0x20(%rax,%rcx,8)
movq %rsi, 0x28(%rax,%rcx,8)
movq 0x110(%rbx), %rsi
movq %rsi, 0x30(%rax,%rcx,8)
movq %rsi, 0x38(%rax,%rcx,8)
addq $0x8, %rcx
jmp 0x91df0
movq 0x110(%rbx), %rdx
movq %rdx, (%rax,%rcx,8)
incq %rcx
cmpq %r12, %rcx
jb 0x91e3e
movq 0x38(%rbx), %rax
movq %r12, 0x8(%rax)
movl %ebp, 0x40(%rbx)
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rbx)
addq %rax, %r15
movq %r15, 0x50(%rbx)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq (%rax,%r14,8), %rax
movq %rax, 0x58(%rbx)
testb $0x4, 0x21c(%rbx)
jne 0x91e90
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rsi
pushq $0x50
popq %rdx
movq %rbx, %rdi
callq 0x36076
movq 0x10(%rax), %r8
leaq 0x518a3(%rip), %rdx     # 0xe374c
movl $0x80, %esi
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0xd5c7
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b718