// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_bv_set_3
static s7_pointer g_bv_set_3(s7_scheme *sc, s7_pointer args)
                {
                    s7_pointer v, index, value;
                    s7_int ind, uval;
                    v = car(args);
                    if (!is_byte_vector(v))
                        return(method_or_bust(sc, v, sc->byte_vector_set_symbol, args, T_BYTE_VECTOR, 1));
                    if (vector_rank(v) != 1)
                        return(univect_set(sc, args, sc->byte_vector_set_symbol, T_BYTE_VECTOR));
                    index = cadr(args);
                    if (!s7_is_integer(index))
                        return(method_or_bust(sc, index, sc->byte_vector_set_symbol, args, T_INTEGER, 2));
                    ind = s7_integer(index);
                    if ((ind < 0) || (ind >= vector_length(v)))
                        return(simple_out_of_range(sc, sc->byte_vector_set_symbol, index, (ind < 0) ? its_negative_string : its_too_large_string));
                    value = caddr(args);
                    if (!s7_is_integer(value))
                        return(method_or_bust(sc, value, sc->byte_vector_set_symbol, args, T_INTEGER, 3));
                    if ((ind < 0) || (ind >= vector_length(v)))
                        return(simple_out_of_range(sc, sc->byte_vector_set_symbol, index, (ind < 0) ? its_negative_string : its_too_large_string));
                    uval = s7_integer(value);
                    if ((uval < 0) || (uval > 255))
                        simple_wrong_type_argument_with_type(sc, sc->byte_vector_set_symbol, value, an_unsigned_byte_string);
                    if (is_immutable_vector(v))
                        return(immutable_object_error(sc, set_elist_3(sc, immutable_error_string, sc->byte_vector_set_symbol, v)));
                    byte_vector(v, ind) = (uint8_t)uval;
                    return(value);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movq 0x8(%rsi), %r14
cmpb $0x18, (%r14)
jne 0xcf202
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rcx
testq %rcx, %rcx
je 0xcf176
cmpq $0x1, 0x10(%rcx)
jne 0xcf23f
movq 0x10(%rax), %rcx
movq 0x8(%rcx), %r10
cmpb $0xb, (%r10)
jne 0xcf219
movq 0x8(%r10), %r12
testq %r12, %r12
js 0xcf25d
cmpq 0x8(%r14), %r12
jge 0xcf25d
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %r15
cmpb $0xb, (%r15)
jne 0xcf294
movq 0x8(%r15), %r13
cmpq $0x100, %r13            # imm = 0x100
jb 0xcf1e2
movq 0xc38(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x140(%rbx), %rcx
movq 0x52e89(%rip), %r8      # 0x122060
movq %rbx, %rdi
movq %r15, %rdx
callq 0xd456
testb $0x1, 0x3(%r14)
jne 0xcf2ab
movq 0x10(%r14), %rax
movb %r13b, (%rax,%r12)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xc38(%rbx), %rdx
pushq $0x18
popq %r8
pushq $0x1
popq %r9
movq %rbx, %rdi
movq %r14, %rsi
jmp 0xcf22e
movq 0xc38(%rbx), %rdx
pushq $0xb
popq %r8
pushq $0x2
popq %r9
movq %rbx, %rdi
movq %r10, %rsi
movq %rax, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcd70
movq 0xc38(%rbx), %rdx
pushq $0x18
popq %rcx
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xcb853
testq %r12, %r12
movq 0xc38(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x4a7d6(%rip), %rax     # 0x119a48
leaq 0x4a7c7(%rip), %rcx     # 0x119a40
cmovsq %rax, %rcx
movq (%rcx), %rcx
movq %rbx, %rdi
movq %r10, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x35b47
movq 0xc38(%rbx), %rdx
pushq $0xb
popq %r8
pushq $0x3
popq %r9
movq %rbx, %rdi
movq %r15, %rsi
jmp 0xcf22e
movq 0x4a6b6(%rip), %rax     # 0x119968
movq 0xc38(%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), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x972b