// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: multivector_length
static s7_int multivector_length(s7_scheme *sc, s7_pointer x, s7_pointer caller)
                {
                    s7_int len, dims;
                    s7_pointer y;

                    dims = s7_list_length(sc, x);
                    if (dims <= 0)                /* 0 if circular, negative if dotted */
                        wrong_type_argument_with_type(sc, caller, 1, x, a_proper_list_string);
                    if (dims > sc->max_vector_dimensions)
                        out_of_range(sc, caller, small_int(1), x, its_too_large_string);

                    for (len = 1, y = x; is_pair(y); y = cdr(y))
                    {
                        if (!s7_is_integer(car(y)))
                            wrong_type_argument(sc, caller, position_of(y, x), car(y), T_INTEGER);
#if HAVE_OVERFLOW_CHECKS
                        if (multiply_overflow(len, s7_integer(car(y)), &len)) /* or better perhaps len > sc->max_vector_length */
                            out_of_range(sc, caller, s7_make_integer(sc, position_of(y, x)), car(y), its_too_large_string);
#else
                        len *= s7_integer(car(y));
#endif
                        if (len < 0)
                            wrong_type_argument_with_type(sc, caller, position_of(y, x), car(y), a_non_negative_integer_string);
                    }
                    return(len);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %rbp
movq %rdi, %r15
callq 0x39d0d
movq %rax, %r12
testq %rax, %rax
jg 0x99d69
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xacc08(%rip), %rdx     # 0x146958
movq 0x140(%r15), %r8
movq 0xb8eba(%rip), %r9      # 0x152c18
movq %r15, %rdi
movq %rbp, %rcx
callq 0xa4e4
cmpq 0x2b8(%r15), %r12
jle 0x99dc5
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0xacbd7(%rip), %rcx     # 0x146958
movq 0xb0cb8(%rip), %rdx     # 0x14aa40
movq 0x1ee8(%r15), %rsi
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rbp, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%r15), %rsi
movq 0x1ee8(%r15), %rdx
movq %r15, %rdi
callq 0x38dfa
movl $0x1, %r12d
cmpb $0x1, (%rbp)
jne 0x99fa6
movq %rbp, %r14
movq 0x8(%r14), %rcx
cmpb $0xb, (%rcx)
je 0x99e7f
movq (%rsp), %rax
movq 0x8(%rax), %r13
cmpq %rbp, %r14
je 0x99e4d
xorl %eax, %eax
movq %rbp, %rdx
movq 0x10(%rdx), %rdx
incq %rax
cmpq %r14, %rdx
jne 0x99df7
leaq 0x1(%rax), %rbx
cmpl $0x7fe, %eax            # imm = 0x7FE
jbe 0x99e52
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x99e2d
movq %r15, %rdi
callq 0xa550
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rdx
movq $0xb, (%rdx)
movq %rbx, 0x8(%rdx)
movq 0x8(%r14), %rcx
jmp 0x99e5d
movl $0x1, %ebx
leaq 0xacaf7(%rip), %rax     # 0x146950
movq (%rax,%rbx,8), %rdx
movq 0x140(%r15), %r8
movq 0xb0c4d(%rip), %r9      # 0x14aab8
movq %r15, %rdi
movq %r13, %rsi
callq 0xa4e4
movq 0x8(%r14), %rcx
cmpb $0xb, (%rcx)
jne 0x99e85
movq 0x8(%rcx), %rax
jmp 0x99e87
xorl %eax, %eax
imulq %rax, %r12
jno 0x99efe
movl $0x1, %esi
cmpq %rbp, %r14
je 0x99ea6
movq %rbp, %rax
movq 0x10(%rax), %rax
incq %rsi
cmpq %r14, %rax
jne 0x99e9a
movq (%rsp), %rax
movq 0x8(%rax), %rbx
movq %r15, %rdi
callq 0xd27e
movq 0x8(%r14), %rcx
movq 0xb0b7f(%rip), %rdx     # 0x14aa40
movq 0x1ee8(%r15), %rsi
movq 0x10(%rsi), %rsi
movq %rbx, 0x8(%rsi)
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%r15), %rsi
movq 0x1ee8(%r15), %rdx
movq %r15, %rdi
callq 0x38dfa
testq %r12, %r12
jns 0x99f98
movq (%rsp), %rax
movq 0x8(%rax), %r13
cmpq %rbp, %r14
je 0x99f6b
xorl %eax, %eax
movq %rbp, %rcx
movq 0x10(%rcx), %rcx
incq %rax
cmpq %r14, %rcx
jne 0x99f19
leaq 0x1(%rax), %rbx
cmpl $0x7fe, %eax            # imm = 0x7FE
jbe 0x99f70
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x99f4f
movq %r15, %rdi
callq 0xa550
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rdx
movq $0xb, (%rdx)
movq %rbx, 0x8(%rdx)
jmp 0x99f7b
movl $0x1, %ebx
leaq 0xac9d9(%rip), %rax     # 0x146950
movq (%rax,%rbx,8), %rdx
movq 0x8(%r14), %rcx
movq 0x140(%r15), %r8
movq 0xb8c4b(%rip), %r9      # 0x152bd8
movq %r15, %rdi
movq %r13, %rsi
callq 0xa4e4
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
je 0x99dd8
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq