// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: flatten_multivector_indices
static s7_int flatten_multivector_indices(s7_scheme *sc, s7_pointer vector, s7_int indices, va_list ap)
                {
                    s7_int rank, index;

                    rank = vector_rank(vector);
                    if (rank != indices)
                        s7_wrong_number_of_args_error(sc, "s7_vector_ref_n: wrong number of indices: ~A", s7_make_integer(sc, indices));

                    if (rank == 1)
                        index = va_arg(ap, s7_int);
                    else
                    {
                        s7_int i;
                        s7_int *offsets, *dimensions;
                        dimensions = vector_dimensions(vector);
                        offsets = vector_offsets(vector);
                        for (i = 0, index = 0; i < indices; i++)
                        {
                            s7_int ind;
                            ind = va_arg(ap, s7_int);
                            if ((ind < 0) ||
                                    (ind >= dimensions[i]))
                            {
                                va_end(ap);
                                out_of_range(sc, sc->vector_ref_symbol, small_int(i), wrap_integer1(sc, ind), (ind < 0) ? its_negative_string : its_too_large_string);
                                return(-1);
                            }
                            index += (ind * offsets[i]);
                        }
                    }
                    va_end(ap);
                    return(index);
                }

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movq 0xb0(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x34795
movq 0xb0(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x347a1
movl $0x1, %eax
movq %rax, 0x68(%rsp)
jmp 0x347a1
movq 0x68(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
cmpq 0xa8(%rsp), %rax
je 0x347f6
movq 0xb8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xb8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x120f0
movq 0x60(%rsp), %rdi
movq %rax, %rdx
leaq 0x1ba3da(%rip), %rsi    # 0x1eebcb
callq 0x33290
cmpq $0x1, 0x98(%rsp)
jne 0x34863
movq 0xa0(%rsp), %rax
movq %rax, 0x50(%rsp)
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
cmpl $0x28, %eax
ja 0x34835
movq 0x50(%rsp), %rcx
movl 0x5c(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, 0x48(%rsp)
jmp 0x3484e
movq 0x50(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x90(%rsp)
jmp 0x34a32
movq 0xb0(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq %rax, 0x78(%rsp)
movq 0xb0(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x88(%rsp), %rax
cmpq 0xa8(%rsp), %rax
jge 0x34a30
movq 0xa0(%rsp), %rax
movq %rax, 0x38(%rsp)
movl (%rax), %eax
movl %eax, 0x44(%rsp)
cmpl $0x28, %eax
ja 0x348f9
movq 0x38(%rsp), %rcx
movl 0x44(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, 0x30(%rsp)
jmp 0x34912
movq 0x38(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
jl 0x34943
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x88(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jl 0x349ed
movq 0xa0(%rsp), %rax
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xb8(%rsp), %rax
movq 0x1660(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x88(%rsp), %rcx
leaq 0x1e1b01(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0xb8(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x12430
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x70(%rsp)
jge 0x349b5
movq 0x1e5bca(%rip), %rax    # 0x21a578
movq %rax, 0x8(%rsp)
jmp 0x349c1
movq 0x1e5bb4(%rip), %rax    # 0x21a570
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r8
callq 0x13880
movq $-0x1, 0xc0(%rsp)
jmp 0x34a4a
movq 0x70(%rsp), %rax
movq 0x80(%rsp), %rcx
movq 0x88(%rsp), %rdx
imulq (%rcx,%rdx,8), %rax
addq 0x90(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x348af
jmp 0x34a32
movq 0xa0(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
addq $0xc8, %rsp
retq
nopw (%rax,%rax)