// File: /workspace/github_c_makefile_star2_O1/atomlang[P]atomlang/src/pk_compiler.c
// Function: compilerImport
static inline Script* compilerImport(Compiler* compiler) {
  ASSERT(compiler->scope_depth == DEPTH_GLOBAL, OOPS);

  // Get the script (from core libs or vm's cache or compile new one).
  // And push it on the stack.
  if (match(compiler, TK_NAME)) { //< Core library.
    return importCoreLib(compiler, compiler->previous.start,
                         compiler->previous.length);

  } else if (match(compiler, TK_STRING)) { //< Local library.
    Var var_path = compiler->previous.value;
    ASSERT(IS_OBJ_TYPE(var_path, OBJ_STRING), OOPS);
    String* path = (String*)AS_OBJ(var_path);
    return importFile(compiler, path->data);
  }

  // Invalid token after import/from keyword.
  parseError(compiler, "Expected a module name or path to import.");
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
cmpl $-0x1, 0xa0(%rdi)
jne 0x12f60
movq %rdi, %rbx
cmpl $0x47, 0x50(%rdi)
jne 0x12bf9
movq %rbx, %rdi
callq 0x10b76
cmpl $-0x1, 0xa0(%rbx)
jne 0x12f65
movl 0x40(%rbx), %ecx
movq (%rbx), %rsi
movq 0x38(%rbx), %rdx
movq 0x18b0(%rbx), %rdi
callq 0x93bb
movl %eax, %ebp
movq 0x18b0(%rbx), %rax
movq 0x60(%rax), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r15
movq (%rbx), %rax
movq 0x130(%rax), %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
orq %r15, %rsi
callq 0x9f27
movq %rax, %r14
movabsq $0x7ffd000000000000, %rax # imm = 0x7FFD000000000000
cmpq %rax, %r14
jne 0x12e88
addq $0x1c, %r15
leaq 0xbb0b(%rip), %rsi      # 0x1e6ef
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x110cb
jmp 0x12f2b
cmpl $0x49, 0x50(%rbx)
jne 0x12e6f
movabsq $-0x4000000000000, %r15 # imm = 0xFFFC000000000000
movq %rbx, %rdi
callq 0x10b76
movq 0x48(%rbx), %r14
leaq -0x1(%r15), %rax
cmpq %rax, %r14
jbe 0x12f6a
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x0, (%r14)
jne 0x12f6a
cmpl $-0x1, 0xa0(%rbx)
jne 0x12f6f
addq $0x1c, %r14
movq (%rbx), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %r14, 0x30(%rsp)
movq 0x108(%r15), %rax
testq %rax, %rax
je 0x12c8b
movq 0x18b0(%rbx), %rcx
movq 0x18(%rcx), %rdx
addq $0x1c, %rdx
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rcx
callq *%rax
cmpq $0x0, 0x30(%rsp)
jne 0x12cb6
movq 0x18b0(%rbx), %rax
movq 0x18(%rax), %rcx
addq $0x1c, %rcx
leaq 0xba6e(%rip), %rsi      # 0x1e717
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x110cb
movq 0x18b0(%rbx), %r14
movq (%rbx), %r12
movq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x2140
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %eax, %ecx
callq 0x93bb
movl %eax, %ebp
movq 0x18b0(%rbx), %rax
movq 0x60(%rax), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x12d13
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq *%rax
movq 0x128(%r15), %rdi
movq %r12, %r13
movabsq $-0x4000000000000, %rax # imm = 0xFFFC000000000000
orq %rax, %r13
movq %r13, %rsi
callq 0x9f27
movq %rax, %r14
movabsq $0x7ffd000000000000, %rax # imm = 0x7FFD000000000000
cmpq %rax, %r14
jne 0x12eda
movq 0x110(%r15), %rax
testq %rax, %rax
je 0x12f3d
leaq 0x1c(%r12), %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rdx, 0x28(%rsp)
callq *%rax
cmpq $0x0, (%r14)
je 0x12f49
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x90b5
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0xb8d6
movq 0x128(%r15), %rsi
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
orq %r14, %rcx
movq %r15, %rdi
movq %r13, %rdx
callq 0xa060
movq %r15, %rdi
callq 0xb949
movq %rbx, %rdi
movl $0x26, %esi
callq 0x1135b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x113b1
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %r12d
andl %r12d, %esi
movq %rbx, %rdi
callq 0x1135b
andl %r12d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1135b
callq 0xb524
movw %ax, 0x26(%rsp)
movq 0x98(%rbx), %rax
testq %rax, %rax
je 0x12e13
movzwl (%rax), %eax
movw %ax, 0x26(%rsp)
leaq 0x26(%rsp), %rcx
movb $0x0, 0x1(%rcx)
movq 0x58(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x10283
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
movq 0x28(%rsp), %r12
je 0x12e55
movups 0x58(%rsp), %xmm0
movups 0x68(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq *%rax
testl %ebp, %ebp
je 0x12f2b
leaq 0xb944(%rip), %rsi      # 0x1e7a8
movq %rbx, %rdi
movq %r12, %rdx
jmp 0x12bed
leaq 0xb841(%rip), %rsi      # 0x1e6b7
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x110cb
jmp 0x12f2b
movq %rbx, %rdi
movl $0x26, %esi
callq 0x1135b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x113b1
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %r15d
andl %r15d, %esi
movq %rbx, %rdi
callq 0x1135b
andl %r15d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1135b
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x4, (%r14)
je 0x12f2b
callq 0x500c
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x4, (%r14)
jne 0x12f74
movq %rbx, %rdi
movl $0x26, %esi
callq 0x1135b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x113b1
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %r15d
andl %r15d, %esi
movq %rbx, %rdi
callq 0x1135b
andl %r15d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1135b
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb7f6(%rip), %rsi      # 0x1e73a
jmp 0x12e76
leaq 0xb83b(%rip), %rsi      # 0x1e78b
xorl %r14d, %r14d
movq %rbx, %rdi
movq 0x28(%rsp), %rdx
jmp 0x12bed
callq 0x4efe
callq 0x4fd6
callq 0x4f34
callq 0x4f6a
callq 0x4fa0