LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::_draw()
void EmuWindow::_draw() {
  // Scale and paint the video memory's buffer to the window
  double scaleX = (double)_width / _vidMem->getWidth();
  double scaleY = (double)_height / _vidMem->getHeight();
  cairo_identity_matrix(_cairo);
  cairo_scale(_cairo, scaleX, scaleY);
  cairo_set_source_surface(_cairo, _vidMem->getBuffer(), 0, 0);
  cairo_pattern_set_filter(cairo_get_source(_cairo), CAIRO_FILTER_NEAREST);
  cairo_paint(_cairo);
  cairo_surface_flush(_surface);
  XFlush(_display);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cvtsi2sdl 0x2c(%rdi), %xmm0
mulsd 0x1f05(%rip), %xmm0     # 0x60f8
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%rdi), %xmm0
divsd 0x1ef7(%rip), %xmm0     # 0x6100
movsd %xmm0, (%rsp)
movq 0x8(%rdi), %rdi
callq 0x3130
movq 0x8(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x3050
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rax
movq (%rax), %rsi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x3470
movq 0x8(%rbx), %rdi
callq 0x3360
movq %rax, %rdi
movl $0x3, %esi
callq 0x34a0
movq 0x8(%rbx), %rdi
callq 0x33c0
movq (%rbx), %rdi
callq 0x33f0
movq 0x10(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x3380
// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::_updateKeyState(XKeyEvent const&)
void EmuWindow::_updateKeyState(const XKeyEvent& event) {
  // Filter out auto repeat key events
  if (event.type == KeyRelease && XPending(_display)) {
    XEvent nev;
    XPeekEvent(_display, &nev);
    if (nev.type == KeyPress &&
        nev.xkey.time == event.time &&
        nev.xkey.keycode == event.keycode) {
      // Key wasn't really released, get rid of the
      // pending KeyPress event and return
      XNextEvent(_display, &nev);
      return;
    }
  }
  int keysyms_per_keycode_return;
  KeySym *keysym = XGetKeyboardMapping(_display,
                                       event.keycode,
                                       1,
                                       &keysyms_per_keycode_return);
  uint16_t status = KeyPress == event.type ? 1 : 0;
  _keyState[keysym[0]] = status;
  XFree(keysym);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x3, (%rsi)
jne 0x4381
movq 0x10(%rbx), %rdi
callq 0x31f0
testl %eax, %eax
je 0x4381
movq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x30c0
cmpl $0x2, (%r15)
jne 0x4381
movq 0x40(%rsp), %rax
cmpq 0x38(%r14), %rax
jne 0x4381
movl 0x5c(%rsp), %eax
cmpl 0x54(%r14), %eax
jne 0x4381
movq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3340
jmp 0x43c0
movq 0x10(%rbx), %rdi
movzbl 0x54(%r14), %esi
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
callq 0x3450
movq %rax, %r15
xorl %ebp, %ebp
cmpl $0x2, (%r14)
sete %bpl
addq $0x68, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4598
movw %bp, (%rax)
movq %r15, %rdi
callq 0x32c0
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-emulator/src/processor.cpp
// Function: EmuProcessor::_pop()
uint16_t EmuProcessor::_pop() {
  uint16_t sp = _registers[REG_SP];
  uint16_t val = (_mainMem[sp] << 8) | _mainMem[sp+1];
  _registers[REG_SP] -= 2;
  return val;
}

// Assembly:
movzwl 0x10008(%rdi), %ecx
movzwl 0x8(%rdi,%rcx), %eax
rolw $0x8, %ax
addl $-0x2, %ecx
movw %cx, 0x10008(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-emulator/src/processor.cpp
// Function: EmuProcessor::_setFlags(unsigned int const&, unsigned int const&, unsigned int const&, unsigned char const&)
void EmuProcessor::_setFlags(const uint32_t& dest,
                             const uint32_t& src,
                             const uint32_t& result,
                             const uint8_t& opcode) {
  // Overflow set if we added two positives and got a negative,
  // added two negatives and got a positive, subtracted a positive
  // from a negative and got a positive, or subtracted a negative
  // from a positive and got a negative
  if (OPCODE_ADD == opcode) {
    _overflowFlag =
      ((0x8000 & dest) && (0x8000 & src) && !(0x8000 & result)) ||
      (!(0x8000 & dest) && !(0x8000 & src) && (0x8000 & result));
  } else if (OPCODE_SUB == opcode || OPCODE_CMP == opcode) {
    _overflowFlag =
      ((0x8000 & dest) && !(0x8000 & src) && !(0x8000 & result)) ||
      (!(0x8000 & dest) && (0x8000 & src) && (0x8000 & result));
  } else {
    _overflowFlag = false;
  }
  // Carry set if c is too large to fit into 16 bits.
  _carryFlag = 0xffff < result;
  // Zero set if the result was zero.
  _zeroFlag = !(0xffff & result);
  // Sign flag set if the sign bit of the result is set.
  _signFlag = 0x8000 & result;
}

// Assembly:
movzbl (%r8), %eax
cmpl $0x14, %eax
je 0x4dd5
cmpl $0xb, %eax
je 0x4dd5
cmpl $0xa, %eax
jne 0x4e02
movl (%rsi), %eax
testw %ax, %ax
jns 0x4e19
testb $-0x80, 0x1(%rdx)
jne 0x4e06
testw %ax, %ax
js 0x4e02
jmp 0x4e19
movl (%rsi), %eax
testw %ax, %ax
jns 0x4dfc
testb $-0x80, 0x1(%rdx)
jne 0x4df7
testw %ax, %ax
sets %sil
testb $-0x80, 0x1(%rcx)
sete %al
orb %al, %sil
je 0x4dfc
jmp 0x4e26
testw %ax, %ax
js 0x4e02
testb $-0x80, 0x1(%rdx)
jne 0x4e1f
xorl %eax, %eax
jmp 0x4e26
testw %ax, %ax
sets %sil
testb $-0x80, 0x1(%rcx)
sete %al
orb %al, %sil
jne 0x4e26
testb $-0x80, 0x1(%rdx)
jne 0x4e02
movl (%rcx), %eax
shrl $0xf, %eax
andb $0x1, %al
movb %al, 0x1002b(%rdi)
movl (%rcx), %eax
cmpl $0x10000, %eax          # imm = 0x10000
setae 0x1002c(%rdi)
testw %ax, %ax
sete 0x1002d(%rdi)
shrl $0xf, %eax
andb $0x1, %al
movb %al, 0x1002e(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ef-gy[P]libefgy/include/ef.gy/test-case.h
// Function: main
int main(int argc, char **argv) {
  if (cli::options(argc, argv, false).matches == 0) {
    return run<function>() ? 0 : -1;
  } else {
    return 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movl %edi, %ebp
callq 0x4a4c
callq 0x4ad2
leaq 0x18c76(%rip), %r8      # 0x1d6f8
leaq 0x18ca7(%rip), %r9      # 0x1d730
movq %rsp, %r15
xorl %ebx, %ebx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x4ff8
movq (%r15), %r14
leaq 0x8(%rsp), %rdi
callq 0xa130
testq %r14, %r14
jne 0x4ac5
callq 0x4ae8
leaq 0x18cad(%rip), %rdi     # 0x1d768
callq 0x5038
movzbl %al, %ebx
decl %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ef-gy[P]libefgy/include/ef.gy/cli.h
// Function: efgy::cli::processor<efgy::cli::option, efgy::cli::hint>::apply(int, char**)
void apply(int argc, char *argv[]) {
    std::vector<std::string> args;
    for (int i = 0; i < argc; i++) {
      args.push_back(argv[i]);
    }
    apply(args);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %esi, %esi
jle 0x10fdc
movq %rdx, %r14
movl %esi, %ebx
xorl %ebp, %ebp
leaq 0x38(%rsp), %r15
leaq 0xf(%rsp), %r12
leaq 0x10(%rsp), %r13
movq (%r14,%rbp,8), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x4e3a
movq %r13, %rdi
movq %r15, %rsi
callq 0x111d8
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x10fd4
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4240
incq %rbp
cmpq %rbp, %rbx
jne 0x10f9e
leaq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x1103c
leaq 0x10(%rsp), %rdi
callq 0xa130
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11006
movq %rax, %rbx
jmp 0x1102a
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1102a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x10(%rsp), %rdi
callq 0xa130
movq %rbx, %rdi
callq 0x43b0
// File: /workspace/github_cpp_makefile_star2_O1/ef-gy[P]libefgy/include/ef.gy/cli.h
// Function: efgy::cli::processor<efgy::cli::option, efgy::cli::hint>::apply(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void apply(const std::vector<std::string> &args) {
    bool doneWithArgs = false;
    bool firstArg = true;

    for (const auto &arg : args) {
      if (arg == "--") {
        doneWithArgs = true;
        continue;
      }

      bool haveMatch = false;

      if (!doneWithArgs) {
        for (const auto &opt : opts) {
          std::smatch match;
          if (std::regex_match(arg, match, opt->match) && opt->handler(match)) {
            matches++;
            haveMatch = true;
          }
        }
      }

      if (!haveMatch && !firstArg) {
        remainder.push_back(arg);
      }

      firstArg = false;
    }

    if (showUsage && (matches == 0) && (args.size() > 0) &&
        (remainder.size() == 0)) {
      usage(std::cout, args[0]);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq (%rsi), %r15
movq %rsi, 0x8(%rsp)
movq 0x8(%rsi), %r13
cmpq %r13, %r15
je 0x1116c
leaq 0x8(%rbx), %rax
movq %rax, 0x18(%rsp)
movb $0x1, %r14b
movl $0x0, (%rsp)
leaq 0x20(%rsp), %rbp
movq %r13, 0x10(%rsp)
movq %r15, %rdi
leaq 0x3b20(%rip), %rsi      # 0x14ba9
callq 0x4070
testl %eax, %eax
je 0x1115a
movl %r14d, 0x4(%rsp)
testb $0x1, (%rsp)
jne 0x11141
movq 0x28(%rbx), %r12
movq 0x18(%r12), %r14
addq $0x8, %r12
cmpq %r12, %r14
je 0x11141
xorl %r13d, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x20(%r14), %rcx
addq $0x60, %rcx
movq (%r15), %rdi
movq 0x8(%r15), %rsi
addq %rdi, %rsi
movq %rbp, %rdx
xorl %r8d, %r8d
callq 0x113e0
testb %al, %al
je 0x1110f
movq 0x20(%r14), %rax
cmpq $0x0, 0x30(%rax)
je 0x111ae
leaq 0x20(%rax), %rdi
movq %rbp, %rsi
callq *0x38(%rax)
testb %al, %al
je 0x1110f
incq (%rbx)
movb $0x1, %r13b
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x11126
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4240
movq %r14, %rdi
callq 0x42c0
movq %rax, %r14
cmpq %r12, %rax
jne 0x110be
testb $0x1, %r13b
movq 0x10(%rsp), %r13
jne 0x11155
testb $0x1, 0x4(%rsp)
jne 0x11155
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xdc8c
xorl %r14d, %r14d
jmp 0x1115f
movb $0x1, %al
movl %eax, (%rsp)
addq $0x20, %r15
cmpq %r13, %r15
jne 0x1107f
cmpb $0x1, 0x20(%rbx)
jne 0x1119f
cmpq $0x0, (%rbx)
jne 0x1119f
movq 0x8(%rsp), %rax
movq (%rax), %rdx
cmpq %rdx, 0x8(%rax)
je 0x1119f
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x1119f
movq 0xbe21(%rip), %rsi      # 0x1cfb8
movq %rbx, %rdi
callq 0x10d36
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40c0
jmp 0x111b5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x111cf
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4240
movq %rbx, %rdi
callq 0x43b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/ahupowerdns[P]spamidea/getsender.cc
// Function: flattenDomain(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
string flattenDomain(const std::string& input, const vector<string>& repl)
{
  for(const auto& r: repl) {
    auto pos = input.find(r);
    if(pos != string::npos) {
      return "*."+r;
    }
  }
  return input;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdx), %r15
movq 0x8(%rdx), %r12
cmpq %r12, %r15
sete %bpl
je 0x4964
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4510
cmpq $-0x1, %rax
jne 0x494d
addq $0x20, %r15
cmpq %r12, %r15
sete %bpl
je 0x4964
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4510
addq $0x20, %r15
cmpq $-0x1, %rax
je 0x4925
addq $-0x20, %r15
leaq 0x107a4(%rip), %rsi     # 0x150f8
movq %rbx, %rdi
movq %r15, %rdx
callq 0x5a92
testb %bpl, %bpl
je 0x497d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x6d00
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ahupowerdns[P]spamidea/getsender.cc
// Function: processReceived(_IO_FILE*)
void processReceived(FILE* fp)
{
  char line[512];
  std::string completeline;
  MailTreeNode* start = &g_mtn;
  while(fgets(line, sizeof(line)-1, fp)) {
    chomp(line);
    if(!*line)
      break;
    if(isspace(*line)) {
      *line=' ';
      completeline += line;
    }
    else {
      processLine(completeline, start);
      completeline=line;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1917d(%rip), %rax     # 0x1e708
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdx
callq 0x44c0
testq %rax, %rax
je 0x563e
movl $0x2401, %ebp           # imm = 0x2401
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
movq %r14, %rcx
movzbl (%rcx), %eax
cmpl $0xd, %eax
ja 0x5639
btl %eax, %ebp
jae 0x5639
movb $0x0, (%rcx)
movsbl 0x30(%rsp), %edi
testl %edi, %edi
je 0x563e
callq 0x4060
testl %eax, %eax
je 0x55f4
movb $0x20, 0x30(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4590
jmp 0x561f
movq %r15, %rdi
movq %r12, %rsi
callq 0x4989
movq 0x10(%rsp), %r13
movq %r14, %rdi
callq 0x4150
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x44a0
movq %r14, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movq %rbx, %rdx
callq 0x44c0
movq %r14, %rcx
testq %rax, %rax
jne 0x55c0
jmp 0x563e
incq %rcx
jmp 0x55c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x565a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x568b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x4520
// File: /workspace/github_cpp_makefile_star2_O1/ahupowerdns[P]spamidea/getsender.cc
// Function: processFile(boost::filesystem::path const&)
void processFile(const boost::filesystem::path& p)
{
  FILE* fp = fopen(p.c_str(), "r");
  if(!fp) {
    cerr<<"Could not open " << p.string() << " for reading"<<endl;
    exit(EXIT_FAILURE);
  }
  processReceived(fp);
  fclose(fp);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x1019b(%rip), %rsi     # 0x1583f
callq 0x43c0
testq %rax, %rax
je 0x56c8
movq %rax, %r14
movq %rax, %rdi
callq 0x555c
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4300
movq 0x18919(%rip), %rdi     # 0x1dfe8
leaq 0xfa86(%rip), %rsi      # 0x1515c
callq 0x42f0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42c0
leaq 0xfa7f(%rip), %rsi      # 0x1516c
movq %rax, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x4160
movl $0x1, %edi
callq 0x43d0
// File: /workspace/github_cpp_makefile_star2_O1/ahupowerdns[P]spamidea/getsender.cc
// Function: processDir(boost::filesystem::path const&)
void processDir(const boost::filesystem::path& p)
{
  for (auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(p), {}))
    if (boost::filesystem::is_regular_file(entry))
      processFile(entry);
    else if (boost::filesystem::is_directory(entry))
      processDir(entry);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5f34
movq $0x0, 0x18(%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x573d
lock
incl (%rax)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x574e
lock
incl (%rax)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
callq 0x14188
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x679a
leaq 0x8(%rsp), %rdi
callq 0x679a
leaq 0x18(%rsp), %rdi
callq 0x679a
leaq 0x20(%rsp), %rdi
callq 0x679a
movq 0x28(%rsp), %rax
movq %rax, (%rbx)
testq %rax, %rax
je 0x5799
lock
incl (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x57ab
lock
incl (%rax)
leaq 0x30(%rsp), %rbx
movq %rsp, %r14
leaq 0x8(%rsp), %r15
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
cmpq %rax, %rcx
je 0x582f
testq %rcx, %rcx
je 0x57d2
cmpq $0x0, 0x38(%rcx)
jne 0x57de
testq %rax, %rax
je 0x582f
cmpq $0x0, 0x38(%rax)
je 0x582f
movq %r14, %rdi
callq 0x6d90
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x4550
cmpl $0x2, 0x8(%rsp)
jne 0x5807
movq %r12, %rdi
callq 0x5693
jmp 0x5823
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4550
cmpl $0x3, 0x8(%rsp)
jne 0x5823
movq %r12, %rdi
callq 0x5707
movq %r14, %rdi
xorl %esi, %esi
callq 0x4420
jmp 0x57b8
leaq 0x10(%rsp), %rdi
callq 0x679a
movq %rsp, %rdi
callq 0x679a
movq %rbx, %rdi
callq 0x679a
leaq 0x28(%rsp), %rdi
callq 0x679a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
callq 0x679a
leaq 0x8(%rsp), %rdi
callq 0x679a
leaq 0x18(%rsp), %rdi
callq 0x679a
leaq 0x20(%rsp), %rdi
jmp 0x58a9
jmp 0x5887
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x679a
movq %rsp, %rdi
callq 0x679a
movq %rbx, %rdi
callq 0x679a
leaq 0x28(%rsp), %rdi
callq 0x679a
movq %r14, %rdi
callq 0x4520
// File: /workspace/github_cpp_makefile_star2_O1/ahupowerdns[P]spamidea/getsender.cc
// Function: main
int main(int argc, char**argv)
{
  for(int n = 1 ; n < argc; ++n) {
    boost::filesystem::path p(argv[n]);
    if (boost::filesystem::exists(p)) {
      if (boost::filesystem::is_regular_file(p))
        processFile(p);
      else if (boost::filesystem::is_directory(p)) {
        processDir(p);
      }
    }
  }
  
  ofstream plot2("plot2.dot");
  plot2 << "digraph { " <<endl;
  g_mtn.emitLinks(plot2);
  plot2 << "}"<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
cmpl $0x2, %edi
jl 0x5961
movq %rsi, %rbx
leaq 0x18(%rsp), %r12
movl %edi, %r13d
movl $0x1, %ebp
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq (%rbx,%rbp,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x62a0
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4480
cmpl $0x2, (%rsp)
jb 0x5942
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4480
cmpl $0x2, (%rsp)
jne 0x5927
movq %r14, %rdi
callq 0x5693
jmp 0x5942
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4480
cmpl $0x3, (%rsp)
jne 0x5942
movq %r14, %rdi
callq 0x5707
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5959
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
incq %rbp
cmpq %rbp, %r13
jne 0x58e8
leaq 0xf811(%rip), %rsi      # 0x15179
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x10, %edx
callq 0x4360
leaq 0xf802(%rip), %rsi      # 0x15183
movl $0xa, %edx
movq %rbx, %rdi
callq 0x4390
movq 0x8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42e0
movsbl %al, %esi
leaq 0x8(%rsp), %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4210
leaq 0x18d48(%rip), %rdi     # 0x1e708
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x5f64
leaq 0xf7bb(%rip), %rsi      # 0x1518e
leaq 0x8(%rsp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x4390
movq 0x8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42e0
movsbl %al, %esi
leaq 0x8(%rsp), %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4210
movq 0x18579(%rip), %rax     # 0x1df90
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x4290
leaq 0x100(%rsp), %rdi
callq 0x40f0
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4470
jmp 0x5a7f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5a7f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x4520
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/MonteCarlo.cpp
// Function: monteCarloSolve(int, int, int, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
int monteCarloSolve(int n, int runs, int display_level,
    std::vector<int> &scores, std::vector<int> &highest_tiles) {

    int successes = 0;
    for (int i = 0; i < n; ++i) {
        std::pair<int, int> result = monteCarloSimulateGame(runs, display_level, Game());
        if (result.first >= WIN) {
            successes++;
        }
        highest_tiles.push_back(result.first);
        scores.push_back(result.second);
    }
    return successes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0x14(%rsp)
movl %esi, 0x10(%rsp)
testl %edi, %edi
jle 0x2d0e
movq %r8, %rbx
movq %rcx, %r14
movl %edi, %r13d
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2e66
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movq %r15, %rdx
callq 0x29ef
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2e18
movl 0x8(%rsp), %eax
xorl %r15d, %r15d
cmpl $0x800, %eax            # imm = 0x800
setge %bpl
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2cc9
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2cd6
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x35e2
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x2cf0
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x2cfd
movq %r14, %rdi
leaq 0xc(%rsp), %rdx
callq 0x35e2
movb %bpl, %r15b
addl %r15d, %r12d
decl %r13d
jne 0x2c77
jmp 0x2d11
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2e18
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/include/Game.hpp
// Function: Game::Game()
Game() : score(0), state{{0, 0, 0, 0}, 
                                 {0, 0, 0, 0}, 
                                 {0, 0, 0, 0}, 
                                 {0, 0, 0, 0}} {
            addNew();
            addNew();
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r15
movl $0x0, (%rdi)
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rcx
movl $0x4, %edx
movq %r14, %rdi
callq 0x2dd2
leaq 0x28(%rsp), %rbx
leaq 0x90(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0xe(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x40(%rsp), %rbx
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0xd(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x58(%rsp), %rbx
leaq 0x70(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0xc(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x8(%r15), %r12
leaq 0x10(%rsp), %rsi
leaq 0xb(%rsp), %rcx
movl $0x4, %edx
movq %r12, %rdi
callq 0x2fd6
movl $0x60, %ebx
movq -0x8(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x2f45
movq 0x8(%rsp,%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $-0x18, %rbx
jne 0x2f2e
movq %r15, %rdi
callq 0x6282
movq %r15, %rdi
callq 0x6282
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2300
movb $0x1, %al
jmp 0x2f93
jmp 0x2f84
jmp 0x2f84
movq %rax, %r15
xorl %eax, %eax
jmp 0x2f93
movq %rax, %r15
xorl %eax, %eax
movq %r14, %rbx
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0x2fcd
leaq 0x10(%rsp), %r14
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2fb7
movq -0x8(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $-0x18, %rbx
cmpq %r14, %rbx
jne 0x2fa2
jmp 0x2fcd
movq %rax, %r15
movq %r12, %rdi
callq 0x2e18
movq %r15, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Minimax.cpp
// Function: minimaxSolve(int, int, int, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
int minimaxSolve(int n, int depth, int display_level, 
    std::vector<int> &scores, std::vector<int> &highest_tiles) {

    int successes = 0;
    for (int i = 0; i < n; ++i) {
        std::pair<int, int> result = minimaxSearch(depth, display_level, Game());
        if (result.first >= WIN) {
            successes++;
        }
        highest_tiles.push_back(result.first);
        scores.push_back(result.second);
    }
    return successes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0x14(%rsp)
movl %esi, 0x10(%rsp)
testl %edi, %edi
jle 0x3ddc
movq %r8, %rbx
movq %rcx, %r14
movl %edi, %r13d
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2e66
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movq %r15, %rdx
callq 0x38c5
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2e18
movl 0x8(%rsp), %eax
xorl %r15d, %r15d
cmpl $0x800, %eax            # imm = 0x800
setge %bpl
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x3d97
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x3da4
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x35e2
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x3dbe
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x3dcb
movq %r14, %rdi
leaq 0xc(%rsp), %rdx
callq 0x35e2
movb %bpl, %r15b
addl %r15d, %r12d
decl %r13d
jne 0x3d45
jmp 0x3ddf
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2e18
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Main.cpp
// Function: CmdParser::getCmdOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
const std::string& getCmdOption(const std::string &opt) const {
            std::vector<std::string>::const_iterator itr;
            itr =  std::find(cmds.begin(), cmds.end(), opt);
            if (itr != cmds.end() && ++itr != cmds.end()){
                return *itr;
            }
            static const std::string empty_string("");
            return empty_string;
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
callq 0x59bf
movq %rax, %rbx
movq 0x8(%r14), %rax
cmpq %rax, %rbx
setne %cl
addq $0x20, %rbx
cmpq %rax, %rbx
setne %al
testb %al, %cl
jne 0x5602
movb 0x8bc1(%rip), %al       # 0xe1b8
leaq 0x8b9a(%rip), %rbx      # 0xe198
testb %al, %al
je 0x560d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x8ba4(%rip), %rdi      # 0xe1b8
callq 0x22d0
testl %eax, %eax
je 0x5602
leaq 0x8b84(%rip), %rax      # 0xe1a8
movq %rax, 0x8b6d(%rip)      # 0xe198
leaq 0x8b66(%rip), %rbx      # 0xe198
leaq 0x4a52(%rip), %rdx      # 0xa08b
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x5bfc
movq 0x897d(%rip), %rdi      # 0xdfc8
leaq 0x8b2e(%rip), %rdx      # 0xe180
movq %rbx, %rsi
callq 0x2160
leaq 0x8b57(%rip), %rdi      # 0xe1b8
callq 0x2100
jmp 0x5602
movq %rax, %rbx
leaq 0x8b46(%rip), %rdi      # 0xe1b8
callq 0x20f0
movq %rbx, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: numDigits(int)
int numDigits(int32_t x)
{
    if (x >= 10000) {
        if (x >= 10000000) {
            if (x >= 100000000) {
                if (x >= 1000000000)
                    return 10;
                return 9;
            }
            return 8;
        }
        if (x >= 100000) {
            if (x >= 1000000)
                return 7;
            return 6;
        }
        return 5;
    }
    if (x >= 100) {
        if (x >= 1000)
            return 4;
        return 3;
    }
    if (x >= 10)
        return 2;
    return 1;
}

// Assembly:
cmpl $0x2710, %edi           # imm = 0x2710
jl 0x6248
cmpl $0x989680, %edi         # imm = 0x989680
jl 0x625c
movl $0x8, %eax
cmpl $0x5f5e100, %edi        # imm = 0x5F5E100
jl 0x6280
xorl %eax, %eax
cmpl $0x3b9aca00, %edi       # imm = 0x3B9ACA00
setge %al
addl $0x9, %eax
retq
xorl %eax, %eax
cmpl $0x64, %edi
jl 0x6278
cmpl $0x3e8, %edi            # imm = 0x3E8
setge %al
addl $0x3, %eax
retq
movl $0x5, %eax
cmpl $0x186a0, %edi          # imm = 0x186A0
jl 0x6280
xorl %eax, %eax
cmpl $0xf4240, %edi          # imm = 0xF4240
setge %al
orl $0x6, %eax
retq
cmpl $0xa, %edi
setge %al
incl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::addNew()
void Game::addNew() {
    // Create vector of empty tiles
    std::vector<std::pair<int, int>> empty_tiles;
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            if (state[i][j] == 0) {
                empty_tiles.push_back(std::pair<int, int>(i, j));
            }
        }
    }

    int size = empty_tiles.size();
    if (size > 0) {
        // Get random empty tile coordinates
        std::pair<int, int> choice = empty_tiles[DISTS[size-1](rng)];

        // Generating a random value of 2 or 4 (weighted probability)
        if (DISTS[9](rng) > 0) {
            state[choice.first][choice.second] = 2;
        }
        else {
            state[choice.first][choice.second] = 4;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
leaq (%r12,%r12,2), %r13
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r13,8), %rax
cmpl $0x0, (%rax,%rbp,4)
jne 0x62d7
movl %r12d, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7a2a
incq %rbp
cmpq $0x4, %rbp
jne 0x62b5
incq %r12
cmpq $0x4, %r12
jne 0x62af
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x3, %rax
testl %eax, %eax
jle 0x635b
decl %eax
leaq 0xa5dc(%rip), %rcx      # 0x108e0
leaq (%rcx,%rax,8), %rdi
leaq 0x9241(%rip), %rsi      # 0xf550
movq %rdi, %rdx
callq 0x33aa
cltq
movq 0x10(%rsp), %rcx
movslq (%rcx,%rax,8), %r15
movslq 0x4(%rcx,%rax,8), %r14
leaq 0x9222(%rip), %rsi      # 0xf550
leaq 0xa5f3(%rip), %rdi      # 0x10928
movq %rdi, %rdx
callq 0x33aa
xorl %ecx, %ecx
testl %eax, %eax
setle %cl
movq 0x8(%rbx), %rax
leaq (%r15,%r15,2), %rdx
movq (%rax,%rdx,8), %rax
leal 0x2(,%rcx,2), %ecx
movl %ecx, (%rax,%r14,4)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6372
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6383
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x639d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::canContinue() const
bool Game::canContinue() const {
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            if (state[i][j] == 0)
                return true;
            if ((i < (DIM-1) && state[i][j] == state[i + 1][j]) || 
                (j < (DIM-1) && state[i][j] == state[i][j + 1]))    // If adj. hor/ver match
                return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rcx
leaq 0x18(%rcx), %rdx
movb $0x1, %al
xorl %esi, %esi
leaq (,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
movq (%rcx,%rdi), %r8
movl (%r8), %r10d
testl %r10d, %r10d
je 0x642d
addq %rdx, %rdi
xorl %r9d, %r9d
xorl %r11d, %r11d
cmpq $0x3, %rsi
je 0x63e3
movq (%rdi), %rbx
cmpl (%rbx,%r11,4), %r10d
je 0x6413
cmpq $0x3, %r11
je 0x63f0
cmpl 0x4(%r8,%r11,4), %r10d
je 0x6413
leaq 0x1(%r11), %rbx
cmpq $0x4, %rbx
je 0x6419
leaq -0x1(%rbx), %r9
cmpq $0x3, %r9
setae %r9b
movl 0x4(%r8,%r11,4), %r10d
movq %rbx, %r11
testl %r10d, %r10d
jne 0x63d4
testb $0x1, %r9b
je 0x642d
cmpq $0x3, %rsi
leaq 0x1(%rsi), %rdi
setb %al
movq %rdi, %rsi
cmpq $0x4, %rdi
jne 0x63b3
andb $0x1, %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::up(bool)
void Game::up(bool peak) {
    board prev_state = state;
    mergeUp();
    compressUp(peak);
    if (state != prev_state && !peak) {
        addNew();
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
movq %rsp, %rdi
callq 0x2d38
movq %rbx, %rdi
callq 0x6a94
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6bc4
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
movq %rsi, %rax
subq %rdi, %rax
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
subq %rdx, %rcx
cmpq %rcx, %rax
jne 0x678b
callq 0x331e
jmp 0x678d
xorl %eax, %eax
orb %al, %bpl
jne 0x679a
movq %rbx, %rdi
callq 0x6282
movq %rsp, %rdi
callq 0x2e18
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2e18
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::mergeUp()
void Game::mergeUp() {
    for (int col = 0; col < DIM; ++col) {
        std::vector<int> merged_column;
        for (int i = 0; i < DIM; ++i) {
            if (state[i][col] != 0) {
                merged_column.push_back(state[i][col]);
            }            
        }
        while (merged_column.size() < DIM) {
            merged_column.push_back(0);
        }
        for (int i = 0; i < DIM; ++i) {
            state[i][col] = merged_column[i];
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %r12d, %r12d
movq %rsp, %r14
leaq 0x1c(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq 0x8(%rbx), %rax
movq (%rax,%r13), %rax
movl (%rax,%r12,4), %ecx
testl %ecx, %ecx
je 0x6af7
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6aeb
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6af7
leaq (%rax,%r12,4), %rdx
movq %r14, %rdi
callq 0x35e2
addq $0x18, %r13
cmpq $0x60, %r13
jne 0x6ac2
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0xf, %rax
ja 0x6b56
movl $0x0, 0x1c(%rsp)
cmpq 0x10(%rsp), %rsi
je 0x6b36
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6b41
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x10, %rax
jb 0x6b16
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
movl (%rdi,%rcx,4), %edx
movq (%rax), %rsi
movl %edx, (%rsi,%r12,4)
incq %rcx
addq $0x18, %rax
cmpq $0x4, %rcx
jne 0x6b5c
testq %rdi, %rdi
je 0x6b85
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
incq %r12
cmpq $0x4, %r12
jne 0x6aaf
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x6ba2
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6bbb
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::hamburgerFlip()
void Game::hamburgerFlip() {
    board flipped_state = {{}, {}, {}, {}};
    for (int row = (DIM-1), i = 0; row >= 0; --row, ++i) {
        flipped_state[i] = state[row];
    }
    state = flipped_state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movl $0x4, %edx
callq 0x2fd6
movl $0x60, %r14d
movq 0x8(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x6ff1
movq 0x18(%rsp,%r14), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $-0x18, %r14
jne 0x6fda
movl $0x48, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq 0x8(%rsp), %rdi
addq %r15, %rdi
callq 0x7770
addq $-0x18, %r14
addq $0x18, %r15
cmpq $-0x18, %r14
jne 0x7000
addq $0x8, %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7846
leaq 0x8(%rsp), %rdi
callq 0x2e18
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x7063
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x23fa
jmp 0x7070
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2e18
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::transpose()
void Game::transpose() {
    board transposed_state = {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}};
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            transposed_state[i][j] = state[j][i];
        }
    }
    state = transposed_state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x20(%rsp), %r14
leaq 0x7(%rsp), %rcx
movl $0x4, %edx
movq %r14, %rdi
callq 0x2dd2
leaq 0x38(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x6(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x50(%rsp), %rbx
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x5(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x68(%rsp), %rbx
leaq 0x80(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x4(%rsp), %rcx
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2dd2
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x3(%rsp), %rcx
movl $0x4, %edx
callq 0x2fd6
movl $0x60, %ebx
movq 0x8(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x7150
movq 0x18(%rsp,%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $-0x18, %rbx
jne 0x7139
movq 0x8(%r15), %rax
movq 0x8(%rsp), %rcx
xorl %edx, %edx
leaq (%rdx,%rdx,2), %rsi
movq (%rcx,%rsi,8), %rsi
movq %rax, %rdi
xorl %r8d, %r8d
movq (%rdi), %r9
movl (%r9,%rdx,4), %r9d
movl %r9d, (%rsi,%r8,4)
incq %r8
addq $0x18, %rdi
cmpq $0x4, %r8
jne 0x716f
incq %rdx
cmpq $0x4, %rdx
jne 0x7161
addq $0x8, %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x7846
leaq 0x8(%rsp), %rdi
callq 0x2e18
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x2e18
jmp 0x7220
movq %rax, %r15
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x242a
movb $0x1, %al
jmp 0x71f3
jmp 0x71e4
jmp 0x71e4
movq %rax, %r15
xorl %eax, %eax
jmp 0x71f3
movq %rax, %r15
xorl %eax, %eax
movq %r14, %rbx
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0x7220
leaq 0x20(%rsp), %r14
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x7217
movq -0x8(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
addq $-0x18, %rbx
cmpq %r14, %rbx
jne 0x7202
movq %r15, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::getHighestTile() const
int Game::getHighestTile() const {
    int highest_tile = 2;
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            if (state[i][j] > highest_tile) {
                highest_tile = state[i][j];
            }
        }
    }
    return highest_tile;
}

// Assembly:
movq 0x8(%rdi), %rcx
movl $0x2, %eax
xorl %edx, %edx
leaq (%rdx,%rdx,2), %rsi
movq (%rcx,%rsi,8), %rsi
xorl %edi, %edi
movl (%rsi,%rdi,4), %r8d
cmpl %eax, %r8d
cmovgl %r8d, %eax
incq %rdi
cmpq $0x4, %rdi
jne 0x723d
incq %rdx
cmpq $0x4, %rdx
jne 0x7233
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::getNumberEmpty(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&)
int Game::getNumberEmpty(const board &game_state) {
    int sum = 0;
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            if (game_state[i][j] == 0) {
                sum += 1;
            }
        }
    }
    return sum;
}

// Assembly:
movq (%rdi), %rcx
xorl %edx, %edx
xorl %eax, %eax
leaq (%rdx,%rdx,2), %rsi
movq (%rcx,%rsi,8), %rsi
xorl %edi, %edi
cmpl $0x1, (%rsi,%rdi,4)
adcl $0x0, %eax
incq %rdi
cmpq $0x4, %rdi
jne 0x726d
incq %rdx
cmpq $0x4, %rdx
jne 0x7263
retq
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Expectimax.cpp
// Function: expectimaxSolve(int, int, int, std::vector<int, std::allocator<int>>*, std::vector<int, std::allocator<int>>*)
int expectimaxSolve(int n, int depth, int display_level, 
    std::vector<int> *scores, std::vector<int> *highest_tiles) {

    int successes = 0;
    for (int i = 0; i < n; ++i) {
        std::pair<int, int> result = expectimaxSearch(depth, display_level, Game());
        if (result.first >= WIN) {
            successes++;
        }
        (*highest_tiles).push_back(result.first);
        (*scores).push_back(result.second);
    }
    return successes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, 0x14(%rsp)
movl %esi, 0x10(%rsp)
testl %edi, %edi
jle 0x8e3f
movq %r8, %rbx
movq %rcx, %r14
movl %edi, %r13d
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2e66
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movq %r15, %rdx
callq 0x88a9
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2e18
movl 0x8(%rsp), %eax
xorl %r15d, %r15d
cmpl $0x800, %eax            # imm = 0x800
setge %bpl
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8dfa
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x8e07
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x35e2
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x8e21
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x8e2e
movq %r14, %rdi
leaq 0xc(%rsp), %rdx
callq 0x35e2
movb %bpl, %r15b
addl %r15d, %r12d
decl %r13d
jne 0x8da8
jmp 0x8e42
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2e18
movq %rbx, %rdi
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/NathanWine[P]2048-AI-Solvers/src/Heuristics.cpp
// Function: Heuristics::get_snake(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&)
float Heuristics::get_snake(const board &state) {        // Perhaps this should be normalized and multiplied by a weight instead? Becomes the only factor at high value tiles
    float snake_total = 0.0;
    for (int i = 0; i < DIM; ++i) {
        for (int j = 0; j < DIM; ++j) {
            snake_total += state[i][j] * snake_weights[i][j];
        }
    }
    return snake_total;
}

// Assembly:
movq (%rdi), %rax
xorps %xmm0, %xmm0
leaq 0x16af(%rip), %rcx      # 0xa670
xorl %edx, %edx
leaq (%rdx,%rdx,2), %rsi
movq (%rax,%rsi,8), %rsi
xorl %edi, %edi
xorps %xmm1, %xmm1
cvtsi2ssl (%rsi,%rdi,4), %xmm1
mulss (%rcx,%rdi,4), %xmm1
addss %xmm1, %xmm0
incq %rdi
cmpq $0x4, %rdi
jne 0x8fcd
incq %rdx
addq $0x10, %rcx
cmpq $0x4, %rdx
jne 0x8fc3
retq
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/units/redirect/redirect_cli.c
// Function: test_hash
void test_hash()
{
  rdint_t in_n = 250 * 1000 * 1000;
  double *in_v = malloc(in_n * sizeof(*in_v));
  vector_init(in_v, in_n, 1, 1.0, NAN);

  rdint_t size = in_n * sizeof(*in_v);

  double t = z_time_wtime();
  redirect_call_hash_param_array_double(in_v, in_n);
  t = z_time_wtime() - t;

  printf("test_hash: size: %" rdint_fmt ", time: %f, rate: %f\n", size, t, (double) size / t * 1e-6);

  free(in_v);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl $0x77359400, %edi       # imm = 0x77359400
callq 0xb6f0
movq %rax, %rbx
movsd 0x5c520(%rip), %xmm0    # 0x69008
movsd 0x5c520(%rip), %xmm1    # 0x69010
movl $0xee6b280, %esi        # imm = 0xEE6B280
movl $0x1, %edx
movq %rax, %rdi
callq 0xdb04
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0xb480
xorps %xmm0, %xmm0
cvtsi2sdq (%r14), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x8(%r14), %xmm1
mulsd 0x5c4eb(%rip), %xmm1    # 0x69018
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movl $0xee6b280, %esi        # imm = 0xEE6B280
movq %rbx, %rdi
callq 0x119d0
leaq 0x8(%rsp), %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0xb480
xorps %xmm1, %xmm1
cvtsi2sdq (%r14), %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r14), %xmm0
mulsd 0x5c4aa(%rip), %xmm0    # 0x69018
addsd %xmm1, %xmm0
subsd (%rsp), %xmm0
movsd 0x5c4a1(%rip), %xmm1    # 0x69020
divsd %xmm0, %xmm1
mulsd 0x5c49d(%rip), %xmm1    # 0x69028
leaq 0x5c4b6(%rip), %rdi     # 0x69048
movl $0x77359400, %esi       # imm = 0x77359400
movb $0x2, %al
callq 0xb080
movq %rbx, %rdi
callq 0xb650
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/units/redirect/redirect_cli.c
// Function: test_result
void test_result(const char *uri)
{
  redirect_call_t rc;

  redirect_call_create_scdc(&rc, "result", uri);

  redirect_call_execute(&rc);

  TRACE_F("result: '%s'", redirect_call_get_result_str(&rc, NULL, 0));

  redirect_call_destroy_scdc(&rc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xbb0, %rsp            # imm = 0xBB0
movq %rdi, %rdx
leaq 0x5f9cc(%rip), %rsi     # 0x6c590
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xf8ec
movq %rbx, %rdi
callq 0xfa40
movq 0x7f3c2(%rip), %r15     # 0x8bfa0
movq (%r15), %rdi
leaq 0x5c48a(%rip), %rsi     # 0x69072
leaq 0x5c496(%rip), %rdx     # 0x69085
xorl %eax, %eax
callq 0xb7a0
movq (%r15), %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10ace
leaq 0x5cb45(%rip), %rsi     # 0x69751
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r15), %rsi
movl $0xa, %edi
callq 0xb690
movq %rbx, %rdi
callq 0xf9b1
addq $0xbb0, %rsp            # imm = 0xBB0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/units/redirect/redirect_cli.c
// Function: test_param_matrix
void test_param_matrix(const char *uri)
{
  redirect_call_t rc;

  redirect_call_create_scdc(&rc, "param_matrix", uri);

  /* double ohne/mit stride */

  redirect_call_execute(&rc);

  TRACE_F("result: '%s'", redirect_call_get_result_str(&rc, NULL, 0));

  redirect_call_destroy_scdc(&rc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xbb0, %rsp            # imm = 0xBB0
movq %rdi, %rdx
leaq 0x5bbba(%rip), %rsi     # 0x69562
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xf8ec
movq %rbx, %rdi
callq 0xfa40
movq 0x7e5de(%rip), %r15     # 0x8bfa0
movq (%r15), %rdi
leaq 0x5b6a6(%rip), %rsi     # 0x69072
leaq 0x5b996(%rip), %rdx     # 0x69369
xorl %eax, %eax
callq 0xb7a0
movq (%r15), %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10ace
leaq 0x5bd61(%rip), %rsi     # 0x69751
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r15), %rsi
movl $0xa, %edi
callq 0xb690
movq %rbx, %rdi
callq 0xf9b1
addq $0xbb0, %rsp            # imm = 0xBB0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/units/redirect/redirect_cli.c
// Function: main
int main(int argc, char *argv[])
{
  scdc_init(SCDC_INIT_DEFAULT);

  TRACE_F("dataprov open");
  scdc_dataprov_t dp = scdc_dataprov_open(REDIRECT_TEST_SCDC_PATH, "hook", &redirect_test_hook);

#if 1
  const char *uri = "scdc:/" REDIRECT_TEST_SCDC_PATH;
#else
  const char *uri = "scdc+uds://redirect/" REDIRECT_TEST_SCDC_PATH;
#endif

#if TEST_HASH
  test_hash();
#endif

#if TEST_RESULT
  test_result(uri);
#endif

#if TEST_CONF
  test_conf(uri);
#endif

#if TEST_CACHE && REDIRECT_CALL_PARAMS_CACHE
  test_cache(uri);
#endif

#if TEST_PARAM_ARRAY
  test_param_array(uri);
#endif

#if TEST_PARAM_VECTOR
  test_param_vector(uri);
#endif

#if TEST_PARAM_MATRIX
  test_param_matrix(uri);
#endif

  TRACE_F("dataprov close");
  scdc_dataprov_close(dp);

  scdc_release();

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5dadf(%rip), %rdi     # 0x6b50d
xorl %eax, %eax
callq 0x19165
movq 0x7e564(%rip), %r12     # 0x8bfa0
movq (%r12), %rdi
leaq 0x5b62b(%rip), %rbx     # 0x69072
leaq 0x5b92d(%rip), %r14     # 0x6937b
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r12), %rcx
leaq 0x5b91a(%rip), %rdi     # 0x69380
movl $0xd, %esi
movl $0x1, %edx
callq 0xba90
movq (%r12), %rsi
movl $0xa, %edi
callq 0xb690
leaq 0x5b90a(%rip), %rdi     # 0x69394
leaq 0x5ee07(%rip), %rsi     # 0x6c898
leaq 0x7c0d0(%rip), %rdx     # 0x89b68
xorl %eax, %eax
callq 0x19527
movq %rax, %r15
leaq 0x5b8e5(%rip), %rdi     # 0x6938e
callq 0xd41e
movq (%r12), %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r12), %rcx
leaq 0x5b8d3(%rip), %rdi     # 0x6939d
movl $0xe, %esi
movl $0x1, %edx
callq 0xba90
movq (%r12), %rsi
movl $0xa, %edi
callq 0xb690
movq %r15, %rdi
callq 0x19622
callq 0x1926a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop