// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/specials.c
// Function: janetc_varset
static JanetSlot janetc_varset(JanetFopts opts, int32_t argn, const Janet *argv) {
    if (argn != 2) {
        janetc_cerror(opts.compiler, "expected 2 arguments to set");
        return janetc_cslot(janet_wrap_nil());
    }
    JanetFopts subopts = janetc_fopts_default(opts.compiler);
    if (janet_checktype(argv[0], JANET_SYMBOL)) {
        /* Normal var - (set a 1) */
        const uint8_t *sym = janet_unwrap_symbol(argv[0]);
        JanetSlot dest = janetc_resolve(opts.compiler, sym);
        if (!(dest.flags & JANET_SLOT_MUTABLE)) {
            janetc_cerror(opts.compiler, "cannot set constant");
            return janetc_cslot(janet_wrap_nil());
        }
        subopts.flags = JANET_FOPTS_HINT;
        subopts.hint = dest;
        JanetSlot ret = janetc_value(subopts, argv[1]);
        janetc_copy(opts.compiler, dest, ret);
        return ret;
    } else if (janet_checktype(argv[0], JANET_TUPLE)) {
        /* Set a field (setf behavior) - (set (tab :key) 2) */
        const Janet *tup = janet_unwrap_tuple(argv[0]);
        /* Tuple must have 2 elements */
        if (janet_tuple_length(tup) != 2) {
            janetc_cerror(opts.compiler, "expected 2 element tuple for l-value to set");
            return janetc_cslot(janet_wrap_nil());
        }
        JanetSlot ds = janetc_value(subopts, tup[0]);
        JanetSlot key = janetc_value(subopts, tup[1]);
        /* Can't be tail position because we will emit a PUT instruction afterwards */
        /* Also can't drop either */
        opts.flags &= ~(JANET_FOPTS_TAIL | JANET_FOPTS_DROP);
        JanetSlot rvalue = janetc_value(opts, argv[1]);
        /* Emit the PUT instruction */
        janetc_emit_sss(opts.compiler, JOP_PUT, ds, key, rvalue, 0);
        return rvalue;
    } else {
        /* Error */
        janetc_cerror(opts.compiler, "expected symbol or tuple for l-value to set");
        return janetc_cslot(janet_wrap_nil());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xc8(%rbp)
movq %rdi, -0xc0(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl %esi, -0x4(%rbp)
movq %rdx, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
je 0x60e8f
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
leaq 0x351dc(%rip), %rsi     # 0x9603e
callq 0x1fff0
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0xc8(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
callq 0x1ff40
jmp 0x61217
movq -0xb8(%rbp), %rax
movq (%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0x1fed0
xorl %eax, %eax
testb $0x1, %al
jne 0x60eaa
jmp 0x60ed9
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x60ebf
jmp 0x60efd
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x60efd
jmp 0x61011
movq -0x10(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x5800000000000, %rcx # imm = 0xFFFA800000000000
cmpq %rcx, %rax
jne 0x61011
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7b260
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x48(%rbp)
movq (%rax), %rsi
movq -0x48(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x208e0
movl -0x50(%rbp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
jne 0x60f72
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
leaq 0x35115(%rip), %rsi     # 0x9605a
callq 0x1fff0
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0xc8(%rbp), %rdi
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
callq 0x1ff40
jmp 0x61217
movq -0xc8(%rbp), %rdi
movl $0x20000, -0x20(%rbp)   # imm = 0x20000
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x21590
movq -0xb8(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq (%rcx), %rdi
leaq -0x60(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x295a0
jmp 0x61217
xorl %eax, %eax
testb $0x1, %al
jne 0x61019
jmp 0x61048
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x6102e
jmp 0x6106c
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x6106c
jmp 0x611d8
movq -0x10(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
cmpq %rcx, %rax
jne 0x611d8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7b260
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpl $0x2, -0x10(%rax)
je 0x610c4
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
leaq 0x34fd7(%rip), %rsi     # 0x9606e
callq 0x1fff0
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0xc8(%rbp), %rdi
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rsi
callq 0x1ff40
jmp 0x61217
movq -0x70(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x90(%rbp), %rdi
callq 0x21590
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0xa8(%rbp), %rdi
callq 0x21590
movq -0xb8(%rbp), %rcx
movq -0xc8(%rbp), %rdi
movl 0x20(%rcx), %eax
andl $0xfffaffff, %eax       # imm = 0xFFFAFFFF
movl %eax, 0x20(%rcx)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x21590
movq -0xb8(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq (%rcx), %rdi
movl $0x3c, %esi
leaq -0x90(%rbp), %r8
leaq -0xa8(%rbp), %rcx
xorl %edx, %edx
movq (%r8), %r9
movq %r9, (%rsp)
movq 0x8(%r8), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%r8), %r8
movq %r8, 0x10(%rsp)
movq (%rcx), %r8
movq %r8, 0x18(%rsp)
movq 0x8(%rcx), %r8
movq %r8, 0x20(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x28(%rsp)
movq (%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
callq 0x2a2c0
jmp 0x61217
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
leaq 0x34eb1(%rip), %rsi     # 0x9609a
callq 0x1fff0
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0xc8(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
callq 0x1ff40
movq -0xc0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)