// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
leaq 0xd2f0b(%rip), %r15     # 0x152c20
cmpb $0x0, (%rax,%r15)
je 0x7feae
testb $0x1, 0x3(%r14)
jne 0x7fedd
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x7ffaa
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
je 0x7ff19
cmpq $0x2, 0x10(%rcx)
jl 0x7ff19
movq 0x10(%r12), %r15
leaq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq 0x110(%rbx), %rcx
sete %sil
je 0x800a9
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rcx
cmpq $0x0, 0x10(%rcx)
jle 0x800af
addq $0x10, %r15
movl $0x2, %ebp
movq $0x0, (%rsp)
movq (%rax), %rsi
cmpb $0xb, (%rsi)
jne 0x7fdc6
movq 0x8(%rsi), %rax
testq %rax, %rax
js 0x7fde6
movq (%rcx), %rdx
cmpq -0x10(%rdx,%rbp,8), %rax
jge 0x7fde6
movq 0x18(%rcx), %rcx
imulq -0x10(%rcx,%rbp,8), %rax
addq %rax, (%rsp)
movb $0x1, %al
jmp 0x7fe5d
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r12, %rcx
movl $0xb, %r8d
movl %ebp, %r9d
callq 0xf1ae
movq %rax, %r13
jmp 0x7fe5b
testq %rax, %rax
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x1f00(%rbx), %rcx
movq %rbp, 0x8(%rcx)
movq 0x1ee8(%rbx), %rcx
leaq 0xd2c33(%rip), %rdx     # 0x152a40
leaq 0xd2c34(%rip), %rdi     # 0x152a48
cmovsq %rdi, %rdx
movq 0x1f00(%rbx), %rdi
movq (%rdx), %rdx
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %rdi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rsi, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r13
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3b366
xorl %eax, %eax
testb %al, %al
je 0x800c9
movq (%r15), %r15
leaq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq 0x110(%rbx), %rcx
sete %sil
je 0x800d1
addq $0x10, %r15
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rcx
leaq 0x1(%rbp), %rdx
decq %rbp
cmpq 0x10(%rcx), %rbp
movq %rdx, %rbp
jl 0x7fd96
addq $-0x2, %rdx
movq (%rsp), %rbp
jmp 0x800b3
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rcx
movl $0x15, %r8d
movl $0x1, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf1ae
movq 0xd2a84(%rip), %rax     # 0x152968
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), %r13
jmp 0x7fff8
movq 0x10(%r12), %rcx
movq 0x8(%rcx), %rsi
cmpb $0xb, (%rsi)
jne 0x80015
movq 0x8(%rsi), %rbp
testq %rbp, %rbp
setns %dl
cmpq %rax, %rbp
setl %al
testb %al, %dl
je 0x8003d
movq 0x10(%rcx), %rax
movq 0x10(%rax), %rcx
cmpq 0x110(%rbx), %rcx
je 0x800c1
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %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,%r15)
je 0x800b8
movq 0x10(%r12), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq 0x558(%rbx), %rsi
movq %rbx, %rdi
callq 0x7fcf5
jmp 0x80102
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xce99c(%rip), %rcx     # 0x14e958
movq 0xd2a7d(%rip), %rdx     # 0x152a40
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)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r13
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3b366
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1668(%rbx), %rdx
movq %rbx, %rdi
movq %r12, %rcx
movl $0xb, %r8d
movl $0x2, %r9d
callq 0xf1ae
movq %rax, %r13
xorl %eax, %eax
jmp 0x80107
testq %rbp, %rbp
movq 0x1668(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xce90e(%rip), %rcx     # 0x14e960
leaq 0xd29ef(%rip), %rdx     # 0x152a48
leaq 0xd29e0(%rip), %rdi     # 0x152a40
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), %r13
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3b366
jmp 0x80105
xorl %edx, %edx
xorl %ebp, %ebp
jmp 0x800db
xorl %ebp, %ebp
xorl %edx, %edx
testb %sil, %sil
jne 0x800db
leaq 0xa484f(%rip), %rsi     # 0x12490e
jmp 0x800f7
movq 0x8(%rax), %r12
movb $0x1, %al
jmp 0x80107
xorl %eax, %eax
movq (%rsp), %rbp
jmp 0x80107
decq %rbp
movq %rbp, %rdx
movq (%rsp), %rbp
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rcx
cmpq 0x10(%rcx), %rdx
jne 0x800f0
movq (%rax), %r12
movb $0x1, %al
jmp 0x80107
leaq 0xa4839(%rip), %rsi     # 0x124930
movq %rbx, %rdi
movq %r12, %rdx
callq 0x3cbe3
movq %rax, %r13
xorl %eax, %eax
testb %al, %al
je 0x80003
testb $0x2, 0x6(%r14)
jne 0x80128
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r12, %rcx
callq *0x28(%r14)
jmp 0x80183
cmpq $0x0, 0x6a0(%rbx)
js 0x8017b
movq 0x28(%r14), %rsi
cmpb $0x30, (%rsi)
jb 0x80158
movq 0x10(%rsi), %rax
movq 0x700(%rbx), %rcx
movq %r12, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq *%rax
jmp 0x80172
movq 0x700(%rbx), %rax
movq %r12, 0x8(%rax)
movq 0x700(%rbx), %rdx
movq %rbx, %rdi
callq 0xbd41
cmpq 0x120(%rbx), %rax
je 0x8018b
movq 0x10(%r14), %rax
movq %r12, (%rax,%rbp,8)
movq %r12, %r13
jmp 0x80003
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa0581
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0xa0491
leaq 0x9b89b(%rip), %rsi     # 0x11ba48
movl $0x3, %edx
movq %rbx, %rdi
movq %r12, %rcx
movq %rax, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe25f