LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/ArashPartow[P]exprtk/exprtk_simple_example_20.cpp
// Function: vector_access_rtc::handle_runtime_violation(exprtk::vector_access_runtime_check::violation_context&)
bool handle_runtime_violation(violation_context& context)
   {
      const map_t::iterator itr     = vector_map.find(static_cast<void*>(context.base_ptr));
      const std::string vector_name = (itr != vector_map.end()) ?
                                      itr->second : "Unknown"   ;

      printf("Runtime vector access violation\n"
             "Vector: %s base: %p end: %p access: %p typesize: %d\n",
             vector_name.c_str(),
             context.base_ptr   ,
             context.end_ptr    ,
             context.access_ptr ,
             static_cast<unsigned int>(context.type_size));

      throw std::runtime_error
         ("Runtime vector access violation. Vector: " + vector_name);

      return false;
   }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
je 0x119619
movq (%rbx), %rcx
addq $0x10, %rdi
movq %rdi, %rax
xorl %esi, %esi
cmpq %rcx, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rax
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x1195f2
cmpq %rdi, %rax
je 0x119619
cmpq 0x20(%rax), %rcx
jae 0x1196a4
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x18c41c(%rip), %rsi    # 0x2a5a45
leaq 0x18c41c(%rip), %rdx    # 0x2a5a4c
movq %rsp, %rdi
callq 0x1177c0
movq %rsp, %r14
movq (%r14), %rsi
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
movl 0x18(%rbx), %r9d
leaq 0x18c3f9(%rip), %rdi    # 0x2a5a4d
xorl %eax, %eax
callq 0x114050
movl $0x10, %edi
callq 0x1141d0
movq %rax, %rbx
leaq 0x18c433(%rip), %rsi    # 0x2a5aa2
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x119718
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x114140
xorl %ebp, %ebp
movq 0x2e7953(%rip), %rsi    # 0x400fe8
movq 0x2e7944(%rip), %rdx    # 0x400fe0
movq %rbx, %rdi
callq 0x1142d0
leaq 0x10(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x1197a0
jmp 0x119638
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1196e3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x114090
testb %bpl, %bpl
jne 0x1196ed
jmp 0x1196f5
movq %rax, %r14
movq %rbx, %rdi
callq 0x114440
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x119710
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x114090
movq %r14, %rdi
callq 0x1142f0
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: operator==(Action const&, Action const&)
bool operator==(const Action& lhs, const Action& rhs) {
  return lhs.type == rhs.type &&
    lhs.system == rhs.system &&
    lhs.ship == rhs.ship &&
    lhs.system_target == rhs.system_target &&
    lhs.target == rhs.target;
}

// Assembly:
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0x26ba
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
jne 0x26ba
movq 0xc(%rdi), %xmm0
movq 0xc(%rsi), %xmm1
pcmpeqd %xmm0, %xmm1
pshufd $0x50, %xmm1, %xmm0     # xmm0 = xmm1[0,0,1,1]
movmskpd %xmm0, %eax
cmpl $0x3, %eax
jne 0x26ba
movl 0x14(%rdi), %eax
cmpl 0x14(%rsi), %eax
jne 0x26ba
movq 0x18(%rdi), %xmm0
movq 0x18(%rsi), %xmm1
pcmpeqd %xmm0, %xmm1
pshufd $0x50, %xmm1, %xmm0     # xmm0 = xmm1[0,0,1,1]
movmskpd %xmm0, %eax
cmpl $0x3, %eax
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: operator<(Action const&, Action const&)
bool operator<(const Action& lhs, const Action& rhs) {
  if (lhs.type < rhs.type) return true;
  if (lhs.type > rhs.type) return false;
  if (lhs.system < rhs.system) return true;
  if (lhs.system > rhs.system) return false;
  if (lhs.ship < rhs.ship) return true;
  if (!(lhs.ship == rhs.ship)) return false;
  if (lhs.system_target < rhs.system_target) return true;
  if (lhs.system_target > rhs.system_target) return false;
  if (lhs.target < rhs.target) return true;
  return false;
}

// Assembly:
movl 0x4(%rdi), %ecx
movl 0x4(%rsi), %edx
movb $0x1, %al
cmpl %edx, %ecx
jl 0x26cd
jle 0x26ce
xorl %eax, %eax
retq
movl 0x8(%rdi), %ecx
movl 0x8(%rsi), %edx
cmpl %edx, %ecx
jl 0x26cd
jg 0x26cb
movl 0xc(%rdi), %ecx
movl 0xc(%rsi), %edx
cmpl %edx, %ecx
jl 0x26cd
jne 0x26cb
movl 0x10(%rdi), %ecx
movl 0x10(%rsi), %edx
cmpl %edx, %ecx
jl 0x26cd
jne 0x26cb
movl 0x14(%rdi), %ecx
movl 0x14(%rsi), %edx
cmpl %edx, %ecx
jl 0x26cd
jg 0x26cb
movl 0x18(%rdi), %ecx
movl 0x18(%rsi), %edx
cmpl %edx, %ecx
jl 0x26cd
jne 0x26cb
movl 0x1c(%rdi), %eax
cmpl 0x1c(%rsi), %eax
setl %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::Game(int)
Game::Game(int num_players) :
    num_players_(num_players),
    cur_player_(1),
    done_main_action_(false),
    homeworlds_built_(0),
    next_system_(1),
    sacrifice_actions_(0),
    sacrifice_colour_(RED) {
  for (const auto colour : { RED, YELLOW, GREEN, BLUE }) {
    for (const auto size : { SMALL, MEDIUM, LARGE }) {
      Pyramid p { size, colour };
      stash_[p] = 1 + num_players;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movl %esi, (%rdi)
movl $0x1, 0x4(%rdi)
movb $0x0, 0x8(%rdi)
movsd 0x88d7(%rip), %xmm0     # 0xb010
movups %xmm0, 0xc(%rdi)
leaq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
xorl %r12d, %r12d
movq %r12, 0x30(%rdi)
leaq 0x38(%rdi), %r14
leaq 0x40(%rdi), %rax
movl $0x0, 0x40(%rdi)
movq %r12, 0x48(%rdi)
movq %rax, 0x50(%rdi)
movq %rax, 0x58(%rdi)
movq %r12, 0x60(%rdi)
movaps 0x88a6(%rip), %xmm0     # 0xb020
movaps %xmm0, 0x20(%rsp)
incl %ebp
movq %rsp, %r15
movl 0x20(%rsp,%r12), %ebx
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, 0x14(%rsp)
movl $0x3, 0x1c(%rsp)
xorl %r13d, %r13d
movl 0x14(%rsp,%r13), %eax
movl %eax, (%rsp)
movl %ebx, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x427c
movl %ebp, (%rax)
addq $0x4, %r13
cmpq $0xc, %r13
jne 0x27a3
addq $0x4, %r12
cmpq $0x10, %r12
jne 0x2784
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r14, %rdi
callq 0x44c2
movq 0x8(%rsp), %rdi
callq 0x4300
movq %r15, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::winner() const
int Game::winner() const {
  if (homeworlds_built_ < num_players_ || sacrifice_actions_ > 0) {
    return 0;
  }
  int w = -1;
  for (const System& s : systems_) {
    if (s.player != 0 && find_if(s.ships.begin(), s.ships.end(), [&s](const Ship& ship) {
            return ship.player == s.player; 
          }) != s.ships.end()) {
      if (w == -1) {
        w = s.player;
      } else {
        return 0;
      }
    }
  }
  return w;
}

// Assembly:
movl 0xc(%rdi), %eax
cmpl (%rdi), %eax
jl 0x2949
cmpl $0x0, 0x14(%rdi)
jg 0x2949
movq 0x20(%rdi), %rcx
movq 0x28(%rdi), %rdx
cmpq %rdx, %rcx
je 0x294c
pushq %rbx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
movl 0x4(%rcx), %eax
testl %eax, %eax
je 0x2936
movq 0x20(%rcx), %r10
movq 0x28(%rcx), %r8
movq %r8, %rbx
subq %r10, %rbx
movq %rbx, %r11
sarq $0x2, %r11
imulq %rsi, %r11
sarq $0x2, %r11
testq %r11, %r11
jle 0x28df
leaq (%r11,%r11,2), %r9
shlq $0x4, %r9
addq %r10, %r9
incq %r11
addq $0x18, %r10
cmpl %eax, -0x18(%r10)
je 0x291a
cmpl %eax, -0xc(%r10)
je 0x2920
cmpl %eax, (%r10)
je 0x292a
cmpl %eax, 0xc(%r10)
je 0x2926
decq %r11
addq $0x30, %r10
cmpq $0x1, %r11
jg 0x28b3
movq %r8, %rbx
subq %r9, %rbx
jmp 0x28e2
movq %r10, %r9
sarq $0x2, %rbx
imulq %rsi, %rbx
cmpq $0x1, %rbx
je 0x290e
cmpq $0x2, %rbx
je 0x2905
cmpq $0x3, %rbx
jne 0x2936
cmpl %eax, (%r9)
je 0x2915
addq $0xc, %r9
cmpl %eax, (%r9)
je 0x2915
addq $0xc, %r9
cmpl %eax, (%r9)
cmovneq %r8, %r9
movq %r9, %r10
jmp 0x292a
addq $-0x18, %r10
jmp 0x292a
addq $-0xc, %r10
jmp 0x292a
addq $0xc, %r10
cmpq %r8, %r10
je 0x2936
cmpl $-0x1, %edi
je 0x2938
jmp 0x2952
movl %edi, %eax
addq $0x38, %rcx
movl %eax, %edi
cmpq %rdx, %rcx
jne 0x2874
jmp 0x2954
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::get_system(int) const
const System& Game::get_system(int id) const {
  for (const System& system : systems_) {
    if (system.id == id) {
      return system;
    }
  }
  throw "system not found";
}

// Assembly:
pushq %rax
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rcx
cmpq %rcx, %rax
je 0x2970
cmpl %esi, (%rax)
je 0x296e
addq $0x38, %rax
jmp 0x295f
popq %rcx
retq
movl $0x8, %edi
callq 0x20d0
leaq 0x8717(%rip), %rcx      # 0xb098
movq %rcx, (%rax)
movq 0xd62d(%rip), %rsi      # 0xffb8
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::smallest_of_colour(Colour) const
Pyramid Game::smallest_of_colour(Colour colour) const {
  for (const auto& it : stash_) {
    if (it.first.colour == colour && it.second > 0) {
      return it.first;
    }
  }
  return Pyramid{ZERO, colour};
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x50(%rdi), %rax
addq $0x40, %r14
xorl %r15d, %r15d
cmpq %r14, %rax
je 0x29cd
movl 0x24(%rax), %ecx
cmpl %ebx, %ecx
jne 0x29bd
cmpl $0x0, 0x28(%rax)
jg 0x29c7
movq %rax, %rdi
callq 0x2200
jmp 0x29ab
movl 0x20(%rax), %r15d
movl %ecx, %ebx
shlq $0x20, %rbx
orq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::hash() const
int Game::hash() const {
  int systems = 0;
  for (const System& system : systems_) {
    systems += ::hash(system);
  }
  return systems ^ (PLAYER_HASH[num_players_] + PLAYER_HASH[cur_player_]) ^
    SIZE_HASH[sacrifice_actions_] ^ COLOUR_HASH[sacrifice_colour_] ^
    (31 * PLAYER_HASH[homeworlds_built_]) ^ (done_main_action_ ? 0xd7067b50 : 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
xorl %ebx, %ebx
movl $0x0, %ebp
cmpq %r12, %r15
je 0x2a12
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2a74
addl %eax, %ebp
addq $0x38, %r15
cmpq %r12, %r15
jne 0x29ff
movslq (%r14), %rax
leaq 0x8670(%rip), %rcx      # 0xb08c
movslq 0x4(%r14), %rdx
movl (%rcx,%rdx,4), %edx
addl (%rcx,%rax,4), %edx
movslq 0x14(%r14), %rax
leaq 0x85ff(%rip), %rsi      # 0xb030
movl 0x18(%r14), %edi
leaq 0x8604(%rip), %r8       # 0xb040
movslq 0xc(%r14), %r9
movl (%rcx,%r9,4), %ecx
movl %ecx, %r9d
shll $0x5, %r9d
subl %ecx, %r9d
cmpb $0x0, 0x8(%r14)
movl $0xd7067b50, %ecx       # imm = 0xD7067B50
cmovnel %ecx, %ebx
xorl %ebp, %edx
xorl (%rsi,%rax,4), %edx
xorl (%r8,%rdi,4), %edx
xorl %r9d, %ebx
xorl %edx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::hash_string[abi:cxx11]() const
std::string Game::hash_string() const {
  std::string h = "";
  // maximum compression! fails for more than 7 players
  // TODO: adapt for more than 7 players, or forbid games from having more than
  // 7 players
  h += (char)(num_players_ << 4 | cur_player_);
  h += (char)(done_main_action_ << 7 | homeworlds_built_ << 4 |
              sacrifice_actions_ << 2 | sacrifice_colour_);
  std::set<std::string> system_hashes;
  for (const System& system : systems_) {
    system_hashes.insert(::hash_string(system));
  }
  for (std::string str : system_hashes) {
    h += str;
  }
  return h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
leaq 0x8698(%rip), %rdx      # 0xb1c9
movq %rdx, %rsi
callq 0x4974
movl (%r14), %eax
shll $0x4, %eax
orl 0x4(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2190
movl 0x8(%r14), %eax
movl 0xc(%r14), %ecx
shll $0x7, %eax
shll $0x4, %ecx
orl %eax, %ecx
movl 0x14(%r14), %eax
shll $0x2, %eax
orl %ecx, %eax
orl 0x18(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2190
leaq 0x30(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x20(%r14), %r15
movq 0x28(%r14), %rbp
cmpq %rbp, %r15
je 0x2c4b
leaq 0x10(%rsp), %r13
movq %rsp, %r14
leaq 0x28(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2cba
movq %r12, %rdi
movq %r14, %rsi
callq 0x4a0a
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2bdd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
addq $0x38, %r15
cmpq %rbp, %r15
jne 0x2bb1
movq 0x40(%rsp), %r14
leaq 0x30(%rsp), %rax
cmpq %rax, %r14
je 0x2c4b
movq %rsp, %r15
movq %r13, (%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x462a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x2080
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2c36
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2200
movq %rax, %r14
leaq 0x30(%rsp), %rax
cmpq %rax, %r14
jne 0x2bf8
leaq 0x28(%rsp), %rdi
callq 0x4512
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2c98
jmp 0x2c70
jmp 0x2c75
movq %rax, %r14
jmp 0x2c8e
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2c8e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x28(%rsp), %rdi
callq 0x4512
movq (%rbx), %rdi
cmpq 0x20(%rsp), %rdi
je 0x2cb2
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: hash_string[abi:cxx11](System const&)
std::string hash_string(const System& system) {
  std::set<char> chars;
  for (const Pyramid& pyramid : system.stars) {
    chars.insert(hash_string(Ship{system.player, pyramid}));
  }
  for (const Ship& ship : system.ships) {
    chars.insert(0x80 | hash_string(ship));
  }
  return std::string(chars.begin(), chars.end());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x8(%rsi), %rbp
movq 0x10(%rsi), %r14
cmpq %r14, %rbp
je 0x2d34
leaq 0x8(%rsp), %r12
leaq 0x7(%rsp), %r13
movb 0x4(%r15), %al
movq (%rbp), %rcx
leal (,%rcx,4), %edx
shrq $0x20, %rcx
shlb $0x4, %al
orb %cl, %al
orb %dl, %al
movb %al, 0x7(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5720
addq $0x8, %rbp
cmpq %r14, %rbp
jne 0x2d02
movq 0x20(%r15), %r14
movq 0x28(%r15), %r13
cmpq %r13, %r14
je 0x2d78
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %r12
movb (%r14), %al
movl 0x4(%r14), %ecx
shll $0x2, %ecx
orl 0x8(%r14), %ecx
shlb $0x4, %al
orb %cl, %al
orb $-0x80, %al
movb %al, 0x7(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x5720
addq $0xc, %r14
cmpq %r13, %r14
jne 0x2d4b
movq 0x20(%rsp), %rsi
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0x582e
leaq 0x8(%rsp), %rdi
callq 0x45da
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2db1
jmp 0x2db1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x45da
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: colour_available(System const&, int, Colour, bool)
bool colour_available(const System& system, int player, Colour colour,
    bool include_stars) {
  if (include_stars) {
    for (const Pyramid& star : system.stars) {
      if (star.colour == colour) {
        return true;
      }
    }
  }

  for (const Ship& ship : system.ships) {
    if (ship.player == player && ship.pyramid.colour == colour) {
      return true;
    }
  }

  return false;
}

// Assembly:
testl %ecx, %ecx
je 0x34e3
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cmpq %rcx, %rax
je 0x34e3
cmpl %edx, 0x4(%rax)
je 0x3510
addq $0x8, %rax
jmp 0x34d3
movq 0x20(%rdi), %rcx
movq 0x28(%rdi), %rdi
cmpq %rdi, %rcx
je 0x350d
movl (%rcx), %eax
xorl %esi, %eax
movl 0x8(%rcx), %r8d
xorl %edx, %r8d
orl %eax, %r8d
sete %al
je 0x350c
addq $0xc, %rcx
cmpq %rdi, %rcx
jne 0x34f0
retq
xorl %eax, %eax
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::advance_cur_player()
void Game::advance_cur_player() {
  cur_player_ = (cur_player_ % num_players_) + 1;
  if (winner() == 0) {
    done_main_action_ = false;
    sacrifice_actions_ = 0;
    // TODO: handle eliminated players in games with more than two players
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %eax
cltd
idivl (%rdi)
incl %edx
movl %edx, 0x4(%rdi)
callq 0x283e
testl %eax, %eax
jne 0x394d
movb $0x0, 0x8(%rbx)
movl $0x0, 0x14(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::add_ship(int, Ship const&)
void Game::add_ship(int system_id, const Ship& ship) {
  auto it = find_if(systems_.begin(), systems_.end(),
      [system_id](const System& s) {
        return s.id == system_id;
      });
  it->ships.push_back(ship);
  stash_[ship.pyramid]--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rdi
movq 0x28(%r14), %rax
movq %rax, %r9
subq %rdi, %r9
movq %r9, %r8
sarq $0x3, %r8
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %r8
sarq $0x2, %r8
testq %r8, %r8
jle 0x3c2e
imulq $0xe0, %r8, %rcx
addq %rdi, %rcx
incq %r8
addq $0x70, %rdi
cmpl %esi, -0x70(%rdi)
je 0x3c5c
cmpl %esi, -0x38(%rdi)
je 0x3c62
cmpl %esi, (%rdi)
je 0x3c7b
cmpl %esi, 0x38(%rdi)
je 0x3c68
decq %r8
addq $0xe0, %rdi
cmpq $0x1, %r8
jg 0x3c03
movq %rax, %r9
subq %rcx, %r9
jmp 0x3c31
movq %rdi, %rcx
sarq $0x3, %r9
imulq %rdx, %r9
cmpq $0x1, %r9
je 0x3c72
cmpq $0x2, %r9
je 0x3c53
cmpq $0x3, %r9
jne 0x3c78
cmpl %esi, (%rcx)
je 0x3c57
addq $0x38, %rcx
cmpl %esi, (%rcx)
jne 0x3c6e
movq %rcx, %rdi
jmp 0x3c7b
addq $-0x70, %rdi
jmp 0x3c7b
addq $-0x38, %rdi
jmp 0x3c7b
addq $0x38, %rdi
jmp 0x3c7b
addq $0x38, %rcx
cmpl %esi, (%rcx)
cmoveq %rcx, %rax
movq %rax, %rdi
movq 0x28(%rdi), %rsi
cmpq 0x30(%rdi), %rsi
je 0x3c98
movl 0x8(%rbx), %eax
movl %eax, 0x8(%rsi)
movq (%rbx), %rax
movq %rax, (%rsi)
addq $0xc, 0x28(%rdi)
jmp 0x3ca4
addq $0x20, %rdi
movq %rbx, %rdx
callq 0x55d0
addq $0x38, %r14
addq $0x4, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x427c
decl (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::create_system(std::vector<Pyramid, std::allocator<Pyramid>> const&, int)
int Game::create_system(const std::vector<Pyramid>& stars, int player) {
  for (const Pyramid& star : stars) {
    stash_[star]--;
  }
  if (player != 0) {
    homeworlds_built_++;
  }
  return add_system(System{0, player, stars});
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r15
movq 0x8(%rsi), %r13
cmpq %r13, %r15
je 0x3cfe
leaq 0x38(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x427c
decl (%rax)
addq $0x8, %r15
cmpq %r13, %r15
jne 0x3ce8
testl %ebp, %ebp
je 0x3d05
incl 0xc(%rbx)
leaq 0x8(%rsp), %r15
movl $0x0, -0x8(%r15)
movl %ebp, -0x4(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x43dc
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
movq $0x0, 0x28(%r15)
movl 0x10(%rbx), %eax
movl %eax, -0x8(%r15)
leaq 0x20(%rbx), %rdi
movq %rsp, %rsi
callq 0x448e
movl 0x10(%rbx), %r14d
leal 0x1(%r14), %eax
movl %eax, 0x10(%rbx)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3d66
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3d7d
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x445c
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game.cc
// Function: Game::destroy_system(int)
void Game::destroy_system(int system_id) {
  const auto& it = find_if(systems_.begin(), systems_.end(),
      [system_id](const System& s) {
        return s.id == system_id;
      });
  for (const Pyramid& star : it->stars) {
    stash_[star]++;
  }
  for (const Ship& ship : it->ships) {
    stash_[ship.pyramid]++;
  }
  systems_.erase(it);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %r14
movq 0x28(%rdi), %rax
movq %rax, %r8
subq %r14, %r8
movq %r8, %rdi
sarq $0x3, %rdi
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rdi
sarq $0x2, %rdi
testq %rdi, %rdi
jle 0x3e1a
imulq $0xe0, %rdi, %rcx
addq %r14, %rcx
incq %rdi
addq $0x70, %r14
cmpl %esi, -0x70(%r14)
je 0x3e48
cmpl %esi, -0x38(%r14)
je 0x3e4e
cmpl %esi, (%r14)
je 0x3e67
cmpl %esi, 0x38(%r14)
je 0x3e54
decq %rdi
addq $0xe0, %r14
cmpq $0x1, %rdi
jg 0x3deb
movq %rax, %r8
subq %rcx, %r8
jmp 0x3e1d
movq %r14, %rcx
sarq $0x3, %r8
imulq %rdx, %r8
cmpq $0x1, %r8
je 0x3e5e
cmpq $0x2, %r8
je 0x3e3f
cmpq $0x3, %r8
jne 0x3e64
cmpl %esi, (%rcx)
je 0x3e43
addq $0x38, %rcx
cmpl %esi, (%rcx)
jne 0x3e5a
movq %rcx, %r14
jmp 0x3e67
addq $-0x70, %r14
jmp 0x3e67
addq $-0x38, %r14
jmp 0x3e67
addq $0x38, %r14
jmp 0x3e67
addq $0x38, %rcx
cmpl %esi, (%rcx)
cmoveq %rcx, %rax
movq %rax, %r14
movq 0x8(%r14), %r15
movq 0x10(%r14), %r13
cmpq %r13, %r15
je 0x3e8e
leaq 0x38(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x427c
incl (%rax)
addq $0x8, %r15
cmpq %r13, %r15
jne 0x3e78
leaq 0x20(%rbx), %r15
movq 0x20(%r14), %r12
movq 0x28(%r14), %r13
cmpq %r13, %r12
je 0x3ebb
addq $0x38, %rbx
leaq 0x4(%r12), %rsi
movq %rbx, %rdi
callq 0x427c
incl (%rax)
addq $0xc, %r12
cmpq %r13, %r12
jne 0x3ea3
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x54ba
nop
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/negamax.cc
// Function: Negamax::half_heuristic(Game const*, int)
int Negamax::half_heuristic(const Game *game, int player) {
  if (game->winner() == player) {
    return 1000000;
  } else if (game->winner() != 0) {
    return 0;
  }

  int total = 0;
  for (const System& system : game->systems()) {
    for (const Ship& ship : system.ships) {
      if (ship.player == player) {
        total += 100 * ship.pyramid.size * ship.pyramid.size;
      }
    }
  }

  return total;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x283e
movl $0xf4240, %ebp          # imm = 0xF4240
cmpl %ebx, %eax
je 0x62df
movq %r14, %rdi
callq 0x283e
xorl %ebp, %ebp
testl %eax, %eax
jne 0x62df
movq %r14, %rdi
callq 0x2818
movq (%rax), %rcx
movq 0x8(%rax), %rax
cmpq %rax, %rcx
je 0x62df
xorl %edx, %edx
xorl %ebp, %ebp
movq 0x20(%rcx), %rsi
movq 0x28(%rcx), %rdi
cmpq %rdi, %rsi
je 0x62d6
movl 0x4(%rsi), %r8d
imull %r8d, %r8d
imull $0x64, %r8d, %r8d
cmpl %ebx, (%rsi)
cmovnel %edx, %r8d
addl %r8d, %ebp
addq $0xc, %rsi
jmp 0x62b6
addq $0x38, %rcx
cmpq %rax, %rcx
jne 0x62ae
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: operator<<(std::ostream&, System const&)
std::ostream& operator<<(std::ostream &os, const System& system) {
  os << "(";
  if (system.player != 0) {
    os << system.player << ", ";
  }
  for (const Pyramid& pyramid : system.stars) {
    os << pyramid;
  }
  os << ")";
  for (const Ship& ship : system.ships) {
    os << " " << ship;
  }
  return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x313c(%rip), %rsi      # 0xb1c5
movl $0x1, %edx
callq 0x21f0
movl 0x4(%r14), %esi
testl %esi, %esi
je 0x80b7
movq %rbx, %rdi
callq 0x22c0
leaq 0x311d(%rip), %rsi      # 0xb1c7
movl $0x2, %edx
movq %rax, %rdi
callq 0x21f0
movq 0x8(%r14), %r12
movq 0x10(%r14), %r13
cmpq %r13, %r12
je 0x8101
leaq 0x30f5(%rip), %rbp      # 0xb1c0
leaq 0x7(%rsp), %r15
movl 0x4(%r12), %eax
movb (%rax,%rbp), %al
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movl (%r12), %esi
movq %rax, %rdi
callq 0x22c0
addq $0x8, %r12
cmpq %r13, %r12
jne 0x80d0
leaq 0x3076(%rip), %rsi      # 0xb17e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movq 0x20(%r14), %r15
movq 0x28(%r14), %r12
cmpq %r12, %r15
je 0x814d
leaq 0x309f(%rip), %r14      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8029
addq $0xc, %r15
cmpq %r12, %r15
jne 0x8129
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: print_game(std::ostream&, Game const&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
void print_game(std::ostream& os, const Game& game,
                const std::map<int, std::string>& system_names) {
  os << game.num_players() << " ";
  os << game.homeworlds_built() << " ";
  os << game.cur_player() << std::endl;
  for (const System& system : game.systems()) {
    os << system_names.at(system.id) << " " << system << std::endl;
  }
  os << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x27fc
movq %rbx, %rdi
movl %eax, %esi
callq 0x22c0
leaq 0x29b0(%rip), %r12      # 0xb1c8
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %r15, %rdi
callq 0x2808
movq %rbx, %rdi
movl %eax, %esi
callq 0x22c0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %r15, %rdi
callq 0x2800
movq %rbx, %rdi
movl %eax, %esi
callq 0x22c0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq %r15, %rdi
callq 0x2818
movq (%rax), %r15
movq 0x8(%rax), %rbp
cmpq %rbp, %r15
je 0x890a
leaq 0x2927(%rip), %r12      # 0xb1c8
movq %r14, %rdi
movq %r15, %rsi
callq 0x93c2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x21f0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %r13, %rdi
movq %r15, %rsi
callq 0x8071
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
addq $0x38, %r15
cmpq %rbp, %r15
jne 0x88a1
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2130
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: operator>>(std::istream&, Pyramid&)
std::istream& operator>>(std::istream& is, Pyramid& pyramid) {
  is >> std::ws;
  char c;
  is.get(c);
  pyramid.colour =
    c == 'r' || c == 'R' ? RED :
    c == 'y' || c == 'Y' ? YELLOW :
    c == 'g' || c == 'G' ? GREEN : BLUE;
  int size;
  is >> size;
  pyramid.size = (Size)size;
  return is;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2180
leaq 0xb(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2230
movzbl (%r15), %ecx
andl $-0x21, %ecx
cmpl $0x52, %ecx
je 0x897b
cmpl $0x59, %ecx
jne 0x897f
movl $0x1, %eax
jmp 0x898a
xorl %eax, %eax
jmp 0x898a
xorl %eax, %eax
cmpb $0x47, %cl
sete %al
xorl $0x3, %eax
movl %eax, 0x4(%r14)
leaq 0xc(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2110
movl (%r15), %eax
movl %eax, (%r14)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: operator>>(std::istream&, Ship&)
std::istream& operator>>(std::istream& is, Ship& ship) {
  is >> std::ws;
  char c;
  is.get(c);
  ship.player = (int)(c - '0');
  is >> ship.pyramid;
  return is;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2180
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2230
movsbl (%r15), %eax
addl $-0x30, %eax
movl %eax, (%rbx)
addq $0x4, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x893f
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: operator>>(std::istream&, System&)
std::istream& operator>>(std::istream& is, System& system) {
  system.player = 0;
  system.id = 0;
  is >> std::ws;
  is.ignore(); // (
  if (std::isdigit(is.peek())) {
    is >> system.player;
    is.ignore(256, ' ');
  }
  while (is.peek() != ')') {
    Pyramid star;
    is >> star;
    system.stars.push_back(star);
  }
  is.ignore(); // )
  while (!is.eof()) {
    Ship ship;
    is >> ship;
    system.ships.push_back(ship);
  }
  return is;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, (%rsi)
callq 0x2180
movq %rbx, %rdi
callq 0x22f0
movq %rbx, %rdi
callq 0x20b0
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x8a4d
leaq 0x4(%r14), %rsi
movq %rbx, %rdi
callq 0x2110
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movl $0x20, %edx
callq 0x2120
movq %rbx, %rdi
callq 0x20b0
cmpl $0x29, %eax
je 0x8a9f
leaq 0x8(%r14), %r15
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x893f
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x8a87
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x10(%r14)
jmp 0x8a92
movq %r15, %rdi
movq %r12, %rdx
callq 0x94fc
movq %rbx, %rdi
callq 0x20b0
cmpl $0x29, %eax
jne 0x8a63
movq %rbx, %rdi
callq 0x22f0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rbx,%rax)
jne 0x8b02
leaq 0x20(%r14), %r15
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x89b1
movq 0x28(%r14), %rsi
cmpq 0x30(%r14), %rsi
je 0x8ae9
movl 0x10(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x28(%r14)
jmp 0x8af4
movq %r15, %rdi
movq %r12, %rdx
callq 0x55d0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rbx,%rax)
je 0x8abe
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: HTMLWriter::WriteFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool HTMLWriter::WriteFile(std::string const& filename)
{
    this->file_ = fopen(filename.c_str(), "w");
    if (this->file_) {
        this->WriteHTML();
        fclose(this->file_);
    }
    return (this->file_ != NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rdi
leaq 0x1880(%rip), %rsi      # 0x40be
callq 0x2190
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2867
movq %rbx, %rdi
callq 0x286c
movq 0x8(%rbx), %rdi
callq 0x2130
cmpq $0x0, 0x8(%rbx)
setne %al
jmp 0x2869
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: HTMLWriter::WriteHTML()
void HTMLWriter::WriteHTML()
{
    fprintf(this->file_, "%s\n", "<!DOCTYPE html>");
    fprintf(this->file_, "%s\n", "<html>");
    
    this->WriteHead();
    this->WriteBody();
    
    fprintf(this->file_, "%s\n", "</html>");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x17b8(%rip), %r14      # 0x4036
leaq 0x1842(%rip), %rdx      # 0x40c7
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x183d(%rip), %rdx      # 0x40d7
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq %rbx, %rdi
callq 0x2960
movq %rbx, %rdi
callq 0x29dc
movq 0x8(%rbx), %rdi
leaq 0x181f(%rip), %rdx      # 0x40de
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: HTMLWriter::Escape(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
std::string HTMLWriter::Escape(std::string const& input) const
{
    std::string result;
    for (char c : input) {
        switch (c) {
        case ' ':   result.append("&nbsp;");    break;
        default:    result.push_back(c);
        }
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x8(%rdx), %r12
testq %r12, %r12
je 0x292f
movq (%rdx), %r13
xorl %ebp, %ebp
leaq 0x17ba(%rip), %r14      # 0x40c0
movb (%r13,%rbp), %al
cmpb $0x20, %al
jne 0x291c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2240
jmp 0x2927
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2110
incq %rbp
cmpq %rbp, %r12
jne 0x2906
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x2957
movq (%r15), %rsi
incq %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2220
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: HTMLWriter::WriteHead()
void HTMLWriter::WriteHead()
{
    fprintf(this->file_, "%s\n", "<head>");
    
    fprintf(this->file_, "%s\n", "<meta charset=\"utf-8\" />");
    fprintf(this->file_, "<title>%s</title>", this->title_.c_str());
    this->WriteStyle();
    this->WriteScript();
    
    fprintf(this->file_, "%s\n", "</head>");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x16c4(%rip), %r14      # 0x4036
leaq 0x176d(%rip), %rdx      # 0x40e6
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x175f(%rip), %rdx      # 0x40ed
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rdx
leaq 0x175f(%rip), %rsi      # 0x4106
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x8(%rbx), %rdi
leaq 0x174d(%rip), %rdx      # 0x4118
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: ImageWriter::WriteStyle()
void ImageWriter::WriteStyle()
{
    fprintf(this->file_, "%s\n", "<style type=\"text/css\">");
    fprintf(this->file_, "%s\n", "*{margin:0;padding:0;line-height:5px;}");
    fprintf(this->file_, "%s\n", ".pixel{width:5px;height:5px;float:left;}");
    fprintf(this->file_, "%s\n", "br{clear:left;}");
    fprintf(this->file_, "%s\n", "</style>");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x1500(%rip), %r14      # 0x4036
leaq 0x1602(%rip), %rdx      # 0x413f
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x1605(%rip), %rdx      # 0x4157
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x1617(%rip), %rdx      # 0x417e
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x162b(%rip), %rdx      # 0x41a7
movq %r14, %rsi
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x1626(%rip), %rdx      # 0x41b7
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/html_writer.cc
// Function: ImageWriter::WriteContent()
void ImageWriter::WriteContent()
{
    Bitmap bitmap;

    fprintf(this->file_, "%s\n", "<div class=\"image\">");
    if (bitmap.Load(this->filename_)) {
        auto w = bitmap.GetWidth();
        auto h = bitmap.GetHeight();
        for (auto y = 0; y < h; y++) {
            for (auto x = 0; x < w; x++) {
                Color color = bitmap.GetColor(x, y);
                this->WritePixel(color);
            }
            fprintf(this->file_, "%s\n", "<br />");
        }
    } else {
        fprintf(this->file_, "<p>Failed open %s: %s</p>",
                             this->filename_.c_str(),
                             bitmap.GetError().c_str());
    }
    fprintf(this->file_, "%s\n", "</div>");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x30bc
movq 0x8(%rbx), %rdi
leaq 0x146d(%rip), %rsi      # 0x4036
leaq 0x15f0(%rip), %rdx      # 0x41c0
xorl %eax, %eax
callq 0x21c0
leaq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x3222
testb %al, %al
je 0x2c48
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
jle 0x2c63
movl (%rsp), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
jle 0x2c25
movslq %r13d, %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movslq (%rsp), %rcx
imulq %r14, %rcx
addq %r15, %rcx
movl (%rax,%rcx,4), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
incq %r15
cmpl %r15d, %r12d
jne 0x2c01
movq 0x8(%rbx), %rdi
leaq 0x1406(%rip), %rsi      # 0x4036
leaq 0x159d(%rip), %rdx      # 0x41d4
xorl %eax, %eax
callq 0x21c0
incl %r13d
cmpl %ebp, %r13d
jne 0x2bf6
jmp 0x2c63
movq 0x8(%rbx), %rdi
movq 0x30(%rbx), %rdx
movq 0x18(%rsp), %rcx
leaq 0x157f(%rip), %rsi      # 0x41db
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rbx), %rdi
leaq 0x13c8(%rip), %rsi      # 0x4036
leaq 0x1580(%rip), %rdx      # 0x41f5
xorl %eax, %eax
callq 0x21c0
movq %rsp, %rdi
callq 0x31c4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c95
movq %rax, %rbx
movq %rsp, %rdi
callq 0x31c4
movq %rbx, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/bitmap.cc
// Function: Bitmap::operator=(Bitmap const&)
Bitmap& Bitmap::operator=(Bitmap const& rhs)
{
    if (this != &rhs) {
        this->Free();
        auto size = rhs.width_ * rhs.height_;
        this->width_  = rhs.width_;
        this->height_ = rhs.height_;
        this->pixels_ = new Color[size];
        memcpy(this->pixels_, rhs.pixels_, size);
    }
    return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x318a
movq %rsi, %r14
movq %rbx, %rdi
callq 0x31e8
movl (%r14), %eax
movl 0x4(%r14), %ecx
movl %eax, (%rbx)
movl %ecx, 0x4(%rbx)
imull %eax, %ecx
movslq %ecx, %r15
leaq (,%r15,4), %rax
testl %r15d, %r15d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2040
movq %rax, 0x8(%rbx)
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x2100
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/bitmap.cc
// Function: Bitmap::Free()
void Bitmap::Free()
{
    this->width_  = 0;
    this->height_ = 0;

    if (this->pixels_) {
        delete[] this->pixels_;
        this->pixels_ = nullptr;
    }

    this->error_type_ = kSuccess;
    this->error_description_.clear();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x0, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3209
callq 0x21a0
movq $0x0, 0x8(%rbx)
movl $0x0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
movq 0x18(%rbx), %rax
movb $0x0, (%rax)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/bitmap.cc
// Function: Bitmap::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Bitmap::Load(std::string const& filename)
{
    this->Free();

    FILE *file = fopen(filename.c_str(), "rb");
    if (file == NULL) {
        this->error_type_ = kIOError;
        this->error_description_ = strerror(errno);
        return false;
    }

    fseek(file, 0, SEEK_END);
    auto length = ftell(file);
    fseek(file, 0, SEEK_SET);

    std::vector<char> buffer;

    buffer.resize(length);
    if (fread(buffer.data(), length, 1, file) != 1) {
        this->error_type_ = kIOError;
        this->error_description_ = "Failed reading data";
        return false;
    }

    fclose(file);

    return this->LoadData(buffer.data(), length);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x31e8
movq (%r14), %rdi
leaq 0x108f(%rip), %rsi      # 0x42d1
callq 0x2190
testq %rax, %rax
je 0x32c4
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2170
movq %r14, %rdi
callq 0x2030
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2170
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %r15, %rsi
callq 0x38ac
movq (%rsp), %rdi
movl $0x1, %edx
movq %r15, %rsi
movq %r14, %rcx
callq 0x21d0
cmpq $0x1, %rax
jne 0x3302
movq %r14, %rdi
callq 0x2130
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3372
movl %eax, %r14d
jmp 0x332b
movl $0x1, 0x10(%rbx)
callq 0x2050
movl (%rax), %edi
callq 0x2090
movq %rax, %r15
movq 0x20(%rbx), %r12
addq $0x18, %rbx
movq %rax, %rdi
callq 0x20a0
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x21f0
jmp 0x3341
movl $0x1, 0x10(%rbx)
movq 0x20(%rbx), %rdx
addq $0x18, %rbx
xorl %r14d, %r14d
leaq 0xfb9(%rip), %rcx       # 0x42d4
movl $0x13, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3341
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2150
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3369
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2220
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/bitmap.cc
// Function: Bitmap::LoadData(char const*, unsigned long)
bool Bitmap::LoadData(char const *data, size_t size)
{
    if (!CheckFormat(data, size)) {
        this->error_type_ = kInvalidBitmap;
        return false;
    }

    auto *bf = reinterpret_cast<BITMAPFILEHEADER const *>(data);
    auto *bi = reinterpret_cast<BITMAPINFOHEADER const *>(bf + 1);

    int w = this->width_  = abs(bi->biWidth );
    int h = this->height_ = abs(bi->biHeight);

    this->pixels_ = new Color[w * h];

    if (bi->biSize < sizeof(BITMAPINFOHEADER)) {
        this->error_type_ = kUnsupportedBitmap;
        this->error_description_ = "DIB header type not supported";
        return false;   // mainly means no BITMAPCOREHEADER support
    }

    if (bi->biCompression != BI_RGB) {
        this->error_type_ = kUnsupportedBitmap;
        this->error_description_ = "Compressed format not supported";
        return false;   // unsupported
    }

    return this->LoadUncompressedPixelData(bf, bi);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x342c
testb %al, %al
je 0x33d5
movl 0x12(%r14), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl %ecx, (%rbx)
movl 0x16(%r14), %eax
movl %eax, %edi
negl %edi
cmovsl %eax, %edi
movl %edi, 0x4(%rbx)
imull %ecx, %edi
shlq $0x2, %rdi
callq 0x2040
movq %rax, 0x8(%rbx)
cmpl $0x27, 0xe(%r14)
ja 0x33de
movl $0x3, 0x10(%rbx)
movq 0x20(%rbx), %rdx
addq $0x18, %rbx
leaq 0xfd1(%rip), %rcx       # 0x439e
movl $0x1d, %r8d
jmp 0x3401
movl $0x2, 0x10(%rbx)
jmp 0x340b
cmpl $0x0, 0x1e(%r14)
je 0x3415
movl $0x3, 0x10(%rbx)
movq 0x20(%rbx), %rdx
addq $0x18, %rbx
leaq 0xfc1(%rip), %rcx       # 0x43bc
movl $0x1f, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xe(%r14), %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x352a
nop
// File: /workspace/github_cpp_makefile_star2_O3/timothyqiu[P]ssoaag/bitmap.cc
// Function: Bitmap::CheckFormat(char const*, unsigned long)
static bool HasBitmapSignature(char const *data, size_t size)
{
    if (size < 2)
        return false;

    // http://en.wikipedia.org/wiki/BMP_file_format#Bitmap_file_header
    return (memcmp(data, "BM", 2) == 0 ||   // Windows 3.1x, 95, NT, ... etc.
            memcmp(data, "BA", 2) == 0 ||   // OS/2 struct Bitmap Array
            memcmp(data, "CI", 2) == 0 ||   // OS/2 struct Color Icon
            memcmp(data, "CP", 2) == 0 ||   // OS/2 const Color Pointer
            memcmp(data, "IC", 2) == 0 ||   // OS/2 struct Icon
            memcmp(data, "PT", 2) == 0);    // OS/2 Pointer
}

// Assembly:
pushq %rbx
cmpq $0x2, %rdx
jae 0x3444
movq 0x20(%rdi), %rdx
addq $0x18, %rdi
leaq 0xea6(%rip), %rcx       # 0x42e8
jmp 0x3483
cmpw $0x4d42, (%rsi)         # imm = 0x4D42
je 0x346e
cmpw $0x4142, (%rsi)         # imm = 0x4142
je 0x346e
cmpw $0x4943, (%rsi)         # imm = 0x4943
je 0x346e
cmpw $0x5043, (%rsi)         # imm = 0x5043
je 0x346e
cmpw $0x4349, (%rsi)         # imm = 0x4349
je 0x346e
cmpw $0x5450, (%rsi)         # imm = 0x5450
jne 0x3433
cmpq $0xd, %rdx
ja 0x3496
movq 0x20(%rdi), %rdx
addq $0x18, %rdi
leaq 0xe79(%rip), %rcx       # 0x42fc
xorl %ebx, %ebx
movl $0x13, %r8d
xorl %esi, %esi
callq 0x21f0
movl %ebx, %eax
popq %rbx
retq
movl 0x2(%rsi), %eax
cmpq %rdx, %rax
jne 0x34af
cmpl $0xc, 0xe(%rsi)
jne 0x34c8
movb $0x1, %bl
cmpw $0x1, 0x16(%rsi)
je 0x3492
jmp 0x34f2
movq 0x20(%rdi), %rdx
addq $0x18, %rdi
leaq 0xe52(%rip), %rcx       # 0x4310
xorl %ebx, %ebx
movl $0x26, %r8d
jmp 0x348b
cmpw $0x1, 0x1a(%rsi)
jne 0x34f2
movl 0x1e(%rsi), %eax
movb $0x1, %bl
cmpl $0x2, %eax
je 0x350b
cmpl $0x1, %eax
jne 0x3492
cmpw $0x8, 0x1c(%rsi)
je 0x3492
addq $0x18, %rdi
leaq 0xe5e(%rip), %rsi       # 0x434e
jmp 0x351d
movq 0x20(%rdi), %rdx
addq $0x18, %rdi
leaq 0xe36(%rip), %rcx       # 0x4337
xorl %ebx, %ebx
movl $0x16, %r8d
jmp 0x348b
cmpw $0x4, 0x1c(%rsi)
je 0x3492
addq $0x18, %rdi
leaq 0xe59(%rip), %rsi       # 0x4376
callq 0x21b0
xorl %ebx, %ebx
jmp 0x3492
nop
// File: /workspace/github_cpp_makefile_star2_O3/ctSkennerton[P]fxtract/util/realpath.c
// Function: main
int main(int argc, char **argv)
{
    int     i;
    char    path[argc][8192];

    if (argc > 1 && !strcmp(argv[1], "-q"))
        --argc, ++argv, fclose(stderr);

    if (argc < 2)
        return fputs("usage: realpath [-q] path [...]\n", stderr), 1;

    for (i = 1; i < argc; ++i)
        if (!realpath(argv[i], path[i]))
            return perror(argv[i]), 1;

    for (i = 1; i < argc; ++i)
        puts(path[i]);

    return  0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %eax
movq %rsp, %rbx
shlq $0xd, %rax
subq %rax, %rbx
movq %rbx, %rsp
cmpl $0x2, %edi
jl 0x1258
movq %rsi, %r14
movl %edi, %r15d
movq 0x8(%rsi), %rax
cmpb $0x2d, (%rax)
jne 0x11f9
cmpb $0x71, 0x1(%rax)
jne 0x11f9
cmpb $0x0, 0x2(%rax)
jne 0x11f9
movq 0x2dfc(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1050
cmpl $0x2, %r15d
je 0x1258
addq $0x8, %r14
decl %r15d
movl %r15d, %r12d
leaq 0x2000(%rbx), %r15
movl $0x1, %r13d
movq (%r14,%r13,8), %rdi
movq %r15, %rsi
callq 0x1030
testq %rax, %rax
je 0x125f
incq %r13
addq $0x2000, %r15           # imm = 0x2000
cmpq %r13, %r12
jne 0x1209
addq $0x2000, %rbx           # imm = 0x2000
decq %r12
movq %rbx, %rdi
callq 0x1070
addq $0x2000, %rbx           # imm = 0x2000
decq %r12
jne 0x1233
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1090
jmp 0x1268
movq (%r14,%r13,8), %rdi
callq 0x1040
movl $0x1, %eax
jmp 0x1249