// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: make_shared_info
static shared_info *make_shared_info(s7_scheme *sc, s7_pointer top, bool stop_at_print_length)
    {
        /* for the printer */
        shared_info *ci;
        int32_t i, refs;
        s7_pointer *ci_objs;
        int32_t *ci_refs;
        bool no_problem = true, cyclic = false;
        s7_int k, stop_len;

        /* check for simple cases first */
        if (is_pair(top))
        {
            s7_pointer x;
            x = top;
            if (stop_at_print_length)
            {
                s7_pointer slow;
                stop_len = sc->print_length;
                slow = top;
                for (k = 0; k < stop_len; k += 2)
                {
                    if (!is_pair(x))
                        break;
                    if (has_structure(car(x)))
                    {
                        no_problem = false;
                        break;
                    }
                    x = cdr(x);
                    if (!is_pair(x))
                        break;
                    if (has_structure(car(x)))
                    {
                        no_problem = false;
                        break;
                    }
                    x = cdr(x);
                    slow = cdr(slow);
                    if (x == slow)
                    {
                        no_problem = false;
                        break;
                    }
                }
            }
            else
            {
                if (s7_list_length(sc, top) == 0) /* it is circular at the top level (following cdr) */
                    no_problem = false;
                else
                {
                    for (; is_pair(x); x = cdr(x))
                        if (has_structure(car(x)))
                        {
                            /* it can help a little in some cases to scan vectors here (and slots):
                             *   if no element has structure, it's ok (maybe also hash_table_entries == 0)
                             */
                            no_problem = false;
                            break;
                        }
                }
            }
            if ((no_problem) &&
                    (!is_null(x)) &&
                    (has_structure(x)))
                no_problem = false;

            if (no_problem)
                return(NULL);
        }
        else
        {
            if (is_any_vector(top))
            {
                if (!is_normal_vector(top))
                    return(NULL);

                stop_len = vector_length(top);
                if ((stop_at_print_length) &&
                        (stop_len > sc->print_length))
                    stop_len = sc->print_length;

                for (k = 0; k < stop_len; k++)
                    if (has_structure(vector_element(top, k)))
                    {
                        no_problem = false;
                        break;
                    }
                if (no_problem)
                    return(NULL);
            }
        }

        ci = new_shared_info(sc);

        /* collect all pointers associated with top */
        cyclic = collect_shared_info(sc, ci, top, stop_at_print_length);

        ci_objs = ci->objs;
        for (i = 0; i < ci->top; i++)
            clear_collected_and_shared(ci_objs[i]);

        if (!cyclic)
            return(NULL);

        if (!(ci->has_hits))
            return(NULL);

        ci_refs = ci->refs;
        /* find if any were referenced twice (once for just being there, so twice=shared)
         *   we know there's at least one such reference because has_hits is true.
         */
        for (i = 0, refs = 0; i < ci->top; i++)
            if (ci_refs[i] > 0)
            {
                set_collected(ci_objs[i]);
                if (i == refs)
                    refs++;
                else
                {
                    ci_objs[refs] = ci_objs[i];
                    ci_refs[refs++] = ci_refs[i];
                    ci_refs[i] = 0;
                    ci_objs[i] = NULL;
                }
            }
        ci->top = refs;
        return(ci);
    }

// Assembly:
subq $0x68, %rsp
movb %dl, %al
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
andb $0x1, %al
movb %al, 0x4f(%rsp)
movb $0x1, 0x27(%rsp)
movb $0x0, 0x26(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xd0873
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x4f(%rsp)
je 0xd0778
movq 0x58(%rsp), %rax
movq 0x280(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jge 0xd0773
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0xd067b
jmp 0xd0773
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x151800(%rip), %rax    # 0x221e90
testb $0x1, (%rax,%rcx)
je 0xd06c8
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
jne 0xd06be
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xd06c8
movb $0x0, 0x27(%rsp)
jmp 0xd0773
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0xd06e8
jmp 0xd0773
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x151793(%rip), %rax    # 0x221e90
testb $0x1, (%rax,%rcx)
je 0xd0732
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
jne 0xd072b
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xd0732
movb $0x0, 0x27(%rsp)
jmp 0xd0773
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
cmpq (%rsp), %rax
jne 0xd075e
movb $0x0, 0x27(%rsp)
jmp 0xd0773
jmp 0xd0760
movq 0x18(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
jmp 0xd0659
jmp 0xd0803
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x31900
cmpq $0x0, %rax
jne 0xd0794
movb $0x0, 0x27(%rsp)
jmp 0xd0801
jmp 0xd0796
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xd07ff
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1516d8(%rip), %rax    # 0x221e90
testb $0x1, (%rax,%rcx)
je 0xd07ed
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
jne 0xd07e6
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xd07ed
movb $0x0, 0x27(%rsp)
jmp 0xd07ff
jmp 0xd07ef
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0xd0796
jmp 0xd0801
jmp 0xd0803
testb $0x1, 0x27(%rsp)
je 0xd0859
movq 0x8(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x110(%rcx), %rax
je 0xd0859
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x151662(%rip), %rax    # 0x221e90
testb $0x1, (%rax,%rcx)
je 0xd0859
movq 0x8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
jne 0xd0854
movq 0x8(%rsp), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xd0859
movb $0x0, 0x27(%rsp)
testb $0x1, 0x27(%rsp)
je 0xd086e
movq $0x0, 0x60(%rsp)
jmp 0xd0b39
jmp 0xd098a
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x149ecc(%rip), %rax    # 0x21a750
testb $0x1, (%rax,%rcx)
je 0xd0988
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
je 0xd08a9
movq $0x0, 0x60(%rsp)
jmp 0xd0b39
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
testb $0x1, 0x4f(%rsp)
je 0xd08e2
movq 0x10(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x280(%rcx), %rax
jle 0xd08e2
movq 0x58(%rsp), %rax
movq 0x280(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jge 0xd0971
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x15157b(%rip), %rax    # 0x221e90
testb $0x1, (%rax,%rcx)
je 0xd095c
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
cmpl $0x15, %eax
jne 0xd0955
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0xd095c
movb $0x0, 0x27(%rsp)
jmp 0xd0971
jmp 0xd095e
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xd08eb
testb $0x1, 0x27(%rsp)
je 0xd0986
movq $0x0, 0x60(%rsp)
jmp 0xd0b39
jmp 0xd0988
jmp 0xd098a
movq 0x58(%rsp), %rdi
callq 0xd14f0
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x50(%rsp), %rdx
movb 0x4f(%rsp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0xd15c0
andb $0x1, %al
movb %al, 0x26(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0xd0a07
movq 0x30(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rcx
andq $-0xa0001, %rcx         # imm = 0xFFF5FFFF
movq %rcx, (%rax)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xd09d1
testb $0x1, 0x26(%rsp)
jne 0xd0a1c
movq $0x0, 0x60(%rsp)
jmp 0xd0b39
movq 0x40(%rsp), %rax
testb $0x1, 0x18(%rax)
jne 0xd0a35
movq $0x0, 0x60(%rsp)
jmp 0xd0b39
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x3c(%rsp)
movl $0x0, 0x38(%rsp)
movl 0x3c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0xd0b23
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xd0b11
movq 0x30(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rcx
orq $0x20000, %rcx          # imm = 0x20000
movq %rcx, (%rax)
movl 0x3c(%rsp), %eax
cmpl 0x38(%rsp), %eax
jne 0xd0aab
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0xd0b0f
movq 0x30(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movslq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x28(%rsp), %rax
movl 0x38(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x38(%rsp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0xd0b11
jmp 0xd0b13
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xd0a53
movl 0x38(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)