// File: /workspace/github_c_makefile_star2_O0/jiribenes[P]scheme/src/core.c
// Function: builtin_vec_set
static value_t builtin_vec_set(vm_t *vm, env_t *env, value_t args) {
    // (vector-set! <vec> <k> <obj>)
    value_t eargs = eval_list(vm, env, args);
    arity_check(vm, "vector-set!", eargs, 3, false);
    value_t first = AS_CONS(eargs)->car;
    value_t second = AS_CONS(AS_CONS(eargs)->cdr)->car;
    value_t third = AS_CONS(AS_CONS(AS_CONS(eargs)->cdr)->cdr)->car;
    if (!IS_VECTOR(first)) {
        error_runtime(vm, "vector-set!: first argument must be a vector");
        return UNDEFINED_VAL;
    }
    vector_t *vec = AS_VECTOR(first);
    if (!IS_INT(second) ||
        !(AS_INT(second) >= 0 && AS_INT(second) < vec->count)) {
        error_runtime(
            vm,
            "vector-set!: second argument must be a valid integer in range");
        return UNDEFINED_VAL;
    }
    vec->data[AS_INT(second)] = third;
    return VOID_VAL;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x8120
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rdx
leaq 0x5b63(%rip), %rsi      # 0xa1c0
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x12a0
movabsq $0x3ffffffffffff, %rax  # imm = 0x3FFFFFFFFFFFF
andq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
movabsq $0x3ffffffffffff, %rcx  # imm = 0x3FFFFFFFFFFFF
andq 0x40(%rsp), %rcx
movabsq $0x3ffffffffffff, %rax  # imm = 0x3FFFFFFFFFFFF
andq 0x18(%rcx), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
movabsq $0x3ffffffffffff, %rax  # imm = 0x3FFFFFFFFFFFF
andq 0x40(%rsp), %rax
movabsq $0x3ffffffffffff, %rcx  # imm = 0x3FFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $0x3ffffffffffff, %rax  # imm = 0x3FFFFFFFFFFFF
andq 0x18(%rcx), %rax
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movl $0x6, %esi
callq 0x4d50
testb $0x1, %al
jne 0x4716
movq 0x58(%rsp), %rdi
leaq 0x5ee4(%rip), %rsi      # 0xa5df
movb $0x0, %al
callq 0x73a0
movabsq $0x7ffc000000000004, %rax # imm = 0x7FFC000000000004
movq %rax, 0x60(%rsp)
jmp 0x4820
movabsq $0x3ffffffffffff, %rax  # imm = 0x3FFFFFFFFFFFF
andq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
andq 0x30(%rsp), %rax
movabsq $0x7ffc000000000000, %rcx # imm = 0x7FFC000000000000
cmpq %rcx, %rax
je 0x47b3
movq 0x30(%rsp), %rdi
callq 0x4cf0
callq 0x1050
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4cf0
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jne 0x47b3
jp 0x47b3
movq 0x30(%rsp), %rdi
callq 0x4cf0
callq 0x1050
cvttsd2si %xmm0, %rax
cmpq $0x0, %rax
jl 0x47b3
movq 0x30(%rsp), %rdi
callq 0x4cf0
callq 0x1050
cvttsd2si %xmm0, %rax
movq 0x20(%rsp), %rcx
movl 0x14(%rcx), %ecx
cmpq %rcx, %rax
jl 0x47d7
movq 0x58(%rsp), %rdi
leaq 0x5e4d(%rip), %rsi      # 0xa60c
movb $0x0, %al
callq 0x73a0
movabsq $0x7ffc000000000004, %rax # imm = 0x7FFC000000000004
movq %rax, 0x60(%rsp)
jmp 0x4820
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4cf0
callq 0x1050
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
cvttsd2si %xmm0, %rcx
movq %rdx, (%rax,%rcx,8)
movabsq $0x7ffc000000000005, %rax # imm = 0x7FFC000000000005
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw (%rax,%rax)