// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_c_pointer
static s7_pointer g_c_pointer(s7_scheme *sc, s7_pointer args)
    {
#define H_c_pointer "(c-pointer int type info unmarked) returns a c-pointer object. The type and info args are optional, defaulting to #f."
#define Q_c_pointer s7_make_circular_signature(sc, 2, 3, sc->is_c_pointer_symbol, sc->is_integer_symbol, sc->T)

        s7_pointer arg, type, info, weak1, weak2, cp;
        intptr_t p;

        type = sc->F;
        info = sc->F;
        weak1 = sc->F;
        weak2 = sc->F;
        arg = car(args);
        if (!s7_is_integer(arg))
            return(method_or_bust(sc, arg, sc->c_pointer_symbol, args, T_INTEGER, 1));
        p = (intptr_t)s7_integer(arg);             /* (c-pointer (bignum "1234")) */
        args = cdr(args);
        if (is_pair(args))
        {
            type = car(args);
            args = cdr(args);
            if (is_pair(args))
            {
                info = car(args);
                args = cdr(args);
                if (is_pair(args))
                {
                    weak1 = car(args);
                    args = cdr(args);
                    if (is_pair(args))
                        weak2 = car(args);
                }
            }
        }
        cp = s7_make_c_pointer_with_type(sc, (void *)p, type, info);
        c_pointer_set_weak1(cp, weak1);
        c_pointer_set_weak2(cp, weak2);
        if ((weak1 != sc->F) || (weak2 != sc->F))
            add_weak_ref(sc, cp);
        return(cp);
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0x6a7d4
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x48(%rsp), %rax
movq 0xc48(%rax), %rdx
movq 0x40(%rsp), %rcx
movl $0xb, %r8d
movl $0x1, %r9d
callq 0x13c50
movq %rax, 0x50(%rsp)
jmp 0x6a911
movq 0x38(%rsp), %rdi
callq 0x10790
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x6a891
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x6a88f
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x6a88d
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x6a88b
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x6a88d
jmp 0x6a88f
jmp 0x6a891
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x107d0
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x6a8f1
movq 0x18(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq 0x120(%rcx), %rax
je 0x6a907
movq 0x48(%rsp), %rax
movq 0x798(%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0x11230
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax,%rax)