// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/asm.c
// Function: janet_asm_decode_instruction
Janet janet_asm_decode_instruction(uint32_t instr) {
    const JanetInstructionDef *def = janet_asm_reverse_lookup(instr);
    Janet name;
    if (NULL == def) {
        return janet_wrap_integer((int32_t)instr);
    }
    name = janet_csymbolv(def->name);
    const Janet *ret = NULL;
#define oparg(shift, mask) ((instr >> ((shift) << 3)) & (mask))
    switch (janet_instructions[def->opcode]) {
        case JINT_0:
            ret = tup1(name);
            break;
        case JINT_S:
            ret = tup2(name, janet_wrap_integer(oparg(1, 0xFFFFFF)));
            break;
        case JINT_L:
            ret = tup2(name, janet_wrap_integer((int32_t)instr >> 8));
            break;
        case JINT_SS:
        case JINT_ST:
        case JINT_SC:
        case JINT_SU:
        case JINT_SD:
            ret = tup3(name,
                       janet_wrap_integer(oparg(1, 0xFF)),
                       janet_wrap_integer(oparg(2, 0xFFFF)));
            break;
        case JINT_SI:
        case JINT_SL:
            ret =  tup3(name,
                        janet_wrap_integer(oparg(1, 0xFF)),
                        janet_wrap_integer((int32_t)instr >> 16));
            break;
        case JINT_SSS:
        case JINT_SES:
        case JINT_SSU:
            ret = tup4(name,
                       janet_wrap_integer(oparg(1, 0xFF)),
                       janet_wrap_integer(oparg(2, 0xFF)),
                       janet_wrap_integer(oparg(3, 0xFF)));
            break;
        case JINT_SSI:
            ret = tup4(name,
                       janet_wrap_integer(oparg(1, 0xFF)),
                       janet_wrap_integer(oparg(2, 0xFF)),
                       janet_wrap_integer((int32_t)instr >> 24));
            break;
    }
#undef oparg
    if (ret) {
        /* Check if break point set */
        if (instr & 0x80) {
            janet_tuple_flag(ret) |= JANET_TUPLE_FLAG_BRACKETCTOR;
        }
        return janet_wrap_tuple(ret);
    }
    return janet_wrap_nil();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x16220
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x15f85
cvtsi2sdl -0xc(%rbp), %xmm0
callq 0x7b820
movq %rax, -0x8(%rbp)
jmp 0x16205
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x7b550
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
leaq 0x9a689(%rip), %rax     # 0xb0650
movl (%rax,%rcx,4), %eax
movq %rax, -0x98(%rbp)
subq $0xd, %rax
ja 0x161b5
movq -0x98(%rbp), %rax
leaq 0x68e07(%rip), %rcx     # 0x7edf0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rdi
callq 0x16290
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x162d0
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
sarl $0x8, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x162d0
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x48(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
andl $0xffff, %eax           # imm = 0xFFFF
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x16320
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %eax
sarl $0x10, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x16320
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x68(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x70(%rbp)
movl -0xc(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rcx
callq 0x16380
movq %rax, -0x30(%rbp)
jmp 0x161b5
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x80(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x88(%rbp)
movl -0xc(%rbp), %eax
sarl $0x18, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
callq 0x16380
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x161f2
movl -0xc(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x161d9
movq -0x30(%rbp), %rax
movl -0x20(%rax), %ecx
orl $0x10000, %ecx          # imm = 0x10000
movl %ecx, -0x20(%rax)
movq -0x30(%rbp), %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
jmp 0x16205
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)