// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_multivector
static s7_pointer g_multivector(s7_scheme *sc, s7_int dims, s7_pointer data)
                {
                    /* get the dimension bounds from data, make the new vector, fill it from data
                     * dims needs to be s7_int so we can at least give correct error messages.
                     */
                    s7_pointer vec, x;
                    s7_int i, err, vec_loc;
                    s7_int *sizes;

                    /* (#2d((1 2 3) (4 5 6)) 0 0) -> 1
                     * (#2d((1 2 3) (4 5 6)) 1 1) -> 5
                     * (#3d(((1 2) (3 4)) ((5 6) (7 8))) 1 1 0) -> 7
                     * #3d(((1 2) (3 4)) ((5 6) (7))) -> error, #3d(((1 2) (3 4)) ((5 6) (7 8 9))), #3d(((1 2) (3 4)) (5 (7 8 9))) etc
                     * but a special case: #nd() is an n-dimensional empty vector
                     */

                    if (dims <= 0)      /* #0d(...) #2147483649D() [if dims is int32_t this is negative] */
                        return(s7_out_of_range_error(sc, "#nD(...) dimensions", 1, wrap_integer1(sc, dims), "must be 1 or more"));
                    if (dims > sc->max_vector_dimensions)
                        return(s7_out_of_range_error(sc, "#nD(...) dimensions", 1, wrap_integer1(sc, dims), "must be < 512")); /* sc->max_vector_dimensions=512 currently */

                    sc->w = sc->nil;
                    if (is_null(data))  /* dims are already 0 (calloc above) */
                        return(g_make_vector(sc, set_plist_1(sc, protected_make_list(sc, dims, small_int(0)))));

                    sizes = (s7_int *)calloc(dims, sizeof(s7_int));
                    for (x = data, i = 0; i < dims; i++)
                    {
                        sizes[i] = safe_list_length(x);
                        sc->w = cons(sc, make_integer(sc, sizes[i]), sc->w);
                        x = car(x);
                        if ((i < (dims - 1)) &&
                                (!is_pair(x)))
                        {
                            free(sizes);
                            return(s7_multivector_error(sc, "we need a list that fully specifies the vector's elements", data));
                        }
                    }

                    vec = g_make_vector(sc, set_plist_1(sc, sc->w = safe_reverse_in_place(sc, sc->w)));
                    vec_loc = s7_gc_protect_1(sc, vec);
                    sc->w = sc->nil;

                    /* now fill the vector checking that all the lists match */
                    err = traverse_vector_data(sc, vec, 0, 0, dims, sizes, data);

                    free(sizes);
                    s7_gc_unprotect_at(sc, vec_loc);
                    if (err < 0)
                        return(s7_multivector_error(sc, (err == MULTIVECTOR_TOO_MANY_ELEMENTS) ? "found too many elements" : "not enough elements found", data));

                    return(vec);
                }

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
cmpq $0x0, 0xc0(%rsp)
jg 0x19a199
movq 0xc8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x12430
movq 0x40(%rsp), %rdi
movq %rax, %rcx
leaq 0x5753c(%rip), %rsi     # 0x1f16b7
movl $0x1, %edx
leaq 0x57544(%rip), %r8      # 0x1f16cb
callq 0x45070
movq %rax, 0xd0(%rsp)
jmp 0x19a686
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
cmpq 0x2b8(%rcx), %rax
jle 0x19a201
movq 0xc8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x12430
movq 0x38(%rsp), %rdi
movq %rax, %rcx
leaq 0x574d4(%rip), %rsi     # 0x1f16b7
movl $0x1, %edx
leaq 0x574ee(%rip), %r8      # 0x1f16dd
callq 0x45070
movq %rax, 0xd0(%rsp)
jmp 0x19a686
movq 0xc8(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0xc8(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0xb8(%rsp), %rax
movq 0xc8(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x19a295
movq 0xc8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x7c217(%rip), %rdx     # 0x216480
callq 0xde940
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x35ea0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x35970
movq %rax, 0xd0(%rsp)
jmp 0x19a686
movq 0xc0(%rsp), %rdi
movl $0x8, %esi
callq 0x9360
movq %rax, 0x88(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jge 0x19a52a
movq 0xa8(%rsp), %rdi
callq 0x3a070
movq %rax, %rdx
movq 0x88(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x88(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x19a349
movq 0x68(%rsp), %rcx
leaq 0x7c145(%rip), %rax     # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
jmp 0x19a3cc
jmp 0x19a34b
movq 0xc8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xc8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x19a378
movq 0xc8(%rsp), %rdi
callq 0xc670
movq 0xc8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq $0xb, (%rax)
movq 0x68(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x58(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xc8(%rsp), %rax
movq 0x4d8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0xc8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xc8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x19a421
movq 0xc8(%rsp), %rdi
callq 0xc670
movq 0xc8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x78(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x70(%rsp), %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x80(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rcx
movq 0xc8(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xa0(%rsp), %rax
movq 0xc0(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jge 0x19a50f
movq 0xa8(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x19a50f
movq 0x88(%rsp), %rdi
callq 0x9050
movq 0xc8(%rsp), %rdi
movq 0xb8(%rsp), %rdx
leaq 0x571ee(%rip), %rsi     # 0x1f16eb
callq 0x19a710
movq %rax, 0xd0(%rsp)
jmp 0x19a686
jmp 0x19a511
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
jmp 0x19a2cb
movq 0xc8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xc8(%rsp), %rax
movq 0x4d8(%rax), %rsi
callq 0xe460
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0xc8(%rsp), %rax
movq %rsi, 0x4d8(%rax)
callq 0x35ea0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x35970
movq %rax, 0xb0(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x9cb0
movq %rax, 0x90(%rsp)
movq 0xc8(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0xc8(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0xc8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xc0(%rsp), %r8
movq 0x88(%rsp), %r9
movq 0xb8(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %rdx
movq %rax, (%rsp)
callq 0x19a7a0
cltq
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rdi
callq 0x9050
movq 0xc8(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x9f60
cmpq $0x0, 0x98(%rsp)
jge 0x19a676
movq 0xc8(%rsp), %rdi
movq 0x98(%rsp), %rcx
leaq 0x570ed(%rip), %rsi     # 0x1f173d
leaq 0x570ce(%rip), %rax     # 0x1f1725
cmpq $-0x1, %rcx
cmoveq %rax, %rsi
movq 0xb8(%rsp), %rdx
callq 0x19a710
movq %rax, 0xd0(%rsp)
jmp 0x19a686
movq 0xb0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)