// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: call_with_exit
static void call_with_exit(s7_scheme *sc)
    {
        int64_t i, new_stack_top, quit = 0;

        if (!call_exit_active(sc->code))
            s7_error(sc, sc->invalid_escape_function_symbol, set_elist_1(sc, wrap_string(sc, "call-with-exit escape procedure called outside its block", 56)));

        call_exit_active(sc->code) = false;
        new_stack_top = call_exit_goto_loc(sc->code);
        sc->op_stack_now = (s7_pointer *)(sc->op_stack + call_exit_op_loc(sc->code));

        /* look for dynamic-wind in the stack section that we are jumping out of */
        for (i = s7_stack_top(sc) - 1; i > new_stack_top; i -= 4)
        {
            opcode_t op;

            op = stack_op(sc->stack, i);
            switch (op)
            {
                case OP_DYNAMIC_WIND:
                    {
                        s7_pointer lx;
                        lx = stack_code(sc->stack, i);
                        if (dynamic_wind_state(lx) == DWIND_BODY)
                        {
                            dynamic_wind_state(lx) = DWIND_FINISH;
                            if (dynamic_wind_out(lx) != sc->F)
                            {
                                push_stack(sc, OP_EVAL_DONE, sc->args, sc->code);
                                sc->args = sc->nil;
                                sc->code = dynamic_wind_out(lx);
                                eval(sc, OP_APPLY);
                            }}}
                    break;

                case OP_EVAL_STRING:
                    s7_close_input_port(sc, sc->input_port);
                    pop_input_port(sc);
                    break;

                case OP_BARRIER:                /* oops -- we almost certainly went too far */
                    goto SET_VALUE;

                case OP_DEACTIVATE_GOTO:        /* here we're jumping into an unrelated call-with-exit block */
                    call_exit_active(stack_args(sc->stack, i)) = false;
                    break;

                case OP_LET_TEMP_DONE:
                    let_temp_done(sc, stack_args(sc->stack, i), stack_code(sc->stack, i), stack_let(sc->stack, i));
                    break;

                case OP_LET_TEMP_UNWIND:
                    let_temp_unwind(sc, stack_code(sc->stack, i), stack_args(sc->stack, i));
                    break;

                case OP_LET_TEMP_S7_UNWIND:
                    g_s7_let_set_fallback(sc, set_plist_3(sc, sc->s7_let, stack_code(sc->stack, i), stack_args(sc->stack, i)));
                    break;

                    /* call/cc does not close files, but I think call-with-exit should */
                case OP_GET_OUTPUT_STRING:
                case OP_UNWIND_OUTPUT:
                    {
                        s7_pointer x;
                        x = stack_code(sc->stack, i);                /* "code" = port that we opened */
                        s7_close_output_port(sc, x);
                        x = stack_args(sc->stack, i);                /* "args" = port that we shadowed, if not #<unused> */
                        if (x != sc->unused)
                            sc->output_port = x;
                    }
                    break;

                case OP_UNWIND_INPUT:
                    s7_close_input_port(sc, stack_code(sc->stack, i)); /* "code" = port that we opened */
                    sc->input_port = stack_args(sc->stack, i);         /* "args" = port that we shadowed */
                    break;

                case OP_EVAL_DONE: /* goto called in a method -- put off the inner eval return(s) until we clean up the stack */
                    quit++;
                    break;

                default:
                    break;
            }
        }

        /* is this right? maybe the SET_VALUE should skip setting stack_end? */
SET_VALUE:
        sc->stack_end = (s7_pointer *)(sc->stack_start + new_stack_top);

        /* the return value should have an implicit values call, just as in call/cc */
        if (is_null(sc->args))
            sc->value = sc->nil;
        else
        {
            if (is_null(cdr(sc->args)))
                sc->value = car(sc->args);
            else sc->value = splice_in_values(sc, sc->args);
        }

        if (quit > 0)
        {
            if (sc->longjmp_ok)
            {
                pop_stack(sc);
                longjmp(sc->goto_start, CALL_WITH_EXIT_JUMP);
            }
            for (i = 0; i < quit; i++)
                push_stack_op_let(sc, OP_EVAL_DONE);
        }
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x18(%rax)
jne 0x131b8a
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rax
movq 0x1938(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdi
leaq 0xbdf44(%rip), %rsi     # 0x1efaa5
movl $0x38, %edx
callq 0xb880
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xc3820
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x60(%rsp), %rax
movq (%rax), %rax
movb $0x0, 0x18(%rax)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq 0x60(%rax), %rcx
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x48(%rcx), %rcx
subq %rcx, %rax
sarq $0x3, %rax
subq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
jle 0x131f77
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $-0x1ba, %rax           # imm = 0xFE46
movq %rax, 0x10(%rsp)
subq $0x55, %rax
ja 0x131f60
movq 0x10(%rsp), %rax
leaq 0xae82d(%rip), %rcx     # 0x1e046c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x131d39
movq 0x38(%rsp), %rax
movl $0x2, 0x20(%rax)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rcx
cmpq 0x120(%rcx), %rax
je 0x131d37
jmp 0x131c9f
movq 0x60(%rsp), %rax
movq (%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1df, %ecx            # imm = 0x1DF
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x60(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x60(%rsp), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rdi
movl $0x198, %esi            # imm = 0x198
callq 0x163d0
jmp 0x131d39
jmp 0x131f62
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x170(%rax), %rsi
callq 0x14ce0
movq 0x60(%rsp), %rdi
callq 0x274d0
jmp 0x131f62
jmp 0x131f79
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movb $0x0, 0x18(%rax)
jmp 0x131f62
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rsi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x2, %rcx
movq (%rax,%rcx,8), %rcx
callq 0x16e780
jmp 0x131f62
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rsi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
callq 0x16e840
jmp 0x131f62
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x2150(%rax), %rsi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
callq 0x359a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xbe5b0
jmp 0x131f62
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x14f80
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq 0x140(%rcx), %rax
je 0x131f02
movq 0x30(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x188(%rax)
jmp 0x131f62
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x3, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x14ce0
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x170(%rax)
jmp 0x131f62
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x131f62
jmp 0x131f62
jmp 0x131f64
movq 0x58(%rsp), %rax
subq $0x4, %rax
movq %rax, 0x58(%rsp)
jmp 0x131bee
jmp 0x131f79
movq 0x60(%rsp), %rax
movq 0x48(%rax), %rcx
movq 0x50(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x131fc5
movq 0x60(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x132019
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x131ff8
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x132017
movq 0x60(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x28170
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x132019
cmpq $0x0, 0x48(%rsp)
jle 0x1320ec
movq 0x60(%rsp), %rax
testb $0x1, 0x678(%rax)
je 0x132088
jmp 0x132035
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rcx
addq $-0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x60(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x50(%rcx), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rdi
addq $0x5b0, %rdi            # imm = 0x5B0
movl $0x1, %esi
callq 0x9530
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x48(%rsp), %rax
jge 0x1320ea
jmp 0x13209f
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1df, %ecx            # imm = 0x1DF
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
jmp 0x1320da
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x132091
jmp 0x1320ec
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)