// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: univect_ref
static s7_pointer univect_ref(s7_scheme *sc, s7_pointer args, s7_pointer caller, int32_t typ)
                {
                    s7_pointer v, index;
                    s7_int ind;

                    v = car(args);
                    if (type(v) != typ)
                        return(method_or_bust(sc, v, caller, args, typ, 1));

                    if (vector_rank(v) == 1)
                    {
                        index = cadr(args);
                        if (!s7_is_integer(index))
                            return(method_or_bust(sc, index, caller, args, T_INTEGER, 2));
                        ind = s7_integer(index);
                        if ((ind < 0) || (ind >= vector_length(v)))
                            return(simple_out_of_range(sc, caller, index, (ind < 0) ? its_negative_string : its_too_large_string));
                        if (!is_null(cddr(args)))
                            return(out_of_range(sc, caller, small_int(2), cdr(args), too_many_indices_string));
                    }
                    else
                    {
                        s7_int i;
                        s7_pointer x;
                        ind = 0;
                        for (x = cdr(args), i = 0; (is_not_null(x)) && (i < vector_ndims(v)); x = cdr(x), i++)
                        {
                            s7_int n;
                            index = car(x);
                            if (!s7_is_integer(index))
                                return(method_or_bust(sc, index, caller, args, T_INTEGER, i + 2));
                            n = s7_integer(index);
                            if ((n < 0) ||
                                    (n >= vector_dimension(v, i)))
                                return(out_of_range(sc, caller, wrap_integer1(sc, i + 2), index, (n < 0) ? its_negative_string : its_too_large_string));
                            ind += n * vector_offset(v, i);
                        }
                        if (is_not_null(x))
                            return(out_of_range(sc, caller, small_int(2), cdr(args), too_many_indices_string));

                        /* if not enough indices, return a subvector covering whatever is left */
                        if (i < vector_ndims(v))
                            return(subvector(sc, v, i, ind));
                    }
                    if (typ == T_FLOAT_VECTOR)
                        return(make_real(sc, float_vector(v, ind)));
                    if (typ == T_INT_VECTOR)
                        return(make_integer(sc, int_vector(v, ind)));
                    return(small_int(byte_vector(v, ind)));
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r11
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
movzbl (%rsi), %eax
cmpl %ecx, %eax
jne 0xd61fc
movq 0x18(%rsi), %rax
movq 0x20(%rax), %r8
testq %r8, %r8
je 0xd6190
movq 0x10(%r8), %rdi
cmpq $0x1, %rdi
jne 0xd6236
movq 0x10(%r11), %rdi
movq 0x8(%rdi), %r9
cmpb $0xb, (%r9)
jne 0xd620e
movq 0x8(%r9), %rax
testq %rax, %rax
js 0xd62bc
cmpq 0x8(%rsi), %rax
jge 0xd62bc
movq 0x10(%rdi), %r8
cmpq 0x110(%rbx), %r8
je 0xd6330
movq 0x8(%rdx), %rax
movq 0x7078f(%rip), %rcx     # 0x146960
movq 0x7f218(%rip), %rdx     # 0x1553f0
movq 0x1ee8(%rbx), %rsi
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdi, 0x8(%rax)
jmp 0xd6421
movzbl %cl, %r8d
movq %rbx, %rdi
movq %r11, %rcx
movl $0x1, %r9d
jmp 0xd6223
movq %rbx, %rdi
movq %r9, %rsi
movq %r11, %rcx
movl $0xb, %r8d
movl $0x2, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe42d
movq 0x110(%rbx), %r15
movq 0x10(%r11), %r13
cmpq %r15, %r13
je 0xd630a
xorl %eax, %eax
testq %rdi, %rdi
movl $0x0, %r12d
cmovgq %rdi, %r12
negq %r12
movl $0x2, %r9d
movq %r13, (%rsp)
leaq (%r12,%r9), %r10
cmpq $0x2, %r10
je 0xd63ec
movq 0x8(%r13), %r10
cmpb $0xb, (%r10)
jne 0xd6454
movq 0x8(%r10), %rbp
testq %rbp, %rbp
js 0xd6395
movq (%r8), %r14
cmpq -0x10(%r14,%r9,8), %rbp
jge 0xd6395
movq 0x18(%r8), %r10
imulq -0x10(%r10,%r9,8), %rbp
addq %rbp, %rax
movq 0x10(%r13), %r13
incq %r9
cmpq %r15, %r13
jne 0xd6266
addq $-0x2, %r9
jmp 0xd630f
testq %rax, %rax
movq 0x8(%rdx), %rax
leaq 0x7477e(%rip), %rcx     # 0x14aa48
leaq 0x7476f(%rip), %rdx     # 0x14aa40
cmovsq %rcx, %rdx
movq (%rdx), %rcx
movq 0x1ef8(%rbx), %rdx
movq 0x10(%rdx), %rdx
movq %rax, 0x8(%rdx)
movq 0x10(%rdx), %rax
movq %r9, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x1948(%rbx), %r14
movq 0x1ef8(%rbx), %rdx
jmp 0xd6437
xorl %r9d, %r9d
xorl %eax, %eax
cmpq %rdi, %r9
jge 0xd6330
movq %rbx, %rdi
movq %r9, %rdx
movq %rax, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd5edf
movq 0x10(%rsi), %rdx
cmpl $0x16, %ecx
je 0xd6468
cmpl $0x17, %ecx
jne 0xd6482
movsd (%rdx,%rax,8), %xmm0
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0xd6374
movq %rbx, %rdi
movsd %xmm0, (%rsp)
callq 0xa550
movsd (%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r14
movq $0xd, (%r14)
movsd %xmm0, 0x8(%r14)
jmp 0xd6442
testq %rbp, %rbp
movq 0x8(%rdx), %rax
movq 0x1f00(%rbx), %rcx
movq %r9, 0x8(%rcx)
movq 0x1ee8(%rbx), %rcx
leaq 0x74693(%rip), %rdx     # 0x14aa48
leaq 0x74684(%rip), %rsi     # 0x14aa40
cmovsq %rdx, %rsi
movq 0x1f00(%rbx), %rdx
movq (%rsi), %rsi
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r10, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
jmp 0xd6429
movq 0x8(%rdx), %rax
movq 0x70569(%rip), %rcx     # 0x146960
movq 0x7eff2(%rip), %rdx     # 0x1553f0
movq 0x1ee8(%rbx), %rsi
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq (%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r14
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38dfa
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r10, %rsi
movq %r11, %rcx
movl $0xb, %r8d
jmp 0xd6223
movq (%rdx,%rax,8), %r15
cmpq $0x7ff, %r15            # imm = 0x7FF
ja 0xd6493
leaq 0x704d4(%rip), %rax     # 0x146950
movq (%rax,%r15,8), %r14
jmp 0xd6442
movzbl (%rdx,%rax), %eax
leaq 0x704c3(%rip), %rcx     # 0x146950
movq (%rcx,%rax,8), %r14
jmp 0xd6442
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0xd64b2
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r14
movq $0xb, (%r14)
movq %r15, 0x8(%r14)
jmp 0xd6442