// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x19f10
movq 0x1911b(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x10269(%rip), %rsi     # 0x2a150
leaq 0x10376(%rip), %rdx     # 0x2a264
leaq 0x11a77(%rip), %rcx     # 0x2b96c
leaq 0x110db(%rip), %r8      # 0x2afd7
movl $0x930, %r9d            # imm = 0x930
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x19f12
jmp 0x19f14
movq 0x40(%rsp), %rax
cmpl $-0x1, 0xa0(%rax)
je 0x19f5c
movq 0x190cf(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1021d(%rip), %rsi     # 0x2a150
leaq 0x1032a(%rip), %rdx     # 0x2a264
leaq 0x11a2b(%rip), %rcx     # 0x2b96c
leaq 0x1108f(%rip), %r8      # 0x2afd7
movl $0x931, %r9d            # imm = 0x931
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x19f5e
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x58(%rcx), %eax
jae 0x19fca
movq 0x38(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %eax
movl %eax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq 0x60(%rax), %rax
movl 0x30(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x1c, %rsi
movq 0x28(%rsp), %rax
movl 0x14(%rax), %edx
callq 0x1a980
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x19f66
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x48(%rcx), %eax
jae 0x1a028
movq 0x38(%rsp), %rax
movq 0x40(%rax), %rax
movl 0x24(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2130
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x1a980
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x19fd2
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jae 0x1a133
jmp 0x1a044
movl 0x10(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jb 0x1a08c
movq 0x18f9f(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x100ed(%rip), %rsi     # 0x2a150
leaq 0x101fa(%rip), %rdx     # 0x2a264
leaq 0x118fb(%rip), %rcx     # 0x2b96c
leaq 0x10f5f(%rip), %r8      # 0x2afd7
movl $0x943, %r9d            # imm = 0x943
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1a08e
jmp 0x1a090
movq 0x38(%rsp), %rax
movq 0x30(%rax), %rax
movl 0x10(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x38(%rsp), %rcx
cmpl 0x68(%rcx), %eax
jb 0x1a0e4
movq 0x18f47(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x10095(%rip), %rsi     # 0x2a150
leaq 0x101a2(%rip), %rdx     # 0x2a264
leaq 0x118a3(%rip), %rcx     # 0x2b96c
leaq 0x10f07(%rip), %r8      # 0x2afd7
movl $0x944, %r9d            # imm = 0x944
movb $0x0, %al
callq 0x2240
ud2
callq 0x2040
jmp 0x1a0e6
movq 0x38(%rsp), %rax
movq 0x60(%rax), %rax
movq 0x38(%rsp), %rcx
movq 0x30(%rcx), %rcx
movl 0x10(%rsp), %edx
movl (%rcx,%rdx,4), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x1c, %rsi
movq 0x8(%rsp), %rax
movl 0x14(%rax), %edx
callq 0x1a980
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1a030
addq $0x48, %rsp
retq
nopl (%rax,%rax)