// File: /workspace/github_c_makefile_star2_O0/mrkite[P]regs/docmaker/compiler.cc
// Function: Compiler::run(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Symbol, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, Symbol>>>&)
bool Compiler::run(std::map<std::string, Symbol> &symbols) {
  numErrors = 0;

  for (auto it = symbols.begin(); it != symbols.end(); it++) {
    if (!it->second.isKnown) {
      if (!refErr(&it->second, "Unknown type: '%s'\n",
                  it->second.name.c_str())) {
        return false;
      }
    } else if (!it->second.isSized) {
      calculateSizes(&it->second);
    }
  }
  AVL avl;

  // verify functions only passed 32-bits or smaller
  // also verify functions have unique signatures
  for (auto it = symbols.begin(); it != symbols.end(); it++) {
    if (it->second.kind == isFunction) {
      Function *f = it->second.asFunction;
      for (auto arg = f->arguments.begin(); arg != f->arguments.end(); arg++) {
        if (arg->ref.pointer == 0 &&
            (arg->ref.symbol->size > 4 || arg->ref.array == 0)) {
          if (!defErr(&it->second, "Argument too large: '%s'\n",
                      arg->key.c_str())) {
            return false;
          }
        }
      }
      if (f->retType.symbol != nullptr && f->retType.pointer == 0 &&
          (f->retType.symbol->size > 4 || f->retType.array >= 0)) {
        if (!defErr(&it->second, "Return value too large on '%s'\n",
                    it->second.name.c_str())) {
          return false;
        }
      }
      if (f->signature.size() > 0) {
        if (!avl.insert(f->signature)) {
          if (!defErr(&it->second, "Duplicate signature on '%s'\n",
                      it->second.name.c_str())) {
            return false;
          }
        }
      }
    }
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, (%rax)
movq -0x18(%rbp), %rdi
callq 0xc000
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7f80
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xc030
testb $0x1, %al
jne 0xb324
jmp 0xb3cd
leaq -0x20(%rbp), %rdi
callq 0xc060
testb $0x1, 0x48(%rax)
jne 0xb38a
leaq -0x20(%rbp), %rdi
callq 0xc060
addq $0x20, %rax
movq %rax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xc060
movq %rax, %rdi
addq $0x20, %rdi
callq 0x3100
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rcx
leaq 0x5e44(%rip), %rdx      # 0x111b8
movb $0x0, %al
callq 0xb6e0
testb $0x1, %al
jne 0xb388
movb $0x0, -0x1(%rbp)
jmp 0xb6c2
jmp 0xb3b7
leaq -0x20(%rbp), %rdi
callq 0xc060
testb $0x1, 0x41(%rax)
jne 0xb3b5
leaq -0x20(%rbp), %rdi
callq 0xc060
movq -0x90(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0xb7e0
jmp 0xb3b7
jmp 0xb3b9
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0xc090
movq %rax, -0x30(%rbp)
jmp 0xb301
leaq -0x40(%rbp), %rdi
callq 0xc0d0
movq -0x18(%rbp), %rdi
callq 0xc000
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7f80
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xc030
testb $0x1, %al
jne 0xb406
jmp 0xb6ae
leaq -0x48(%rbp), %rdi
callq 0xc060
cmpl $0x6, 0x98(%rax)
jne 0xb695
leaq -0x48(%rbp), %rdi
callq 0xc060
movq 0xa0(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x98b0
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x9680
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xc0f0
testb $0x1, %al
jne 0xb460
jmp 0xb533
leaq -0x60(%rbp), %rdi
callq 0xc130
cmpl $0x0, 0x28(%rax)
jne 0xb51d
leaq -0x60(%rbp), %rdi
callq 0xc130
movq 0x20(%rax), %rax
cmpl $0x4, 0x24(%rax)
jg 0xb499
leaq -0x60(%rbp), %rdi
callq 0xc130
cmpl $0x0, 0x2c(%rax)
jne 0xb51d
leaq -0x48(%rbp), %rdi
callq 0xc060
addq $0x20, %rax
movq %rax, -0xa8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xc130
movq %rax, %rdi
callq 0x3100
movq -0x90(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rcx
leaq 0x5cf6(%rip), %rdx      # 0x111cc
xorl %eax, %eax
callq 0xba90
movb %al, -0x99(%rbp)
jmp 0xb4e5
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0xb51b
jmp 0xb4f1
movb $0x0, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xb6b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xc190
jmp 0xb6d0
jmp 0xb51d
jmp 0xb51f
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0xc150
movq %rax, -0x80(%rbp)
jmp 0xb43d
movq -0x58(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb5e0
movq -0x58(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0xb5e0
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x4, 0x24(%rax)
jg 0xb568
movq -0x58(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jl 0xb5e0
leaq -0x48(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xc060
movq -0xc0(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0xb8(%rbp)
callq 0xc060
movq %rax, %rdi
addq $0x20, %rdi
callq 0x3100
movq -0x90(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq %rax, %rcx
leaq 0x5c33(%rip), %rdx      # 0x111e6
xorl %eax, %eax
callq 0xba90
movb %al, -0xa9(%rbp)
jmp 0xb5c2
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0xb5de
jmp 0xb5ce
movb $0x0, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xb6b9
jmp 0xb5e0
movq -0x58(%rbp), %rdi
addq $0x48, %rdi
callq 0xa4f0
cmpq $0x0, %rax
jbe 0xb693
movq -0x58(%rbp), %rsi
addq $0x48, %rsi
leaq -0x40(%rbp), %rdi
callq 0xda30
movb %al, -0xc1(%rbp)
jmp 0xb610
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0xb691
jmp 0xb61c
leaq -0x48(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0xc060
movq -0xd8(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0xd0(%rbp)
callq 0xc060
movq %rax, %rdi
addq $0x20, %rdi
callq 0x3100
movq -0x90(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq %rax, %rcx
leaq 0x5b9f(%rip), %rdx      # 0x11206
xorl %eax, %eax
callq 0xba90
movb %al, -0xc2(%rbp)
jmp 0xb676
movb -0xc2(%rbp), %al
testb $0x1, %al
jne 0xb68f
jmp 0xb682
movb $0x0, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xb6b9
jmp 0xb691
jmp 0xb693
jmp 0xb695
jmp 0xb697
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0xc090
movq %rax, -0x88(%rbp)
jmp 0xb3e3
movb $0x1, -0x1(%rbp)
movl $0x1, -0x78(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xc190
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x3490
nopl (%rax)