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

                    vec = car(args);
                    if (type(vec) != typ)
                        return(method_or_bust(sc, vec, caller, args, typ, 1));
                    if (is_immutable_vector(vec))
                        return(immutable_object_error(sc, set_elist_3(sc, immutable_error_string, caller, vec)));

                    if (vector_rank(vec) > 1)
                    {
                        s7_int i;
                        s7_pointer x;
                        ind = 0;
                        for (x = cdr(args), i = 0; (is_not_null(cdr(x))) && (i < vector_ndims(vec)); 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(vec, 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(vec, i);
                        }
                        if (is_not_null(cdr(x)))
                            return(s7_wrong_number_of_args_error(sc, "too many args: ~S", args));
                        if (i != vector_ndims(vec))
                            return(s7_wrong_number_of_args_error(sc, "not enough args: ~S", args));
                        val = car(x);
                    }
                    else
                    {
                        s7_pointer p;
                        p = cdr(args);
                        index = car(p);
                        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(vec)))
                            return(out_of_range(sc, caller, small_int(2), index, (ind < 0) ? its_negative_string : its_too_large_string));
                        if (is_not_null(cddr(p)))
                            return(s7_wrong_number_of_args_error(sc, "too many args: ~S", args));
                        val = cadr(p);
                    }

                    if (typ == T_FLOAT_VECTOR)
                    {
                        if (!s7_is_real(val))
                            return(method_or_bust(sc, val, caller, args, T_REAL, 3));
                        float_vector(vec, ind) = s7_real(val);
                    }
                    else
                    {
                        if (typ == T_INT_VECTOR)
                        {
                            if (!s7_is_integer(val))
                                return(method_or_bust(sc, val, caller, args, T_INTEGER, 3));
                            int_vector(vec, ind) = s7_integer(val);
                        }
                        else
                        {
                            if (!is_byte(val))
                                return(method_or_bust(sc, val, caller, args, T_INTEGER, 3));
                            byte_vector(vec, ind) = (uint8_t)s7_integer(val);
                        }
                    }
                    return(val);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rax
movq 0x8(%rsi), %rbx
movzbl (%rbx), %esi
cmpl %ecx, %esi
jne 0xcb904
testb $0x1, 0x3(%rbx)
jne 0xcb920
movq 0x18(%rbx), %rsi
movq 0x20(%rsi), %rsi
testq %rsi, %rsi
je 0xcb957
movq 0x10(%rsi), %r8
cmpq $0x2, %r8
jl 0xcb957
movq 0x110(%rdi), %r11
movq 0x10(%rax), %r14
pushq $0x2
popq %r9
xorl %r15d, %r15d
movq %r14, %r10
movq 0x10(%r14), %r14
addq $0x8, %r10
cmpq %r11, %r14
je 0xcb9f1
leaq -0x2(%r9), %r12
cmpq %r8, %r12
jge 0xcb989
movq (%r10), %r10
cmpb $0xb, (%r10)
jne 0xcba12
movq 0x8(%r10), %r12
testq %r12, %r12
js 0xcb9b2
movq (%rsi), %r13
cmpq -0x10(%r13,%r9,8), %r12
jge 0xcb9b2
movq 0x18(%rsi), %r10
imulq -0x10(%r10,%r9,8), %r12
addq %r12, %r15
incq %r9
jmp 0xcb8a9
movzbl %cl, %r8d
pushq $0x1
popq %r9
movq %rbx, %rsi
movq %rax, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcd70
movq 0x4e041(%rip), %rax     # 0x119968
movq 0x6e8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rbx, 0x8(%rax)
movq 0x6e8(%rdi), %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x972b
movq 0x10(%rax), %rsi
movq 0x8(%rsi), %r10
cmpb $0xb, (%r10)
jne 0xcb992
movq 0x8(%r10), %r15
testq %r15, %r15
js 0xcb9a2
cmpq 0x8(%rbx), %r15
jge 0xcb9a2
movq 0x10(%rsi), %r10
movq 0x10(%r10), %rsi
cmpq 0x110(%rdi), %rsi
je 0xcba21
leaq 0x1c0f7(%rip), %rsi     # 0xe7a87
jmp 0xcba01
pushq $0xb
popq %r8
pushq $0x2
popq %r9
movq %r10, %rsi
jmp 0xcb90f
testq %r15, %r15
movq 0x8(%rdx), %rsi
movq 0x49fb0(%rip), %rdx     # 0x115960
jmp 0xcb9cb
testq %r12, %r12
movq 0x8(%rdx), %rsi
movq 0x1f00(%rdi), %rax
movq %r9, 0x8(%rax)
movq 0x1f00(%rdi), %rdx
leaq 0x4e076(%rip), %rax     # 0x119a48
leaq 0x4e067(%rip), %rcx     # 0x119a40
cmovsq %rax, %rcx
movq (%rcx), %r8
movq %r10, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcb8f
subq %r8, %r9
cmpq $0x2, %r9
je 0xcba25
leaq 0x1c098(%rip), %rsi     # 0xe7a99
movq %rax, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2e40a
pushq $0xb
popq %r8
movq %r10, %rsi
movq %rax, %rcx
jmp 0xcb912
addq $0x8, %r10
movq (%r10), %r14
movzbl (%r14), %esi
cmpl $0x16, %ecx
je 0xcba57
cmpl $0x17, %ecx
jne 0xcba6a
leaq 0x4df73(%rip), %rcx     # 0x1199b0
cmpb $0x0, (%rsi,%rcx)
je 0xcba95
movq %r14, %rdi
callq 0xc42a
movq 0x10(%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
jmp 0xcba84
cmpl $0xb, %esi
jne 0xcba91
movq 0x8(%r14), %rax
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
jmp 0xcba84
cmpl $0xb, %esi
jne 0xcba91
movq 0x8(%r14), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jae 0xcba91
movq 0x10(%rbx), %rax
movb %cl, (%rax,%r15)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0xb
jmp 0xcba97
pushq $0xd
popq %r8
pushq $0x3
popq %r9
movq %r14, %rsi
jmp 0xcb90f