LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
movb 0x1c(%rsi), %bpl
testb %bpl, %bpl
je 0x9a3c
movq %rsi, %r15
leaq 0x1c(%rsi), %r14
callq 0x23c0
movq (%rax), %rcx
xorl %eax, %eax
movsbq %bpl, %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x9a52
movb 0x1d(%r15,%rax), %bpl
incq %rax
testb %bpl, %bpl
jne 0x9a24
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7f0c
movl 0x14(%r15), %edx
leaq (%rdx,%r15), %rdi
addq $0x1b, %rdi
xorl %esi, %esi
movsbq (%rdi,%rsi), %r8
decq %rsi
testb $0x20, 0x1(%rcx,%r8,2)
jne 0x9a60
movq %rsi, %rcx
notq %rcx
orq %rax, %rcx
jne 0x9a89
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq %rax, %r14
subl %eax, %edx
addl %esi, %edx
incl %edx
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x9a43
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl 0x14(%rsi), %eax
testq %rax, %rax
je 0x9b49
movq %rsi, %r14
movl 0x14(%rbx), %ecx
testq %rcx, %rcx
je 0x9b46
movq %rdi, %r12
leaq (%rcx,%rax), %r13
addq %rax, %rcx
addq $0x21, %rcx
xorl %ebp, %ebp
xorl %esi, %esi
xorl %edx, %edx
callq 0xb4b5
movq %rax, %r15
movl $0x0, (%rax)
movb %bpl, 0x4(%rax)
movq (%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, (%r12)
movl %r13d, 0x14(%r15)
leaq 0x1c(%r15), %r12
movb %bpl, 0x1c(%r15,%r13)
leal 0x1(%r13), %eax
movl %eax, 0x18(%r15)
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 0xefbe
movl %eax, 0x10(%r15)
movq %r15, %rbx
jmp 0x9b49
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9b93
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %rbx, %rsi
movq %r15, %rdi
callq 0xb71b
leaq 0x10(%r14), %rdi
movl 0x18(%r14), %edx
incl %edx
movq %r15, %rsi
callq 0x85ee
movl 0x18(%r14), %edx
leal 0x1(%rdx), %ecx
movq 0x10(%r14), %rax
movabsq $0x7ffc000000000000, %rsi # imm = 0x7FFC000000000000
movq %rsi, (%rax,%rdx,8)
movl %ecx, 0x18(%r14)
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x9bdb
movq %r15, %rdi
callq 0xb78e
movl 0x18(%r14), %ecx
movq 0x10(%r14), %rax
leal -0x1(%rcx), %edx
cmpl %ebp, %edx
jbe 0x9bfc
movl %edx, %esi
addl $-0x2, %ecx
movq %rax, %rdi
movq (%rdi,%rcx,8), %r8
movq %r8, (%rdi,%rsi,8)
addq $-0x8, %rdi
decl %edx
cmpl %ebp, %edx
ja 0x9bea
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_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
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 0x9c4e
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %r14, %rsi
movq %r15, %rdi
callq 0xb71b
movl 0x18(%rbx), %eax
leal -0x1(%rax), %edx
cmpl %ebp, %edx
jbe 0x9c73
movq 0x10(%rbx), %rcx
movl %edx, %edx
movq 0x8(%rcx,%r13,8), %rsi
movq %rsi, (%rcx,%r13,8)
leaq 0x1(%r13), %rsi
movq %rsi, %r13
cmpq %rsi, %rdx
jne 0x9c5e
movl 0x1c(%rbx), %ecx
movl %ecx, %edx
shrl %edx
cmpl %eax, %edx
jb 0x9c9d
movq 0x10(%rbx), %rsi
leaq (,%rcx,8), %rdx
shlq $0x2, %rcx
movq %r15, %rdi
callq 0xb4b5
movq %rax, 0x10(%rbx)
shrl 0x1c(%rbx)
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0x9cae
movq %r15, %rdi
callq 0xb78e
decl 0x18(%rbx)
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_O3/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 0x9d85
movq %rsi, %r12
movl 0x18(%rbx), %esi
testl %esi, %esi
je 0x9d82
movq %rdi, %r14
addl %eax, %esi
callq 0x8049
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0xb71b
leaq 0x10(%r15), %r13
movl 0x18(%r12), %edx
addl 0x18(%r15), %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x85ee
movl 0x18(%r15), %edi
shlq $0x3, %rdi
addq 0x10(%r15), %rdi
movq 0x10(%r12), %rsi
movl 0x18(%r12), %edx
shlq $0x3, %rdx
callq 0x2280
movl 0x18(%r15), %edx
addl 0x18(%r12), %edx
movl %edx, 0x18(%r15)
addl 0x18(%rbx), %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x85ee
movl 0x18(%r15), %edi
shlq $0x3, %rdi
addq 0x10(%r15), %rdi
movq 0x10(%rbx), %rsi
movl 0x18(%rbx), %edx
shlq $0x3, %rdx
callq 0x2280
movl 0x18(%rbx), %eax
addl %eax, 0x18(%r15)
movq %r14, %rdi
callq 0xb78e
movq %r15, %rbx
jmp 0x9d85
movq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9de0
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rbx
movl (%rbx), %eax
leal -0x3(%rax), %ecx
cmpl $-0x2, %ecx
jae 0x9e05
testl %eax, %eax
je 0x9dee
cmpl $0x3, %eax
jne 0x9df8
movsd 0x10(%rbx), %xmm0
callq 0xef77
movl %eax, %ebp
movsd 0x18(%rbx), %xmm0
callq 0xef77
xorl %ebp, %eax
jmp 0x9df1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xef35
movl 0x10(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addl $-0x4, %eax
cmpl $0x5, %eax
jae 0x9e0a
callq 0x2623
callq 0x25ed
callq 0x2659
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_var.c
// Function: mapFindEntry
static bool _mapFindEntry(Map* self, Var key, MapEntry** result) {

  // An empty map won't contain the key.
  if (self->capacity == 0) return false;

  // The [start_index] is where the entry supposed to be if there wasn't any
  // collision occurred. It'll be the start index for the linear probing.
  uint32_t start_index = varHashValue(key) % self->capacity;
  uint32_t index = start_index;

  // Keep track of the first tombstone after the [start_index] if we don't find
  // the key anywhere. The tombstone would be the entry at where we will have
  // to insert the key/value pair.
  MapEntry* tombstone = NULL;

  do {
    MapEntry* entry = &self->entries[index];

    if (IS_UNDEF(entry->key)) {
      ASSERT(IS_BOOL(entry->value), OOPS);

      if (IS_TRUE(entry->value)) {

        // We've found a tombstone, if we haven't found one [tombstone] should
        // be updated. We still need to keep search for if the key exists.
        if (tombstone == NULL) tombstone = entry;

      } else {
        // We've found a new empty slot and the key isn't found. If we've
        // found a tombstone along the sequence we could use that entry
        // otherwise the entry at the current index.

        *result = (tombstone != NULL) ? tombstone : entry;
        return false;
      }

    } else if (isValuesEqual(entry->key, key)) {
      // We've found the key.
      *result = entry;
      return true;
    }

    index = (index + 1) % self->capacity;

  } while (index != start_index);

  // If we reach here means the map is filled with tombstone. Set the first
  // tombstone as result for the next insertion and return false.
  ASSERT(tombstone != NULL, OOPS);
  *result = tombstone;
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x10(%rdi)
je 0x9f19
movq %rdi, %r15
movq %rdx, 0x8(%rsp)
movabsq $0x7ffd000000000000, %rbx # imm = 0x7FFD000000000000
movq %rsi, 0x20(%rsp)
movq %rsi, %rdi
callq 0x9d92
movl 0x10(%r15), %esi
xorl %edx, %edx
divl %esi
movq 0x18(%r15), %r9
leaq 0x2(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x3(%rbx), %rax
movq %rax, 0x10(%rsp)
movl %edx, %ebp
xorl %r14d, %r14d
movl %esi, 0x4(%rsp)
movl %ebp, %eax
shlq $0x4, %rax
leaq (%r9,%rax), %r13
movq (%r9,%rax), %rdi
movabsq $0x7ffd000000000000, %rax # imm = 0x7FFD000000000000
cmpq %rax, %rdi
setne %r12b
je 0x9ed1
movq 0x20(%rsp), %rsi
movl %edx, %r15d
movq %r9, %rbx
callq 0xa912
movq %rbx, %r9
movl %r15d, %edx
movl 0x4(%rsp), %esi
testb %al, %al
je 0x9ef4
jmp 0x9f0f
movq 0x8(%r13), %rax
movq %rax, %rcx
andq $-0x2, %rcx
cmpq 0x18(%rsp), %rcx
jne 0x9f2e
testq %r14, %r14
cmovneq %r14, %r13
movq %r13, %r14
cmpq 0x10(%rsp), %rax
jne 0x9f0f
incl %ebp
cmpl %esi, %ebp
movl $0x0, %eax
cmovel %eax, %ebp
cmpl %edx, %ebp
jne 0x9e90
testq %r14, %r14
je 0x9f33
xorl %r12d, %r12d
movq %r14, %r13
movq 0x8(%rsp), %rax
movq %r13, (%rax)
jmp 0x9f1c
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2688
callq 0x26be
// File: /workspace/github_c_makefile_star2_O3/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), %eax
movl 0x14(%rsi), %ecx
incl %ecx
imull $0x4b, %eax, %edx
imulq $0x51eb851f, %rdx, %rdx # imm = 0x51EB851F
shrq $0x25, %rdx
cmpl %edx, %ecx
jbe 0x9f75
addl %eax, %eax
cmpl $0x9, %eax
movl $0x8, %edx
cmovael %eax, %edx
movq %rbx, %rsi
callq 0x9f90
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xa035
testb %al, %al
je 0x9f8a
incl 0x14(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movabsq $0x7ffd000000000000, %r13 # imm = 0x7FFD000000000000
movq 0x18(%rsi), %r14
movl 0x10(%rsi), %ebx
movl %edx, %r12d
shlq $0x4, %r12
movq %rdi, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %rcx
callq 0xb4b5
movq %rax, 0x18(%r15)
movl %ebp, 0x10(%r15)
testl %ebp, %ebp
je 0x9fec
xorl %ecx, %ecx
leaq 0x2(%r13), %rdx
movq %r13, (%rax,%rcx)
movq %rdx, 0x8(%rax,%rcx)
addq $0x10, %rcx
cmpq %rcx, %r12
jne 0x9fda
testq %rbx, %rbx
je 0xa017
shlq $0x4, %rbx
xorl %r12d, %r12d
movq (%r14,%r12), %rsi
cmpq %r13, %rsi
je 0xa00e
movq 0x8(%r14,%r12), %rdx
movq %r15, %rdi
callq 0xa035
addq $0x10, %r12
cmpq %r12, %rbx
jne 0x9ff8
movq (%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb4b5
// File: /workspace/github_c_makefile_star2_O3/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 0xa071
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x9e32
movq (%r15), %rcx
testb %al, %al
jne 0xa061
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
xorb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x26f4
// File: /workspace/github_c_makefile_star2_O3/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 0x9e32
testb %al, %al
je 0xa141
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 0xa107
movabsq $0xffffffffffff, %rsi   # imm = 0xFFFFFFFFFFFF
andq %r14, %rsi
movq %rbx, %rdi
callq 0xb71b
movl 0x14(%r15), %eax
testl %eax, %eax
je 0xa14d
movl 0x10(%r15), %ecx
cmpl $0x9, %ecx
jb 0xa165
shrl $0x2, %ecx
imull $0x64, %eax, %eax
imulq $0x1b4e81b5, %rax, %rax # imm = 0x1B4E81B5
shrq $0x23, %rax
cmpl %eax, %ecx
jbe 0xa165
cmpl $0x9, %ecx
movl $0x8, %edx
cmovael %ecx, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9f90
jmp 0xa165
movabsq $0x7ffc000000000000, %r14 # imm = 0x7FFC000000000000
jmp 0xa176
movq 0x18(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xb4b5
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jb 0xa176
movq %rbx, %rdi
callq 0xb78e
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movl 0x58(%rdi), %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r13, %r13
je 0xa3f8
movl %edx, %ebp
movq %rdi, %r15
movq 0x50(%rdi), %rbx
movl 0x68(%rdi), %r14d
movl %edx, %eax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rax
movl 0x18(%rax), %eax
cmpl %r14d, %eax
jae 0xa407
movq 0x60(%r15), %rcx
movq (%rcx,%rax,8), %rdi
cmpl %ebp, 0x14(%rdi)
jne 0xa3e6
addq $0x1c, %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x2090
testl %eax, %eax
je 0xa3f5
incq %r12
cmpq %r12, %r13
jne 0xa3b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa3f8
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x272a
// File: /workspace/github_c_makefile_star2_O3/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
movq %rsi, (%rsp)
movl 0x48(%rdi), %r13d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r13, %r13
je 0xa46c
movl %edx, %ebp
movl %edx, %r15d
movq 0x40(%rdi), %r14
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rax
movq 0x10(%rax), %r12
movq %r12, %rdi
callq 0x2140
cmpl %ebp, %eax
jne 0xa45b
movq %r12, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x2090
testl %eax, %eax
je 0xa46a
incq %rbx
cmpq %rbx, %r13
jne 0xa434
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa46c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq %rsi, (%rsp)
movl 0x38(%rdi), %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0xa4dc
movl %edx, %ebp
movq 0x30(%rdi), %r13
movq 0x60(%rdi), %rbx
movl %edx, %r15d
xorl %r14d, %r14d
movl (%r13,%r14,4), %eax
movq (%rbx,%rax,8), %rdi
cmpl %ebp, 0x14(%rdi)
jne 0xa4ca
addq $0x1c, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x2090
testl %eax, %eax
je 0xa4d9
incq %r14
cmpq %r14, %r12
jne 0xa4a8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa4dc
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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)
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xaa82
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x7f0c
movq %rax, %r15
movq (%r14), %rsi
movl 0xc(%r14), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xb4b5
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xa8b3
leaq 0x11a0e(%rip), %rax     # 0x1c2c0
retq
movq %rdi, %rcx
shrq %rcx
movabsq $0x3ffe800000000001, %rdx # imm = 0x3FFE800000000001
cmpq %rdx, %rcx
jne 0xa8d0
leaq 0x13167(%rip), %rax     # 0x1da36
retq
movq %rdi, %rcx
notq %rcx
testq %rcx, %rax
jne 0xa8fd
movq %rdi, %rax
shrq $0x32, %rax
cmpl $0x3ffe, %eax           # imm = 0x3FFE
jbe 0xa905
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rdi
movl (%rdi), %edi
jmp 0xa880
leaq 0x1315a(%rip), %rax     # 0x1da5e
retq
pushq %rax
callq 0x2902
// File: /workspace/github_c_makefile_star2_O3/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:
movb $0x1, %al
cmpq %rsi, %rdi
je 0xa994
movq %rdi, %rcx
shrq $0x32, %rcx
movl $0x3fff, %edx           # imm = 0x3FFF
cmpl %edx, %ecx
setb %cl
movq %rsi, %r8
shrq $0x32, %r8
cmpl %edx, %r8d
setb %dl
orb %cl, %dl
jne 0xa992
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
andq %rcx, %rdi
andq %rcx, %rsi
movl (%rdi), %ecx
cmpl (%rsi), %ecx
jne 0xa9f3
testl %ecx, %ecx
je 0xa9cf
cmpl $0x1, %ecx
je 0xa995
cmpl $0x3, %ecx
jne 0xa9f3
movsd 0x10(%rdi), %xmm0
ucomisd 0x10(%rsi), %xmm0
jne 0xa9f3
jp 0xa9f3
movsd 0x18(%rsi), %xmm0
cmpeqsd 0x18(%rdi), %xmm0
movq %xmm0, %rax
andl $0x1, %eax
jmp 0xa9f5
xorl %eax, %eax
retq
movl 0x18(%rdi), %ebx
cmpl 0x18(%rsi), %ebx
jne 0xa9f3
testl %ebx, %ebx
je 0xa9f5
movq 0x10(%rsi), %r14
movq 0x10(%rdi), %r15
decl %ebx
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
movq (%r14,%r12,8), %rsi
callq 0xa912
testb %al, %al
je 0xa9f5
movq %r12, %rcx
incq %rcx
cmpl %r12d, %ebx
movq %rcx, %r12
jne 0xa9ae
jmp 0xa9f5
movl 0x10(%rdi), %eax
cmpl 0x10(%rsi), %eax
jne 0xa9f3
movl 0x14(%rdi), %edx
cmpl 0x14(%rsi), %edx
jne 0xa9f3
addq $0x1c, %rdi
addq $0x1c, %rsi
callq 0x22d0
testl %eax, %eax
sete %al
jmp 0xa9f5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xaa38
movabsq $0xffffffffffff, %r14   # imm = 0xFFFFFFFFFFFF
andq %rsi, %r14
cmpl $0x0, (%r14)
je 0xaa75
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movq %rbx, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xaa82
movq (%r15), %rsi
movl 0x8(%r15), %edx
movq %rbx, %rdi
callq 0x7f0c
movq %rax, %r14
movq (%r15), %rsi
movl 0xc(%r15), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xb4b5
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xb2bb
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %rdi
sete %al
jmp 0xb333
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
cmpq %rax, %rdi
jne 0xb2ce
xorl %eax, %eax
jmp 0xb333
movq %rdi, %rcx
notq %rcx
testq %rcx, %rax
jne 0xb314
movq %rdi, %rax
shrq $0x32, %rax
cmpl $0x3ffe, %eax           # imm = 0x3FFE
jbe 0xb335
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rdi
movl (%rdi), %ecx
movb $0x1, %al
leal -0x3(%rcx), %edx
cmpl $0x6, %edx
jb 0xb333
cmpl $0x2, %ecx
je 0xb30e
cmpl $0x1, %ecx
je 0xb32c
testl %ecx, %ecx
jne 0xb33a
cmpl $0x0, 0x14(%rdi)
jmp 0xb330
callq 0xef2f
xorpd %xmm1, %xmm1
cmpneqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
jmp 0xb333
cmpl $0x0, 0x18(%rdi)
setne %al
popq %rcx
retq
callq 0x29d3
callq 0x2a09
nop
// File: /workspace/github_c_makefile_star2_O3/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       # 0xb365
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
movl $0xb, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x8, 0x34(%rbx)
movl $0x40, %esi
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 0x812d
movq %rax, 0x128(%rbx)
movq %rbx, %rdi
callq 0x812d
movq %rax, 0x130(%rbx)
movl $0x0, 0x5e8(%rbx)
movq %rbx, %rdi
callq 0x137c7
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xb473
movq 0x8(%rsi), %r14
movq %rbx, %rdi
callq 0xa18e
movq %r14, %rsi
testq %r14, %r14
jne 0xb45f
movq 0x28(%rbx), %rdi
movq 0x118(%rbx), %rdx
xorl %esi, %esi
callq *0xc8(%rbx)
movq %rax, 0x28(%rbx)
cmpq $0x0, 0xc0(%rbx)
jne 0xb4b0
movq 0xc8(%rbx), %rax
movq 0x118(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
callq 0x2a38
// File: /workspace/github_c_makefile_star2_O3/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 0xb4e4
cmpq 0x10(%r15), %rax
jbe 0xb4e4
movq %r15, %rdi
callq 0xdfaf
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_O3/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
movq 0x8(%rdi), %rax
addq $0x18, %rax
movq %rax, 0x8(%rdi)
cmpq 0x10(%rdi), %rax
jbe 0xb53b
movq %rbx, %rdi
callq 0xdfaf
movq 0x118(%rbx), %rdx
movl $0x18, %esi
xorl %edi, %edi
callq *0xc8(%rbx)
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
movq 0xc0(%rbx), %rcx
movq %rcx, 0x10(%rax)
testq %rcx, %rcx
je 0xb56e
movq %rax, 0x8(%rcx)
movq %rax, 0xc0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xb5c5
movq 0x10(%rsi), %rax
cmpq %rsi, 0xc0(%rdi)
jne 0xb59a
movq %rax, 0xc0(%rdi)
movq 0x8(%rsi), %rcx
testq %rax, %rax
je 0xb5a7
movq %rcx, 0x8(%rax)
testq %rcx, %rcx
je 0xb5b0
movq %rax, 0x10(%rcx)
movq 0xc8(%rdi), %rax
movq 0x118(%rdi), %rdx
movq %rsi, %rdi
xorl %esi, %esi
jmpq *%rax
pushq %rax
callq 0x2a6c
// File: /workspace/github_c_makefile_star2_O3/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 0xb5fd
movq %r15, %rdi
callq 0x2140
movq %rax, %rdx
jmp 0xb5ff
xorl %edx, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7f0c
movq %rax, %r12
movq 0x8(%r13), %rax
testq %rax, %rax
je 0xb62e
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 0xb71b
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb748
movq %rax, %r15
testq %rax, %rax
jne 0xb699
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x8ff9
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0xb71b
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 0x9f38
movq %rbx, %rdi
callq 0xb78e
movq %rbx, %rdi
callq 0xb78e
movq (%r13), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0xfea4
movl %eax, %ebp
movq 0x8(%r13), %rax
testq %rax, %rax
je 0xb6d6
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq *%rax
testl %ebp, %ebp
je 0xb6eb
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 0x81ce
movq %rbx, %rdi
movq %rax, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb7a7
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: vmPushTempRef
void vmPushTempRef(PKVM* vm, Object* obj) {
  ASSERT(obj != NULL, "Cannot reference to NULL.");
  ASSERT(vm->temp_reference_count < MAX_TEMP_REFERENCE,
    "Too many temp references");
  vm->temp_reference[vm->temp_reference_count++] = obj;
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0xb73e
movslq 0xb8(%rdi), %rax
cmpq $0x10, %rax
jge 0xb743
leal 0x1(%rax), %ecx
movl %ecx, 0xb8(%rdi)
movq %rsi, 0x38(%rdi,%rax,8)
popq %rax
retq
callq 0x2ad6
callq 0x2aa0
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: vmGetScript
Script* vmGetScript(PKVM* vm, String* path) {
  Var scr = mapGet(vm->scripts, VAR_OBJ(path));
  if (IS_UNDEF(scr)) return NULL;
  ASSERT(AS_OBJ(scr)->type == OBJ_SCRIPT, OOPS);
  return (Script*)AS_OBJ(scr);
}

// Assembly:
pushq %rax
movq 0x128(%rdi), %rdi
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %rsi
callq 0x9e0f
movabsq $0x7ffd000000000000, %rcx # imm = 0x7FFD000000000000
cmpq %rcx, %rax
jne 0xb775
xorl %eax, %eax
jmp 0xb787
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
andq %rcx, %rax
cmpl $0x4, (%rax)
jne 0xb789
popq %rcx
retq
callq 0x2b0c
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: pkRunFiber
PkResult pkRunFiber(PKVM* vm, PkHandle* fiber,
                    int argc, PkHandle** argv) {
  __ASSERT(fiber != NULL, "Handle fiber was NULL.");
  Var fb = fiber->value;
  __ASSERT(IS_OBJ_TYPE(fb, OBJ_FIBER), "Given handle is not a fiber.");
  Fiber* _fiber = (Fiber*)AS_OBJ(fb);

  Var* args[MAX_ARGC];
  for (int i = 0; i < argc; i++) {
    args[i] = &(argv[i]->value);
  }

  if (!vmPrepareFiber(vm, _fiber, argc, args)) {
    return PK_RESULT_RUNTIME_ERROR;
  }

  ASSERT(_fiber->frame_count == 1, OOPS);
  return runFiber(vm, _fiber);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
testq %rsi, %rsi
je 0xdbe2
movq (%rsi), %r14
movq %r14, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xdbdd
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x6, (%r14)
jne 0xdbdd
movl %edx, %ebp
movq %rdi, %rbx
testl %edx, %edx
jle 0xdb9b
movl %ebp, %edx
shlq $0x3, %rdx
movq %rsp, %rdi
movq %rcx, %rsi
callq 0x2280
movq %rsp, %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xdbec
testb %al, %al
je 0xdbcc
cmpl $0x1, 0x4c(%r14)
jne 0xdbe7
movq %rbx, %rdi
movq %r14, %rsi
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
jmp 0xb7a7
movl $0x3, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
callq 0x42f5
callq 0x4361
callq 0x432b
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: pkResumeFiber
PkResult pkResumeFiber(PKVM* vm, PkHandle* fiber, PkVar value) {
  __ASSERT(fiber != NULL, "Handle fiber was NULL.");
  Var fb = fiber->value;
  __ASSERT(IS_OBJ_TYPE(fb, OBJ_FIBER), "Given handle is not a fiber.");
  Fiber* _fiber = (Fiber*)AS_OBJ(fb);

  if (!vmSwitchFiber(vm, _fiber, (Var*)value)) {
    return PK_RESULT_RUNTIME_ERROR;
  }

  return runFiber(vm, _fiber);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xde2d
movq (%rsi), %r14
movq %r14, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xde28
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x6, (%r14)
jne 0xde28
movq %rdi, %rbx
movq %r14, %rsi
callq 0xde32
testb %al, %al
je 0xde1b
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb7a7
movl $0x3, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x45e2
callq 0x4618
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: vmSwitchFiber
bool vmSwitchFiber(PKVM* vm, Fiber* fiber, Var* value) {
  if (fiber->state != FIBER_YIELDED) {
    switch (fiber->state) {
      case FIBER_NEW:
        _ERR_FAIL(newString(vm, "The fiber hasn't started. call fiber_run() "
          "to start."));
      case FIBER_RUNNING:
        _ERR_FAIL(newString(vm, "The fiber has already been running."));
      case FIBER_YIELDED: UNREACHABLE();
      case FIBER_DONE:
        _ERR_FAIL(newString(vm, "The fiber has done running."));
    }
    UNREACHABLE();
  }

  // Pass the resume argument if it has any.

  // Assert if we have a call frame and the stack size enough for the return
  // value and the resumed value.
  ASSERT(fiber->frame_count != 0, OOPS);
  ASSERT((fiber->stack + fiber->stack_size) - fiber->sp >= 2, OOPS);

  // fb->ret will points to the return value of the 'yield()' call.
  if (value == NULL) *fiber->ret = VAR_NULL;
  else *fiber->ret = *value;

  // Switch fiber.
  fiber->caller = vm->fiber;
  vm->fiber = fiber;

  // On success return true.
  return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rsi), %ebp
cmpl $0x2, %ebp
jne 0xde6e
cmpl $0x0, 0x4c(%rsi)
je 0xdf38
movslq 0x28(%rsi), %rax
shlq $0x3, %rax
addq 0x20(%rsi), %rax
subq 0x30(%rsi), %rax
cmpq $0x8, %rax
jle 0xdf3d
testq %rdx, %rdx
je 0xdeb0
movq (%rdx), %rax
jmp 0xdeba
cmpl $0x3, %ebp
je 0xdef9
cmpl $0x1, %ebp
je 0xded5
testl %ebp, %ebp
jne 0xdf42
movq 0x5f0(%rbx), %rax
testq %rax, %rax
je 0xdf2b
cmpq $0x0, 0x58(%rax)
jne 0xdf47
leaq 0xe960(%rip), %rsi      # 0x1c806
movq %rbx, %rdi
movl $0x34, %edx
jmp 0xdf1b
movabsq $0x7ffc000000000000, %rax # imm = 0x7FFC000000000000
movq 0x38(%rsi), %rcx
movq %rax, (%rcx)
movq 0x5f0(%rbx), %rax
movq %rax, 0x50(%rsi)
movq %rsi, 0x5f0(%rbx)
jmp 0xdf2b
movq 0x5f0(%rbx), %rax
testq %rax, %rax
je 0xdf2b
cmpq $0x0, 0x58(%rax)
jne 0xdf4c
leaq 0xe888(%rip), %rsi      # 0x1c777
movq %rbx, %rdi
movl $0x23, %edx
jmp 0xdf1b
movq 0x5f0(%rbx), %rax
testq %rax, %rax
je 0xdf2b
cmpq $0x0, 0x58(%rax)
jne 0xdf51
leaq 0xe8c9(%rip), %rsi      # 0x1c7dc
movq %rbx, %rdi
movl $0x1b, %edx
callq 0x7f0c
movq 0x5f0(%rbx), %rcx
movq %rax, 0x58(%rcx)
cmpl $0x2, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x4755
callq 0x471f
callq 0x46f0
callq 0x46ba
callq 0x4684
callq 0x464e
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: vmYieldFiber
void vmYieldFiber(PKVM* vm, Var* value) {

  Fiber* caller = vm->fiber->caller;

  // Return the yield value to the caller fiber.
  if (caller != NULL) {
    if (value == NULL) *caller->ret = VAR_NULL;
    else *caller->ret = *value;
  }

  // Can be resumed by another caller fiber.
  vm->fiber->caller = NULL;
  vm->fiber->state = FIBER_YIELDED;
  vm->fiber = caller;
}

// Assembly:
movq 0x5f0(%rdi), %rax
movq 0x50(%rax), %rcx
testq %rcx, %rcx
je 0xe118
testq %rsi, %rsi
je 0xe107
movq (%rsi), %rdx
jmp 0xe111
movabsq $0x7ffc000000000000, %rdx # imm = 0x7FFC000000000000
movq 0x38(%rcx), %rsi
movq %rdx, (%rsi)
movq $0x0, 0x50(%rax)
movl $0x2, 0x10(%rax)
movq %rcx, 0x5f0(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_vm.c
// Function: reportError
static void reportError(PKVM* vm) {
  ASSERT(VM_HAS_ERROR(vm), "runtimeError() should be called after an error.");
  // TODO: pass the error to the caller of the fiber.

  // Print the Error message and stack trace.
  if (vm->config.error_fn == NULL) return;
  Fiber* fiber = vm->fiber;
  vm->config.error_fn(vm, PK_ERROR_RUNTIME, NULL, -1, fiber->error->data);
  for (int i = fiber->frame_count - 1; i >= 0; i--) {
    CallFrame* frame = &fiber->frames[i];
    const Function* fn = frame->fn;
    ASSERT(!fn->is_native, OOPS);
    int line = fn->fn->oplines.data[frame->ip - fn->fn->opcodes.data - 1];
    vm->config.error_fn(vm, PK_ERROR_STACKTRACE, fn->owner->path->data, line,
                        fn->name);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x5f0(%rdi), %r14
movq 0x58(%r14), %r8
testq %r8, %r8
je 0xe1ef
movq %rdi, %rbx
movq 0xd0(%rdi), %rax
testq %rax, %rax
je 0xe1de
addq $0x1c, %r8
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq *%rax
movslq 0x4c(%r14), %r15
testq %r15, %r15
jle 0xe1de
leaq (%r15,%r15,2), %rax
incq %r15
leaq -0x10(,%rax,8), %r12
movq 0x40(%r14), %rcx
movq (%rcx,%r12), %rax
cmpb $0x1, 0x30(%rax)
je 0xe1ea
movq 0x38(%rax), %rdx
movq -0x8(%rcx,%r12), %rcx
movq (%rdx), %rsi
notq %rsi
shlq $0x2, %rsi
addq 0x10(%rdx), %rsi
movl (%rsi,%rcx,4), %ecx
movq 0x10(%rax), %r8
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdx
addq $0x1c, %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq *0xd0(%rbx)
decq %r15
addq $-0x18, %r12
cmpq $0x1, %r15
ja 0xe18b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x47f7
callq 0x482d