// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: call_begin_hook
static bool call_begin_hook(s7_scheme *sc)
                {
                    bool result = false;
                    /* originally begin_hook was bool (*hook)(s7_scheme *sc): the value was returned directly,
                     *   rather than going through a *bool arg (&result below).  That works in gcc (Linux/OSX),
                     *   but does not work in MS Visual C++.  In the latter, the compiler apparently completely
                     *   eliminates any local, returning (for example) a thread-relative stack-allocated value
                     *   directly, but then by the time we get here, that variable has vanished, and we get
                     *   garbage.  We had to thwart the optimization by adding if ((flag) && (!flag)) fprintf(...);
                     *   So, in the new form (26-Jun-13), the value is passed directly into an s7 variable
                     *   that I hope can't be optimized out of existence.
                     */
                    opcode_t op;
                    op = sc->cur_op;

                    push_stack(sc, OP_BARRIER, sc->args, sc->code);
                    sc->begin_hook(sc, &result);
                    if (result)
                    {
                        /* set (owlet) in case we were interrupted and need to see why something was hung */
                        slot_set_value(sc->error_type, sc->F);
                        slot_set_value(sc->error_data, sc->value); /* was sc->F but we now clobber this below */
                        slot_set_value(sc->error_code, current_code(sc));
                        integer(slot_value(sc->error_line)) = 0;
                        slot_set_value(sc->error_file, sc->F);
#if WITH_HISTORY
                        slot_set_value(sc->error_history, sc->F);
#endif
                        set_outlet(sc->owlet, sc->envir);

                        sc->value = make_symbol(sc, "begin-hook-interrupt");
                        /* otherwise the evaluator returns whatever random thing is in sc->value (normally #<closure>)
                         *   which makes debugging unnecessarily difficult.
                         */
                        s7_quit(sc);     /* don't call gc here -- perhaps at restart somehow? */
                        return(true);
                    }
                    pop_stack_no_op(sc);
                    sc->cur_op = op;         /* for better error handling.  otherwise we get "barrier" as the offending function name in eval_error */
                    return(false);
                }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movb $0x0, 0x17(%rsp)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x203, %ecx            # imm = 0x203
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x18(%rsp), %rax
movq 0x680(%rax), %rax
movq 0x18(%rsp), %rdi
leaq 0x17(%rsp), %rsi
callq *%rax
testb $0x1, 0x17(%rsp)
je 0x13e83b
movq 0x18(%rsp), %rax
movq 0x120(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x1a0(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x1a8(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x1b0(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x1b8(%rax), %rax
movq 0x10(%rax), %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x120(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x198(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rdi
leaq 0xb1782(%rip), %rsi     # 0x1eff9b
callq 0xb400
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %rdi
callq 0x46b20
movb $0x1, 0x27(%rsp)
jmp 0x13e88d
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rcx
addq $-0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rsp), %rcx
movq 0x50(%rcx), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
xorl %eax, %eax
testb $0x1, %al
jne 0x13e878
jmp 0x13e87a
jmp 0x13e870
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax,%rax)