// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_call_cc
static s7_pointer g_call_cc(s7_scheme *sc, s7_pointer args)
    {
#define H_call_cc "(call-with-current-continuation (lambda (continuer)...)) is always a mistake!"
#define Q_call_cc s7_make_signature(sc, 2, sc->T, sc->is_procedure_symbol)

        s7_pointer p;
        p = car(args);                             /* this is the procedure passed to call/cc */
        if (!is_t_procedure(p))                    /* this includes continuations */
        {
            check_method(sc, p, sc->call_cc_symbol, args);
            check_method(sc, p, sc->call_with_current_continuation_symbol, args);
            return(simple_wrong_type_argument_with_type(sc, sc->call_cc_symbol, p, a_procedure_string));
        }
        if (!s7_is_aritable(sc, p, 1))
            return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_2(sc, wrap_string(sc, "call/cc procedure, ~A, should take one argument", 47), p)));

        sc->w = s7_make_continuation(sc);
        push_stack(sc, OP_APPLY, list_1(sc, sc->w), p);
        sc->w = sc->nil;

        return(sc->nil);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
leaq 0xb7461(%rip), %rcx     # 0x11b330
cmpb $0x0, (%rax,%rcx)
je 0x63f88
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32378
testb %al, %al
je 0x6404a
movq %rbx, %rdi
callq 0xb532
movq %rax, 0x4d8(%rbx)
movq 0x50(%rbx), %rax
movq %r14, (%rax)
movq 0x8(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x4d8(%rbx), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x63f3e
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r14, 0x8(%rax)
movq %r15, 0x10(%rax)
movq 0x50(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x50(%rbx), %rax
movq $0x198, 0x18(%rax)      # imm = 0x198
addq $0x20, 0x50(%rbx)
movq 0x110(%rbx), %r15
movq %r15, 0x4d8(%rbx)
jmp 0x640ad
testb $0x40, 0x3(%r14)
je 0x6401b
movq %rsi, %r15
cmpb $0x1, 0x24c(%rbx)
jne 0x63fc5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0xce8(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
jne 0x63ff4
cmpb $0x1, 0x24c(%rbx)
jne 0x6401b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0xcf0(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x6401b
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x35492
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa34c
movq 0xce8(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x140(%rbx), %rcx
movq 0xc05cc(%rip), %r8      # 0x124600
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd456
movq 0x1940(%rbx), %r15
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x83c42(%rip), %rcx     # 0xe7cb7
movq %rcx, 0x10(%rax)
movq $0x2f, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2cdc0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq