LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: newFunction
Function* newFunction(PKVM* vm, const char* name, int length, Script* owner,
                      bool is_native, const char* docstring) {

  Function* func = ALLOCATE(vm, Function);
  varInitObject(&func->_super, vm, OBJ_FUNC);

  vmPushTempRef(vm, &func->_super); // func

  if (owner == NULL) {
    ASSERT(is_native, OOPS);
    func->name = name;
    func->owner = NULL;
    func->is_native = is_native;

  } else {
    pkFunctionBufferWrite(&owner->functions, vm, func);
    uint32_t name_index = scriptAddName(owner, vm, name, length);

    func->name = owner->names.data[name_index]->data;
    func->owner = owner;
    func->arity = -2; // -1 means variadic args.
    func->is_native = is_native;
  }

  if (is_native) {
    func->native = NULL;

  } else {
    Fn* fn = ALLOCATE(vm, Fn);
    pkByteBufferInit(&fn->opcodes);
    pkUintBufferInit(&fn->oplines);
    fn->stack_size = 0;
    func->fn = fn;
  }

  // Both native and script (TODO:) functions support docstring.
  func->docstring = docstring;

  vmPopTempRef(vm); // func
  return func;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %r8d, %ebp
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, %r13
movq %rdi, %r14
pushq $0x40
popq %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
movq %rax, %r15
movl $0x5, (%rax)
movb $0x0, 0x4(%rax)
movq (%r14), %rax
movq %rax, 0x8(%r15)
movq %r15, (%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x5cb0
testq %r12, %r12
je 0x386b
leaq 0x40(%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2f19
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x38d9
movq 0x60(%r12), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
addq $0x1c, %rax
movq %rax, 0x10(%r15)
movq %r12, 0x18(%r15)
movl $0xfffffffe, 0x20(%r15) # imm = 0xFFFFFFFE
movb %bpl, 0x30(%r15)
testb %bpl, %bpl
jne 0x387d
pushq $0x28
popq %rcx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
andl $0x0, 0x20(%rax)
movq %rax, 0x38(%r15)
jmp 0x3882
testb %bpl, %bpl
je 0x38a4
movq %r13, 0x10(%r15)
andq $0x0, 0x18(%r15)
movb %bpl, 0x30(%r15)
andq $0x0, 0x38(%r15)
movq (%rsp), %rax
movq %rax, 0x28(%r15)
movq %r14, %rdi
callq 0x5dac
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f74d(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x1483b(%rip), %rsi     # 0x180f0
leaq 0x14948(%rip), %rdx     # 0x18204
leaq 0x14970(%rip), %rcx     # 0x18233
leaq 0x14872(%rip), %r8      # 0x1813c
movl $0x1a4, %r9d            # imm = 0x1A4
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: scriptAddName
uint32_t scriptAddName(Script* self, PKVM* vm, const char* name,
  uint32_t length) {

  for (uint32_t i = 0; i < self->names.count; i++) {
    String* _name = self->names.data[i];
    if (_name->length == length && strncmp(_name->data, name, length) == 0) {
      // Name already exists in the buffer.
      return i;
    }
  }

  // If we reach here the name doesn't exists in the buffer, so add it and
  // return the index.
  String* new_name = newStringLength(vm, name, length);
  vmPushTempRef(vm, &new_name->_super);
  pkStringBufferWrite(&self->names, vm, new_name);
  vmPopTempRef(vm);
  return self->names.count - 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, 0x8(%rsp)
leaq 0x60(%rdi), %r15
movq %rdi, 0x10(%rsp)
movl 0x68(%rdi), %r14d
movl %ecx, %ebx
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x392c
movq (%r15), %rax
movq (%rax,%r13,8), %rdi
cmpl %ebp, 0x14(%rdi)
jne 0x3927
addq $0x1c, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2090
testl %eax, %eax
je 0x396e
incq %r13
jmp 0x3903
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x261f
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x5cb0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2e22
movq %r14, %rdi
callq 0x5dac
movq 0x10(%rsp), %rax
movl 0x68(%rax), %r13d
decl %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: newClass
Class* newClass(PKVM* vm, Script* scr, const char* name, uint32_t length) {
  Class* type = ALLOCATE(vm, Class);
  varInitObject(&type->_super, vm, OBJ_CLASS);

  vmPushTempRef(vm, &type->_super); // type.

  pkClassBufferWrite(&scr->classes, vm, type);
  type->owner = scr;
  type->name = scriptAddName(scr, vm, name, length);
  pkUintBufferInit(&type->field_names);

  // Can't use '$' in string format. (TODO)
  String* ty_name = scr->names.data[type->name];
  String* dollar = newStringLength(vm, "$", 1);
  vmPushTempRef(vm, &dollar->_super); // dollar
  String* ctor_name = stringFormat(vm, "@(Ctor:@)", dollar, ty_name);
  vmPopTempRef(vm); // dollar

  // Constructor.
  vmPushTempRef(vm, &ctor_name->_super); // ctor_name
  type->ctor = newFunction(vm, ctor_name->data, ctor_name->length,
                           scr, false, NULL);
  vmPopTempRef(vm); // ctor_name

  vmPopTempRef(vm); // type.
  return type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x38
popq %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
movq %rax, %r14
movl $0x7, (%rax)
movb $0x0, 0x4(%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5cb0
leaq 0x50(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3010
movq %r15, 0x10(%r14)
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x38d9
movl %eax, 0x18(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq 0x60(%r15), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %r12
leaq 0x16390(%rip), %rsi     # 0x19d94
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x261f
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5cb0
leaq 0x1481b(%rip), %rsi     # 0x1823f
movq %rbx, %rdi
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3a8d
movq %rax, %r12
movq %rbx, %rdi
callq 0x5dac
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5cb0
movl 0x14(%r12), %edx
addq $0x1c, %r12
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x37b0
movq %rax, 0x20(%r14)
movq %rbx, %rdi
callq 0x5dac
movq %rbx, %rdi
callq 0x5dac
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: newInstance
Instance* newInstance(PKVM* vm, Class* ty, bool initialize) {

  Instance* inst = ALLOCATE(vm, Instance);
  varInitObject(&inst->_super, vm, OBJ_INST);

  vmPushTempRef(vm, &inst->_super); // inst.

  ASSERT(ty->name < ty->owner->names.count, OOPS);
  inst->name = ty->owner->names.data[ty->name]->data;
  inst->is_native = false;

  Inst* ins = ALLOCATE(vm, Inst);
  inst->ins = ins;
  ins->type = ty;
  pkVarBufferInit(&ins->fields);

  if (initialize && ty->field_names.count != 0) {
    pkVarBufferFill(&ins->fields, vm, VAR_NULL, ty->field_names.count);
  }

  vmPopTempRef(vm); // inst.

  return inst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x28
popq %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
movq %rax, %r14
movl $0x8, (%rax)
movb $0x0, 0x4(%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5cb0
movl 0x18(%r15), %eax
movq 0x10(%r15), %rcx
cmpl 0x68(%rcx), %eax
jae 0x3d5f
movq 0x60(%rcx), %rcx
movq (%rcx,%rax,8), %rax
addq $0x1c, %rax
movq %rax, 0x10(%r14)
movb $0x0, 0x18(%r14)
pushq $0x18
popq %rcx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
movq %rax, 0x20(%r14)
movq %r15, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
testb %bpl, %bpl
je 0x3d49
movl 0x30(%r15), %ecx
testl %ecx, %ecx
je 0x3d49
addq $0x8, %rax
movabsq $0x7ffc000000000000, %rdx # imm = 0x7FFC000000000000
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2cf0
movq %rbx, %rdi
callq 0x5dac
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f292(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x14380(%rip), %rsi     # 0x180f0
leaq 0x1448d(%rip), %rdx     # 0x18204
leaq 0x144cb(%rip), %rcx     # 0x18249
leaq 0x143b7(%rip), %r8      # 0x1813c
movl $0x215, %r9d            # imm = 0x215
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: rangeAsList
List* rangeAsList(PKVM* vm, Range* self) {
  List* list;
  if (self->from < self->to) {
    list = newList(vm, (uint32_t)(self->to - self->from));
    for (double i = self->from; i < self->to; i++) {
      pkVarBufferWrite(&list->elements, vm, VAR_NUM(i));
    }
    return list;

  } else {
    list = newList(vm, 0);
  }

  return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd 0x10(%rsi), %xmm0
movsd 0x18(%rsi), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3e15
movq %rsi, %r14
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
movq %rbx, %rdi
callq 0x2747
movq %rax, %r15
movsd 0x10(%r14), %xmm0
movq %rax, %r12
addq $0x10, %r12
movsd 0x18(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3e06
movsd %xmm0, (%rsp)
callq 0xab89
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2d2b
movsd (%rsp), %xmm0
addsd 0x142e4(%rip), %xmm0    # 0x180e8
jmp 0x3dd3
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2747
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: stringLower
String* stringLower(PKVM* vm, String* self) {
  // If the string itself is already lower, don't allocate new string.
  uint32_t index = 0;
  for (const char* c = self->data; *c != '\0'; c++, index++) {
    if (isupper(*c)) {

      // It contain upper case letters, allocate new lower case string .
      String* lower = newStringLength(vm, self->data, self->length);

      // Start where the first upper case letter found.
      char* _c = lower->data + (c - self->data);
      for (; *_c != '\0'; _c++) *_c = (char)tolower(*_c);

      // Since the string is modified re-hash it.
      lower->hash = utilHashString(lower->data);
      return lower;
    }
  }
  // If we reached here the string itself is lower, return it.
  return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1c(%rsi), %r14
pushq $0x1c
popq %r12
movsbq (%rbx,%r12), %r13
testq %r13, %r13
je 0x3ea2
callq 0x23c0
movq (%rax), %rax
testb $0x1, 0x1(%rax,%r13,2)
jne 0x3e60
incq %r12
jmp 0x3e41
movl 0x14(%rbx), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x261f
movq %rax, %rbx
leaq 0x1c(%rax), %r14
addq %rax, %r12
movsbq (%r12), %r15
testq %r15, %r15
je 0x3e97
callq 0x23b0
movq (%rax), %rax
movb (%rax,%r15,4), %al
movb %al, (%r12)
incq %r12
jmp 0x3e78
movq %r14, %rdi
callq 0xabd7
movl %eax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: stringUpper
String* stringUpper(PKVM* vm, String* self) {
  // If the string itself is already upper don't allocate new string.
  uint32_t index = 0;
  for (const char* c = self->data; *c != '\0'; c++, index++) {
    if (islower(*c)) {
      // It contain lower case letters, allocate new upper case string .
      String* upper = newStringLength(vm, self->data, self->length);

      // Start where the first lower case letter found.
      char* _c = upper->data + (c - self->data);
      for (; *_c != '\0'; _c++) *_c = (char)toupper(*_c);

      // Since the string is modified re-hash it.
      upper->hash = utilHashString(upper->data);
      return upper;
    }
  }
  // If we reached here the string itself is lower, return it.
  return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1c(%rsi), %r14
pushq $0x1c
popq %r12
movsbq (%rbx,%r12), %r13
testq %r13, %r13
je 0x3f27
callq 0x23c0
movq (%rax), %rax
testb $0x2, 0x1(%rax,%r13,2)
jne 0x3ee5
incq %r12
jmp 0x3ec6
movl 0x14(%rbx), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x261f
movq %rax, %rbx
leaq 0x1c(%rax), %r14
addq %rax, %r12
movsbq (%r12), %r15
testq %r15, %r15
je 0x3f1c
callq 0x2030
movq (%rax), %rax
movb (%rax,%r15,4), %al
movb %al, (%r12)
incq %r12
jmp 0x3efd
movq %r14, %rdi
callq 0xabd7
movl %eax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: stringStrip
String* stringStrip(PKVM* vm, String* self) {

  // Implementation:
  //
  // "     a string with leading and trailing white space    "
  //  ^start >>                                       << end^
  //
  // These 'start' and 'end' pointers will move respectively right and left
  // while it's a white space and return an allocated string from 'start' with
  // length of (end - start + 1). For already trimmed string it'll not allocate
  // a new string, instead returns the same string provided.

  const char* start = self->data;
  while (*start && isspace(*start)) start++;

  // If we reached the end of the string, it's all white space, return
  // an empty string.
  if (*start == '\0') {
    return newStringLength(vm, NULL, 0);
  }

  const char* end = self->data + self->length - 1;
  while (isspace(*end)) end--;

  // If the string is already trimmed, return the same string.
  if (start == self->data && end == self->data + self->length - 1) {
    return self;
  }

  return newStringLength(vm, start, (uint32_t)(end - start + 1));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1c
popq %r15
pushq $-0x1
popq %rbp
movsbq (%r14,%r15), %r12
testq %r12, %r12
je 0x3f6a
callq 0x23c0
movq (%rax), %rcx
testb $0x20, 0x1(%rcx,%r12,2)
je 0x3f73
incq %r15
incl %ebp
jmp 0x3f49
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
jmp 0x3fb7
leaq (%r14,%r15), %rsi
movl 0x14(%r14), %eax
leaq (%rax,%r14), %rdi
addq $0x1b, %rdi
xorl %edx, %edx
movsbq (%rdi,%rdx), %r8
decq %rdx
testb $0x20, 0x1(%rcx,%r8,2)
jne 0x3f85
xorq $0x1c, %r15
movq %rdx, %rcx
notq %rcx
orq %r15, %rcx
jne 0x3fb0
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
subl %ebp, %eax
addl %eax, %edx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x261f
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: stringJoin
String* stringJoin(PKVM* vm, String* str1, String* str2) {

  // Optimize end case.
  if (str1->length == 0) return str2;
  if (str2->length == 0) return str1;

  size_t length = (size_t)str1->length + (size_t)str2->length;
  String* string = _allocateString(vm, length);

  memcpy(string->data, str1->data, str1->length);
  memcpy(string->data + str1->length, str2->data, str2->length);
  // Null byte already existed. From _allocateString.

  string->hash = utilHashString(string->data);
  return string;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl 0x14(%rsi), %eax
testq %rax, %rax
je 0x4030
movq %rsi, %r14
movl 0x14(%rbx), %esi
testq %rsi, %rsi
je 0x402d
addq %rax, %rsi
callq 0x34d8
movq %rax, %r15
leaq 0x1c(%rax), %r12
leaq 0x1c(%r14), %rsi
movl 0x14(%r14), %edx
movq %r12, %rdi
callq 0x2280
movl 0x14(%r14), %eax
leaq (%r15,%rax), %rdi
addq $0x1c, %rdi
movl 0x14(%rbx), %edx
addq $0x1c, %rbx
movq %rbx, %rsi
callq 0x2280
movq %r12, %rdi
callq 0xabd7
movl %eax, 0x10(%r15)
movq %r15, %rbx
jmp 0x4030
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: listInsert
void listInsert(PKVM* vm, List* self, uint32_t index, Var value) {

  // Add an empty slot at the end of the buffer.
  if (IS_OBJ(value)) vmPushTempRef(vm, AS_OBJ(value));
  pkVarBufferWrite(&self->elements, vm, VAR_NULL);
  if (IS_OBJ(value)) vmPopTempRef(vm);

  // Shift the existing elements down.
  for (uint32_t i = self->elements.count - 1; i > index; i--) {
    self->elements.data[i] = self->elements.data[i - 1];
  }

  // Insert the new element.
  self->elements.data[index] = value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq %rcx, %r12
shrq $0x32, %r12
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x4077
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %rbx, %rsi
movq %r15, %rdi
callq 0x5cb0
leaq 0x10(%r14), %rdi
movabsq $0x7ffc000000000000, %rdx # imm = 0x7FFC000000000000
movq %r15, %rsi
callq 0x2d2b
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x409e
movq %r15, %rdi
callq 0x5dac
movl 0x18(%r14), %edx
movq 0x10(%r14), %rax
leal -0x2(%rdx), %ecx
decl %edx
leaq (%rax,%rdx,8), %rdx
leal 0x1(%rcx), %esi
cmpl %ebp, %esi
jbe 0x40c7
movl %ecx, %esi
movq (%rax,%rsi,8), %rsi
movq %rsi, (%rdx)
decl %ecx
addq $-0x8, %rdx
jmp 0x40af
movl %ebp, %ecx
movq %rbx, (%rax,%rcx,8)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: listRemoveAt
Var listRemoveAt(PKVM* vm, List* self, uint32_t index) {
  Var removed = self->elements.data[index];
  if (IS_OBJ(removed)) vmPushTempRef(vm, AS_OBJ(removed));

  // Shift the rest of the elements up.
  for (uint32_t i = index; i < self->elements.count - 1; i++) {
    self->elements.data[i] = self->elements.data[i + 1];
  }

  // Shrink the size if it's too much excess.
  if (self->elements.capacity / GROW_FACTOR >= self->elements.count) {
    self->elements.data = (Var*)vmRealloc(vm, self->elements.data,
      sizeof(Var) * self->elements.capacity,
      sizeof(Var) * self->elements.capacity / GROW_FACTOR);
    self->elements.capacity /= GROW_FACTOR;
  }

  if (IS_OBJ(removed)) vmPopTempRef(vm);

  self->elements.count--;
  return removed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%rsi), %rax
movl %edx, %r13d
movq (%rax,%r13,8), %r14
movq %r14, %r12
shrq $0x32, %r12
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x4115
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %r14, %rsi
movq %r15, %rdi
callq 0x5cb0
movl 0x18(%rbx), %eax
leal -0x1(%rax), %ecx
cmpq %rcx, %r13
jae 0x4132
movq 0x10(%rbx), %rdx
movq 0x8(%rdx,%r13,8), %rsi
movq %rsi, (%rdx,%r13,8)
incq %r13
jmp 0x411b
movl 0x1c(%rbx), %ecx
movl %ecx, %edx
shrl %edx
cmpl %eax, %edx
jb 0x415c
movq 0x10(%rbx), %rsi
leaq (,%rcx,8), %rdx
shlq $0x2, %rcx
movq %r15, %rdi
callq 0x5a41
movq %rax, 0x10(%rbx)
shrl 0x1c(%rbx)
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x416d
movq %r15, %rdi
callq 0x5dac
decl 0x18(%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: listJoin
List* listJoin(PKVM* vm, List* l1, List* l2) {

  // Optimize end case.
  if (l1->elements.count == 0) return l2;
  if (l2->elements.count == 0) return l1;

  uint32_t size = l1->elements.count + l2->elements.count;
  List* list = newList(vm, size);

  vmPushTempRef(vm, &list->_super);
  pkVarBufferConcat(&list->elements, vm, &l1->elements);
  pkVarBufferConcat(&list->elements, vm, &l2->elements);
  vmPopTempRef(vm);

  return list;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl 0x18(%rsi), %eax
testl %eax, %eax
je 0x41ed
movq %rsi, %r15
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x41ea
movq %rdi, %r14
addq $0x10, %r15
addq $0x10, %rbx
addl %eax, %esi
callq 0x2747
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x5cb0
movq %r12, %r13
addq $0x10, %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2d33
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2d33
movq %r14, %rdi
callq 0x5dac
movq %r12, %rbx
jmp 0x41ed
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: varHashValue
uint32_t varHashValue(Var v) {
  if (IS_OBJ(v)) return _hashObject(AS_OBJ(v));

#if VAR_NAN_TAGGING
  return utilHashBits(v);
#else
  #error TODO:
#endif
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0x4248
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rbx
movl (%rbx), %eax
leal -0x3(%rax), %ecx
cmpl $-0x2, %ecx
jae 0x4296
testl %eax, %eax
je 0x4256
cmpl $0x3, %eax
jne 0x4260
movsd 0x10(%rbx), %xmm0
callq 0xabcd
movl %eax, %ebp
movsd 0x18(%rbx), %xmm0
callq 0xabcd
xorl %ebp, %eax
jmp 0x4259
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xab95
movl 0x10(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addl $-0x4, %eax
cmpl $0x5, %eax
jae 0x42cb
movq 0x1ed89(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13e77(%rip), %rsi     # 0x180f0
leaq 0x140cf(%rip), %rdx     # 0x1834f
leaq 0x140bc(%rip), %rcx     # 0x18343
leaq 0x13eae(%rip), %r8      # 0x1813c
movl $0x32d, %r9d            # imm = 0x32D
jmp 0x42c2
movq 0x1ed5b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13e49(%rip), %rsi     # 0x180f0
leaq 0x14062(%rip), %rdx     # 0x18310
leaq 0x1408e(%rip), %rcx     # 0x18343
leaq 0x13e80(%rip), %r8      # 0x1813c
movl $0x317, %r9d            # imm = 0x317
xorl %eax, %eax
callq 0x2250
ud2
movq 0x1ed26(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13e9e(%rip), %rsi     # 0x1817a
leaq 0x14060(%rip), %rdx     # 0x18343
leaq 0x13e52(%rip), %rcx     # 0x1813c
movl $0x332, %r8d            # imm = 0x332
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: mapSet
void mapSet(PKVM* vm, Map* self, Var key, Var value) {

  // If map is about to fill, resize it first.
  if (self->count + 1 > self->capacity * MAP_LOAD_PERCENT / 100) {
    uint32_t capacity = self->capacity * GROW_FACTOR;
    if (capacity < MIN_CAPACITY) capacity = MIN_CAPACITY;
    _mapResize(vm, self, capacity);
  }

  if (_mapInsertEntry(self, key, value)) {
    self->count++; //< A new key added.
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movl 0x10(%rsi), %ecx
movl 0x14(%rsi), %esi
incl %esi
imull $0x4b, %ecx, %eax
pushq $0x64
popq %r8
xorl %edx, %edx
divl %r8d
cmpl %eax, %esi
jbe 0x44b4
addl %ecx, %ecx
cmpl $0x9, %ecx
pushq $0x8
popq %rdx
cmovael %ecx, %edx
movq %rbx, %rsi
callq 0x44cf
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x457a
testb %al, %al
je 0x44c9
incl 0x14(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: mapResize
static void _mapResize(PKVM* vm, Map* self, uint32_t capacity) {

  MapEntry* old_entries = self->entries;
  uint32_t old_capacity = self->capacity;

  self->entries = ALLOCATE_ARRAY(vm, MapEntry, capacity);
  self->capacity = capacity;
  for (uint32_t i = 0; i < capacity; i++) {
    self->entries[i].key = VAR_UNDEFINED;
    self->entries[i].value = VAR_FALSE;
  }

  // Insert the old entries to the new entries.
  for (uint32_t i = 0; i < old_capacity; i++) {
    // Skip the empty entries or tombstones.
    if (IS_UNDEF(old_entries[i].key)) continue;

    _mapInsertEntry(self, old_entries[i].key, old_entries[i].value);
  }

  DEALLOCATE(vm, old_entries);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %r15
movabsq $0x7ffd000000000000, %r13 # imm = 0x7FFD000000000000
movq 0x18(%rsi), %r14
movl 0x10(%rsi), %ebx
movl %edx, %r12d
shlq $0x4, %r12
xorl %ebp, %ebp
movq %rdi, 0x10(%rsp)
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %rcx
callq 0x5a41
movq %rax, 0x18(%r15)
movl 0xc(%rsp), %ecx
movl %ecx, 0x10(%r15)
leaq 0x2(%r13), %rcx
cmpq %rbp, %r12
je 0x4533
movq %r13, (%rax,%rbp)
movq %rcx, 0x8(%rax,%rbp)
addq $0x10, %rbp
jmp 0x451f
shlq $0x4, %rbx
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x455b
movq (%r14,%r12), %rsi
cmpq %r13, %rsi
je 0x4555
movq 0x8(%r14,%r12), %rdx
movq %r15, %rdi
callq 0x457a
addq $0x10, %r12
jmp 0x453a
movq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5a41
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: mapInsertEntry
static bool _mapInsertEntry(Map* self, Var key, Var value) {

  ASSERT(self->capacity != 0, "Should ensure the capacity before inserting.");

  MapEntry* result;
  if (_mapFindEntry(self, key, &result)) {
    // Key already found, just replace the value.
    result->value = value;
    return false;
  } else {
    result->key = key;
    result->value = value;
    return true;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0x10(%rdi)
je 0x45b6
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x431c
movq (%r15), %rcx
testb %al, %al
jne 0x45a6
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
xorb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x1ea3b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13b29(%rip), %rsi     # 0x180f0
leaq 0x13db0(%rip), %rdx     # 0x1837e
leaq 0x13dd6(%rip), %rcx     # 0x183ab
leaq 0x13b60(%rip), %r8      # 0x1813c
movl $0x37f, %r9d            # imm = 0x37F
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: mapRemoveKey
Var mapRemoveKey(PKVM* vm, Map* self, Var key) {
  MapEntry* entry;
  if (!_mapFindEntry(self, key, &entry)) return VAR_NULL;

  // Set the key as VAR_UNDEFINED to mark is as an available slow and set it's
  // value to VAR_TRUE for tombstone.
  Var value = entry->value;
  entry->key = VAR_UNDEFINED;
  entry->value = VAR_TRUE;

  self->count--;

  if (IS_OBJ(value)) vmPushTempRef(vm, AS_OBJ(value));

  if (self->count == 0) {
    // Clear the map if it's empty.
    mapClear(vm, self);

 } else if ((self->capacity > MIN_CAPACITY) &&
             (self->capacity / (GROW_FACTOR * GROW_FACTOR)) >
             ((self->count * 100) / MAP_LOAD_PERCENT)) {

    // We grow the map when it's filled 75% (MAP_LOAD_PERCENT) by 2
    // (GROW_FACTOR) but we're not shrink the map when it's half filled (ie.
    // half of the capacity is 75%). Instead we wait till it'll become 1/4 is
    // filled (1/4 = 1/(GROW_FACTOR*GROW_FACTOR)) to minimize the
    // reallocations and which is more faster.

    uint32_t capacity = self->capacity / (GROW_FACTOR * GROW_FACTOR);
    if (capacity < MIN_CAPACITY) capacity = MIN_CAPACITY;

    _mapResize(vm, self, capacity);
  }

  if (IS_OBJ(value)) vmPopTempRef(vm);

  return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x431c
testb %al, %al
je 0x46b0
movq (%rsp), %rax
movq 0x8(%rax), %r14
movabsq $0x7ffd000000000000, %rcx # imm = 0x7FFD000000000000
movq %rcx, (%rax)
orq $0x3, %rcx
movq %rcx, 0x8(%rax)
movl 0x14(%r15), %eax
decl %eax
movl %eax, 0x14(%r15)
movq %r14, %r12
shrq $0x32, %r12
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x467c
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %r14, %rsi
movq %rbx, %rdi
callq 0x5cb0
movl 0x14(%r15), %eax
testl %eax, %eax
je 0x46bc
movl 0x10(%r15), %ecx
cmpl $0x9, %ecx
jb 0x46c7
shrl $0x2, %ecx
imull $0x64, %eax, %eax
pushq $0x4b
popq %rsi
xorl %edx, %edx
divl %esi
cmpl %eax, %ecx
jbe 0x46c7
cmpl $0x9, %ecx
pushq $0x8
popq %rdx
cmovael %ecx, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44cf
jmp 0x46c7
movabsq $0x7ffc000000000000, %r14 # imm = 0x7FFC000000000000
jmp 0x46d8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45eb
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x46d8
movq %rbx, %rdi
callq 0x5dac
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: scriptGetClass
int scriptGetClass(Script* script, const char* name, uint32_t length) {
  for (uint32_t i = 0; i < script->classes.count; i++) {
    uint32_t name_ind = script->classes.data[i]->name;
    ASSERT(name_ind < script->names.count, OOPS);
    String* ty_name = script->names.data[name_ind];
    if (ty_name->length == length &&
        strncmp(ty_name->data, name, length) == 0) {
      return (int)i;
    }
  }
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl 0x58(%rdi), %r13d
movl %edx, %r12d
xorl %ebp, %ebp
cmpq %r13, %rbp
jae 0x4883
movq 0x50(%r15), %rax
movq (%rax,%rbp,8), %rax
movl 0x18(%rax), %eax
cmpl 0x68(%r15), %eax
jae 0x4899
movq 0x60(%r15), %rcx
movq (%rcx,%rax,8), %rdi
cmpl %ebx, 0x14(%rdi)
jne 0x487e
addq $0x1c, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
je 0x4888
incq %rbp
jmp 0x4848
pushq $-0x1
popq %rax
jmp 0x488a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1e758(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13846(%rip), %rsi     # 0x180f0
leaq 0x13953(%rip), %rdx     # 0x18204
leaq 0x139a2(%rip), %rcx     # 0x1825a
leaq 0x1387d(%rip), %r8      # 0x1813c
movl $0x44f, %r9d            # imm = 0x44F
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: scriptGetFunc
int scriptGetFunc(Script* script, const char* name, uint32_t length) {
  for (uint32_t i = 0; i < script->functions.count; i++) {
    const char* fn_name = script->functions.data[i]->name;
    uint32_t fn_length = (uint32_t)strlen(fn_name);
    if (fn_length == length && strncmp(fn_name, name, length) == 0) {
      return (int)i;
    }
  }
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, (%rsp)
movq %rdi, %r15
movl %edx, %r12d
movl 0x48(%rdi), %r14d
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0x4920
movq 0x40(%r15), %rax
movq (%rax,%rbp,8), %rax
movq 0x10(%rax), %r13
movq %r13, %rdi
callq 0x2140
cmpl %ebx, %eax
jne 0x491b
movq %r13, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
je 0x4925
incq %rbp
jmp 0x48eb
pushq $-0x1
popq %rax
jmp 0x4927
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: scriptGetGlobals
int scriptGetGlobals(Script* script, const char* name, uint32_t length) {
  for (uint32_t i = 0; i < script->global_names.count; i++) {
    uint32_t name_index = script->global_names.data[i];
    String* g_name = script->names.data[name_index];
    if (g_name->length == length && strncmp(g_name->data, name, length) == 0) {
      return (int)i;
    }
  }
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl 0x38(%rdi), %r13d
movl %edx, %r12d
xorl %ebp, %ebp
cmpq %r13, %rbp
jae 0x4983
movq 0x30(%r15), %rax
movq 0x60(%r15), %rcx
movl (%rax,%rbp,4), %eax
movq (%rcx,%rax,8), %rdi
cmpl %ebx, 0x14(%rdi)
jne 0x497e
addq $0x1c, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
je 0x4988
incq %rbp
jmp 0x4952
pushq $-0x1
popq %rax
jmp 0x498a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: toRepr
String* toRepr(PKVM* vm, const Var value) {
  pkByteBuffer buff;
  pkByteBufferInit(&buff);
  _toStringInternal(vm, value, &buff, NULL, true);
  String* ret = newStringLength(vm, (const char*)buff.data, buff.count);
  pkByteBufferClear(&buff, vm);
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
pushq $0x1
popq %r8
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x506b
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x261f
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ba1
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: varTypeName
const char* varTypeName(Var v) {
  if (IS_NULL(v)) return "Null";
  if (IS_BOOL(v)) return "Bool";
  if (IS_NUM(v))  return "Number";

  ASSERT(IS_OBJ(v), OOPS);
  Object* obj = AS_OBJ(v);
  return getObjectTypeName(obj->type);
}

// Assembly:
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
cmpq %rax, %rdi
jne 0x4e78
leaq 0x13459(%rip), %rax     # 0x182d0
retq
movq %rdi, %rcx
shrq %rcx
movabsq $0x3ffe800000000001, %rdx # imm = 0x3FFE800000000001
cmpq %rdx, %rcx
jne 0x4e95
leaq 0x14b82(%rip), %rax     # 0x19a16
retq
movq %rdi, %rcx
notq %rcx
testq %rcx, %rax
jne 0x4ec2
movq %rdi, %rax
shrq $0x32, %rax
cmpl $0x3ffe, %eax           # imm = 0x3FFE
jbe 0x4eca
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rdi
movl (%rdi), %edi
jmp 0x4e1c
leaq 0x14b75(%rip), %rax     # 0x19a3e
retq
pushq %rax
movq 0x1e126(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x13214(%rip), %rsi     # 0x180f0
leaq 0x13321(%rip), %rdx     # 0x18204
leaq 0x13413(%rip), %rcx     # 0x182fd
leaq 0x1324b(%rip), %r8      # 0x1813c
movl $0x532, %r9d            # imm = 0x532
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: isValuesEqual
bool isValuesEqual(Var v1, Var v2) {
  if (isValuesSame(v1, v2)) return true;

  // If we reach here only heap allocated objects could be compared.
  if (!IS_OBJ(v1) || !IS_OBJ(v2)) return false;

  Object* o1 = AS_OBJ(v1), *o2 = AS_OBJ(v2);
  if (o1->type != o2->type) return false;

  switch (o1->type) {
    case OBJ_RANGE:
      return ((Range*)o1)->from == ((Range*)o2)->from &&
             ((Range*)o1)->to   == ((Range*)o2)->to;

    case OBJ_STRING: {
      String* s1 = (String*)o1, *s2 = (String*)o2;
      return s1->hash == s2->hash &&
             s1->length == s2->length &&
             memcmp(s1->data, s2->data, s1->length) == 0;
    }

    case OBJ_LIST: {
      /*
      * l1 = []; list_append(l1, l1) # [[...]]
      * l2 = []; list_append(l2, l2) # [[...]]
      * l1 == l2 ## This will cause a stack overflow but not handling that
      *          ## (in python too).
      */
      List *l1 = (List*)o1, *l2 = (List*)o2;
      if (l1->elements.count != l2->elements.count) return false;
      Var* _v1 = l1->elements.data;
      Var* _v2 = l2->elements.data;
      for (uint32_t i = 0; i < l1->elements.count; i++) {
        if (!isValuesEqual(*_v1, *_v2)) return false;
        _v1++, _v2++;
      }
      return true;
    }

    default:
      return false;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movb $0x1, %bl
cmpq %rsi, %rdi
je 0x4fe4
movq %rdi, %rax
shrq $0x32, %rax
movl $0x3fff, %ecx           # imm = 0x3FFF
cmpl %ecx, %eax
setb %al
movq %rsi, %rdx
shrq $0x32, %rdx
cmpl %ecx, %edx
setb %cl
orb %al, %cl
jne 0x4fe2
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rdi
andq %rax, %rsi
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x4fe2
testl %eax, %eax
je 0x4fbe
cmpl $0x1, %eax
je 0x4f8b
cmpl $0x3, %eax
jne 0x4fe2
movsd 0x10(%rdi), %xmm0
ucomisd 0x10(%rsi), %xmm0
jne 0x4fe2
jp 0x4fe2
movsd 0x18(%rsi), %xmm0
cmpeqsd 0x18(%rdi), %xmm0
movq %xmm0, %rbx
andl $0x1, %ebx
jmp 0x4fe4
movl 0x18(%rdi), %r14d
cmpl 0x18(%rsi), %r14d
jne 0x4fe2
movq 0x10(%rdi), %r15
movq 0x10(%rsi), %r12
xorl %r13d, %r13d
cmpl %r13d, %r14d
sete %bl
je 0x4fe4
movq (%r15,%r13,8), %rdi
movq (%r12,%r13,8), %rsi
callq 0x4f07
testb %al, %al
je 0x4fe4
incq %r13
jmp 0x4fa0
movl 0x10(%rdi), %eax
cmpl 0x10(%rsi), %eax
jne 0x4fe2
movl 0x14(%rdi), %edx
cmpl 0x14(%rsi), %edx
jne 0x4fe2
addq $0x1c, %rdi
addq $0x1c, %rsi
callq 0x22d0
testl %eax, %eax
sete %bl
jmp 0x4fe4
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: toString
String* toString(PKVM* vm, const Var value) {

  // If it's already a string don't allocate a new string.
  if (IS_OBJ_TYPE(value, OBJ_STRING)) {
    return (String*)AS_OBJ(value);
  }

  pkByteBuffer buff;
  pkByteBufferInit(&buff);
  _toStringInternal(vm, value, &buff, NULL, false);
  String* ret = newStringLength(vm, (const char*)buff.data, buff.count);
  pkByteBufferClear(&buff, vm);
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0x5027
movabsq $0xffffffffffff, %r14   # imm = 0xFFFFFFFFFFFF
andq %rsi, %r14
cmpl $0x0, (%r14)
je 0x505e
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movq %rbx, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x506b
movq (%r15), %rsi
movl 0x8(%r15), %edx
movq %rbx, %rdi
callq 0x261f
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2ba1
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_var.c
// Function: toBool
bool toBool(Var v) {

  if (IS_BOOL(v)) return AS_BOOL(v);
  if (IS_NULL(v)) return false;
  if (IS_NUM(v)) return AS_NUM(v) != 0;

  ASSERT(IS_OBJ(v), OOPS);
  Object* o = AS_OBJ(v);
  switch (o->type) {
    case OBJ_STRING: return ((String*)o)->length != 0;
    case OBJ_LIST:   return ((List*)o)->elements.count != 0;
    case OBJ_MAP:    return ((Map*)o)->count != 0;
    case OBJ_RANGE: // [[FALLTHROUGH]]
    case OBJ_SCRIPT:
    case OBJ_FUNC:
    case OBJ_FIBER:
    case OBJ_CLASS:
    case OBJ_INST:
      return true;
  }

  UNREACHABLE();
}

// Assembly:
pushq %rax
movq %rdi, %rax
shrq %rax
movabsq $0x3ffe800000000001, %rcx # imm = 0x3FFE800000000001
cmpq %rcx, %rax
jne 0x57ca
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %rdi
sete %al
jmp 0x5842
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
cmpq %rax, %rdi
jne 0x57dd
xorl %eax, %eax
jmp 0x5842
movq %rdi, %rcx
notq %rcx
testq %rcx, %rax
jne 0x5823
movq %rdi, %rax
shrq $0x32, %rax
cmpl $0x3ffe, %eax           # imm = 0x3FFE
jbe 0x5844
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rdi
movl (%rdi), %ecx
cmpq $0x8, %rcx
ja 0x5879
movb $0x1, %al
leaq 0x12858(%rip), %rdx     # 0x1806c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x0, 0x14(%rdi)
jmp 0x583f
callq 0xab8f
xorpd %xmm1, %xmm1
cmpneqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
jmp 0x5842
cmpl $0x0, 0x18(%rdi)
setne %al
popq %rcx
retq
movq 0x1d7ad(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x1289b(%rip), %rsi     # 0x180f0
leaq 0x129a8(%rip), %rdx     # 0x18204
leaq 0x12aa6(%rip), %rcx     # 0x18309
leaq 0x128d2(%rip), %r8      # 0x1813c
movl $0x693, %r9d            # imm = 0x693
xorl %eax, %eax
callq 0x2250
ud2
movq 0x1d778(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x128f0(%rip), %rsi     # 0x1817a
leaq 0x12a78(%rip), %rdx     # 0x18309
leaq 0x128a4(%rip), %rcx     # 0x1813c
movl $0x6a2, %r8d            # imm = 0x6A2
xorl %eax, %eax
callq 0x2250
ud2
nop
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: pkNewVM
PKVM* pkNewVM(PkConfiguration* config) {

  PkConfiguration default_config = pkNewConfiguration();

  if (config == NULL) config = &default_config;

  PKVM* vm = (PKVM*)config->realloc_fn(NULL, sizeof(PKVM), config->user_data);
  memset(vm, 0, sizeof(PKVM));

  vm->config = *config;
  vm->working_set_count = 0;
  vm->working_set_capacity = MIN_CAPACITY;
  vm->working_set = (Object**)vm->config.realloc_fn(
                       NULL, sizeof(Object*) * vm->working_set_capacity, NULL);
  vm->next_gc = INITIAL_GC_SIZE;
  vm->min_heap_size = MIN_HEAP_SIZE;
  vm->heap_fill_percent = HEAP_FILL_PERCENT;

  vm->scripts = newMap(vm);
  vm->core_libs = newMap(vm);
  vm->builtins_count = 0;

  initializeCore(vm);
  return vm;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
leaq -0x24(%rip), %rax       # 0x58cd
movq %rsp, %r14
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x38(%r14)
movups %xmm0, 0x48(%r14)
testq %rdi, %rdi
cmovneq %rdi, %r14
movq 0x50(%r14), %rdx
movl $0x5f8, %esi            # imm = 0x5F8
xorl %edi, %edi
callq *(%r14)
movq %rax, %rbx
movl $0x5f8, %edx            # imm = 0x5F8
movq %rax, %rdi
xorl %esi, %esi
callq 0x21a0
leaq 0xc8(%rbx), %rdi
pushq $0xb
popq %rcx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x8, 0x34(%rbx)
pushq $0x40
popq %rsi
xorl %edi, %edi
xorl %edx, %edx
callq *0xc8(%rbx)
movq %rax, 0x28(%rbx)
movq $0xa00000, 0x10(%rbx)   # imm = 0xA00000
movq $0x100000, 0x18(%rbx)   # imm = 0x100000
movl $0x4b, 0x20(%rbx)
movq %rbx, %rdi
callq 0x2801
movq %rax, 0x128(%rbx)
movq %rbx, %rdi
callq 0x2801
movq %rax, 0x130(%rbx)
andl $0x0, 0x5e8(%rbx)
movq %rbx, %rdi
callq 0xf844
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: pkFreeVM
void pkFreeVM(PKVM* vm) {

  Object* obj = vm->first;
  while (obj != NULL) {
    Object* next = obj->next;
    freeObject(vm, obj);
    obj = next;
  }

  vm->working_set = (Object**)vm->config.realloc_fn(
    vm->working_set, 0, vm->config.user_data);

  // Tell the host application that it forget to release all of it's handles
  // before freeing the VM.
  __ASSERT(vm->handles == NULL, "Not all handles were released.");

  DEALLOCATE(vm, vm);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x59d1
movq 0x8(%rsi), %r14
movq %rbx, %rdi
callq 0x46f0
movq %r14, %rsi
jmp 0x59bb
movq 0x28(%rbx), %rdi
movq 0x118(%rbx), %rdx
xorl %esi, %esi
callq *0xc8(%rbx)
movq %rax, 0x28(%rbx)
cmpq $0x0, 0xc0(%rbx)
jne 0x5a0e
movq 0xc8(%rbx), %rax
movq 0x118(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
movq 0x1d5e3(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x126d1(%rip), %rsi     # 0x180f0
leaq 0x12b92(%rip), %rdx     # 0x185b8
leaq 0x12baa(%rip), %rcx     # 0x185d7
leaq 0x12bac(%rip), %r8      # 0x185e0
pushq $0x5f
popq %r9
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: vmRealloc
void* vmRealloc(PKVM* vm, void* memory, size_t old_size, size_t new_size) {

  // TODO: Debug trace allocations here.

  // Track the total allocated memory of the VM to trigger the GC.
  // if vmRealloc is called for freeing, the old_size would be 0 since
  // deallocated bytes are traced by garbage collector.
  vm->bytes_allocated += new_size - old_size;

  if (new_size > 0 && vm->bytes_allocated > vm->next_gc) {
    vmCollectGarbage(vm);
  }

  return vm->config.realloc_fn(memory, new_size, vm->config.user_data);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rcx, %rax
subq %rdx, %rax
addq 0x8(%rdi), %rax
movq %rax, 0x8(%rdi)
testq %rcx, %rcx
je 0x5a70
cmpq 0x10(%r15), %rax
jbe 0x5a70
movq %r15, %rdi
callq 0x9ab5
movq 0xc8(%r15), %rax
movq 0x118(%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: vmNewHandle
PkHandle* vmNewHandle(PKVM* vm, Var value) {
  PkHandle* handle = (PkHandle*)ALLOCATE(vm, PkHandle);
  handle->value = value;
  handle->prev = NULL;
  handle->next = vm->handles;
  if (handle->next != NULL) handle->next->prev = handle;
  vm->handles = handle;
  return handle;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x18
popq %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a41
movq %r14, (%rax)
andq $0x0, 0x8(%rax)
movq 0xc0(%rbx), %rcx
movq %rcx, 0x10(%rax)
testq %rcx, %rcx
je 0x5ad5
movq %rax, 0x8(%rcx)
movq %rax, 0xc0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: pkReleaseHandle
void pkReleaseHandle(PKVM* vm, PkHandle* handle) {
  __ASSERT(handle != NULL, "Given handle was NULL.");

  // If the handle is the head of the vm's handle chain set it to the next one.
  if (handle == vm->handles) {
    vm->handles = handle->next;
  }

  // Remove the handle from the chain by connecting the both ends together.
  if (handle->next) handle->next->prev = handle->prev;
  if (handle->prev) handle->prev->next = handle->next;

  // Free the handle.
  DEALLOCATE(vm, handle);
}

// Assembly:
testq %rsi, %rsi
je 0x5b2c
movq 0x10(%rsi), %rax
cmpq %rsi, 0xc0(%rdi)
jne 0x5b01
movq %rax, 0xc0(%rdi)
movq 0x8(%rsi), %rcx
testq %rax, %rax
je 0x5b0e
movq %rcx, 0x8(%rax)
testq %rcx, %rcx
je 0x5b17
movq %rax, 0x10(%rcx)
movq 0xc8(%rdi), %rax
movq 0x118(%rdi), %rdx
movq %rsi, %rdi
xorl %esi, %esi
jmpq *%rax
pushq %rax
movq 0x1d4c4(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x125b2(%rip), %rsi     # 0x180f0
leaq 0x12aa7(%rip), %rdx     # 0x185ec
leaq 0x12ab7(%rip), %rcx     # 0x18603
leaq 0x12a8d(%rip), %r8      # 0x185e0
pushq $0x75
popq %r9
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: pkInterpretSource
PkResult pkInterpretSource(PKVM* vm, PkStringPtr source, PkStringPtr path,
                           const PkCompileOptions* options) {

  String* path_name = newString(vm, path.string);
  if (path.on_done) path.on_done(vm, path);
  vmPushTempRef(vm, &path_name->_super); // path_name.

  // TODO: Should I clean the script if it already exists before compiling it?

  // Load a new script to the vm's scripts cache.
  Script* scr = vmGetScript(vm, path_name);
  if (scr == NULL) {
    scr = newScript(vm, path_name, false);
    vmPushTempRef(vm, &scr->_super); // scr.
    mapSet(vm, vm->scripts, VAR_OBJ(path_name), VAR_OBJ(scr));
    vmPopTempRef(vm); // scr.
  }
  vmPopTempRef(vm); // path_name.

  // Compile the source.
  PkResult result = compile(vm, scr, source.string, options);
  if (source.on_done) source.on_done(vm, source);
  if (result != PK_RESULT_SUCCESS) return result;

  // Set script initialized to true before the execution ends to prevent cyclic
  // inclusion cause a crash.
  scr->initialized = true;

  return runFiber(vm, newFiber(vm, scr->body));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rsp), %r13
movq (%r13), %r15
testq %r15, %r15
je 0x5b92
movq %r15, %rdi
callq 0x2140
movq %rax, %rdx
jmp 0x5b94
xorl %edx, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x261f
movq %rax, %r12
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x5bc3
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq *%rax
leaq 0x60(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5cb0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5d36
movq %rax, %r15
testq %rax, %rax
jne 0x5c2e
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3566
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5cb0
movq 0x128(%rbx), %rsi
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %r12
movq %r15, %rcx
orq %rax, %rcx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x447b
movq %rbx, %rdi
callq 0x5dac
movq %rbx, %rdi
callq 0x5dac
movq (%r13), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0xb76d
movl %eax, %ebp
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x5c6b
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq *%rax
testl %ebp, %ebp
je 0x5c80
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x88(%r15)
movq 0x80(%r15), %rsi
movq %rbx, %rdi
callq 0x28ce
movq %rbx, %rdi
movq %rax, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5df5