LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x5cd3
movslq 0xb8(%rdi), %rax
cmpq $0x10, %rax
jge 0x5d01
leal 0x1(%rax), %ecx
movl %ecx, 0xb8(%rdi)
movq %rsi, 0x38(%rdi,%rax,8)
popq %rax
retq
movq 0x1d31e(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x1240c(%rip), %rsi     # 0x180f0
leaq 0x129b4(%rip), %rdx     # 0x1869f
leaq 0x129c7(%rip), %rcx     # 0x186b9
leaq 0x128e7(%rip), %r8      # 0x185e0
movl $0xea, %r9d
jmp 0x5d2d
movq 0x1d2f0(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x123de(%rip), %rsi     # 0x180f0
leaq 0x129ae(%rip), %rdx     # 0x186c7
leaq 0x12999(%rip), %rcx     # 0x186b9
leaq 0x128b9(%rip), %r8      # 0x185e0
movl $0xec, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 0x42f9
movabsq $0x7ffd000000000000, %rcx # imm = 0x7FFD000000000000
cmpq %rcx, %rax
jne 0x5d63
xorl %eax, %eax
jmp 0x5d75
movabsq $0xffffffffffff, %rcx   # imm = 0xFFFFFFFFFFFF
andq %rcx, %rax
cmpl $0x4, (%rax)
jne 0x5d77
popq %rcx
retq
movq 0x1d27a(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x12368(%rip), %rsi     # 0x180f0
leaq 0x12475(%rip), %rdx     # 0x18204
leaq 0x1297c(%rip), %rcx     # 0x18712
leaq 0x12843(%rip), %r8      # 0x185e0
movl $0xf9, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
testq %rsi, %rsi
je 0x930a
movq (%rsi), %r14
movq %r14, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0x92dc
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x6, (%r14)
jne 0x92dc
movq %rdi, %rbx
xorl %eax, %eax
testl %edx, %edx
movl $0x0, %esi
cmovgl %edx, %esi
cmpq %rax, %rsi
je 0x92a0
movq (%rcx,%rax,8), %rdi
movq %rdi, (%rsp,%rax,8)
incq %rax
jmp 0x928e
movq %rsp, %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x936d
testb %al, %al
je 0x92ce
cmpl $0x1, 0x4c(%r14)
jne 0x9338
movq %rbx, %rdi
movq %r14, %rsi
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
jmp 0x5df5
pushq $0x3
popq %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
movq 0x19d15(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xee03(%rip), %rsi      # 0x180f0
leaq 0xf341(%rip), %rdx      # 0x18635
leaq 0xf32f(%rip), %rcx      # 0x1862a
leaq 0xf2de(%rip), %r8       # 0x185e0
movl $0xa9, %r9d
jmp 0x9364
movq 0x19ce7(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xedd5(%rip), %rsi      # 0x180f0
leaq 0xf2f1(%rip), %rdx      # 0x18613
leaq 0xf301(%rip), %rcx      # 0x1862a
leaq 0xf2b0(%rip), %r8       # 0x185e0
movl $0xa7, %r9d
jmp 0x9364
movq 0x19cb9(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xeda7(%rip), %rsi      # 0x180f0
leaq 0xeeb4(%rip), %rdx      # 0x18204
leaq 0xf2d3(%rip), %rcx      # 0x1862a
leaq 0xf282(%rip), %r8       # 0x185e0
movl $0xb5, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 0x97b1
movq (%rsi), %r14
movq %r14, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0x9783
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x6, (%r14)
jne 0x9783
movq %rdi, %rbx
movq %r14, %rsi
callq 0x97e6
testb %al, %al
je 0x9778
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5df5
pushq $0x3
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x1986e(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe95c(%rip), %rsi      # 0x180f0
leaq 0xee9a(%rip), %rdx      # 0x18635
leaq 0xeeb0(%rip), %rcx      # 0x18652
leaq 0xee37(%rip), %r8       # 0x185e0
movl $0xbc, %r9d
jmp 0x97dd
movq 0x19840(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe92e(%rip), %rsi      # 0x180f0
leaq 0xee4a(%rip), %rdx      # 0x18613
leaq 0xee82(%rip), %rcx      # 0x18652
leaq 0xee09(%rip), %r8       # 0x185e0
movl $0xba, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 0x9bfd
testq %rsi, %rsi
je 0x9bec
movq (%rsi), %rdx
jmp 0x9bf6
movabsq $0x7ffc000000000000, %rdx # imm = 0x7FFC000000000000
movq 0x38(%rcx), %rsi
movq %rdx, (%rsi)
andq $0x0, 0x50(%rax)
movl $0x2, 0x10(%rax)
movq %rcx, 0x5f0(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x5f0(%rdi), %r14
movq 0x58(%r14), %r8
testq %r8, %r8
je 0x9ceb
movq %rdi, %rbx
movq 0xd0(%rdi), %rax
testq %rax, %rax
je 0x9cad
addq $0x1c, %r8
pushq $0x1
popq %rsi
pushq $-0x1
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq *%rax
movl 0x4c(%r14), %r15d
imulq $0x18, %r15, %r12
addq $-0x10, %r12
pushq $0x2
popq %rbp
testl %r15d, %r15d
jle 0x9cad
movq 0x40(%r14), %rcx
movq (%rcx,%r12), %rax
cmpb $0x1, 0x30(%rax)
je 0x9cb6
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 %ebp, %esi
callq *0xd0(%rbx)
decl %r15d
addq $-0x18, %r12
jmp 0x9c5c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1933b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe429(%rip), %rsi      # 0x180f0
leaq 0xe536(%rip), %rdx      # 0x18204
leaq 0xecab(%rip), %rcx      # 0x18980
leaq 0xe904(%rip), %r8       # 0x185e0
movl $0x254, %r9d            # imm = 0x254
xorl %eax, %eax
callq 0x2250
ud2
movq 0x19306(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe3f4(%rip), %rsi      # 0x180f0
leaq 0xec4d(%rip), %rdx      # 0x18950
leaq 0xec76(%rip), %rcx      # 0x18980
leaq 0xe8cf(%rip), %r8       # 0x185e0
movl $0x24a, %r9d            # imm = 0x24A
jmp 0x9ce2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: pushCallFrame
static inline void pushCallFrame(PKVM* vm, const Function* fn, Var* rbp) {
  ASSERT(!fn->is_native, "Native function shouldn't use call frames.");

  // Grow the stack frame if needed.
  if (vm->fiber->frame_count + 1 > vm->fiber->frame_capacity) {
    int new_capacity = vm->fiber->frame_capacity << 1;
    vm->fiber->frames = (CallFrame*)vmRealloc(vm, vm->fiber->frames,
                           sizeof(CallFrame) * vm->fiber->frame_capacity,
                           sizeof(CallFrame) * new_capacity);
    vm->fiber->frame_capacity = new_capacity;
  }

  // Grow the stack if needed.
  int needed = fn->fn->stack_size + (int)(vm->fiber->sp - vm->fiber->stack);
  if (vm->fiber->stack_size <= needed) growStack(vm, needed);

  CallFrame* frame = vm->fiber->frames + vm->fiber->frame_count++;
  frame->rbp = rbp;
  frame->fn = fn;
  frame->ip = fn->fn->opcodes.data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x30(%rsi)
je 0x9dc7
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x5f0(%rdi), %rcx
movslq 0x48(%rcx), %rax
cmpl %eax, 0x4c(%rcx)
jl 0x9d6d
leal (%rax,%rax), %edi
movq 0x40(%rcx), %rsi
imulq $0x18, %rax, %rdx
movslq %edi, %r12
imulq $0x18, %r12, %rcx
movq %r15, %rdi
callq 0x5a41
movq 0x5f0(%r15), %rcx
movq %rax, 0x40(%rcx)
movl %r12d, 0x48(%rcx)
movq 0x38(%rbx), %rax
movq 0x30(%rcx), %rsi
subq 0x20(%rcx), %rsi
shrq $0x3, %rsi
addl 0x20(%rax), %esi
cmpl %esi, 0x28(%rcx)
jg 0x9d94
movq %r15, %rdi
callq 0x9dfc
movq 0x5f0(%r15), %rcx
movq 0x40(%rcx), %rax
movslq 0x4c(%rcx), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x4c(%rcx)
imulq $0x18, %rdx, %rcx
movq %r14, 0x10(%rax,%rcx)
movq %rbx, 0x8(%rax,%rcx)
movq 0x38(%rbx), %rdx
movq (%rdx), %rdx
movq %rdx, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1922a(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe318(%rip), %rsi      # 0x180f0
leaq 0xebba(%rip), %rdx      # 0x18999
leaq 0xebde(%rip), %rcx      # 0x189c4
leaq 0xe7f3(%rip), %r8       # 0x185e0
movl $0x217, %r9d            # imm = 0x217
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_vm.c
// Function: growStack
static inline void growStack(PKVM* vm, int size) {
  Fiber* fiber = vm->fiber;
  ASSERT(fiber->stack_size <= size, OOPS);
  int new_size = utilPowerOf2Ceil(size);

  Var* old_rbp = fiber->stack; //< Old stack base pointer.
  fiber->stack = (Var*)vmRealloc(vm, fiber->stack,
                                 sizeof(Var) * fiber->stack_size,
                                 sizeof(Var) * new_size);
  fiber->stack_size = new_size;

  // If the old stack base pointer is the same as the current, that means the
  // stack hasn't been moved by the reallocation. In that case we're done.
  if (old_rbp == fiber->stack) return;

  // If we reached here that means the stack is moved by the reallocation and
  // we have to update all the pointers that pointing to the old stack slots.

  //
  //                                     '        '
  //             '        '              '        '
  //             '        '              |        | <new_rsp
  //    old_rsp> |        |              |        |
  //             |        |       .----> | value  | <new_ptr
  //             |        |       |      |        |
  //    old_ptr> | value  | ------'      |________| <new_rbp
  //             |        | ^            new stack
  //    old_rbp> |________| | height
  //             old stack
  //
  //            new_ptr = new_rbp      + height
  //                    = fiber->stack + ( old_ptr  - old_rbp )
#define MAP_PTR(old_ptr) (fiber->stack + ((old_ptr) - old_rbp))

  // Update the stack top pointer and the return pointer.
  fiber->sp = MAP_PTR(fiber->sp);
  fiber->ret = MAP_PTR(fiber->ret);

  // Update the stack base pointer of the call frames.
  for (int i = 0; i < fiber->frame_count; i++) {
    CallFrame* frame = fiber->frames + i;
    frame->rbp = MAP_PTR(frame->rbp);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x5f0(%rdi), %r15
cmpl %esi, 0x28(%r15)
jg 0x9ea4
movq %rdi, %r14
movl %esi, %edi
callq 0xab40
movq 0x20(%r15), %rbx
movslq 0x28(%r15), %rdx
shlq $0x3, %rdx
movslq %eax, %r12
leaq (,%r12,8), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5a41
movq %rax, 0x20(%r15)
movl %r12d, 0x28(%r15)
cmpq %rax, %rbx
je 0x9e98
movq 0x30(%r15), %rcx
movq 0x38(%r15), %rdx
subq %rbx, %rcx
addq %rax, %rcx
movq %rcx, 0x30(%r15)
subq %rbx, %rdx
addq %rax, %rdx
movq %rdx, 0x38(%r15)
movl 0x4c(%r15), %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
imulq $0x18, %rdx, %rdx
cmpq %rcx, %rdx
je 0x9e98
movq 0x40(%r15), %rsi
movq 0x10(%rsi,%rcx), %rdi
subq %rbx, %rdi
addq %rax, %rdi
movq %rdi, 0x10(%rsi,%rcx)
addq $0x18, %rcx
jmp 0x9e79
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1914d(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xe23b(%rip), %rsi      # 0x180f0
leaq 0xe348(%rip), %rdx      # 0x18204
leaq 0xeb0f(%rip), %rcx      # 0x189d2
leaq 0xe716(%rip), %r8       # 0x185e0
movl $0x1eb, %r9d            # imm = 0x1EB
xorl %eax, %eax
callq 0x2250
ud2
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_debug.c
// Function: dumpValue
void dumpValue(PKVM* vm, Var value, pkByteBuffer* buff) {
  String* repr = toRepr(vm, value);
  vmPushTempRef(vm, &repr->_super);
  pkByteBufferAddString(buff, vm, repr->data, repr->length);
  vmPopTempRef(vm);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
callq 0x4c36
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x5cb0
movl 0x14(%r15), %ecx
addq $0x1c, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3056
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5dac
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_debug.c
// Function: dumpGlobalValues
void dumpGlobalValues(PKVM* vm) {
  Fiber* fiber = vm->fiber;
  int frame_ind = fiber->frame_count - 1;
  ASSERT(frame_ind >= 0, OOPS);
  CallFrame* frame = &fiber->frames[frame_ind];
  Script* scr = frame->fn->owner;

  for (uint32_t i = 0; i < scr->global_names.count; i++) {
    String* name = scr->names.data[scr->global_names.data[i]];
    Var value = scr->globals.data[i];
    printf("%10s = ", name->data);

    // Dump value. TODO: refactor.
    pkByteBuffer buff;
    pkByteBufferInit(&buff);
    dumpValue(vm, value, &buff);
    pkByteBufferWrite(&buff, vm, '\0');
    printf("%s", (const char*)buff.data);
    pkByteBufferClear(&buff, vm);

    printf("\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x5f0(%rdi), %rax
movslq 0x4c(%rax), %rcx
testq %rcx, %rcx
jle 0xaa06
movq %rdi, %rbx
movq 0x40(%rax), %rax
imulq $0x18, %rcx, %rcx
movq -0x10(%rax,%rcx), %rax
movq 0x18(%rax), %r14
leaq 0x8(%rsp), %r15
pushq $0xa
popq %rbp
xorl %r12d, %r12d
movl 0x38(%r14), %eax
cmpq %rax, %r12
jae 0xa9f7
movq 0x60(%r14), %rax
movq 0x20(%r14), %rcx
movq 0x30(%r14), %rdx
movl (%rdx,%r12,4), %edx
movq (%rax,%rdx,8), %rsi
movq (%rcx,%r12,8), %r13
addq $0x1c, %rsi
leaq 0xe204(%rip), %rdi      # 0x18ba7
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
callq 0x2b9a
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x9edc
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2c3c
movq 0x8(%rsp), %rsi
leaq 0x10fb6(%rip), %rdi     # 0x1b98f
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2ba1
movl %ebp, %edi
callq 0x2050
incq %r12
jmp 0xa977
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x185eb(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xd6d9(%rip), %rsi      # 0x180f0
leaq 0xd7e6(%rip), %rdx      # 0x18204
leaq 0xe171(%rip), %rcx      # 0x18b96
leaq 0xe128(%rip), %r8       # 0x18b54
movl $0x19e, %r9d            # imm = 0x19E
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_debug.c
// Function: dumpStackFrame
void dumpStackFrame(PKVM* vm) {
  Fiber* fiber = vm->fiber;
  int frame_ind = fiber->frame_count - 1;
  ASSERT(frame_ind >= 0, OOPS);
  CallFrame* frame = &fiber->frames[frame_ind];
  Var* sp = fiber->sp - 1;

  printf("Frame[%d]\n", frame_ind);
  for (; sp >= frame->rbp; sp--) {
    printf("       ");

    // Dump value. TODO: refactor.
    pkByteBuffer buff;
    pkByteBufferInit(&buff);
    dumpValue(vm, *sp, &buff);
    pkByteBufferWrite(&buff, vm, '\0');
    printf("%s", (const char*)buff.data);
    pkByteBufferClear(&buff, vm);

    printf("\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x5f0(%rdi), %rax
movl 0x4c(%rax), %r14d
testl %r14d, %r14d
jle 0xab08
movq %rdi, %rbx
decl %r14d
movq 0x30(%rax), %r13
movq 0x40(%rax), %r15
leaq 0xe14c(%rip), %rdi      # 0x18bbe
movl %r14d, %esi
xorl %eax, %eax
callq 0x2150
imulq $0x18, %r14, %rax
leaq (%r15,%rax), %r14
addq $0x10, %r14
addq $-0x8, %r13
leaq 0x8(%rsp), %r15
leaq 0x10ef7(%rip), %r12     # 0x1b98f
pushq $0xa
popq %rbp
cmpq (%r14), %r13
jb 0xaaf9
leaq 0xe0c0(%rip), %rdi      # 0x18b67
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
callq 0x2b9a
movq (%r13), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9edc
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2c3c
movq 0x8(%rsp), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2ba1
movl %ebp, %edi
callq 0x2050
addq $-0x8, %r13
jmp 0xaa9b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x184e9(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xd5d7(%rip), %rsi      # 0x180f0
leaq 0xd6e4(%rip), %rdx      # 0x18204
leaq 0xe088(%rip), %rcx      # 0x18baf
leaq 0xe026(%rip), %r8       # 0x18b54
movl $0x1b6, %r9d            # imm = 0x1B6
xorl %eax, %eax
callq 0x2250
ud2
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_utils.c
// Function: utilHashBits
uint32_t utilHashBits(uint64_t hash) {
  // From v8's ComputeLongHash() which in turn cites:
  // Thomas Wang, Integer Hash Functions.
  // http://www.concentric.net/~Ttwang/tech/inthash.htm
  hash = ~hash + (hash << 18);
  hash = hash ^ (hash >> 31);
  hash = hash * 21;
  hash = hash ^ (hash >> 11);
  hash = hash + (hash << 6);
  hash = hash ^ (hash >> 22);
  return (uint32_t)(hash & 0x3fffffff);
}

// Assembly:
movq %rdi, %rax
notq %rax
shlq $0x12, %rdi
addq %rax, %rdi
movq %rdi, %rax
shrq $0x1f, %rax
xorq %rdi, %rax
imulq $0x15, %rax, %rax
movq %rax, %rcx
shrq $0xb, %rcx
xorq %rax, %rcx
imulq $0x41, %rcx, %rcx
movq %rcx, %rax
shrq $0x16, %rax
xorl %ecx, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_utils.c
// Function: utf8_encodeBytesCount
int utf8_encodeBytesCount(int value) {
  if (value <= 0x7f) return 1;
  if (value <= 0x7ff) return 2;
  if (value <= 0xffff) return 3;
  if (value <= 0x10ffff) return 4;

  // if we're here means it's an invalid leading byte
  return 0;
}

// Assembly:
cmpl $0x80, %edi
jge 0xabfd
pushq $0x1
jmp 0xac13
cmpl $0x800, %edi            # imm = 0x800
jae 0xac09
pushq $0x2
jmp 0xac13
cmpl $0x10000, %edi          # imm = 0x10000
jae 0xac15
pushq $0x3
popq %rax
retq
xorl %eax, %eax
cmpl $0x110000, %edi         # imm = 0x110000
setb %al
shll $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_utils.c
// Function: utf8_decodeBytesCount
int utf8_decodeBytesCount(uint8_t byte) {

  if ((byte >> 7) == 0b0) return 1;
  if ((byte >> 6) == 0b10) return 1; //< continuation byte
  if ((byte >> 5) == 0b110) return 2;
  if ((byte >> 4) == 0b1110) return 3;
  if ((byte >> 3) == 0b11110) return 4;

  // if we're here means it's an invalid utf8 byte
  return 1;
}

// Assembly:
testb %dil, %dil
setns %al
movl %edi, %ecx
andl $-0x40, %ecx
cmpl $0x80, %ecx
sete %cl
orb %al, %cl
je 0xac40
pushq $0x1
jmp 0xac5e
movl %edi, %eax
andl $-0x20, %eax
cmpl $0xc0, %eax
jne 0xac50
pushq $0x2
jmp 0xac5e
movl %edi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0xac60
pushq $0x3
popq %rax
retq
andl $-0x8, %edi
xorl %eax, %eax
cmpl $0xf0, %edi
sete %al
leal (%rax,%rax,2), %eax
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_utils.c
// Function: utf8_encodeValue
int utf8_encodeValue(int value, uint8_t* bytes) {

  if (value <= 0x7f) {
    *bytes = value & 0x7f;
    return 1;
  }

  // 2 byte character 110xxxxx 10xxxxxx -> last 6 bits write to 2nd byte and
  // first 5 bit write to first byte
  if (value <= 0x7ff) {
    *(bytes++) = (uint8_t)(0b11000000 | ((value & 0b11111000000) >> 6));
    *(bytes) = (uint8_t)(0b10000000 | ((value & 111111)));
    return 2;
  }

  // 3 byte character 1110xxxx 10xxxxxx 10xxxxxx -> from last, 6 bits write
  // to  3rd byte, next 6 bits write to 2nd byte, and 4 bits to first byte.
  if (value <= 0xffff) {
    *(bytes++) = (uint8_t)(0b11100000 | ((value & 0b1111000000000000) >> 12));
    *(bytes++) = (uint8_t)(0b10000000 | ((value & 0b111111000000) >> 6));
    *(bytes) =   (uint8_t)(0b10000000 | ((value & 0b111111)));
    return 3;
  }

  // 4 byte character 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx -> last 6 bits to
  // to 4th byte, next 6 bits to 3rd byte, next 6 bits to 2nd byte, 3 bits
  // first byte.
  if (value <= 0x10ffff) {
    *(bytes++) = (uint8_t)(0b11110000 | ((value & (0b111    << 18)) >> 18));
    *(bytes++) = (uint8_t)(0b10000000 | ((value & (0b111111 << 12)) >> 12));
    *(bytes++) = (uint8_t)(0b10000000 | ((value & (0b111111 << 6))  >> 6));
    *(bytes)   = (uint8_t)(0b10000000 | ((value &  0b111111)));
    return 4;
  }

  return 0;
}

// Assembly:
cmpl $0x7f, %edi
jg 0xac84
andb $0x7f, %dil
movb %dil, (%rsi)
pushq $0x1
jmp 0xacd0
cmpl $0x7ff, %edi            # imm = 0x7FF
ja 0xaca5
movl %edi, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%rsi)
andb $0x7, %dil
orb $-0x80, %dil
movb %dil, 0x1(%rsi)
pushq $0x2
jmp 0xacd0
cmpl $0xffff, %edi           # imm = 0xFFFF
ja 0xacd2
movl %edi, %eax
shrl $0xc, %eax
orb $-0x20, %al
movb %al, (%rsi)
movl %edi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rsi)
andb $0x3f, %dil
orb $-0x80, %dil
movb %dil, 0x2(%rsi)
pushq $0x3
popq %rax
retq
xorl %eax, %eax
cmpl $0x10ffff, %edi         # imm = 0x10FFFF
ja 0xad0c
movl %edi, %eax
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%rsi)
movl %edi, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rsi)
movl %edi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rsi)
andb $0x3f, %dil
orb $-0x80, %dil
movb %dil, 0x3(%rsi)
pushq $0x4
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_utils.c
// Function: utf8_decodeBytes
int utf8_decodeBytes(uint8_t* bytes, int* value) {

  int continue_bytes = 0;
  int byte_count = 1;
  int _value = 0;

  if ((*bytes & 0b11000000) == 0b10000000) {
    *value = *bytes;
    return byte_count;
  }

  else if ((*bytes & 0b11100000) == 0b11000000) {
    continue_bytes = 1;
    _value = (*bytes & 0b11111);
  }

  else if ((*bytes & 0b11110000) == 0b11100000) {
    continue_bytes = 2;
    _value = (*bytes & 0b1111);
  }

  else if ((*bytes & 0b11111000) == 0b11110000) {
    continue_bytes = 3;
    _value = (*bytes & 0b111);
  }

  else {
    // Invalid leading byte
    return -1;
  }

  // now add the continuation bytes to the _value
  while (continue_bytes--) {
    bytes++, byte_count++;

    if ((*bytes & 0b11000000) != 0b10000000) return -1;

    _value = (_value << 6) | (*bytes & 0b00111111);
  }

  *value = _value;
  return byte_count;
}

// Assembly:
movzbl (%rdi), %ecx
movl %ecx, %eax
andl $-0x40, %eax
cmpl $0x80, %eax
jne 0xad24
pushq $0x1
popq %rdx
movl %ecx, (%rsi)
movl %edx, %eax
retq
movl %ecx, %edx
andl $-0x20, %edx
pushq $-0x1
popq %rax
cmpl $0xc0, %edx
jne 0xad3b
pushq $0x1
popq %rdx
pushq $0x1f
jmp 0xad61
movl %ecx, %edx
andl $-0x10, %edx
cmpl $0xe0, %edx
jne 0xad4f
pushq $0x2
popq %rdx
pushq $0xf
jmp 0xad61
movl %ecx, %edx
andl $-0x8, %edx
cmpl $0xf0, %edx
jne 0xad23
pushq $0x3
popq %rdx
pushq $0x7
popq %r8
andl %r8d, %ecx
movl %edx, %r8d
incl %edx
xorl %r9d, %r9d
cmpl %r9d, %r8d
je 0xad1f
movzbl 0x1(%rdi,%r9), %r10d
movl %r10d, %r11d
andl $-0x40, %r11d
cmpl $0x80, %r11d
jne 0xad23
shll $0x6, %ecx
andl $0x3f, %r10d
orl %r10d, %ecx
incq %r9
jmp 0xad6e
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprAttrib
static void exprAttrib(Compiler* compiler) {
  consume(compiler, TK_NAME, "Expected an attribute name after '.'.");
  const char* name = compiler->previous.start;
  int length = compiler->previous.length;

  // Store the name in script's names.
  int index = scriptAddName(compiler->script, compiler->vm, name, length);

  if (compiler->l_value && matchAssignment(compiler)) {
    skipNewLines(compiler);

    TokenType assignment = compiler->previous.type;
    if (assignment != TK_EQ) {
      emitOpcode(compiler, OP_GET_ATTRIB_KEEP);
      emitShort(compiler, index);
      compileExpression(compiler);
      emitAssignment(compiler, assignment);
    } else {
      compileExpression(compiler);
    }

    emitOpcode(compiler, OP_SET_ATTRIB);
    emitShort(compiler, index);

  } else {
    emitOpcode(compiler, OP_GET_ATTRIB);
    emitShort(compiler, index);
  }

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xe5bc(%rip), %rdx      # 0x19362
pushq $0x47
popq %rsi
callq 0xc4fb
movq (%rbx), %rsi
movq 0x38(%rbx), %rdx
movl 0x40(%rbx), %ecx
movq 0x18b0(%rbx), %rdi
callq 0x38d9
movl %eax, %ebp
pushq $0x30
popq %r14
cmpb $0x1, 0x38cd(%rbx)
jne 0xae27
movq %rbx, %rdi
callq 0xd760
testb %al, %al
je 0xae27
movq %rbx, %rdi
callq 0xd399
movl 0x30(%rbx), %r14d
cmpl $0x1a, %r14d
jne 0xadfb
movq %rbx, %rdi
callq 0xd50e
jmp 0xae23
pushq $0x31
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc748
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
movl %r14d, %esi
callq 0xd851
pushq $0x32
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc748
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprBinaryOp
static void exprBinaryOp(Compiler* compiler) {
  TokenType op = compiler->previous.type;
  skipNewLines(compiler);
  parsePrecedence(compiler, (Precedence)(getRule(op)->precedence + 1));

  switch (op) {
    case TK_DOTDOT:  emitOpcode(compiler, OP_RANGE);      break;
    case TK_PERCENT: emitOpcode(compiler, OP_MOD);        break;
    case TK_AMP:     emitOpcode(compiler, OP_BIT_AND);    break;
    case TK_PIPE:    emitOpcode(compiler, OP_BIT_OR);     break;
    case TK_CARET:   emitOpcode(compiler, OP_BIT_XOR);    break;
    case TK_PLUS:    emitOpcode(compiler, OP_ADD);        break;
    case TK_MINUS:   emitOpcode(compiler, OP_SUBTRACT);   break;
    case TK_STAR:    emitOpcode(compiler, OP_MULTIPLY);   break;
    case TK_FSLASH:  emitOpcode(compiler, OP_DIVIDE);     break;
    case TK_GT:      emitOpcode(compiler, OP_GT);         break;
    case TK_LT:      emitOpcode(compiler, OP_LT);         break;
    case TK_EQEQ:    emitOpcode(compiler, OP_EQEQ);       break;
    case TK_NOTEQ:   emitOpcode(compiler, OP_NOTEQ);      break;
    case TK_GTEQ:    emitOpcode(compiler, OP_GTEQ);       break;
    case TK_LTEQ:    emitOpcode(compiler, OP_LTEQ);       break;
    case TK_SRIGHT:  emitOpcode(compiler, OP_BIT_RSHIFT); break;
    case TK_SLEFT:   emitOpcode(compiler, OP_BIT_LSHIFT); break;
    case TK_IN:      emitOpcode(compiler, OP_IN);         break;
    default:
      UNREACHABLE();
  }

  compiler->is_last_call = false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x30(%rdi), %r14
callq 0xd399
imulq $0x18, %r14, %rax
leaq 0x1839d(%rip), %rcx     # 0x23200
movl 0x10(%rax,%rcx), %esi
incl %esi
movq %rbx, %rdi
callq 0xd627
leal -0xf(%r14), %eax
cmpl $0x28, %eax
ja 0xae8e
leaq 0xdd4b(%rip), %rcx      # 0x18bcc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x3d
jmp 0xaed6
cmpl $0x4, %r14d
jne 0xaeee
pushq $0x49
jmp 0xaed6
pushq $0x3b
jmp 0xaed6
pushq $0x3c
jmp 0xaed6
pushq $0x3e
jmp 0xaed6
pushq $0x39
jmp 0xaed6
pushq $0x44
jmp 0xaed6
pushq $0x3f
jmp 0xaed6
pushq $0x45
jmp 0xaed6
pushq $0x48
jmp 0xaed6
pushq $0x40
jmp 0xaed6
pushq $0x43
jmp 0xaed6
pushq $0x47
jmp 0xaed6
pushq $0x3a
jmp 0xaed6
pushq $0x46
jmp 0xaed6
pushq $0x42
jmp 0xaed6
pushq $0x4a
jmp 0xaed6
pushq $0x41
popq %rsi
movq %rbx, %rdi
callq 0xc734
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18103(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xd27b(%rip), %rsi      # 0x1817a
leaq 0xe3c3(%rip), %rdx      # 0x192c9
leaq 0xdf56(%rip), %rcx      # 0x18e63
movl $0x5bf, %r8d            # imm = 0x5BF
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprGrouping
static void exprGrouping(Compiler* compiler) {
  skipNewLines(compiler);
  compileExpression(compiler);
  skipNewLines(compiler);
  consume(compiler, TK_RPARAN, "Expected ')' after expression.");

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd399
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
callq 0xd399
leaq 0xe3a6(%rip), %rdx      # 0x192e2
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0xc4fb
movb $0x0, 0x38ce(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprCall
static void exprCall(Compiler* compiler) {

  // Compile parameters.
  int argc = 0;
  if (!match(compiler, TK_RPARAN)) {
    do {
      skipNewLines(compiler);
      compileExpression(compiler);
      skipNewLines(compiler);
      argc++;
    } while (match(compiler, TK_COMMA));
    consume(compiler, TK_RPARAN, "Expected ')' after parameter list.");
  }

  emitOpcode(compiler, OP_CALL);
  emitByte(compiler, argc);

  compiler->is_last_call = true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0xa
popq %rsi
callq 0xc438
xorl %ebp, %ebp
testb %al, %al
jne 0xafa6
xorl %ebp, %ebp
pushq $0x5
popq %r14
movq %rbx, %rdi
callq 0xd399
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
callq 0xd399
incl %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc438
testb %al, %al
jne 0xaf6b
leaq 0xdff0(%rip), %rdx      # 0x18f8b
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0xc4fb
pushq $0x27
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc773
movb $0x1, 0x38ce(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprList
static void exprList(Compiler* compiler) {

  emitOpcode(compiler, OP_PUSH_LIST);
  int size_index = emitShort(compiler, 0);

  int size = 0;
  do {
    skipNewLines(compiler);
    if (peek(compiler) == TK_RBRACKET) break;

    compileExpression(compiler);
    emitOpcode(compiler, OP_LIST_APPEND);
    size++;

    skipNewLines(compiler);
  } while (match(compiler, TK_COMMA));

  skipNewLines(compiler);
  consume(compiler, TK_RBRACKET, "Expected ']' after list elements.");

  _FN->opcodes.data[size_index] = (size >> 8) & 0xff;
  _FN->opcodes.data[size_index + 1] = size & 0xff;

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r12
pushq $0x6
popq %rsi
callq 0xc734
xorl %ebx, %ebx
movq %r12, %rdi
xorl %esi, %esi
callq 0xc748
movl %eax, %ebp
pushq $0x9
popq %r14
pushq $0x5
popq %r15
movq %r12, %rdi
callq 0xd399
cmpl $0xc, 0x50(%r12)
je 0xb02c
movq %r12, %rdi
callq 0xd50e
movq %r12, %rdi
movl %r14d, %esi
callq 0xc734
incl %ebx
movq %r12, %rdi
callq 0xd399
movq %r12, %rdi
movl %r15d, %esi
callq 0xc438
testb %al, %al
jne 0xaff0
movq %r12, %rdi
callq 0xd399
leaq 0xe2c6(%rip), %rdx      # 0x19301
pushq $0xc
popq %rsi
movq %r12, %rdi
callq 0xc4fb
movq 0x18c0(%r12), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movslq %ebp, %rcx
movb %bh, (%rax,%rcx)
movq 0x18c0(%r12), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movb %bl, 0x1(%rax,%rcx)
movb $0x0, 0x38ce(%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprSubscript
static void exprSubscript(Compiler* compiler) {
  compileExpression(compiler);
  consume(compiler, TK_RBRACKET, "Expected ']' after subscription ends.");

  if (compiler->l_value && matchAssignment(compiler)) {
    skipNewLines(compiler);

    TokenType assignment = compiler->previous.type;
    if (assignment != TK_EQ) {
      emitOpcode(compiler, OP_GET_SUBSCRIPT_KEEP);
      compileExpression(compiler);
      emitAssignment(compiler, assignment);

    } else {
      compileExpression(compiler);
    }

    emitOpcode(compiler, OP_SET_SUBSCRIPT);

  } else {
    emitOpcode(compiler, OP_GET_SUBSCRIPT);
  }
  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xd50e
leaq 0xe2ee(%rip), %rdx      # 0x19388
pushq $0xc
popq %rsi
movq %rbx, %rdi
callq 0xc4fb
pushq $0x33
popq %rbp
cmpb $0x1, 0x38cd(%rbx)
jne 0xb0f7
movq %rbx, %rdi
callq 0xd760
testb %al, %al
je 0xb0f7
movq %rbx, %rdi
callq 0xd399
movl 0x30(%rbx), %ebp
cmpl $0x1a, %ebp
jne 0xb0d7
movq %rbx, %rdi
callq 0xd50e
jmp 0xb0f4
pushq $0x34
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
movl %ebp, %esi
callq 0xd851
pushq $0x35
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc734
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprMap
static void exprMap(Compiler* compiler) {
  emitOpcode(compiler, OP_PUSH_MAP);

  do {
    skipNewLines(compiler);
    if (peek(compiler) == TK_RBRACE) break;

    compileExpression(compiler);
    consume(compiler, TK_COLLON, "Expected ':' after map's key.");
    compileExpression(compiler);

    emitOpcode(compiler, OP_MAP_INSERT);

    skipNewLines(compiler);
  } while (match(compiler, TK_COMMA));

  skipNewLines(compiler);
  consume(compiler, TK_RBRACE, "Expected '}' after map elements.");

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0x7
popq %rsi
callq 0xc734
leaq 0xe1fa(%rip), %r14      # 0x19323
pushq $0x6
popq %rbp
pushq $0xa
popq %r15
pushq $0x5
popq %r12
movq %rbx, %rdi
callq 0xd399
cmpl $0xe, 0x50(%rbx)
je 0xb181
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xc4fb
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
movl %r15d, %esi
callq 0xc734
movq %rbx, %rdi
callq 0xd399
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc438
testb %al, %al
jne 0xb134
movq %rbx, %rdi
callq 0xd399
leaq 0xe1b1(%rip), %rdx      # 0x19341
pushq $0xe
popq %rsi
movq %rbx, %rdi
callq 0xc4fb
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprUnaryOp
static void exprUnaryOp(Compiler* compiler) {
  TokenType op = compiler->previous.type;
  skipNewLines(compiler);
  parsePrecedence(compiler, (Precedence)(PREC_UNARY + 1));

  switch (op) {
    case TK_TILD:  emitOpcode(compiler, OP_BIT_NOT); break;
    case TK_MINUS: emitOpcode(compiler, OP_NEGATIVE); break;
    case TK_NOT:   emitOpcode(compiler, OP_NOT); break;
    default:
      UNREACHABLE();
  }

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x30(%rdi), %ebp
callq 0xd399
pushq $0xf
popq %rsi
movq %rbx, %rdi
callq 0xd627
cmpl $0x10, %ebp
je 0xb1db
cmpl $0x3a, %ebp
je 0xb1d7
cmpl $0x16, %ebp
jne 0xb1f4
pushq $0x36
jmp 0xb1dd
pushq $0x37
jmp 0xb1dd
pushq $0x38
popq %rsi
movq %rbx, %rdi
callq 0xc734
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x17dfd(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xcf75(%rip), %rsi      # 0x1817a
leaq 0xe0ca(%rip), %rdx      # 0x192d6
leaq 0xdc50(%rip), %rcx      # 0x18e63
movl $0x5cf, %r8d            # imm = 0x5CF
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprChainCall
static void exprChainCall(Compiler* compiler) {
  skipNewLines(compiler);
  parsePrecedence(compiler, (Precedence)(PREC_CHAIN_CALL + 1));
  emitOpcode(compiler, OP_SWAP); // Swap the data with the function.

  int argc = 1; // The initial data.

  if (match(compiler, TK_LBRACE)) {
    if (!match(compiler, TK_RBRACE)) {
      do {
        skipNewLines(compiler);
        compileExpression(compiler);
        skipNewLines(compiler);
        argc++;
      } while (match(compiler, TK_COMMA));
      consume(compiler, TK_RBRACE, "Expected '}' after chain call "
                                   "parameter list.");
    }
  }

  // TODO: ensure argc < 256 (MAX_ARGC) 1byte.

  emitOpcode(compiler, OP_CALL);
  emitByte(compiler, argc);

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xd399
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0xd627
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0xc734
pushq $0xd
popq %rsi
movq %rbx, %rdi
callq 0xc438
pushq $0x1
popq %rbp
testb %al, %al
je 0xb2a7
pushq $0xe
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xb2a7
pushq $0x1
popq %rbp
pushq $0x5
popq %r14
movq %rbx, %rdi
callq 0xd399
movq %rbx, %rdi
callq 0xd50e
movq %rbx, %rdi
callq 0xd399
incl %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc438
testb %al, %al
jne 0xb26c
leaq 0xdfff(%rip), %rdx      # 0x1929b
pushq $0xe
popq %rsi
movq %rbx, %rdi
callq 0xc4fb
pushq $0x27
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc773
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprFunc
static void exprFunc(Compiler* compiler) {
  int fn_index = compileFunction(compiler, FN_LITERAL);
  emitOpcode(compiler, OP_PUSH_FN);
  emitByte(compiler, fn_index);

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2
popq %rsi
callq 0xc82e
movl %eax, %ebp
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc773
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprValue
static void exprValue(Compiler* compiler) {
  TokenType op = compiler->previous.type;
  switch (op) {
    case TK_NULL:  emitOpcode(compiler, OP_PUSH_NULL);  break;
    case TK_TRUE:  emitOpcode(compiler, OP_PUSH_TRUE);  break;
    case TK_FALSE: emitOpcode(compiler, OP_PUSH_FALSE); break;
    default:
      UNREACHABLE();
  }

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x30(%rdi), %eax
cmpl $0x36, %eax
je 0xb319
cmpl $0x3c, %eax
je 0xb315
cmpl $0x3b, %eax
jne 0xb32d
pushq $0x3
jmp 0xb31b
pushq $0x4
jmp 0xb31b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xc734
movb $0x0, 0x38ce(%rbx)
popq %rbx
retq
movq 0x17cc4(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xce3c(%rip), %rsi      # 0x1817a
leaq 0xe069(%rip), %rdx      # 0x193ae
leaq 0xdb17(%rip), %rcx      # 0x18e63
movl $0x662, %r8d            # imm = 0x662
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprAnd
void exprAnd(Compiler* compiler) {
  emitOpcode(compiler, OP_JUMP_IF_NOT);
  int false_offset_a = emitShort(compiler, 0xffff); //< Will be patched.

  parsePrecedence(compiler, PREC_LOGICAL_AND);
  emitOpcode(compiler, OP_JUMP_IF_NOT);
  int false_offset_b = emitShort(compiler, 0xffff); //< Will be patched.

  emitOpcode(compiler, OP_PUSH_TRUE);
  emitOpcode(compiler, OP_JUMP);
  int end_offset = emitShort(compiler, 0xffff); //< Will be patched.

  patchJump(compiler, false_offset_a);
  patchJump(compiler, false_offset_b);
  emitOpcode(compiler, OP_PUSH_FALSE);

  patchJump(compiler, end_offset);

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2e
popq %r14
movl %r14d, %esi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %ebp
pushq $0x3
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd627
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %r14d
movq %rbx, %rdi
movl %r15d, %esi
callq 0xc734
pushq $0x2b
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xd6a6
movq %rbx, %rdi
movl %r14d, %esi
callq 0xd6a6
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd6a6
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprOr
void exprOr(Compiler* compiler) {
  emitOpcode(compiler, OP_JUMP_IF);
  int true_offset_a = emitShort(compiler, 0xffff); //< Will be patched.

  parsePrecedence(compiler, PREC_LOGICAL_OR);
  emitOpcode(compiler, OP_JUMP_IF);
  int true_offset_b = emitShort(compiler, 0xffff); //< Will be patched.

  emitOpcode(compiler, OP_PUSH_FALSE);
  emitOpcode(compiler, OP_JUMP);
  int end_offset = emitShort(compiler, 0xffff); //< Will be patched.

  patchJump(compiler, true_offset_a);
  patchJump(compiler, true_offset_b);
  emitOpcode(compiler, OP_PUSH_TRUE);

  patchJump(compiler, end_offset);

  compiler->is_last_call = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2d
popq %r14
movl %r14d, %esi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %ebp
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xd627
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %r14d
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xc734
pushq $0x2b
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xd6a6
movq %rbx, %rdi
movl %r14d, %esi
callq 0xd6a6
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd6a6
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: exprLiteral
static void exprLiteral(Compiler* compiler) {
  Token* value = &compiler->previous;
  int index = compilerAddConstant(compiler, value->value);
  emitOpcode(compiler, OP_PUSH_CONSTANT);
  emitShort(compiler, index);

  compiler->is_last_call = false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %r15
movq 0x18b0(%rdi), %r13
leaq 0x70(%r13), %r12
xorl %r14d, %r14d
movl 0x78(%r13), %eax
cmpq %rax, %r14
jae 0xb713
movq (%r12), %rax
movq (%rax,%r14,8), %rdi
movq %r15, %rsi
callq 0x4f00
testb %al, %al
jne 0xb747
incq %r14
jmp 0xb6f1
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0xb72a
movq (%rbx), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x2d2b
jmp 0xb740
leaq 0xd761(%rip), %rsi      # 0x18e92
movq %rbx, %rdi
movl $0x10000, %edx          # imm = 0x10000
xorl %eax, %eax
callq 0xc455
movl 0x78(%r13), %r14d
decl %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc734
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc748
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: parseError
static void parseError(Compiler* compiler, const char* fmt, ...) {

  Token* token = &compiler->previous;

  // Lex errors would repored earlier by lexError and lexed a TK_ERROR token.
  if (token->type == TK_ERROR) return;

  va_list args;
  va_start(args, fmt);
  const char* path = compiler->script->path->data;
  reportError(compiler, path, token->line, fmt, args);
  va_end(args);
}

// Assembly:
subq $0xd8, %rsp
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xc49c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r8, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
cmpl $0x0, 0x30(%rdi)
je 0xc4f3
movq %rsi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %r8
movq %rax, 0x10(%r8)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r8)
movq 0x18b0(%rdi), %rax
movq 0x18(%rax), %rsi
addq $0x1c, %rsi
movl 0x44(%rdi), %edx
movq %r10, %rcx
callq 0xde07
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: consume
static void consume(Compiler* self, TokenType expected, const char* err_msg) {

  lexToken(self);
  if (self->previous.type != expected) {
    parseError(self, "%s", err_msg);

    // If the next token is expected discard the current to minimize
    // cascaded errors and continue parsing.
    if (peek(self) == expected) {
      lexToken(self);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0xbfe9
cmpl %ebp, 0x30(%rbx)
je 0xc536
leaq 0xf477(%rip), %rsi      # 0x1b98f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc455
cmpl %ebp, 0x50(%rbx)
jne 0xc536
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xbfe9
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: resolveError
static void resolveError(Compiler* compiler, int line, const char* fmt, ...) {
  va_list args;
  va_start(args, fmt);
  const char* path = compiler->script->path->data;
  reportError(compiler, path, line, fmt, args);
  va_end(args);
}

// Assembly:
subq $0xd8, %rsp
movl %esi, %edx
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xc5c9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r8
movq %rsi, 0x10(%r8)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%r8)
movq 0x18b0(%rdi), %rax
movq 0x18(%rax), %rsi
addq $0x1c, %rsi
leaq 0xc81e(%rip), %rcx      # 0x18e1d
callq 0xde07
addq $0xd8, %rsp
retq