// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_call_with_output_string
static s7_pointer g_call_with_output_string(s7_scheme *sc, s7_pointer args)
    {
#define H_call_with_output_string "(call-with-output-string proc) opens a string port applies proc to it, then returns the collected output"
#define Q_call_with_output_string s7_make_signature(sc, 2, sc->is_string_symbol, s7_make_signature(sc, 2, sc->is_procedure_symbol, sc->is_macro_symbol))
        s7_pointer port, proc;

        proc = car(args);
        if (is_let(proc))
            check_method(sc, proc, sc->call_with_output_string_symbol, args);
        if ((!is_any_procedure(proc)) ||        /* this disallows goto/continuation */
                (!s7_is_aritable(sc, proc, 1)))
            return(method_or_bust_with_type(sc, proc, sc->call_with_output_string_symbol, args, wrap_string(sc, "a procedure of one argument (the port)", 38), 1));

        port = s7_open_output_string(sc);
        push_stack(sc, OP_UNWIND_OUTPUT, sc->unused, port);     /* #<unused> here is a marker (needed) */
        push_stack(sc, OP_GET_OUTPUT_STRING, sc->unused, port); /* args checked in call_with_exit */
        push_stack(sc, OP_APPLY, list_1(sc, port), proc);
        return(sc->F);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movb (%r14), %r13b
cmpb $0x1c, %r13b
jne 0x500fa
movq (%r14), %r13
btl $0x1e, %r13d
jae 0x500fa
cmpb $0x1, 0x24c(%rbx)
jne 0x500fa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0xd18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x500fa
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x35492
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xa34c
cmpb $0x28, %r13b
jb 0x50214
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32378
testb %al, %al
je 0x50214
movq %rbx, %rdi
callq 0xdc08
movq %rax, %r15
movq 0x50(%rbx), %rax
movq %r15, (%rax)
movq 0x8(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x50(%rbx), %rax
movq 0x140(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x50(%rbx), %rax
movq $0x1ef, 0x18(%rax)      # imm = 0x1EF
movq 0x50(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x50(%rbx)
movq %r15, 0x20(%rax)
movq 0x8(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x50(%rbx), %rax
movq 0x140(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq 0x50(%rbx), %rax
movq $0x207, 0x18(%rax)      # imm = 0x207
movq 0x50(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x50(%rbx)
movq %r14, 0x20(%rax)
movq 0x8(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r14
cmpq 0x98(%rbx), %rax
ja 0x501cc
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 %r15, 0x8(%rax)
movq %r14, 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 0x120(%rbx), %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xd18(%rbx), %rdx
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %r8
leal 0x1(%rcx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0x97430(%rip), %rax     # 0xe7670
movq %rax, 0x10(%r8)
movq $0x26, 0x8(%r8)
pushq $0x1
popq %r9
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcf9a