LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xc6ae
movq (%rsi), %rsi
movq %rsi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xc680
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rsi
cmpl $0x4, (%rsi)
jne 0xc680
movq %rdx, %rcx
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movq (%r14), %rdx
callq 0xb76d
movl %eax, %ebp
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xc675
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
movq 0x16971(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xba5f(%rip), %rsi      # 0x180f0
leaq 0xc7dd(%rip), %rdx      # 0x18e75
leaq 0xc7b4(%rip), %rcx      # 0x18e53
leaq 0xc7bd(%rip), %r8       # 0x18e63
movl $0xb45, %r9d            # imm = 0xB45
jmp 0xc6da
movq 0x16943(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xba31(%rip), %rsi      # 0x180f0
leaq 0xc773(%rip), %rdx      # 0x18e39
leaq 0xc786(%rip), %rcx      # 0x18e53
leaq 0xc78f(%rip), %r8       # 0x18e63
movl $0xb43, %r9d            # imm = 0xB43
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 0x30a4
movq 0x68(%rbx), %rsi
movq %r14, %rdi
callq 0x3109
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x3109
movq 0x88(%rbx), %rsi
movq %r14, %rdi
callq 0x3109
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xc6ed
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2c3c
movq 0x18c0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
addq $0x10, %rdi
movq (%rbx), %rsi
movl 0x44(%rbx), %edx
callq 0x2b54
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_O2/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 0xc7f8
movq 0x18c0(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
cmpl 0x20(%rax), %esi
jle 0xc7f7
movl %esi, 0x20(%rax)
retq
pushq %rax
movq 0x167f8(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xb8e6(%rip), %rsi      # 0x180f0
leaq 0xb9f3(%rip), %rdx      # 0x18204
leaq 0xc6af(%rip), %rcx      # 0x18ec7
leaq 0xc644(%rip), %r8       # 0x18e63
movl $0x701, %r9d            # imm = 0x701
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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
movl 0x18a8(%rdi), %ebx
movl %edx, %r12d
imulq $0x18, %rbx, %rax
leaq (%rax,%rdi), %r13
addq $0x9c, %r13
testl %ebx, %ebx
jle 0xcbc4
movl (%r13), %eax
cmpl $-0x1, %eax
je 0xcc53
movq 0x18c0(%r15), %rcx
cmpl %eax, (%rcx)
jge 0xcbbc
cmpl %ebp, -0x4(%r13)
jne 0xcbbc
movq -0xc(%r13), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2090
testl %eax, %eax
je 0xcbfc
decl %ebx
addq $-0x18, %r13
jmp 0xcb87
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4936
cmpl $-0x1, %eax
je 0xcbe0
movl %eax, %ebx
pushq $0x2
jmp 0xcc1c
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x482c
cmpl $-0x1, %eax
je 0xcc02
movl %eax, %ebx
pushq $0x4
jmp 0xcc1c
decl %ebx
pushq $0x1
jmp 0xcc1c
movq 0x18b0(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x48ce
cmpl $-0x1, %eax
je 0xcc36
movl %eax, %ebx
pushq $0x3
popq %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
movq (%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xf6c7
movl %eax, %ebx
xorl %eax, %eax
cmpl $-0x1, %ebx
setne %al
leaq (%rax,%rax,4), %rax
jmp 0xcc1d
movq 0x1639e(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xb48c(%rip), %rsi      # 0x180f0
leaq 0xb599(%rip), %rdx      # 0x18204
leaq 0xc37a(%rip), %rcx      # 0x18fec
leaq 0xc1ea(%rip), %r8       # 0x18e63
movl $0x40f, %r9d            # imm = 0x40F
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
incl 0xa0(%rdi)
cmpl $0x2, %esi
je 0xcd48
testl %ebp, %ebp
je 0xcd82
cmpl $0x3, %ebp
je 0xcd82
pushq $0x3d
jmp 0xcd4a
pushq $0x3e
popq %rsi
movq %rbx, %rdi
callq 0xc438
movl %eax, %r14d
movq %rbx, %rdi
callq 0xd399
orb %r14b, %al
jne 0xcd82
cmpl $0x2, %ebp
leaq 0xc2c8(%rip), %rax      # 0x19035
leaq 0xc2ec(%rip), %rsi      # 0x19060
cmovneq %rax, %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc455
movq %rbx, %rdi
callq 0xd399
xorl $0x2, %ebp
movl 0x50(%rbx), %eax
cmpl $0x1, %eax
je 0xcdb6
cmpl $0x35, %eax
je 0xcdb6
andl $-0x2, %eax
xorl $0x42, %eax
orl %ebp, %eax
je 0xcdb6
movq %rbx, %rdi
callq 0xce1b
movq %rbx, %rdi
callq 0xd399
jmp 0xcd8d
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xcdbf
// File: /workspace/github_c_makefile_star2_O2/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 0xcde6
movq %rdi, %rbx
callq 0xd3f2
subl %eax, 0x18a8(%rbx)
subl %eax, 0x18ac(%rbx)
decl 0xa0(%rbx)
popq %rbx
retq
movq 0x1620b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xb2f9(%rip), %rsi      # 0x180f0
leaq 0xc41b(%rip), %rdx      # 0x19219
leaq 0xc42a(%rip), %rcx      # 0x1922f
leaq 0xc057(%rip), %r8       # 0x18e63
movl $0x721, %r9d            # imm = 0x721
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 0xd3be
pushq $0x2
popq %rax
cmpl $0x2, %eax
jne 0xd3be
movq %rbx, %rdi
callq 0xbfe9
movl 0x50(%rbx), %eax
jmp 0xd3ac
movq 0x98(%rbx), %rcx
testq %rcx, %rcx
je 0xd3e5
cmpb $0x1, 0x1(%rcx)
jne 0xd3e5
cmpl $0x1, %eax
jne 0xd3e5
cmpb $0x0, 0x90(%rbx)
jne 0xd3e5
movb $0x1, 0x91(%rbx)
cmpl $0x2, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
js 0xd464
movl %esi, %ebp
movq %rdi, %rbx
movl 0x18a8(%rdi), %r12d
movl %r12d, %r15d
sarl $0x1f, %r15d
andl %r12d, %r15d
imulq $0x18, %r12, %rax
leaq (%rax,%rdi), %r13
addq $0x9c, %r13
pushq $0x25
popq %r14
testl %r12d, %r12d
jle 0xd44c
cmpl %ebp, (%r13)
jl 0xd449
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc773
decl %r12d
addq $-0x18, %r13
jmp 0xd42a
movl %r12d, %r15d
movl 0x18a8(%rbx), %eax
subl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x15b8d(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xac7b(%rip), %rsi      # 0x180f0
leaq 0xbcb1(%rip), %rdx      # 0x1912d
leaq 0xbcc7(%rip), %rcx      # 0x1914a
leaq 0xb9d9(%rip), %r8       # 0x18e63
movl $0x70e, %r9d            # imm = 0x70E
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x7
popq %rsi
callq 0xc438
movl %eax, %ebp
movq %rbx, %rdi
callq 0xd399
orb %bpl, %al
movb $0x1, %al
jne 0xd507
movl 0x50(%rbx), %ecx
leal -0x35(%rcx), %edx
cmpl $0xe, %edx
ja 0xd500
movl $0x6001, %esi           # imm = 0x6001
btl %edx, %esi
jb 0xd507
cmpl $0x1, %ecx
je 0xd507
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: compileIfStatement
static void compileIfStatement(Compiler* compiler, bool elsif) {

  skipNewLines(compiler);
  compileExpression(compiler); //< Condition.
  emitOpcode(compiler, OP_JUMP_IF_NOT);
  int ifpatch = emitShort(compiler, 0xffff); //< Will be patched.

  compileBlockBody(compiler, BLOCK_IF);

  if (match(compiler, TK_ELSIF)) {

    // Jump pass else.
    emitOpcode(compiler, OP_JUMP);
    int exit_jump = emitShort(compiler, 0xffff); //< Will be patched.

    // if (false) jump here.
    patchJump(compiler, ifpatch);

    compilerEnterBlock(compiler);
    compileIfStatement(compiler, true);
    compilerExitBlock(compiler);

    patchJump(compiler, exit_jump);

  } else if (match(compiler, TK_ELSE)) {

    // Jump pass else.
    emitOpcode(compiler, OP_JUMP);
    int exit_jump = emitShort(compiler, 0xffff); //< Will be patched.

    patchJump(compiler, ifpatch);
    compileBlockBody(compiler, BLOCK_ELSE);
    patchJump(compiler, exit_jump);

  } else {
    patchJump(compiler, ifpatch);
  }

  // elsif will not consume the 'end' keyword as it'll be leaved to be consumed
  // by it's 'if'.
  if (!elsif) {
    skipNewLines(compiler);
    consume(compiler, TK_END, "Expected 'end' after statement end.");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0xd399
movq %rbx, %rdi
callq 0xd50e
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0xc748
movl %eax, %r14d
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xcd27
pushq $0x42
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
je 0xd5a5
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 %r14d, %esi
callq 0xd6a6
incl 0xa0(%rbx)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xd516
movq %rbx, %rdi
callq 0xcdbf
jmp 0xd5e5
pushq $0x43
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
je 0xd5e8
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 %r14d, %esi
callq 0xd6a6
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xcd27
movl %r15d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0xd6a6
testb %bpl, %bpl
je 0xd603
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xd399
leaq 0xbb62(%rip), %rdx      # 0x19174
pushq $0x35
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc4fb
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: parsePrecedence
static void parsePrecedence(Compiler* compiler, Precedence precedence) {
  lexToken(compiler);
  GrammarFn prefix = getRule(compiler->previous.type)->prefix;

  if (prefix == NULL) {
    parseError(compiler, "Expected an expression.");
    return;
  }

  // Reset to false and this will set to true by the exprCall() function,
  // If the next infix is call '('.
  compiler->is_last_call = false;
  compiler->l_value = precedence <= PREC_LOWEST;

  prefix(compiler);

  while (getRule(compiler->current.type)->precedence >= precedence) {
    lexToken(compiler);
    GrammarFn infix = getRule(compiler->previous.type)->infix;
    infix(compiler);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0xbfe9
movslq 0x30(%rbx), %rax
imulq $0x18, %rax, %rax
leaq 0x15bbc(%rip), %r14     # 0x23200
movq (%rax,%r14), %rax
testq %rax, %rax
je 0xd691
movb $0x0, 0x38ce(%rbx)
cmpl $0x2, %ebp
setb 0x38cd(%rbx)
movq %rbx, %rdi
callq *%rax
movslq 0x50(%rbx), %rax
imulq $0x18, %rax, %rax
cmpl %ebp, 0x10(%rax,%r14)
jb 0xd68c
movq %rbx, %rdi
callq 0xbfe9
movslq 0x30(%rbx), %rax
imulq $0x18, %rax, %rax
movq %rbx, %rdi
callq *0x8(%rax,%r14)
jmp 0xd663
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xbac4(%rip), %rsi      # 0x1915c
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0xc455
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: patchJump
static void patchJump(Compiler* compiler, int addr_index) {
  int offset = (int)_FN->opcodes.count - (addr_index + 2 /*bytes index*/);
  ASSERT(offset < MAX_JUMP, "Too large address offset to jump to.");

  _FN->opcodes.data[addr_index] = (offset >> 8) & 0xff;
  _FN->opcodes.data[addr_index + 1] = offset & 0xff;
}

// Assembly:
movq 0x18c0(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rcx
movl 0x8(%rcx), %eax
subl %esi, %eax
addl $-0x2, %eax
cmpl $0x10000, %eax          # imm = 0x10000
jge 0xd6e4
movq (%rcx), %rcx
movslq %esi, %rdx
movb %ah, (%rcx,%rdx)
movq 0x18c0(%rdi), %rcx
movq 0x8(%rcx), %rcx
movq 0x38(%rcx), %rcx
movq (%rcx), %rcx
movb %al, 0x1(%rcx,%rdx)
retq
pushq %rax
movq 0x1590c(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xa9fa(%rip), %rsi      # 0x180f0
leaq 0xba9b(%rip), %rdx      # 0x19198
leaq 0xbab9(%rip), %rcx      # 0x191bd
leaq 0xb758(%rip), %r8       # 0x18e63
movl $0x77a, %r9d            # imm = 0x77A
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: emitStoreVariable
static void emitStoreVariable(Compiler* compiler, int index, bool global) {
  if (global) {
    emitOpcode(compiler, OP_STORE_GLOBAL);
    emitByte(compiler, index);

  } else {
    if (index < 9) { //< 0..8 locals have single opcode.
      emitOpcode(compiler, (Opcode)(OP_STORE_LOCAL_0 + index));
    } else {
      emitOpcode(compiler, OP_STORE_LOCAL_N);
      emitByte(compiler, index);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %edx, %edx
je 0xd72b
pushq $0x21
jmp 0xd746
cmpl $0x8, %ebx
jg 0xd744
addl $0x16, %ebx
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc734
pushq $0x1f
popq %rsi
movq %r14, %rdi
callq 0xc734
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc773
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: matchAssignment
static bool matchAssignment(Compiler* compiler) {
  if (match(compiler, TK_EQ))       return true;
  if (match(compiler, TK_PLUSEQ))   return true;
  if (match(compiler, TK_MINUSEQ))  return true;
  if (match(compiler, TK_STAREQ))   return true;
  if (match(compiler, TK_DIVEQ))    return true;
  if (match(compiler, TK_MODEQ))    return true;
  if (match(compiler, TK_ANDEQ))    return true;
  if (match(compiler, TK_OREQ))     return true;
  if (match(compiler, TK_XOREQ))    return true;
  if (match(compiler, TK_SRIGHTEQ)) return true;
  if (match(compiler, TK_SLEFTEQ))  return true;

  return false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1a
popq %rsi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x24
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x25
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x27
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
jne 0xd7fb
pushq $0x2b
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
je 0xd7ff
movb $0x1, %al
popq %rbx
retq
pushq $0x2c
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0xc438
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: emitPushVariable
static void emitPushVariable(Compiler* compiler, int index, bool global) {
  if (global) {
    emitOpcode(compiler, OP_PUSH_GLOBAL);
    emitByte(compiler, index);

  } else {
    if (index < 9) { //< 0..8 locals have single opcode.
      emitOpcode(compiler, (Opcode)(OP_PUSH_LOCAL_0 + index));
    } else {
      emitOpcode(compiler, OP_PUSH_LOCAL_N);
      emitByte(compiler, index);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %edx, %edx
je 0xd81c
pushq $0x20
jmp 0xd837
cmpl $0x8, %ebx
jg 0xd835
addl $0xc, %ebx
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc734
pushq $0x15
popq %rsi
movq %r14, %rdi
callq 0xc734
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc773
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: eatChar
static char eatChar(Compiler* compiler) {
  char c = peekChar(compiler);
  compiler->current_char++;
  if (c == '\n') compiler->current_line++;
  return c;
}

// Assembly:
movq 0x20(%rdi), %rcx
movb (%rcx), %al
incq %rcx
movq %rcx, 0x20(%rdi)
cmpb $0xa, %al
jne 0xd8b7
incl 0x28(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: setNextToken
static void setNextToken(Compiler* compiler, TokenType type) {
  Token* next = &compiler->next;
  next->type = type;
  next->start = compiler->token_start;
  next->length = (int)(compiler->current_char - compiler->token_start);
  next->line = compiler->current_line - ((type == TK_LINE) ? 1 : 0);
}

// Assembly:
movl %esi, 0x70(%rdi)
movq 0x18(%rdi), %rax
movq %rax, 0x78(%rdi)
movl 0x20(%rdi), %ecx
subl %eax, %ecx
movl %ecx, 0x80(%rdi)
movl 0x28(%rdi), %eax
xorl %ecx, %ecx
cmpl $0x2, %esi
sete %cl
subl %ecx, %eax
movl %eax, 0x84(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: reportError
static void reportError(Compiler* compiler, const char* file, int line,
                        const char* fmt, va_list args) {

  // On REPL mode only the first error is reported.
  if (compiler->options && compiler->options->repl_mode &&
      compiler->has_errors) {
    return;
  }

  compiler->has_errors = true;

  // If the source is incomplete we're not printing an error message,
  // instead return PK_RESULT_UNEXPECTED_EOF to the host.
  if (compiler->need_more_lines) {
    ASSERT(compiler->options && compiler->options->repl_mode, OOPS);
    return;
  }

  PKVM* vm = compiler->vm;
  if (vm->config.error_fn == NULL) return;

  // TODO: fix the buffer size. A non terminated large string could cause this
  // crash.

  char message[ERROR_MESSAGE_SIZE];
  int length = vsnprintf(message, sizeof(message), fmt, args);
  __ASSERT(length >= 0, "Error message buffer failed at vsnprintf().");
  vm->config.error_fn(vm, PK_ERROR_COMPILE, file, line, message);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %edx, %ebx
movq %rsi, %r14
movq 0x98(%rdi), %rax
testq %rax, %rax
je 0xde45
cmpb $0x1, 0x1(%rax)
jne 0xde9a
cmpb $0x0, 0x90(%rdi)
jne 0xde8d
movb $0x1, 0x90(%rdi)
cmpb $0x0, 0x91(%rdi)
je 0xde55
jmp 0xde8d
movb $0x1, 0x90(%rdi)
cmpb $0x1, 0x91(%rdi)
je 0xdeaa
movq (%rdi), %r15
cmpq $0x0, 0xd0(%r15)
je 0xde8d
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rcx, %rdx
movq %r8, %rcx
callq 0x20d0
testl %eax, %eax
js 0xded8
movq %rsp, %r8
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movl %ebx, %ecx
callq *0xd0(%r15)
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
movb $0x1, 0x90(%rdi)
cmpb $0x0, 0x91(%rdi)
je 0xde55
movq 0x15147(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xa235(%rip), %rsi      # 0x180f0
leaq 0xa342(%rip), %rdx      # 0x18204
leaq 0xaab7(%rip), %rcx      # 0x18980
leaq 0xaf93(%rip), %r8       # 0x18e63
movl $0x19e, %r9d            # imm = 0x19E
jmp 0xdf04
movq 0x15119(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xa207(%rip), %rsi      # 0x180f0
leaq 0xb619(%rip), %rdx      # 0x19509
leaq 0xaa89(%rip), %rcx      # 0x18980
leaq 0xaf65(%rip), %r8       # 0x18e63
movl $0x1aa, %r9d            # imm = 0x1AA
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerImportAll
static void compilerImportAll(Compiler* compiler, Script* script) {

  ASSERT(script != NULL, OOPS);
  ASSERT(compiler->scope_depth == DEPTH_GLOBAL, OOPS);

  // Import all types.
  for (uint32_t i = 0; i < script->classes.count; i++) {
    uint32_t name_ind = script->classes.data[i]->name;
    String* name = script->names.data[name_ind];
    compilerImportSingleEntry(compiler, name->data, name->length);
  }

  // Import all functions.
  for (uint32_t i = 0; i < script->functions.count; i++) {
    const char* name = script->functions.data[i]->name;
    uint32_t length = (uint32_t)strlen(name);
    compilerImportSingleEntry(compiler, name, length);
  }

  // Import all globals.
  for (uint32_t i = 0; i < script->globals.count; i++) {
    ASSERT(i < script->global_names.count, OOPS);
    ASSERT(script->global_names.data[i] < script->names.count, OOPS);
    const String* name = script->names.data[script->global_names.data[i]];

    compilerImportSingleEntry(compiler, name->data, name->length);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $-0x1, 0xa0(%rdi)
jne 0xe505
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl 0x58(%rbx), %eax
cmpq %rax, %r15
jae 0xe429
movq 0x50(%rbx), %rax
movq 0x60(%rbx), %rcx
movq (%rax,%r15,8), %rax
movl 0x18(%rax), %eax
movq (%rcx,%rax,8), %rsi
movl 0x14(%rsi), %edx
addq $0x1c, %rsi
movq %r14, %rdi
callq 0xe63f
incq %r15
jmp 0xe3fa
xorl %r12d, %r12d
movl 0x48(%rbx), %eax
cmpq %rax, %r12
jae 0xe45a
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %r15
movq %r15, %rdi
callq 0x2140
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0xe63f
incq %r12
jmp 0xe42c
xorl %r15d, %r15d
movl 0x28(%rbx), %eax
cmpq %rax, %r15
jae 0xe496
movl 0x38(%rbx), %eax
cmpq %rax, %r15
jae 0xe4a2
movq 0x30(%rbx), %rax
movl (%rax,%r15,4), %eax
cmpl 0x68(%rbx), %eax
jae 0xe4d0
movq 0x60(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movl 0x14(%rsi), %edx
addq $0x1c, %rsi
movq %r14, %rdi
callq 0xe63f
incq %r15
jmp 0xe45d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x14b4f(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9c3d(%rip), %rsi      # 0x180f0
leaq 0x9d4a(%rip), %rdx      # 0x18204
leaq 0xb32e(%rip), %rcx      # 0x197ef
leaq 0xa99b(%rip), %r8       # 0x18e63
movl $0x943, %r9d            # imm = 0x943
jmp 0xe4fc
movq 0x14b21(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9c0f(%rip), %rsi      # 0x180f0
leaq 0x9d1c(%rip), %rdx      # 0x18204
leaq 0xb300(%rip), %rcx      # 0x197ef
leaq 0xa96d(%rip), %r8       # 0x18e63
movl $0x944, %r9d            # imm = 0x944
xorl %eax, %eax
callq 0x2250
ud2
movq 0x14aec(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9bda(%rip), %rsi      # 0x180f0
leaq 0x9ce7(%rip), %rdx      # 0x18204
leaq 0xb2cb(%rip), %rcx      # 0x197ef
leaq 0xa938(%rip), %r8       # 0x18e63
movl $0x931, %r9d            # imm = 0x931
jmp 0xe4fc
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerImportName
static int compilerImportName(Compiler* compiler, int line,
                              const char* name, uint32_t length) {
  ASSERT(compiler->scope_depth == DEPTH_GLOBAL, OOPS);

  NameSearchResult result = compilerSearchName(compiler, name, length);
  switch (result.type) {
    case NAME_NOT_DEFINED:
      return compilerAddVariable(compiler, name, length, line);

    case NAME_LOCAL_VAR:
      UNREACHABLE();

    case NAME_GLOBAL_VAR:
      return result.index;

    case NAME_FUNCTION:
    case NAME_CLASS:
    case NAME_BUILTIN:
      parseError(compiler, "Name '%.*s' already exists.", length, name);
      return -1;
  }

  UNREACHABLE();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $-0x1, 0xa0(%rdi)
jne 0xe5b5
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, %rsi
movl %ecx, %edx
callq 0xcb5c
cmpl $0x5, %eax
ja 0xe611
movl %eax, %ecx
leaq 0xa807(%rip), %rdx      # 0x18d70
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0xa97c(%rip), %rsi      # 0x18ef5
movq %r15, %rdi
movl %ebx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0xc455
pushq $-0x1
popq %rax
jmp 0xe591
shrq $0x20, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xcc88
movq 0x14a3c(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9b2a(%rip), %rsi      # 0x180f0
leaq 0x9c37(%rip), %rdx      # 0x18204
leaq 0xb22d(%rip), %rcx      # 0x19801
leaq 0xa888(%rip), %r8       # 0x18e63
movl $0x8fc, %r9d            # imm = 0x8FC
xorl %eax, %eax
callq 0x2250
ud2
movq 0x14a07(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9b7f(%rip), %rsi      # 0x1817a
leaq 0xb1ff(%rip), %rdx      # 0x19801
leaq 0xa85a(%rip), %rcx      # 0x18e63
movl $0x904, %r8d            # imm = 0x904
jmp 0xe636
movq 0x149e0(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9b58(%rip), %rsi      # 0x1817a
leaq 0xb1d8(%rip), %rdx      # 0x19801
leaq 0xa833(%rip), %rcx      # 0x18e63
movl $0x910, %r8d            # imm = 0x910
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerImportSingleEntry
static void compilerImportSingleEntry(Compiler* compiler,
                                      const char* name, uint32_t length) {

  // Special names are begins with '$' like function body (only for now).
  // Skip them.
  if (name[0] == '$') return;

  // Line number of the variables which will be bind to the imported symbol.
  int line = compiler->previous.line;

  // Add the name to the **current** script's name buffer.
  int name_index = (int)scriptAddName(compiler->script, compiler->vm,
                                      name, length);

  // Get the function from the script.
  emitOpcode(compiler, OP_GET_ATTRIB_KEEP);
  emitShort(compiler, name_index);

  int index = compilerImportName(compiler, line, name, length);
  if (index != -1) emitStoreVariable(compiler, index, true);
  emitOpcode(compiler, OP_POP);
}

// Assembly:
cmpb $0x24, (%rsi)
jne 0xe645
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x44(%rdi), %r15d
movq 0x18b0(%rdi), %rdi
movq (%rbx), %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x38d9
movl %eax, %r12d
pushq $0x31
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc748
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0xe533
cmpl $-0x1, %eax
je 0xe6a8
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0xd71a
pushq $0x25
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc734
nop
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: newModuleInternal
static Script* newModuleInternal(PKVM* vm, const char* name) {

  // Create a new Script for the module.
  String* _name = newString(vm, name);
  vmPushTempRef(vm, &_name->_super);

  // Check if any module with the same name already exists and assert to the
  // hosting application.
  if (!IS_UNDEF(mapGet(vm->core_libs, VAR_OBJ(_name)))) {
    vmPopTempRef(vm); // _name
    __ASSERT(false, stringFormat(vm,
             "A module named '$' already exists", name)->data);
  }

  Script* scr = newScript(vm, _name, true);
  vmPopTempRef(vm); // _name

  // Add the script to core_libs.
  vmPushTempRef(vm, &scr->_super);
  mapSet(vm, vm->core_libs, VAR_OBJ(_name), VAR_OBJ(scr));
  vmPopTempRef(vm);

  return scr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0xe6fc
movq %r14, %rdi
callq 0x2140
movq %rax, %rdx
jmp 0xe6fe
xorl %edx, %edx
movabsq $-0x4000000000000, %r15 # imm = 0xFFFC000000000000
movq %rbx, %rdi
movq %r14, %rsi
callq 0x261f
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5cb0
movq 0x130(%rbx), %rdi
movq %r13, %r12
orq %r15, %r12
movq %r12, %rsi
callq 0x42f9
movabsq $0x7ffd000000000000, %rcx # imm = 0x7FFD000000000000
cmpq %rcx, %rax
jne 0xe796
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3566
movq %rax, %r14
movq %rbx, %rdi
callq 0x5dac
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5cb0
movq 0x130(%rbx), %rsi
orq %r14, %r15
movq %rbx, %rdi
movq %r12, %rdx
movq %r15, %rcx
callq 0x447b
movq %rbx, %rdi
callq 0x5dac
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x5dac
movq 0x14853(%rip), %rax     # 0x22ff8
movq (%rax), %r15
leaq 0xb896(%rip), %rsi      # 0x1a045
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3a8d
leaq 0x1c(%rax), %rdx
leaq 0x9929(%rip), %rsi      # 0x180f0
leaq 0xb899(%rip), %rcx      # 0x1a067
leaq 0xb151(%rip), %r8       # 0x19926
movq %r15, %rdi
movl $0x2f5, %r9d            # imm = 0x2F5
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkModuleAddGlobal
PK_PUBLIC void pkModuleAddGlobal(PKVM* vm, PkHandle* module,
                                 const char* name, PkHandle* value) {
  __ASSERT(module != NULL, "Argument module was NULL.");
  __ASSERT(value != NULL, "Argument value was NULL.");
  Var scr = module->value;
  __ASSERT(IS_OBJ_TYPE(scr, OBJ_SCRIPT), "Given handle is not a module");

  moduleAddGlobalInternal(vm, (Script*)AS_OBJ(scr), name, value->value);
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0xe84c
testq %rcx, %rcx
je 0xe876
movq (%rsi), %rsi
movq %rsi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xe822
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rsi
cmpl $0x4, (%rsi)
jne 0xe822
movq (%rcx), %rcx
popq %rax
jmp 0xe8a9
movq 0x147cf(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x98bd(%rip), %rsi      # 0x180f0
leaq 0xa63b(%rip), %rdx      # 0x18e75
leaq 0xb0d3(%rip), %rcx      # 0x19914
leaq 0xb0de(%rip), %r8       # 0x19926
pushq $0x40
jmp 0xe89e
movq 0x147a5(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9893(%rip), %rsi      # 0x180f0
leaq 0xa5d5(%rip), %rdx      # 0x18e39
leaq 0xb0a9(%rip), %rcx      # 0x19914
leaq 0xb0b4(%rip), %r8       # 0x19926
pushq $0x3d
jmp 0xe89e
movq 0x1477b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9869(%rip), %rsi      # 0x180f0
leaq 0xb0a6(%rip), %rdx      # 0x19934
leaq 0xb07f(%rip), %rcx      # 0x19914
leaq 0xb08a(%rip), %r8       # 0x19926
pushq $0x3e
popq %r9
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkModuleAddFunction
void pkModuleAddFunction(PKVM* vm, PkHandle* module, const char* name,
                         pkNativeFn fptr, int arity) {
  __ASSERT(module != NULL, "Argument module was NULL.");
  Var scr = module->value;
  __ASSERT(IS_OBJ_TYPE(scr, OBJ_SCRIPT), "Given handle is not a module");
  moduleAddFunctionInternal(vm, (Script*)AS_OBJ(scr), name, fptr, arity,
                            NULL /*TODO: Public API for function docstring.*/);
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0xe941
movq (%rsi), %rsi
movq %rsi, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xe917
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %rsi
cmpl $0x4, (%rsi)
jne 0xe917
xorl %r9d, %r9d
popq %rax
jmp 0xe974
movq 0x146da(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x97c8(%rip), %rsi      # 0x180f0
leaq 0xa546(%rip), %rdx      # 0x18e75
leaq 0xb017(%rip), %rcx      # 0x1994d
leaq 0xafe9(%rip), %r8       # 0x19926
pushq $0x4a
jmp 0xe969
movq 0x146b0(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x979e(%rip), %rsi      # 0x180f0
leaq 0xa4e0(%rip), %rdx      # 0x18e39
leaq 0xafed(%rip), %rcx      # 0x1994d
leaq 0xafbf(%rip), %r8       # 0x19926
pushq $0x48
popq %r9
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: moduleAddFunctionInternal
static void moduleAddFunctionInternal(PKVM* vm, Script* script,
                                      const char* name, pkNativeFn fptr,
                                      int arity, const char* docstring) {

  // Ensure the name isn't predefined.
  assertModuleNameDef(vm, script, name);

  Function* fn = newFunction(vm, name, (int)strlen(name),
                             script, true, docstring);
  fn->native = fptr;
  fn->arity = arity;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x140a6
movq %r15, %rdi
callq 0x2140
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r15, %rsi
movl %eax, %edx
movq %r12, %rcx
movq %rbx, %r9
callq 0x37b0
movq %r14, 0x38(%rax)
movl %ebp, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkGetFunction
PkHandle* pkGetFunction(PKVM* vm, PkHandle* module,
                                  const char* name) {
  __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);

  for (uint32_t i = 0; i < script->functions.count; i++) {
    const char* fn_name = script->functions.data[i]->name;
    if (strcmp(name, fn_name) == 0) {
      return vmNewHandle(vm, VAR_OBJ(script->functions.data[i]));
    }
  }

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xea98
movq %rdi, (%rsp)
movq (%rsi), %r12
movq %r12, %rax
shrq $0x32, %rax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jb 0xea6e
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r12
cmpl $0x4, (%r12)
jne 0xea6e
movq %rdx, %r14
movabsq $-0x4000000000001, %r13 # imm = 0xFFFBFFFFFFFFFFFF
movl 0x48(%r12), %ebp
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0xea5d
movq 0x40(%r12), %rax
movq (%rax,%rbx,8), %r15
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x2230
incq %rbx
testl %eax, %eax
jne 0xea1c
incq %r13
orq %r13, %r15
movq (%rsp), %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5aa3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x14583(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9671(%rip), %rsi      # 0x180f0
leaq 0xa3ef(%rip), %rdx      # 0x18e75
leaq 0xaed4(%rip), %rcx      # 0x19961
leaq 0xae92(%rip), %r8       # 0x19926
pushq $0x53
jmp 0xeac0
movq 0x14559(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9647(%rip), %rsi      # 0x180f0
leaq 0xa389(%rip), %rdx      # 0x18e39
leaq 0xaeaa(%rip), %rcx      # 0x19961
leaq 0xae68(%rip), %r8       # 0x19926
pushq $0x51
popq %r9
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkCheckArgcRange
bool pkCheckArgcRange(PKVM* vm, int argc, int min, int max) {
  ASSERT(min <= max, "invalid argc range (min > max).");

  if (argc < min) {
    char buff[STR_INT_BUFF_SIZE]; sprintf(buff, "%d", min);
    VM_SET_ERROR(vm, stringFormat(vm, "Expected at least %s argument(s).",
                                       buff));
    return false;

  } else if (argc > max) {
    char buff[STR_INT_BUFF_SIZE]; sprintf(buff, "%d", max);
    VM_SET_ERROR(vm, stringFormat(vm, "Expected at most %s argument(s).",
                                       buff));
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
cmpl %ecx, %edx
jg 0xebb9
movq %rdi, %rbx
cmpl %edx, %esi
jge 0xeb5f
leaq 0xcee9(%rip), %rsi      # 0x1ba21
leaq 0xc(%rsp), %rdi
xorl %eax, %eax
callq 0x2360
movq 0x5f0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
jne 0xebe7
leaq 0xae4d(%rip), %rsi      # 0x199aa
jmp 0xeb94
movb $0x1, %bpl
cmpl %ecx, %esi
jle 0xebb0
leaq 0xceb4(%rip), %rsi      # 0x1ba21
leaq 0xc(%rsp), %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x2360
movq 0x5f0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
jne 0xec15
leaq 0xae38(%rip), %rsi      # 0x199cc
xorl %ebp, %ebp
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3a8d
movq 0x5f0(%rbx), %rcx
movq %rax, 0x58(%rcx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq 0x14438(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9526(%rip), %rsi      # 0x180f0
leaq 0xada8(%rip), %rdx      # 0x19979
leaq 0xadc1(%rip), %rcx      # 0x19999
leaq 0xad47(%rip), %r8       # 0x19926
movl $0x94, %r9d
jmp 0xec41
movq 0x1440a(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x94f8(%rip), %rsi      # 0x180f0
leaq 0x9605(%rip), %rdx      # 0x18204
leaq 0xad93(%rip), %rcx      # 0x19999
leaq 0xad19(%rip), %r8       # 0x19926
movl $0x99, %r9d
jmp 0xec41
movq 0x143dc(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x94ca(%rip), %rsi      # 0x180f0
leaq 0x95d7(%rip), %rdx      # 0x18204
leaq 0xad65(%rip), %rcx      # 0x19999
leaq 0xaceb(%rip), %r8       # 0x19926
movl $0x9f, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkGetArgBool
bool pkGetArgBool(PKVM* vm, int arg, bool* value) {
  CHECK_GET_ARG_API_ERRORS();

  Var val = ARG(arg);
  *value = toBool(val);
  return true;
}

// Assembly:
pushq %rbx
movq 0x5f0(%rdi), %rax
testq %rax, %rax
je 0xed3a
movq %rdx, %rbx
testl %esi, %esi
je 0xed06
jle 0xed20
movq 0x30(%rax), %rcx
subq 0x38(%rax), %rcx
shrq $0x3, %rcx
cmpl %esi, %ecx
jle 0xed20
testq %rbx, %rbx
je 0xed54
movq 0x38(%rax), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x579f
movb %al, (%rbx)
movb $0x1, %al
popq %rbx
retq
movq 0x142d1(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x93bf(%rip), %rsi      # 0x180f0
leaq 0xacbe(%rip), %rdx      # 0x199f6
jmp 0xed6c
movq 0x142b7(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x93a5(%rip), %rsi      # 0x180f0
leaq 0x990e(%rip), %rdx      # 0x18660
jmp 0xed6c
movq 0x1429d(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x938b(%rip), %rsi      # 0x180f0
leaq 0xacaf(%rip), %rdx      # 0x19a1b
leaq 0xac9b(%rip), %rcx      # 0x19a0e
leaq 0xabac(%rip), %r8       # 0x19926
movl $0xb0, %r9d
xorl %eax, %eax
callq 0x2250
ud2
// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/src/pk_core.c
// Function: pkGetArgNumber
bool pkGetArgNumber(PKVM* vm, int arg, double* value) {
  CHECK_GET_ARG_API_ERRORS();

  Var val = ARG(arg);
  if (IS_NUM(val)) {
    *value = AS_NUM(val);

  } else if (IS_BOOL(val)) {
    *value = AS_BOOL(val) ? 1 : 0;

  } else {
    ERR_INVALID_ARG_TYPE("number");
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x5f0(%rdi), %rax
testq %rax, %rax
je 0xeed6
movq %rdx, %r14
movl %esi, %edx
movq %rdi, %rbx
testl %esi, %esi
je 0xedc7
jle 0xeebc
movq 0x30(%rax), %rcx
subq 0x38(%rax), %rcx
shrq $0x3, %rcx
cmpl %edx, %ecx
jle 0xeebc
testq %r14, %r14
je 0xeef0
movq 0x38(%rax), %rcx
movl %edx, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, %rcx
notq %rcx
movabsq $0x7ffc000000000000, %rsi # imm = 0x7FFC000000000000
testq %rsi, %rcx
jne 0xee1b
movq %rdi, %rcx
shrq %rcx
movabsq $0x3ffe800000000001, %rsi # imm = 0x3FFE800000000001
cmpq %rsi, %rcx
jne 0xee2d
movabsq $0x7ffd000000000002, %rax # imm = 0x7FFD000000000002
incq %rax
cmpq %rax, %rdi
je 0xee77
xorps %xmm0, %xmm0
jmp 0xee20
callq 0x34d3
movsd %xmm0, (%r14)
movb $0x1, %bpl
jmp 0xeeb1
testl %edx, %edx
je 0xee81
leaq 0xcbe9(%rip), %rsi      # 0x1ba21
leaq 0x4(%rsp), %rdi
xorl %eax, %eax
callq 0x2360
movq 0x5f0(%rbx), %rax
cmpq $0x0, 0x58(%rax)
jne 0xef25
leaq 0xabe8(%rip), %rsi      # 0x19a45
leaq 0xabff(%rip), %rdx      # 0x19a63
xorl %ebp, %ebp
leaq 0x4(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3a8d
jmp 0xeea6
movsd 0x9269(%rip), %xmm0     # 0x180e8
jmp 0xee20
cmpq $0x0, 0x58(%rax)
jne 0xef25
leaq 0xabd7(%rip), %rsi      # 0x19a6a
leaq 0xabc9(%rip), %rdx      # 0x19a63
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3a8d
movq 0x5f0(%rbx), %rcx
movq %rax, 0x58(%rcx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x14135(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9223(%rip), %rsi      # 0x180f0
leaq 0xab22(%rip), %rdx      # 0x199f6
jmp 0xef08
movq 0x1411b(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9209(%rip), %rsi      # 0x180f0
leaq 0x9772(%rip), %rdx      # 0x18660
jmp 0xef08
movq 0x14101(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x91ef(%rip), %rsi      # 0x180f0
leaq 0xab13(%rip), %rdx      # 0x19a1b
leaq 0xab27(%rip), %rcx      # 0x19a36
leaq 0xaa10(%rip), %r8       # 0x19926
movl $0xb9, %r9d
xorl %eax, %eax
callq 0x2250
ud2
movq 0x140cc(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x91ba(%rip), %rsi      # 0x180f0
leaq 0x92c7(%rip), %rdx      # 0x18204
leaq 0xaaf2(%rip), %rcx      # 0x19a36
leaq 0xa9db(%rip), %r8       # 0x19926
movl $0xc3, %r9d
jmp 0xef1c