// File: /workspace/github_c_makefile_star2_O3/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 0xb9987
leaq 0x5de06(%rip), %rsi     # 0x117738
movq %rbx, %rdi
callq 0x9afc
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x5dde8(%rip), %rdx     # 0x117746
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 0x38dfa
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rsi
movl %ebp, %r12d
leaq (,%r12,8), %rdx
movq %rbx, %rdi
callq 0x9fd6
movq $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 0xb9a44
leaq 0x5dda1(%rip), %rdx     # 0x117772
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeea2
leaq 0x5dd51(%rip), %rsi     # 0x117738
movq %rbx, %rdi
callq 0x9afc
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x5dd80(%rip), %rdx     # 0x117793
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 0x38dfa
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
movl 0x40(%rbx), %esi
movq %r12, %rcx
subq %rsi, %rcx
addq $-0x8, %rcx
cmpq %rsi, %rcx
jl 0xb9aa9
movq 0x110(%rbx), %rdx
movq %rdx, (%rax,%rsi,8)
movq 0x110(%rbx), %rdx
movq %rdx, 0x8(%rax,%rsi,8)
movq %rdx, 0x10(%rax,%rsi,8)
movq 0x110(%rbx), %rdx
movq %rdx, 0x18(%rax,%rsi,8)
movq %rdx, 0x20(%rax,%rsi,8)
movq 0x110(%rbx), %rdx
movq %rdx, 0x28(%rax,%rsi,8)
movq %rdx, 0x30(%rax,%rsi,8)
movq 0x110(%rbx), %rdx
movq %rdx, 0x38(%rax,%rsi,8)
addq $0x8, %rsi
cmpq %rcx, %rsi
jle 0xb9a5d
movq %r12, %rdi
subq %rsi, %rdi
jbe 0xb9b50
movq 0x110(%rbx), %rcx
leaq 0x1(%rdi), %rdx
andq $-0x2, %rdx
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rax,%rsi,8), %rax
addq $0x8, %rax
xorl %esi, %esi
movdqa 0x503ed(%rip), %xmm1    # 0x109ed0
movdqa 0x503f5(%rip), %xmm2    # 0x109ee0
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movq %rsi, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %edi
notl %edi
testb $0x1, %dil
je 0xb9b34
movq %rcx, -0x8(%rax,%rsi,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %edi
testb $0x1, %dil
je 0xb9b47
movq %rcx, (%rax,%rsi,8)
addq $0x2, %rsi
cmpq %rsi, %rdx
jne 0xb9af3
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 0xb9b8f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rsi
movl $0x50, %edx
movq %rbx, %rdi
callq 0x43f21
movq 0x10(%rax), %r8
leaq 0x5dc02(%rip), %rdx     # 0x1177ac
movl $0x80, %esi
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0xeea2
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x379c0