LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x30(%rsi)
je 0xe332
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x5f0(%rdi), %r13
movslq 0x48(%r13), %rax
cmpl %eax, 0x4c(%r13)
jl 0xe258
leal (%rax,%rax), %ecx
movq 0x40(%r13), %rsi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
movslq %ecx, %r12
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %rcx
movq %r15, %rdi
callq 0xb4b5
movq 0x5f0(%r15), %r13
movq %rax, 0x40(%r13)
movl %r12d, 0x48(%r13)
movq 0x38(%rbx), %rax
movq 0x30(%r13), %rdi
subq 0x20(%r13), %rdi
shrq $0x3, %rdi
addl 0x20(%rax), %edi
cmpl %edi, 0x28(%r13)
jg 0xe2f5
callq 0xeee0
movq 0x20(%r13), %r12
movslq 0x28(%r13), %rdx
shlq $0x3, %rdx
movslq %eax, %rbp
leaq (,%rbp,8), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0xb4b5
movq %rax, 0x20(%r13)
movl %ebp, 0x28(%r13)
cmpq %rax, %r12
je 0xe2f5
movq 0x30(%r13), %rcx
movq 0x38(%r13), %rdx
subq %r12, %rcx
addq %rax, %rcx
movq %rcx, 0x30(%r13)
subq %r12, %rdx
addq %rax, %rdx
movq %rdx, 0x38(%r13)
movslq 0x4c(%r13), %rdx
testq %rdx, %rdx
jle 0xe2f5
movq 0x40(%r13), %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movq 0x10(%rcx,%rsi), %rdi
subq %r12, %rdi
addq %rax, %rdi
movq %rdi, 0x10(%rcx,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0xe2dc
movq 0x5f0(%r15), %rax
movq 0x40(%rax), %rcx
movslq 0x4c(%rax), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x4c(%rax)
leaq (%rdx,%rdx,2), %rax
movq %r14, 0x10(%rcx,%rax,8)
movq %rbx, 0x8(%rcx,%rax,8)
movq 0x38(%rbx), %rdx
movq (%rdx), %rdx
movq %rdx, (%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4863
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xa6d5
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0xb71b
movl 0x14(%r15), %ecx
addq $0x1c, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8a34
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xb78e
// File: /workspace/github_c_makefile_star2_O3/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 0xedfd
movq 0x40(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movq -0x10(%rax,%rcx,8), %rax
movq 0x18(%rax), %rbp
cmpl $0x0, 0x38(%rbp)
je 0xedee
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
leaq 0x10c20(%rip), %r12     # 0x1f98f
xorl %r14d, %r14d
movq 0x60(%rbp), %rax
movq 0x20(%rbp), %rcx
movq 0x30(%rbp), %rdx
movl (%rdx,%r14,4), %edx
movq (%rax,%rdx,8), %rsi
movq (%rcx,%r14,8), %r13
addq $0x1c, %rsi
leaq 0xddfa(%rip), %rdi      # 0x1cb8f
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
callq 0x84c3
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xe338
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x8562
movq 0x8(%rsp), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
movq %rbx, %rsi
callq 0x84ca
movl $0xa, %edi
callq 0x2050
incq %r14
movl 0x38(%rbp), %eax
cmpq %rax, %r14
jb 0xed72
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x49d4
// File: /workspace/github_c_makefile_star2_O3/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 0xeed8
movq %rdi, %rbx
decl %r14d
movq 0x30(%rax), %r13
movq 0x40(%rax), %r15
leaq 0xdd6d(%rip), %rdi      # 0x1cba6
movl %r14d, %esi
xorl %eax, %eax
callq 0x2150
leaq (%r14,%r14,2), %rax
addq $-0x8, %r13
cmpq 0x10(%r15,%rax,8), %r13
jb 0xeec9
leaq (%r15,%rax,8), %rbp
addq $0x10, %rbp
leaq 0xdcee(%rip), %r14      # 0x1cb4f
leaq 0x8(%rsp), %r15
leaq 0x10b22(%rip), %r12     # 0x1f98f
movq %r14, %rdi
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
callq 0x84c3
movq (%r13), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe338
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x8562
movq 0x8(%rsp), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2150
movq %r15, %rdi
movq %rbx, %rsi
callq 0x84ca
movl $0xa, %edi
callq 0x2050
addq $-0x8, %r13
cmpq (%rbp), %r13
jae 0xee6d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4a0a
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0x1, %eax
cmpl $0x80, %edi
jl 0xf01c
movl $0x2, %eax
cmpl $0x800, %edi            # imm = 0x800
jb 0xf01c
movl $0x3, %eax
cmpl $0x10000, %edi          # imm = 0x10000
jb 0xf01c
xorl %eax, %eax
cmpl $0x110000, %edi         # imm = 0x110000
setb %al
shll $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf084
andb $0x7f, %dil
movb %dil, (%rsi)
movl $0x1, %eax
retq
cmpl $0x7ff, %edi            # imm = 0x7FF
ja 0xf0a7
movl %edi, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%rsi)
andb $0x7, %dil
orb $-0x80, %dil
movb %dil, 0x1(%rsi)
movl $0x2, %eax
retq
cmpl $0xffff, %edi           # imm = 0xFFFF
ja 0xf0d6
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)
movl $0x3, %eax
retq
xorl %eax, %eax
cmpl $0x10ffff, %edi         # imm = 0x10FFFF
ja 0xf112
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)
movl $0x4, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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, %edx
andl $-0x40, %edx
movl $0x1, %eax
cmpl $0x80, %edx
je 0xf1b1
movl %ecx, %eax
andl $-0x20, %eax
cmpl $0xc0, %eax
jne 0xf141
xorl %eax, %eax
movl $0x1f, %edx
jmp 0xf175
movl %ecx, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0xf159
movl $0x1, %eax
movl $0xf, %edx
jmp 0xf175
movl %ecx, %edx
andl $-0x8, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xf0, %edx
jne 0xf1b3
movl $0x2, %eax
movl $0x7, %edx
andl %edx, %ecx
movl %eax, %edx
addl $0x2, %eax
incq %rdx
xorl %r8d, %r8d
movzbl 0x1(%rdi,%r8), %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
cmpl $0x80, %r10d
jne 0xf1b4
movl %ecx, %r10d
shll $0x6, %r10d
andl $0x3f, %r9d
movl %r9d, %ecx
orl %r10d, %ecx
incq %r8
cmpl %r8d, %edx
jne 0xf182
movl %ecx, (%rsi)
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xe1b4(%rip), %rdx      # 0x1d382
movl $0x47, %esi
callq 0x10df5
movq (%rbx), %rsi
movq 0x38(%rbx), %rdx
movl 0x40(%rbx), %ecx
movq 0x18b0(%rbx), %rdi
callq 0x9306
movl %eax, %ebp
cmpb $0x1, 0x38cd(%rbx)
jne 0xf258
movl 0x50(%rbx), %eax
leal -0x21(%rax), %ecx
cmpl $0x8, %ecx
jb 0xf21b
cmpl $0x2c, %eax
ja 0xf258
movl %eax, %eax
movabsq $0x180004000000, %rcx   # imm = 0x180004000000
btq %rax, %rcx
jae 0xf258
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
movl 0x30(%rbx), %r15d
movq %rbx, %rdi
cmpl $0x1a, %r15d
jne 0xf28a
movl $0x1, %esi
callq 0x11eb4
movl %ebp, %r14d
shrl $0x8, %r14d
movl $0xff, %eax
andl %eax, %r14d
andl %eax, %ebp
jmp 0xf2de
movq %rbx, %rdi
movl $0x30, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %r14d
andl %r14d, %esi
movq %rbx, %rdi
callq 0x10fbe
andl %r14d, %ebp
jmp 0xf300
movl $0x31, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movl %ebp, %r14d
shrl $0x8, %r14d
movl $0xff, %r12d
andl %r12d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x10fbe
andl %r12d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10fbe
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
movl %r15d, %esi
callq 0x12035
movq %rbx, %rdi
movl $0x32, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl %r14d, %esi
callq 0x10fbe
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10fbe
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x11bcc
leaq (%r14,%r14,2), %rax
leaq 0x19ecb(%rip), %rcx     # 0x29200
movl 0x10(%rcx,%rax,8), %esi
incl %esi
movq %rbx, %rdi
callq 0x11eb4
leal -0xf(%r14), %eax
cmpl $0x28, %eax
ja 0xf363
leaq 0xd861(%rip), %rcx      # 0x1cbb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x3d, %esi
jmp 0xf3e1
movl $0x49, %esi
cmpl $0x4, %r14d
je 0xf3e1
callq 0x4a40
movl $0x3b, %esi
jmp 0xf3e1
movl $0x3c, %esi
jmp 0xf3e1
movl $0x3e, %esi
jmp 0xf3e1
movl $0x39, %esi
jmp 0xf3e1
movl $0x44, %esi
jmp 0xf3e1
movl $0x3f, %esi
jmp 0xf3e1
movl $0x45, %esi
jmp 0xf3e1
movl $0x48, %esi
jmp 0xf3e1
movl $0x40, %esi
jmp 0xf3e1
movl $0x43, %esi
jmp 0xf3e1
movl $0x47, %esi
jmp 0xf3e1
movl $0x3a, %esi
jmp 0xf3e1
movl $0x46, %esi
jmp 0xf3e1
movl $0x42, %esi
jmp 0xf3e1
movl $0x4a, %esi
jmp 0xf3e1
movl $0x41, %esi
movq %rbx, %rdi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x11bcc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
callq 0x11bcc
leaq 0xdedb(%rip), %rdx      # 0x1d302
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10df5
movb $0x0, 0x38ce(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xa, 0x50(%rdi)
jne 0xf455
movq %rbx, %rdi
callq 0x10771
xorl %ebp, %ebp
jmp 0xf4c3
movq %rbx, %rdi
callq 0x11bcc
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
callq 0x11bcc
cmpl $0x5, 0x50(%rbx)
jne 0xf4af
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
callq 0x11bcc
incl %ebp
cmpl $0x5, 0x50(%rbx)
je 0xf482
leaq 0xdaf5(%rip), %rdx      # 0x1cfab
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10df5
movq %rbx, %rdi
movl $0x27, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10fbe
movb $0x1, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
movq %rdi, %rbx
movl $0x6, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10fbe
movl %eax, %ebp
movq %rbx, %rdi
callq 0x11bcc
xorl %r14d, %r14d
cmpl $0xc, 0x50(%rbx)
je 0xf588
movl $0x1, %eax
movl %eax, %r14d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
movl $0x9, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
callq 0x11bcc
cmpl $0x5, 0x50(%rbx)
jne 0xf588
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
leal 0x1(%r14), %eax
cmpl $0xc, 0x50(%rbx)
jne 0xf539
movslq %ebp, %rbp
movq %rbx, %rdi
callq 0x11bcc
leaq 0xdd87(%rip), %rdx      # 0x1d321
movq %rbx, %rdi
movl $0xc, %esi
callq 0x10df5
movq 0x18c0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movq %r14, %rcx
movb %ch, -0x1(%rax,%rbp)
movq 0x18c0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movb %cl, (%rax,%rbp)
movb $0x0, 0x38ce(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %esi
callq 0x11eb4
leaq 0xddb0(%rip), %rdx      # 0x1d3a8
movq %rbx, %rdi
movl $0xc, %esi
callq 0x10df5
movl $0x33, %esi
cmpb $0x1, 0x38cd(%rbx)
jne 0xf68c
movl 0x50(%rbx), %eax
leal -0x21(%rax), %ecx
cmpl $0x8, %ecx
jb 0xf635
cmpl $0x2c, %eax
ja 0xf68c
movl %eax, %eax
movabsq $0x180004000000, %rcx   # imm = 0x180004000000
btq %rax, %rcx
jae 0xf68c
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
movl 0x30(%rbx), %ebp
movq %rbx, %rdi
cmpl $0x1a, %ebp
jne 0xf65c
movl $0x1, %esi
callq 0x11eb4
jmp 0xf687
movl $0x34, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
movl %ebp, %esi
callq 0x12035
movl $0x35, %esi
movq %rbx, %rdi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x7, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
callq 0x11bcc
cmpl $0xe, 0x50(%rbx)
je 0xf741
leaq 0xdc67(%rip), %r14      # 0x1d343
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
movl $0x6, %esi
movq %r14, %rdx
callq 0x10df5
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
callq 0x11bcc
cmpl $0x5, 0x50(%rbx)
jne 0xf741
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
cmpl $0xe, 0x50(%rbx)
jne 0xf6dc
movq %rbx, %rdi
callq 0x11bcc
leaq 0xdc11(%rip), %rdx      # 0x1d361
movq %rbx, %rdi
movl $0xe, %esi
callq 0x10df5
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x11bcc
movq %rbx, %rdi
movl $0xf, %esi
callq 0x11eb4
cmpl $0x10, %ebp
je 0xf7a4
cmpl $0x3a, %ebp
je 0xf79d
cmpl $0x16, %ebp
jne 0xf7c9
movl $0x36, %esi
jmp 0xf7a9
movl $0x37, %esi
jmp 0xf7a9
movl $0x38, %esi
movq %rbx, %rdi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x4a6f
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
callq 0x11bcc
movq %rbx, %rdi
movl $0x10, %esi
callq 0x11eb4
movq %rbx, %rdi
movl $0x5, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movl $0x1, %ebp
cmpl $0xd, 0x50(%rbx)
jne 0xf885
movq %rbx, %rdi
callq 0x10771
cmpl $0xe, 0x50(%rbx)
jne 0xf820
movq %rbx, %rdi
callq 0x10771
jmp 0xf885
movq %rbx, %rdi
callq 0x11bcc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
callq 0x11bcc
movl $0x2, %ebp
cmpl $0x5, 0x50(%rbx)
jne 0xf871
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x11eb4
movq %rbx, %rdi
callq 0x11bcc
incl %ebp
jmp 0xf842
leaq 0xda43(%rip), %rdx      # 0x1d2bb
movq %rbx, %rdi
movl $0xe, %esi
callq 0x10df5
movq %rbx, %rdi
movl $0x27, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10fbe
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x2, %esi
callq 0x11049
movl %eax, %ebp
movq %rbx, %rdi
movl $0x22, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl %ebp, %esi
callq 0x10fbe
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf919
cmpl $0x3c, %eax
je 0xf912
cmpl $0x3b, %eax
jne 0xf939
movl $0x3, %esi
jmp 0xf91e
movl $0x4, %esi
jmp 0xf91e
movl $0x1, %esi
movq %rbx, %rdi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movb $0x0, 0x38ce(%rbx)
popq %rbx
retq
callq 0x4a9e
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x2e, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
leal -0x1(%rax), %ebp
movq %rbx, %rdi
movl $0x3, %esi
callq 0x11eb4
movq %rbx, %rdi
movl $0x2e, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
leal -0x1(%rax), %r14d
movq %rbx, %rdi
movl $0x3, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl $0x2b, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
movq %rbx, %rdi
movl $0xff, %esi
callq 0x10fbe
leal -0x1(%rax), %r15d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11f33
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11f33
movq %rbx, %rdi
movl $0x4, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movq %rbx, %rdi
movl %r15d, %esi
callq 0x11f33
movb $0x0, 0x38ce(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x48(%rdi), %r15
movq 0x18b0(%rdi), %r13
leaq 0x70(%r13), %r12
cmpl $0x0, 0x78(%r13)
je 0xfe2a
xorl %r14d, %r14d
movq (%r12), %rax
movq (%rax,%r14,8), %rdi
movq %r15, %rsi
callq 0xa90b
testb %al, %al
jne 0xfe57
incq %r14
movl 0x78(%r13), %eax
cmpq %rax, %r14
jb 0xfe03
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0xfe3a
movq (%rbx), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x8674
jmp 0xfe50
leaq 0xd071(%rip), %rsi      # 0x1ceb2
movq %rbx, %rdi
movl $0x10000, %edx          # imm = 0x10000
xorl %eax, %eax
callq 0x10d4f
movl 0x78(%r13), %r14d
decl %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11014
movl %r14d, %esi
shrl $0x8, %esi
movl $0xff, %ebp
andl %ebp, %esi
movq %rbx, %rdi
callq 0x10fbe
andl %ebp, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x10fbe
movb $0x0, 0x38ce(%rbx)
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_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 0x10d96
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 0x10ded
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 0x1257a
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x10771
cmpl %ebp, 0x30(%rbx)
je 0x10e30
leaq 0xeb7d(%rip), %rsi      # 0x1f98f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d4f
cmpl %ebp, 0x50(%rbx)
jne 0x10e30
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x10771
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: emitFunctionEnd
static void emitFunctionEnd(Compiler* compiler) {

  // Don't use emitOpcode(compiler, OP_RETURN); Because it'll recude the stack
  // size by -1, (return value will be popped). We really don't have to pop the
  // return value of the function, when returning from the end of the function,
  // because there'll always be a null value at the base of the current call
  // frame as the return value of the function.
  emitByte(compiler, OP_RETURN);

  emitOpcode(compiler, OP_END);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x10fbe
movq %rbx, %rdi
movl $0x4c, %esi
callq 0x10fbe
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x11014
// File: /workspace/github_c_makefile_star2_O3/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 0x10eb0
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 0xbf57(%rip), %rcx      # 0x1ce3d
callq 0x1257a
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: pkCompileModule
PkResult pkCompileModule(PKVM* vm, PkHandle* module, PkStringPtr source,
                         const PkCompileOptions* options) {
  __ASSERT(module != NULL, "Argument module was NULL.");
  Var scr = module->value;
  __ASSERT(IS_OBJ_TYPE(scr, OBJ_SCRIPT), "Given handle is not a module");
  Script* script = (Script*)AS_OBJ(scr);

  PkResult result = compile(vm, script, source.string, options);
  if (source.on_done) source.on_done(vm, source);
  return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x10f68
movq (%rsi), %rsi
movq %rsi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0x10f63
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rsi
cmpl $0x4, (%rsi)
jne 0x10f63
movq %rdx, %rcx
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movq (%r14), %rdx
callq 0xfea4
movl %eax, %ebp
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x10f58
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq *%rax
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x4b6f
callq 0x4ba5
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerMarkObjects
void compilerMarkObjects(PKVM* vm, Compiler* compiler) {

  // Mark the script which is currently being compiled.
  markObject(vm, &compiler->script->_super);

  // Mark the string literals (they haven't added to the script's literal
  // buffer yet).
  markValue(vm, compiler->current.value);
  markValue(vm, compiler->previous.value);
  markValue(vm, compiler->next.value);

  if (compiler->next_compiler != NULL) {
    compilerMarkObjects(vm, compiler->next_compiler);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18b0(%rbx), %rsi
movq %r14, %rdi
callq 0x8a84
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x8ae9
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x8ae9
movq 0x88(%rbx), %rsi
movq %r14, %rdi
callq 0x8ae9
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x10f77
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: emitByte
static int emitByte(Compiler* compiler, int byte) {

  pkByteBufferWrite(&_FN->opcodes, compiler->vm,
                    (uint8_t)byte);
  pkUintBufferWrite(&_FN->oplines, compiler->vm,
                   compiler->previous.line);
  return (int)_FN->opcodes.count - 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18c0(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq (%rbx), %rax
movzbl %sil, %edx
movq %rax, %rsi
callq 0x8562
movq 0x18c0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
addq $0x10, %rdi
movq (%rbx), %rsi
movl 0x44(%rbx), %edx
callq 0x8459
movq 0x18c0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movl 0x8(%rax), %eax
decl %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerChangeStack
static void compilerChangeStack(Compiler* compiler, int num) {
  compiler->stack_size += num;

  // If the compiler has error (such as undefined name, that will not popped
  // because of the semantic error but it'll be popped once the expression
  // parsing is done.
  if (!compiler->has_errors) ASSERT(compiler->stack_size >= 0, OOPS);

  if (compiler->stack_size > _FN->stack_size) {
    _FN->stack_size = compiler->stack_size;
  }
}

// Assembly:
addl 0x18ac(%rdi), %esi
movl %esi, 0x18ac(%rdi)
setns %al
orb 0x90(%rdi), %al
je 0x11043
movq 0x18c0(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
cmpl 0x20(%rax), %esi
jle 0x11042
movl %esi, 0x20(%rax)
retq
pushq %rax
callq 0x4bdb
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerSearchName
static NameSearchResult compilerSearchName(Compiler* compiler,
  const char* name, uint32_t length) {

  NameSearchResult result;
  result.type = NAME_NOT_DEFINED;

  for (int i = compiler->local_count - 1; i >= 0; i--) {
    Local* local = &compiler->locals[i];
    ASSERT(local->depth != DEPTH_GLOBAL, OOPS);

    // Literal functions are not closures and ignore it's outer function's
    // local variables.
    if (compiler->func->depth >= local->depth) {
      continue;
    }

    if (length == local->length) {
      if (strncmp(local->name, name, length) == 0) {
        result.type = NAME_LOCAL_VAR;
        result.index = i;
        return result;
      }
    }
  }

  int index; // For storing the search result below.

  // Search through globals.
  index = scriptGetGlobals(compiler->script, name, length);
  if (index != -1) {
    result.type = NAME_GLOBAL_VAR;
    result.index = index;
    return result;
  }

  // Search through classes.
  index = scriptGetClass(compiler->script, name, length);
  if (index != -1) {
    result.type = NAME_CLASS;
    result.index = index;
    return result;
  }

  // Search through functions.
  index = scriptGetFunc(compiler->script, name, length);
  if (index != -1) {
    result.type = NAME_FUNCTION;
    result.index = index;
    return result;
  }

  // Search through builtin functions.
  index = findBuiltinFunction(compiler->vm, name, length);
  if (index != -1) {
    result.type = NAME_BUILTIN;
    result.index = index;
    return result;
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movslq 0x18a8(%rdi), %rbx
testq %rbx, %rbx
jle 0x113a1
movl %ebp, %r12d
leaq (%rbx,%rbx,2), %rax
leaq (%r15,%rax,8), %r13
addq $0x9c, %r13
movl (%r13), %eax
cmpl $-0x1, %eax
je 0x1143b
movq 0x18c0(%r15), %rcx
cmpl %eax, (%rcx)
jge 0x11390
cmpl %ebp, -0x4(%r13)
jne 0x11390
movq -0xc(%r13), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
je 0x113df
decq %rbx
leaq 0x1(%rbx), %rax
addq $-0x18, %r13
cmpq $0x1, %rax
ja 0x1135f
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xa47b
cmpl $-0x1, %eax
je 0x113c0
movl %eax, %ebx
movl $0x2, %eax
jmp 0x11422
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xa37e
cmpl $-0x1, %eax
je 0x113e8
movl %eax, %ebx
movl $0x4, %eax
jmp 0x11422
decl %ebx
movl $0x1, %eax
jmp 0x11422
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xa40c
cmpl $-0x1, %eax
je 0x11407
movl %eax, %ebx
movl $0x3, %eax
jmp 0x11422
movq (%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x136d0
movl %eax, %ebx
xorl %eax, %eax
cmpl $-0x1, %ebx
setne %al
leaq (%rax,%rax,4), %rax
shlq $0x20, %rbx
orq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4cb3
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compileBlockBody
static void compileBlockBody(Compiler* compiler, BlockType type) {

  compilerEnterBlock(compiler);

  if (type == BLOCK_IF) {
    consumeStartBlock(compiler, TK_THEN);
    skipNewLines(compiler);

  } else if (type == BLOCK_ELSE) {
    skipNewLines(compiler);

  } else if (type == BLOCK_FUNC) {
    // Function body doesn't require a 'do' or 'then' delimiter to enter.
    skipNewLines(compiler);

  } else {
    // For/While loop block body delimiter is 'do'.
    consumeStartBlock(compiler, TK_DO);
    skipNewLines(compiler);
  }

  TokenType next = peek(compiler);
  while (!(next == TK_END || next == TK_EOF || (
    (type == BLOCK_IF) && (next == TK_ELSE || next == TK_ELSIF)))) {

    compileStatement(compiler);
    skipNewLines(compiler);

    next = peek(compiler);
  }

  compilerExitBlock(compiler);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
incl 0xa0(%rdi)
movl %esi, %ebp
movl $0x3e, %eax
cmpl $0x2, %esi
je 0x11507
testl %ebp, %ebp
je 0x11549
movl $0x3d, %eax
cmpl $0x3, %ebp
je 0x11549
cmpl %eax, 0x50(%rbx)
jne 0x1151e
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
jmp 0x11549
movq %rbx, %rdi
callq 0x11bcc
testb %al, %al
jne 0x11549
cmpl $0x2, %ebp
je 0x11538
leaq 0xbb1f(%rip), %rsi      # 0x1d055
jmp 0x1153f
leaq 0xbb41(%rip), %rsi      # 0x1d080
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10d4f
movq %rbx, %rdi
callq 0x11bcc
xorl $0x2, %ebp
movl 0x50(%rbx), %eax
cmpl $0x1, %eax
je 0x1157d
cmpl $0x35, %eax
je 0x1157d
andl $-0x2, %eax
xorl $0x42, %eax
orl %ebp, %eax
je 0x1157d
movq %rbx, %rdi
callq 0x115b4
movq %rbx, %rdi
callq 0x11bcc
jmp 0x11554
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x11588
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerExitBlock
static void compilerExitBlock(Compiler* compiler) {
  ASSERT(compiler->scope_depth > (int)DEPTH_GLOBAL, "Cannot exit toplevel.");

  // Discard all the locals at the current scope.
  int popped = compilerPopLocals(compiler, compiler->scope_depth);
  compiler->local_count -= popped;
  compiler->stack_size -= popped;
  compiler->scope_depth--;
}

// Assembly:
pushq %rbx
movl 0xa0(%rdi), %esi
testl %esi, %esi
js 0x115af
movq %rdi, %rbx
callq 0x11c20
subl %eax, 0x18a8(%rbx)
subl %eax, 0x18ac(%rbx)
decl 0xa0(%rbx)
popq %rbx
retq
callq 0x4ce9
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: matchLine
static bool matchLine(Compiler* compiler) {

  bool consumed = false;

  if (peek(compiler) == TK_LINE) {
    while (peek(compiler) == TK_LINE)
      lexToken(compiler);
    consumed = true;
  }

  // If we're running on REPL mode, at the EOF and compile time error occurred,
  // signal the host to get more lines and try re-compiling it.
  if (compiler->options && compiler->options->repl_mode &&
    !compiler->has_errors) {
    if (peek(compiler) == TK_EOF) {
      compiler->need_more_lines = true;
    }
  }

  return consumed;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x50(%rdi), %ebp
movl %ebp, %eax
cmpl $0x2, %ebp
jne 0x11bec
movq %rbx, %rdi
callq 0x10771
movl 0x50(%rbx), %eax
cmpl $0x2, %eax
je 0x11bdc
movq 0x98(%rbx), %rcx
testq %rcx, %rcx
je 0x11c13
cmpb $0x1, 0x1(%rcx)
jne 0x11c13
cmpl $0x1, %eax
jne 0x11c13
cmpb $0x0, 0x90(%rbx)
jne 0x11c13
movb $0x1, 0x91(%rbx)
cmpl $0x2, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerPopLocals
static int compilerPopLocals(Compiler* compiler, int depth) {
  ASSERT(depth > (int)DEPTH_GLOBAL, "Cannot pop global variables.");

  int local = compiler->local_count - 1;
  while (local >= 0 && compiler->locals[local].depth >= depth) {

    // Note: Do not use emitOpcode(compiler, OP_POP);
    // Because this function is called at the middle of a scope (break,
    // continue). So we need the pop instruction here but we still need the
    // locals to continue parsing the next statements in the scope. They'll be
    // popped once the scope is ended.
    emitByte(compiler, OP_POP);

    local--;
  }
  return (compiler->local_count - 1) - local;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x11c8e
movq %rdi, %r14
movslq 0x18a8(%rdi), %rbx
testq %rbx, %rbx
jle 0x11c72
movl %esi, %ebp
leaq (%rbx,%rbx,2), %rax
leaq (%r14,%rax,8), %r15
addq $0x9c, %r15
cmpl %ebp, (%r15)
jl 0x11c76
decq %rbx
movq %r14, %rdi
movl $0x25, %esi
callq 0x10fbe
leaq 0x1(%rbx), %rax
addq $-0x18, %r15
cmpq $0x1, %rax
ja 0x11c4b
xorl %eax, %eax
jmp 0x11c78
movl %ebx, %eax
jmp 0x11c7f
movl %ebx, %eax
movl 0x18a8(%r14), %ebx
subl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x4dc1
// File: /workspace/github_c_makefile_star2_O3/atomlang[P]atomlang/src/pk_compiler.c
// Function: matchEndStatement
static bool matchEndStatement(Compiler* compiler) {
  if (match(compiler, TK_SEMICOLLON)) {
    skipNewLines(compiler);
    return true;
  }
  if (matchLine(compiler) || peek(compiler) == TK_EOF)
    return true;

  // In the below statement we don't require any new lines or semicolons.
  // 'if cond then stmnt1 elsif cond2 then stmnt2 else stmnt3 end'
  if (peek(compiler) == TK_END || peek(compiler) == TK_ELSE ||
      peek(compiler) == TK_ELSIF)
    return true;

  return false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x7, 0x50(%rdi)
jne 0x11d11
movq %rbx, %rdi
callq 0x10771
movq %rbx, %rdi
callq 0x11bcc
movb $0x1, %al
jmp 0x11d3d
movq %rbx, %rdi
callq 0x11bcc
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x11d3d
movl 0x50(%rbx), %ecx
leal -0x35(%rcx), %edx
cmpl $0xe, %edx
ja 0x11d36
movl $0x6001, %esi           # imm = 0x6001
btl %edx, %esi
jb 0x11d3d
cmpl $0x1, %ecx
je 0x11d3d
xorl %eax, %eax
popq %rbx
retq