// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/value.c
// Function: janet_put
void janet_put(Janet ds, Janet key, Janet value) {
    JanetType type = janet_type(ds);
    switch (type) {
        default:
            janet_panicf("expected %T, got %v",
                         JANET_TFLAG_ARRAY | JANET_TFLAG_BUFFER | JANET_TFLAG_TABLE, ds);
        case JANET_ARRAY: {
            JanetArray *array = janet_unwrap_array(ds);
            int32_t index = getter_checkint(type, key, INT32_MAX - 1);
            if (index >= array->count) {
                janet_array_setcount(array, index + 1);
            }
            array->data[index] = value;
            break;
        }
        case JANET_BUFFER: {
            JanetBuffer *buffer = janet_unwrap_buffer(ds);
            int32_t index = getter_checkint(type, key, INT32_MAX - 1);
            if (!janet_checkint(value))
                janet_panicf("can only put integers in buffers, got %v", value);
            if (index >= buffer->count) {
                janet_buffer_setcount(buffer, index + 1);
            }
            buffer->data[index] = (uint8_t)(janet_unwrap_integer(value) & 0xFF);
            break;
        }
        case JANET_TABLE:
            janet_table_put(janet_unwrap_table(ds), key, value);
            break;
        case JANET_ABSTRACT: {
            JanetAbstractType *type = (JanetAbstractType *)janet_abstract_type(janet_unwrap_abstract(ds));
            if (type->put) {
                (type->put)(janet_unwrap_abstract(ds), key, value);
            } else {
                janet_panicf("no setter for %v ", ds);
            }
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x705b6
jmp 0x705c7
movq -0x8(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
movl %eax, -0x4c(%rbp)
jmp 0x705ce
xorl %eax, %eax
movl %eax, -0x4c(%rbp)
jmp 0x705ce
movl -0x4c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x7, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x7, %eax
ja 0x705f9
movq -0x58(%rbp), %rax
leaq 0x2868c(%rip), %rcx     # 0x98c7c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdx
leaq 0x10ae3(%rip), %rdi     # 0x810e7
movl $0xa80, %esi            # imm = 0xA80
movb $0x0, %al
callq 0x1ac40
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0x7ffffffe, %edx       # imm = 0x7FFFFFFE
callq 0x6f8d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x7064c
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
addl $0x1, %esi
callq 0x13470
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq -0x18(%rbp), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x70751
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x38(%rbp)
movl -0x1c(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0x7ffffffe, %edx       # imm = 0x7FFFFFFE
callq 0x6f8d0
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6d480
cmpl $0x0, %eax
jne 0x706a6
movq -0x18(%rbp), %rsi
leaq 0x286c9(%rip), %rdi     # 0x98d68
movb $0x0, %al
callq 0x1ac40
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x706c1
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %esi
addl $0x1, %esi
callq 0x185e0
cvttsd2si -0x18(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x3c(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x70751
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x697e0
jmp 0x70751
movq -0x8(%rbp), %rdi
callq 0x7b260
movq -0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7073d
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, %rdi
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq *%rax
jmp 0x7074f
movq -0x8(%rbp), %rsi
leaq 0x28649(%rip), %rdi     # 0x98d91
movb $0x0, %al
callq 0x1ac40
jmp 0x70751
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)