// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_vector_set
static s7_pointer g_vector_set(s7_scheme *sc, s7_pointer args)
                {
#define H_vector_set "(vector-set! v i ... value) sets the i-th element of vector v to value."
#define Q_vector_set s7_make_circular_signature(sc, 3, 4, sc->T, sc->is_vector_symbol, sc->is_integer_symbol, sc->is_integer_or_any_at_end_symbol)

                    s7_pointer vec, val;
                    s7_int index;

                    vec = car(args);
                    if (!is_any_vector(vec))
                        return(method_or_bust(sc, vec, sc->vector_set_symbol, args, T_VECTOR, 1));
                    if (is_immutable_vector(vec))
                        return(immutable_object_error(sc, set_elist_3(sc, immutable_error_string, sc->vector_set_symbol, vec)));

                    if (vector_length(vec) == 0)
                        return(out_of_range(sc, sc->vector_set_symbol, small_int(1), vec, its_too_large_string));

                    if (vector_rank(vec) > 1)
                    {
                        s7_int i;
                        s7_pointer x;
                        index = 0;
                        for (x = cdr(args), i = 0; (is_not_null(cdr(x))) && (i < vector_ndims(vec)); x = cdr(x), i++)
                        {
                            s7_int n;
                            s7_pointer p;
                            p = car(x);
                            if (!s7_is_integer(p))
                                return(method_or_bust(sc, p, sc->vector_set_symbol, args, T_INTEGER, i + 2));
                            n = s7_integer(p);
                            if ((n < 0) ||
                                    (n >= vector_dimension(vec, i)))
                                return(out_of_range(sc, sc->vector_set_symbol, wrap_integer1(sc, i + 2), p, (n < 0) ? its_negative_string : its_too_large_string));

                            index += n * vector_offset(vec, i);
                        }

                        if (is_not_null(cdr(x)))
                            return(s7_wrong_number_of_args_error(sc, "too many args for vector-set!: ~S", args));
                        if (i != vector_ndims(vec))
                            return(s7_wrong_number_of_args_error(sc, "not enough args for vector-set!: ~S", args));

                        val = car(x);
                    }
                    else
                    {
                        s7_pointer p;
                        p = cadr(args);
                        if (!s7_is_integer(p))
                            return(method_or_bust(sc, p, sc->vector_set_symbol, args, T_INTEGER, 2));
                        index = s7_integer(p);
                        if ((index < 0) ||
                                (index >= vector_length(vec)))
                            return(out_of_range(sc, sc->vector_set_symbol, small_int(2), p, (index < 0) ? its_negative_string : its_too_large_string));

                        if (is_not_null(cdddr(args)))
                        {
                            set_car(sc->temp_cell_2, vector_getter(vec)(sc, vec, index));
                            if (!is_any_vector(car(sc->temp_cell_2)))
                                return(s7_wrong_number_of_args_error(sc, "too many args for vector-set!: ~S", args));
                            set_cdr(sc->temp_cell_2, cddr(args));
                            return(g_vector_set(sc, sc->temp_cell_2));
                        }
                        val = caddr(args);
                    }

                    if (is_typed_vector(vec))
                    {
                        if ((sc->safety < NO_SAFETY) || /* or == NO_SAFETY?? */
                                (typed_vector_typer_call(sc, vec, set_plist_1(sc, val)) != sc->F))
                        {
                            vector_element(vec, index) = val;
                            return(val);
                        }
                        return(s7_wrong_type_arg_error(sc, "vector-set!", 3, val, make_type_name(sc, typed_vector_typer_name(sc, vec), INDEFINITE_ARTICLE)));
                    }

                    vector_setter(vec)(sc, vec, index, val);
                    return(val);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
leaq 0xd0f3d(%rip), %r13     # 0x14ac20
cmpb $0x1, (%rax,%r13)
jne 0x79db6
movq (%r14), %rax
btl $0x18, %eax
jb 0x79de0
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0x79e1c
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rdi
testq %rdi, %rdi
je 0x79d23
movq 0x10(%rdi), %rcx
cmpq $0x2, %rcx
jge 0x79f0f
movq 0x10(%r15), %rcx
movq 0x8(%rcx), %rsi
cmpb $0xb, (%rsi)
jne 0x79e56
movq 0x8(%rsi), %r12
testq %r12, %r12
js 0x79e74
cmpq %rdx, %r12
jge 0x79e74
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rcx
cmpq 0x110(%rbx), %rcx
je 0x79eeb
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *0x20(%r14)
movq 0x558(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x558(%rbx), %rax
movq 0x8(%rax), %rcx
movzbl (%rcx), %ecx
cmpb $0x0, (%rcx,%r13)
je 0x79f94
movq 0x10(%r15), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x558(%rbx), %r15
movq 0x8(%r15), %r14
movzbl (%r14), %eax
cmpb $0x0, (%rax,%r13)
jne 0x79cee
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl $0x15, %r8d
movl $0x1, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe42d
movq 0xd0b81(%rip), %rax     # 0x14a968
movq 0x1668(%rbx), %rcx
movq 0x6e8(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq 0x10(%rdx), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
movq 0x6e8(%rbx), %rdx
movq 0xea8(%rbx), %r15
jmp 0x79ed3
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xccb2a(%rip), %rcx     # 0x146958
movq 0xd0c0b(%rip), %rdx     # 0x14aa40
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 %r14, 0x8(%rax)
jmp 0x79ebd
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rcx
movl $0xb, %r8d
movl $0x2, %r9d
jmp 0x79dd2
testq %r12, %r12
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xccad7(%rip), %rcx     # 0x146960
leaq 0xd0bb8(%rip), %rdx     # 0x14aa48
leaq 0xd0ba9(%rip), %rdi     # 0x14aa40
cmovsq %rdx, %rdi
movq (%rdi), %rdx
movq 0x1ee8(%rbx), %rdi
movq 0x10(%rdi), %rdi
movq %rax, 0x8(%rdi)
movq 0x10(%rdi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r15
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x38dfa
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq $0x8, %rdx
movq (%rdx), %r15
btq $0x31, %rax
jb 0x79faf
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq *0x28(%r14)
jmp 0x79ede
movq 0x110(%rbx), %r8
movq 0x10(%r15), %rdx
movq 0x10(%rdx), %r11
addq $0x8, %rdx
cmpq %r8, %r11
je 0x79fdf
movq %rcx, %r10
negq %r10
movl $0x2, %r9d
xorl %r12d, %r12d
leaq (%r10,%r9), %rsi
cmpq $0x2, %rsi
je 0x79f94
movq (%rdx), %rsi
cmpb $0xb, (%rsi)
jne 0x7a097
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
js 0x7a027
movq (%rdi), %r13
cmpq -0x10(%r13,%r9,8), %rdx
jge 0x7a027
movq 0x18(%rdi), %rsi
imulq -0x10(%rsi,%r9,8), %rdx
addq %rdx, %r12
movq %r11, %rdx
movq 0x10(%r11), %rsi
addq $0x8, %rdx
incq %r9
movq %rsi, %r11
cmpq %r8, %rsi
jne 0x79f3a
addq $-0x2, %r9
jmp 0x79fe5
leaq 0xa1a83(%rip), %rsi     # 0x11ba1e
movq %rbx, %rdi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3a657
cmpq $0x0, 0x6a0(%rbx)
js 0x7a01a
movq 0x28(%r14), %rsi
cmpb $0x30, (%rsi)
jb 0x79ff7
movq 0x10(%rsi), %rax
movq 0x700(%rbx), %rcx
movq %r15, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq *%rax
jmp 0x7a011
xorl %r9d, %r9d
xorl %r12d, %r12d
cmpq %rcx, %r9
je 0x79eef
leaq 0xa1a4b(%rip), %rsi     # 0x11ba40
jmp 0x79f9b
movq 0x700(%rbx), %rax
movq %r15, 0x8(%rax)
movq 0x700(%rbx), %rdx
movq %rbx, %rdi
callq 0xaee6
cmpq 0x120(%rbx), %rax
je 0x7a088
movq 0x10(%r14), %rax
movq %r15, (%rax,%r12,8)
jmp 0x79ede
testq %rdx, %rdx
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x1f00(%rbx), %rcx
movq %r9, 0x8(%rcx)
movq 0x1ee8(%rbx), %rcx
leaq 0xd09fa(%rip), %rdx     # 0x14aa48
leaq 0xd09eb(%rip), %rdi     # 0x14aa40
cmovsq %rdx, %rdi
movq 0x1f00(%rbx), %rdx
movq (%rdi), %rdi
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdi, 0x8(%rax)
jmp 0x79ec5
movq 0x28(%r14), %rsi
cmpb $0x30, (%rsi)
jb 0x7a0af
movq 0x8(%rsi), %rax
jmp 0x7a0c3
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rcx
movl $0xb, %r8d
jmp 0x79dd2
movq 0x18(%rsi), %rdx
movq %rbx, %rdi
callq 0x99caa
movq 0x8(%rax), %rax
addq $0x10, %rax
movq (%rax), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x99bbf
leaq 0x98a7e(%rip), %rsi     # 0x112b58
movl $0x3, %edx
movq %rbx, %rdi
movq %r15, %rcx
movq %rax, %r8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd4e5