// File: /workspace/github_c_makefile_star2_O0/atomlang[P]atomlang/src/pk_var.c
// Function: pkGetValueType
PkVarType pkGetValueType(const PkVar value) {
  __ASSERT(value != NULL, "Given value was NULL.");

  if (IS_NULL(*(const Var*)(value))) return PK_NULL;
  if (IS_BOOL(*(const Var*)(value))) return PK_BOOL;
  if (IS_NUM(*(const Var*)(value))) return PK_NUMBER;

  __ASSERT(IS_OBJ(*(const Var*)(value)),
           "Invalid var pointer. Might be a dangling pointer");

  const Object* obj = AS_OBJ(*(const Var*)(value));
  switch (obj->type) {
    case OBJ_STRING: return PK_STRING;
    case OBJ_LIST:   return PK_LIST;
    case OBJ_MAP:    return PK_MAP;
    case OBJ_RANGE:  return PK_RANGE;
    case OBJ_SCRIPT: return PK_SCRIPT;
    case OBJ_FUNC:   return PK_FUNCTION;
    case OBJ_FIBER:  return PK_FIBER;
    case OBJ_CLASS:  return PK_CLASS;
    case OBJ_INST:   return PK_INST;
  }

  UNREACHABLE();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x24fb
movq 0x30b30(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x27c7e(%rip), %rsi     # 0x2a150
leaq 0x27c9e(%rip), %rdx     # 0x2a177
leaq 0x27cad(%rip), %rcx     # 0x2a18d
leaq 0x27cb5(%rip), %r8      # 0x2a19c
movl $0x13, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x24fd
movq 0x18(%rsp), %rax
movabsq $0x7ffc000000000000, %rcx # imm = 0x7FFC000000000000
cmpq %rcx, (%rax)
jne 0x251e
movl $0x0, 0x24(%rsp)
jmp 0x26b3
movq 0x18(%rsp), %rax
movabsq $0x7ffd000000000003, %rcx # imm = 0x7FFD000000000003
cmpq %rcx, (%rax)
je 0x2546
movq 0x18(%rsp), %rax
movabsq $0x7ffd000000000002, %rcx # imm = 0x7FFD000000000002
cmpq %rcx, (%rax)
jne 0x2553
movl $0x1, 0x24(%rsp)
jmp 0x26b3
movq 0x18(%rsp), %rcx
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
andq (%rcx), %rax
movabsq $0x7ffc000000000000, %rcx # imm = 0x7FFC000000000000
cmpq %rcx, %rax
je 0x2581
movl $0x2, 0x24(%rsp)
jmp 0x26b3
jmp 0x2583
movq 0x18(%rsp), %rcx
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
andq (%rcx), %rax
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
cmpq %rcx, %rax
je 0x25de
movq 0x30a4d(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x27b9b(%rip), %rsi     # 0x2a150
leaq 0x27bed(%rip), %rdx     # 0x2a1a9
leaq 0x27bca(%rip), %rcx     # 0x2a18d
leaq 0x27bd2(%rip), %r8      # 0x2a19c
movl $0x1a, %r9d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x25e0
movq 0x18(%rsp), %rax
movq (%rax), %rax
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
andq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x8, %rax
ja 0x267e
movq 0x8(%rsp), %rax
leaq 0x279ec(%rip), %rcx     # 0x2a004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x3, 0x24(%rsp)
jmp 0x26b3
movl $0x4, 0x24(%rsp)
jmp 0x26b3
movl $0x5, 0x24(%rsp)
jmp 0x26b3
movl $0x6, 0x24(%rsp)
jmp 0x26b3
movl $0x7, 0x24(%rsp)
jmp 0x26b3
movl $0x8, 0x24(%rsp)
jmp 0x26b3
movl $0x9, 0x24(%rsp)
jmp 0x26b3
movl $0xa, 0x24(%rsp)
jmp 0x26b3
movl $0xb, 0x24(%rsp)
jmp 0x26b3
jmp 0x2680
movq 0x30971(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x27b49(%rip), %rsi     # 0x2a1da
leaq 0x27af5(%rip), %rdx     # 0x2a18d
leaq 0x27afd(%rip), %rcx     # 0x2a19c
movl $0x29, %r8d
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)