// File: /workspace/github_c_makefile_star2_O2/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 0xe2e9
movq %rdi, %rbx
pushq $0x47
popq %rsi
callq 0xc438
testb %al, %al
je 0xdfc4
cmpl $-0x1, 0xa0(%rbx)
jne 0xe31a
movl 0x40(%rbx), %ecx
movq (%rbx), %rsi
movq 0x38(%rbx), %rdx
movq 0x18b0(%rbx), %rdi
callq 0x38d9
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 0x42f9
movq %rax, %r14
movabsq $0x7ffd000000000000, %rax # imm = 0x7FFD000000000000
cmpq %rax, %r14
jne 0xe0a9
addq $0x1c, %r15
leaq 0xb75c(%rip), %rsi      # 0x1970b
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc455
jmp 0xe2b4
pushq $0x49
popq %rsi
movq %rbx, %rdi
callq 0xc438
testb %al, %al
je 0xe090
movabsq $-0x4000000000000, %r12 # imm = 0xFFFC000000000000
movq 0x48(%rbx), %r14
leaq -0x1(%r12), %rax
cmpq %rax, %r14
jbe 0xe34b
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x0, (%r14)
jne 0xe34b
cmpl $-0x1, 0xa0(%rbx)
jne 0xe379
addq $0x1c, %r14
movq (%rbx), %r15
xorps %xmm0, %xmm0
andq $0x0, 0x50(%rsp)
movups %xmm0, 0x40(%rsp)
movq %r14, 0x38(%rsp)
movq 0x108(%r15), %rax
testq %rax, %rax
je 0xe106
movq 0x18b0(%rbx), %rcx
movq 0x18(%rcx), %rdx
addq $0x1c, %rdx
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq *%rax
movq (%r13), %r13
testq %r13, %r13
jne 0xe109
movq 0x18b0(%rbx), %rax
movq 0x18(%rax), %rcx
addq $0x1c, %rcx
leaq 0xb6b0(%rip), %rsi      # 0x19733
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc455
leaq 0xb63c(%rip), %rsi      # 0x196d3
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc455
jmp 0xe2b4
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc748
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x4, (%r14)
je 0xe2b4
movq 0x14f1c(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0xa00a(%rip), %rsi      # 0x180f0
leaq 0xa117(%rip), %rdx      # 0x18204
leaq 0xb609(%rip), %rcx      # 0x196fd
leaq 0xad68(%rip), %r8       # 0x18e63
movl $0x8db, %r9d            # imm = 0x8DB
jmp 0xe3d3
movq %r14, %r13
movq 0x18b0(%rbx), %r14
movq (%rbx), %rbp
movq %r13, %rdi
callq 0x2140
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movl %eax, %ecx
callq 0x38d9
movq 0x18b0(%rbx), %rcx
movq 0x60(%rcx), %rdx
movl %eax, 0x2c(%rsp)
movslq %eax, %rcx
movq (%rdx,%rcx,8), %rbp
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0xe163
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq *%rax
movq 0x128(%r15), %rdi
movq %rbp, %r13
orq %r12, %r13
movq %r13, %rsi
callq 0x42f9
movq %rax, %r14
movabsq $0x7ffd000000000000, %rax # imm = 0x7FFD000000000000
cmpq %rax, %r14
jne 0xe286
movq 0x110(%r15), %rax
testq %rax, %rax
je 0xe2c6
leaq 0x1c(%rbp), %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rdx, 0x30(%rsp)
callq *%rax
cmpq $0x0, (%r14)
je 0xe2d2
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x3566
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x5cb0
movq 0x128(%r15), %rsi
orq %r14, %r12
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x447b
movq %r15, %rdi
callq 0x5dac
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
callq 0xc748
callq 0x58e0
movw %ax, 0x2a(%rsp)
movq 0x98(%rbx), %rax
testq %rax, %rax
je 0xe22e
movzwl (%rax), %eax
movw %ax, 0x2a(%rsp)
leaq 0x2a(%rsp), %rcx
movb $0x0, 0x1(%rcx)
movq 0x58(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xb76d
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
movq 0x30(%rsp), %r12
je 0xe270
movups 0x58(%rsp), %xmm0
movups 0x68(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq *%rax
testl %ebp, %ebp
je 0xe2b4
leaq 0xb549(%rip), %rsi      # 0x197c4
movq %rbx, %rdi
movq %r12, %rdx
jmp 0xdfb8
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq %rax, %r14
cmpl $0x4, (%r14)
jne 0xe3a7
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0xc734
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
callq 0xc748
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb489(%rip), %rsi      # 0x19756
jmp 0xe097
leaq 0xb4ce(%rip), %rsi      # 0x197a7
xorl %r14d, %r14d
movq %rbx, %rdi
movq 0x30(%rsp), %rdx
jmp 0xdfb8
movq 0x14d08(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9df6(%rip), %rsi      # 0x180f0
leaq 0x9f03(%rip), %rdx      # 0x18204
leaq 0xb3bc(%rip), %rcx      # 0x196c4
leaq 0xab54(%rip), %r8       # 0x18e63
movl $0x8e2, %r9d            # imm = 0x8E2
jmp 0xe3d3
movq 0x14cd7(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9dc5(%rip), %rsi      # 0x180f0
leaq 0x9ed2(%rip), %rdx      # 0x18204
leaq 0xb3c4(%rip), %rcx      # 0x196fd
leaq 0xab23(%rip), %r8       # 0x18e63
movl $0x8c9, %r9d            # imm = 0x8C9
jmp 0xe3d3
movq 0x14ca6(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9d94(%rip), %rsi      # 0x180f0
leaq 0x9ea1(%rip), %rdx      # 0x18204
leaq 0xb35a(%rip), %rcx      # 0x196c4
leaq 0xaaf2(%rip), %r8       # 0x18e63
movl $0x8ec, %r9d            # imm = 0x8EC
jmp 0xe3d3
movq 0x14c78(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9d66(%rip), %rsi      # 0x180f0
leaq 0x9e73(%rip), %rdx      # 0x18204
leaq 0xb390(%rip), %rcx      # 0x19728
leaq 0xaac4(%rip), %r8       # 0x18e63
movl $0x87a, %r9d            # imm = 0x87A
jmp 0xe3d3
movq 0x14c4a(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x9d38(%rip), %rsi      # 0x180f0
leaq 0x9e45(%rip), %rdx      # 0x18204
leaq 0xb362(%rip), %rcx      # 0x19728
leaq 0xaa96(%rip), %r8       # 0x18e63
movl $0x893, %r9d            # imm = 0x893
xorl %eax, %eax
callq 0x2250
ud2