LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::curl_path(char const*, bool)
inline const char *curl_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        if (!path_found) {
          std::strcpy(st_path,".\\curl.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"curl.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./curl");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"curl");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x7bb6
movq 0x287a4(%rip), %rdi     # 0x30348
testq %rdi, %rdi
je 0x7bae
callq 0x3370
andq $0x0, 0x28792(%rip)     # 0x30348
movq 0x2878b(%rip), %r14     # 0x30348
testq %rbx, %rbx
je 0x7bfc
testq %r14, %r14
jne 0x7bdb
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x2876d(%rip)     # 0x30348
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x7c61
testq %r14, %r14
jne 0x7c61
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x28733(%rip)     # 0x30348
leaq 0x7(%rax), %rdi
movl $0x3f9, %edx            # imm = 0x3F9
xorl %esi, %esi
callq 0x3150
movl $0x75632f2e, (%rbx)     # imm = 0x75632F2E
movl $0x6c7275, 0x3(%rbx)    # imm = 0x6C7275
leaq 0x1aa5d(%rip), %rsi     # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x7c50
movq %rax, %rdi
callq 0x7982
jmp 0x7c61
movq 0x286f1(%rip), %rax     # 0x30348
movb $0x0, 0x4(%rax)
movl $0x6c727563, (%rax)     # imm = 0x6C727563
movq 0x286e0(%rip), %rax     # 0x30348
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::wget_path(char const*, bool)
inline const char *wget_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        if (!path_found) {
          std::strcpy(st_path,".\\wget.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"wget.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./wget");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"wget");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x7c94
movq 0x286ce(%rip), %rdi     # 0x30350
testq %rdi, %rdi
je 0x7c8c
callq 0x3370
andq $0x0, 0x286bc(%rip)     # 0x30350
movq 0x286b5(%rip), %r14     # 0x30350
testq %rbx, %rbx
je 0x7cda
testq %r14, %r14
jne 0x7cb9
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x28697(%rip)     # 0x30350
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x7d3f
testq %r14, %r14
jne 0x7d3f
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x2865d(%rip)     # 0x30350
leaq 0x7(%rax), %rdi
movl $0x3f9, %edx            # imm = 0x3F9
xorl %esi, %esi
callq 0x3150
movl $0x67772f2e, (%rbx)     # imm = 0x67772F2E
movl $0x746567, 0x3(%rbx)    # imm = 0x746567
leaq 0x1a97f(%rip), %rsi     # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x7d2e
movq %rax, %rdi
callq 0x7982
jmp 0x7d3f
movq 0x2861b(%rip), %rax     # 0x30350
movb $0x0, 0x4(%rax)
movl $0x74656777, (%rax)     # imm = 0x74656777
movq 0x2860a(%rip), %rax     # 0x30350
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::gunzip_path(char const*, bool)
inline const char *gunzip_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        if (!path_found) {
          std::strcpy(st_path,".\\gunzip.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"gunzip.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./gunzip");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"gunzip");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x7d72
movq 0x285f8(%rip), %rdi     # 0x30358
testq %rdi, %rdi
je 0x7d6a
callq 0x3370
andq $0x0, 0x285e6(%rip)     # 0x30358
movq 0x285df(%rip), %r14     # 0x30358
testq %rbx, %rbx
je 0x7db8
testq %r14, %r14
jne 0x7d97
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x285c1(%rip)     # 0x30358
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x7e24
testq %r14, %r14
jne 0x7e24
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x28587(%rip)     # 0x30358
leaq 0x9(%rax), %rdi
movl $0x3f7, %edx            # imm = 0x3F7
xorl %esi, %esi
callq 0x3150
movabsq $0x70697a6e75672f2e, %rax # imm = 0x70697A6E75672F2E
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
leaq 0x1a89d(%rip), %rsi     # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x7e10
movq %rax, %rdi
callq 0x7982
jmp 0x7e24
movq 0x28541(%rip), %rax     # 0x30358
movl $0x70697a, 0x3(%rax)    # imm = 0x70697A
movl $0x7a6e7567, (%rax)     # imm = 0x7A6E7567
movq 0x2852d(%rip), %rax     # 0x30358
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::CImg<unsigned char>::CImg(unsigned int, unsigned int, unsigned int, unsigned int)
explicit CImg(const unsigned int size_x, const unsigned int size_y=1, const unsigned int size_z=1, const unsigned int size_c=1):
      _is_shared(false) {
      const unsigned long siz = (unsigned long)size_x*size_y*size_z*size_c;
      if (siz) {
        _width = size_x; _height = size_y; _depth = size_z; _spectrum = size_c;
        try { _data = new T[siz]; } catch (...) {
          _width = _height = _depth = _spectrum = 0; _data = 0;
          throw CImgInstanceException(_cimg_instance
                                      "CImg(): Failed to allocate memory (%s) for image (%u,%u,%u,%u).",
                                      cimg_instance,
                                      cimg::strbuffersize(sizeof(T)*size_x*size_y*size_z*size_c),size_x,size_y,size_z,size_c);
        }
      } else { _width = _height = _depth = _spectrum = 0; _data = 0; }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r15d
movq %rdi, %rbp
movb $0x0, 0x10(%rdi)
movl %esi, %eax
movl %edx, %ecx
imulq %rax, %rcx
movl %r15d, %eax
movl %r8d, %r13d
imulq %rax, %r13
imulq %rcx, %r13
testq %r13, %r13
je 0xf6d1
movl %r8d, %r12d
movl %edx, %r14d
movl %esi, %ebx
movl %esi, (%rbp)
movl %edx, 0x4(%rbp)
movl %r15d, 0x8(%rbp)
movl %r8d, 0xc(%rbp)
movq %r13, %rdi
callq 0x3040
movq %rax, 0x18(%rbp)
jmp 0xf6dd
andq $0x0, 0x18(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x30d0
andq $0x0, 0x18(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, 0x18(%rsp)
movl (%rbp), %eax
movl %eax, 0x14(%rsp)
movl 0x4(%rbp), %eax
movl %eax, 0x10(%rsp)
movl 0x8(%rbp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rbp), %eax
movl %eax, 0x8(%rsp)
movq 0x18(%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x15ce4(%rip), %rax     # 0x2541f
leaq 0x12d8d(%rip), %rcx     # 0x224cf
cmpb $0x0, 0x10(%rbp)
cmovneq %rax, %rcx
movq %rcx, %rbp
movq %r13, %rdi
callq 0x83b2
movq %rax, %r10
leaq 0x12f2b(%rip), %r11     # 0x2268a
leaq 0x13b56(%rip), %rsi     # 0x232bc
movq 0x18(%rsp), %rdi
movq %rdi, %r13
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x8(%rsp), %r9d
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r10
pushq %r11
pushq %rbp
pushq 0x58(%rsp)
callq 0x8496
addq $0x40, %rsp
leaq 0x2057e(%rip), %rsi     # 0x2fd20
movq 0x2082f(%rip), %rdx     # 0x2ffd8
movq %r13, %rdi
callq 0x34e0
movq %rax, %rbx
jmp 0xf7c1
movq %rax, %rbx
movq %r13, %rdi
callq 0x31d0
callq 0x34d0
movq %rbx, %rdi
callq 0x3500
movq %rax, %rdi
callq 0x4391
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::dcraw_path(char const*, bool)
inline const char *dcraw_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        if (!path_found) {
          std::strcpy(st_path,".\\dcraw.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"dcraw.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./dcraw");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"dcraw");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x13198
movq 0x1d2da(%rip), %rdi     # 0x30460
testq %rdi, %rdi
je 0x13190
callq 0x3370
andq $0x0, 0x1d2c8(%rip)     # 0x30460
movq 0x1d2c1(%rip), %r14     # 0x30460
testq %rbx, %rbx
je 0x131de
testq %r14, %r14
jne 0x131bd
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x1d2a3(%rip)     # 0x30460
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x13245
testq %r14, %r14
jne 0x13245
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x1d269(%rip)     # 0x30460
leaq 0x8(%rax), %rdi
movl $0x3f8, %edx            # imm = 0x3F8
xorl %esi, %esi
callq 0x3150
movabsq $0x77617263642f2e, %rax # imm = 0x77617263642F2E
movq %rax, (%rbx)
leaq 0xf47b(%rip), %rsi      # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x13232
movq %rax, %rdi
callq 0x7982
jmp 0x13245
movq 0x1d227(%rip), %rax     # 0x30460
movw $0x77, 0x4(%rax)
movl $0x61726364, (%rax)     # imm = 0x61726364
movq 0x1d214(%rip), %rax     # 0x30460
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::cimg::ffmpeg_path(char const*, bool)
inline const char *ffmpeg_path(const char *const user_path=0, const bool reinit_path=false) {
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_path,0,1024);
        bool path_found = false;
        std::FILE *file = 0;
#if cimg_OS==2
        if (!path_found) {
          std::strcpy(st_path,".\\ffmpeg.exe");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"ffmpeg.exe");
#else
        if (!path_found) {
          std::strcpy(st_path,"./ffmpeg");
          if ((file=std::fopen(st_path,"r"))!=0) { cimg::fclose(file); path_found = true; }
        }
        if (!path_found) std::strcpy(st_path,"ffmpeg");
#endif
        winformat_string(st_path);
      }
      return st_path;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x1f594
movq 0x10f36(%rip), %rdi     # 0x304b8
testq %rdi, %rdi
je 0x1f58c
callq 0x3370
andq $0x0, 0x10f24(%rip)     # 0x304b8
movq 0x10f1d(%rip), %r14     # 0x304b8
testq %rbx, %rbx
je 0x1f5da
testq %r14, %r14
jne 0x1f5b9
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %r14
movq %rax, 0x10eff(%rip)     # 0x304b8
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x1f646
testq %r14, %r14
jne 0x1f646
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, %rbx
movq %rax, 0x10ec5(%rip)     # 0x304b8
leaq 0x9(%rax), %rdi
movl $0x3f7, %edx            # imm = 0x3F7
xorl %esi, %esi
callq 0x3150
movabsq $0x6765706d66662f2e, %rax # imm = 0x6765706D66662F2E
movq %rax, (%rbx)
movb $0x0, 0x8(%rbx)
leaq 0x307b(%rip), %rsi      # 0x22696
movq %rbx, %rdi
callq 0x3340
testq %rax, %rax
je 0x1f632
movq %rax, %rdi
callq 0x7982
jmp 0x1f646
movq 0x10e7f(%rip), %rax     # 0x304b8
movl $0x676570, 0x3(%rax)    # imm = 0x676570
movl $0x706d6666, (%rax)     # imm = 0x706D6666
movq 0x10e6b(%rip), %rax     # 0x304b8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::colorComponent(kallaballa::NamedColor const&, int const&)
double colorComponent(const NamedColor& color, const int& k) {
  if(k == 0)
    return color.rgb & 0x0000ff;
  else if(k == 1)
    return (color.rgb & 0x00ff00) >> 8;
  else
    return (color.rgb & 0xff0000) >> 16;
}

// Assembly:
movl (%rsi), %ecx
movl (%rdi), %eax
testl %ecx, %ecx
je 0x20a35
cmpl $0x1, %ecx
jne 0x20a32
shrl $0x8, %eax
jmp 0x20a35
shrl $0x10, %eax
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::getNextLineAndSplitIntoTokens[abi:cxx11](std::istream&)
std::vector<string> getNextLineAndSplitIntoTokens(std::istream& str) {
  std::vector<string> result;
  string line;
  if(!std::getline(str, line))
    return {};

  std::stringstream lineStream(line);
  string cell;

  while (std::getline(lineStream, cell, ',')) {
    result.push_back(cell);
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rsi, %rax
movq %rdi, %rbx
andq $0x0, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x28(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x3060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x20a9b
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
jmp 0x20b27
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x3470
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %r14
leaq 0x38(%rsp), %r15
pushq $0x2c
popq %rbp
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x3550
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x20af6
movq %r12, %rdi
movq %r15, %rsi
callq 0x20cae
jmp 0x20ace
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x30f0
leaq 0x58(%rsp), %rdi
callq 0x31e0
leaq 0x18(%rsp), %rdi
callq 0x30f0
movq %rsp, %rdi
callq 0x20cda
movq %rbx, %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20b4e
movq %rax, %rbx
jmp 0x20b6a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x30f0
leaq 0x58(%rsp), %rdi
callq 0x31e0
leaq 0x18(%rsp), %rdi
callq 0x30f0
movq %rsp, %rdi
callq 0x20cda
movq %rbx, %rdi
callq 0x3500
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/NamedColorTable.cpp
// Function: kallaballa::NamedColorTable::readFromCSV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void NamedColorTable::readFromCSV(const string& filename) {
  std::ifstream ifs(filename);
  std::vector<string> row;
  NamedColor ralColor;
  while ((row = getNextLineAndSplitIntoTokens(ifs)).size() == 2) {
    ralColor.name = row[0];
    ralColor.rgb = strtol(row[1].substr(1).c_str(), NULL, 16);
    this->insert(ralColor);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %r14
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x34a0
xorps %xmm0, %xmm0
movq %rsp, %rcx
andq $0x0, 0x10(%rcx)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movaps %xmm0, (%rcx)
movb $0x0, (%rax)
leaq 0x40(%rsp), %r13
pushq $-0x1
popq %rbx
pushq $0x10
popq %r15
leaq 0x18(%rsp), %r12
movq %r13, %rdi
leaq 0x60(%rsp), %rsi
callq 0x20a3d
movq %rsp, %rdi
movq %r13, %rsi
callq 0x20f88
movq 0x8(%rsp), %rbp
subq (%rsp), %rbp
movq %r13, %rdi
callq 0x20cda
cmpq $0x40, %rbp
jne 0x20c53
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3140
movq (%rsp), %rsi
addq $0x20, %rsi
movq %r13, %rdi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x32e0
movq 0x40(%rsp), %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x33b0
movl %eax, 0x18(%rsp)
movq %r13, %rdi
callq 0x30f0
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20cfc
jmp 0x20bd5
leaq 0x20(%rsp), %rdi
callq 0x30f0
movq %rsp, %rdi
callq 0x20cda
leaq 0x60(%rsp), %rdi
callq 0x3070
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20c87
jmp 0x20c87
jmp 0x20c87
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30f0
movq %rsp, %rdi
callq 0x20cda
leaq 0x60(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3500
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::insert(kallaballa::NamedColor const&)
iterator
      insert(const_reference __V)
      {
        if (!_M_get_root())
          {
            _Link_type __n = _M_new_node(__V, &_M_header);
            ++_M_count;
            _M_set_root(__n);
            _M_set_leftmost(__n);
            _M_set_rightmost(__n);
            return iterator(__n);
          }
        return _M_insert(_M_get_root(), __V, 0);
      }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rcx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
je 0x20d22
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x21080
jmp 0x20d49
leaq 0x10(%r14), %rdx
movq %r14, %rdi
movq %rcx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20fda
incq 0x28(%r14)
movq %rax, 0x8(%r14)
movq %rax, 0x18(%r14)
movq %rax, 0x20(%r14)
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_new_node(kallaballa::NamedColor const&, KDTree::_Node_base*, KDTree::_Node_base*, KDTree::_Node_base*)
_Link_type
      _M_new_node(const_reference __V, //  = value_type(),
                  _Base_ptr const __PARENT = NULL,
                  _Base_ptr const __LEFT = NULL,
                  _Base_ptr const __RIGHT = NULL)
      {
         typename _Base::NoLeakAlloc noleak(this);
         _Link_type new_node = noleak.get();
	 _Base::_M_construct_node(new_node, __V, __PARENT, __LEFT, __RIGHT);
         noleak.disconnect();
         return new_node;
      }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, 0x8(%rsp)
pushq $0x40
popq %rdi
callq 0x32b0
movq %rax, %rbx
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x4380
movq %r12, (%rbx)
movq %r15, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movq %rbx, %rdi
addq $0x18, %rdi
leaq 0x18(%rsp), %rsi
callq 0x4380
leaq 0x20(%rsp), %rdi
callq 0x30f0
leaq 0x8(%rsp), %rdi
andq $0x0, 0x8(%rdi)
callq 0x2112c
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30f0
jmp 0x2106d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2112c
movq %rbx, %rdi
callq 0x3500
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&, unsigned long)
iterator
      _M_insert(_Link_type __N, const_reference __V,
             size_type const __L)
      {
        if (_Node_compare_(__L % __K, _M_acc, _M_cmp)(__V, __N->_M_value))
          {
            if (!_S_left(__N))
              return _M_insert_left(__N, __V);
            return _M_insert(_S_left(__N), __V, __L+1);
          }
        else
          {
            if (!_S_right(__N) || __N == _M_get_rightmost())
              return _M_insert_right(__N, __V);
            return _M_insert(_S_right(__N), __V, __L+1);
          }
      }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x3
popq %rcx
movq %r8, %rax
xorl %edx, %edx
divq %rcx
leaq 0x8(%rsp), %rdi
movq %rdx, (%rdi)
movq 0x30(%rsi), %rax
movq %rax, 0x8(%rdi)
leaq 0x18(%r13), %rdx
movq %r14, %rsi
callq 0x2113e
testb %al, %al
je 0x210e3
movq 0x8(%r13), %rdx
testq %rdx, %rdx
jne 0x210f3
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x21186
jmp 0x2111a
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x21109
cmpq %r13, 0x20(%r12)
je 0x21109
incq %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %r15, %r8
callq 0x21080
jmp 0x2111a
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x211cc
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert_left(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&)
iterator
      _M_insert_left(_Link_type __N, const_reference __V)
      {
        _S_set_left(__N, _M_new_node(__V)); ++_M_count;
        _S_set_parent( _S_left(__N), __N );
        if (__N == _M_get_leftmost())
           _M_set_leftmost( _S_left(__N) );
        return iterator(_S_left(__N));
      }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movq %rcx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20fda
movq %rax, 0x8(%r14)
incq 0x28(%r15)
movq %r14, (%rax)
cmpq %r14, 0x18(%r15)
jne 0x211bf
movq %rax, 0x18(%r15)
movq 0x8(%r14), %rax
movq %rax, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kallaballa[P]PixelStencil/./kdtree++/kdtree.hpp
// Function: KDTree::KDTree<3ul, kallaballa::NamedColor, std::pointer_to_binary_function<kallaballa::NamedColor const&, int const&, double>, KDTree::squared_difference<double, double>, std::less<double>, std::allocator<KDTree::_Node<kallaballa::NamedColor>>>::_M_insert_right(KDTree::_Node<kallaballa::NamedColor>*, kallaballa::NamedColor const&)
iterator
      _M_insert_right(_Link_type __N, const_reference __V)
      {
        _S_set_right(__N, _M_new_node(__V)); ++_M_count;
        _S_set_parent( _S_right(__N), __N );
        if (__N == _M_get_rightmost())
           _M_set_rightmost( _S_right(__N) );
        return iterator(_S_right(__N));
      }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movq %rcx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20fda
movq %rax, 0x10(%r14)
incq 0x28(%r15)
movq %r14, (%rax)
cmpq %r14, 0x20(%r15)
jne 0x21205
movq %rax, 0x20(%r15)
movq 0x10(%r14), %rax
movq %rax, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::ADDIInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDIInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = (int16_t)constant;
    int32_t result = left + right;
    
    bool overflow = sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("ADDI encountered an overflow"); }
    
    reg.write(rt, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movswl 0xa(%r14), %ecx
leal (%rax,%rcx), %edx
xorl %eax, %ecx
js 0x61aa
xorl %edx, %eax
js 0x61bf
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8b2e
pushq $0x48
popq %rdi
callq 0x50f0
movq %rax, %rbx
leaq 0x41c8(%rip), %rsi      # 0xa399
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x67c8
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5586
xorl %ebp, %ebp
leaq 0x9b7f(%rip), %rsi      # 0xfd78
leaq -0x330(%rip), %rdx      # 0x5ed0
movq %rbx, %rdi
callq 0x5360
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x50d0
testb %bpl, %bpl
jne 0x621f
jmp 0x6227
movq %rax, %r14
movq %rbx, %rdi
callq 0x5170
movq %r14, %rdi
callq 0x5390
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::ADDIUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDIUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = (int16_t)constant;
    int32_t result = left + right;
    reg.write(rt, result);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movswl 0xa(%r14), %edx
addl %eax, %edx
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8b2e
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::LWLInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void LWLInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t addr = reg.read(rs) + (int16_t)constant;
    uint32_t byteIndex = addr % 4;
    uint32_t wordIndex = addr - byteIndex;
    uint32_t mask = 0xFFFFFFFF;
    
    uint32_t rawWord = mem.read<uint32_t>(wordIndex);
    byte* byteArray = reinterpret_cast<byte*>(&rawWord);
    
    for (int i = byteIndex; i < 4; ++i)
    {
        data <<= 8;
        data |= byteArray[3 - i];
        mask >>= 8;
    }
    data <<= 8 * byteIndex;
    data |= (reg.read(rt) & mask);
    reg.write(rt, data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movswl 0xa(%r14), %r15d
addl %eax, %r15d
movl %r15d, %esi
andl $-0x4, %esi
movq %r12, %rdi
callq 0x6804
movl %eax, 0xc(%rsp)
movl 0xc(%r14), %eax
movl %r15d, %edx
andl $0x3, %edx
pushq $0x4
popq %rcx
subq %rdx, %rcx
pushq $-0x1
popq %rbp
movq %rcx, %rdx
subq $0x1, %rdx
jb 0x646d
shll $0x8, %eax
movzbl 0xb(%rsp,%rcx), %ecx
orl %ecx, %eax
shrl $0x8, %ebp
movq %rdx, %rcx
jmp 0x6455
shll $0x3, %r15d
movl %r15d, %ecx
shll %cl, %eax
movl %eax, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
andl %eax, %ebp
orl 0xc(%r14), %ebp
movl %ebp, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8b2e
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/IInstructions.cpp
// Function: Clarkitechture::MIPS::LWRInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void LWRInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t addr = reg.read(rs) + (int16_t)constant;
    uint32_t byteIndex = addr % 4;
    uint32_t wordIndex = addr - byteIndex;
    uint32_t mask = 0xFFFFFFFF;

    uint32_t rawWord = mem.read<uint32_t>(wordIndex);
    byte* byteArray = reinterpret_cast<byte*>(&rawWord);
    
    for (int i = 0; i <= byteIndex; ++i)
    {
        data <<= 8;
        data |= byteArray[3 - i];
        mask <<= 8;
    }
    data |= (reg.read(rt) & mask);
    reg.write(rt, data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %r12d
movswl 0xa(%r14), %r13d
leal (%r12,%r13), %esi
andl $-0x4, %esi
movq %r15, %rdi
callq 0x6804
movl %eax, 0x4(%rsp)
movl 0xc(%r14), %eax
addb %r12b, %r13b
movzbl %r13b, %ecx
andl $0x3, %ecx
negq %rcx
pushq $-0x1
popq %rbp
pushq $0x1
popq %rdx
cmpq %rdx, %rcx
je 0x6515
shll $0x8, %eax
movzbl 0x6(%rsp,%rdx), %esi
orl %esi, %eax
shll $0x8, %ebp
decq %rdx
jmp 0x64fe
movl %eax, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
andl %eax, %ebp
orl 0xc(%r14), %ebp
movl %ebp, 0xc(%r14)
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b2e
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/MemoryMap.hpp
// Function: unsigned int Clarkitechture::MIPS::MemoryMap::bswap<unsigned int>(unsigned int)
T bswap(T data)
            {
                byte* dataArray = reinterpret_cast<byte*>(&data);
                T newData = 0;
                for (int i = 0; i < sizeof(T); ++i)
                {
                    newData |= dataArray[i] << ((sizeof(T) - i - 1) * 8);
                }

                return newData;
            }

// Assembly:
movl %esi, -0x4(%rsp)
xorl %edx, %edx
movl $0x18, %ecx
xorl %eax, %eax
cmpq $0x4, %rdx
je 0x743e
movzbl -0x4(%rsp,%rdx), %esi
shll %cl, %esi
orl %esi, %eax
incq %rdx
addl $-0x8, %ecx
jmp 0x7427
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::BinaryDecoder::decodeBranchInstruction(unsigned int)
BranchIInstruction* BinaryDecoder::decodeBranchInstruction(uint32_t bin)
{
    byte rs = 0b11111 & (bin >> (32 - (6 + 5)));
    byte cond = 0b11111 & (bin >> (32 - (6 + 5 + 5)));
    uint16_t constant = 0xFFFF & bin;
    
    switch (cond)
    {
        case 0b00001: return new BGEZInstr(rs, cond, constant);
        case 0b10001: return new BGEZALInstr(rs, cond, constant);
        case 0b00000: return new BLTZInstr(rs, cond, constant);
        case 0b10000: return new BLTZALInstr(rs, cond, constant);
        default:
            throw BadInstructionDecode(bin, "invalid or unsupported branch condition - " + toBinStr(cond));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edi, %ebx
movl %edi, %eax
shrl $0x10, %eax
movl %eax, %ebp
andb $0x1f, %bpl
andl $0x1f, %eax
je 0x7d2f
cmpl $0x1, %eax
je 0x7d38
cmpl $0x10, %eax
je 0x7d26
cmpl $0x11, %eax
jne 0x7d70
leaq 0x857c(%rip), %r14      # 0x102a0
jmp 0x7d3f
leaq 0x8693(%rip), %r14      # 0x103c0
jmp 0x7d3f
leaq 0x8642(%rip), %r14      # 0x10378
jmp 0x7d3f
leaq 0x8519(%rip), %r14      # 0x10258
addq $0x10, %r14
movl %ebx, %r15d
shrl $0x15, %r15d
andb $0x1f, %r15b
pushq $0x18
popq %rdi
callq 0x51f0
movb %r15b, 0x8(%rax)
movb %bpl, 0x9(%rax)
movw %bx, 0xa(%rax)
movq %r14, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x50
popq %rdi
callq 0x50f0
movq %rax, %r14
movzbl %bpl, %esi
leaq 0x8(%rsp), %rdi
callq 0x7ea7
leaq 0x2bd4(%rip), %rsi      # 0xa964
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5d89
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x586c
xorl %ebp, %ebp
leaq 0x8006(%rip), %rsi      # 0xfdc0
leaq -0x1e4f(%rip), %rdx     # 0x5f72
movq %r14, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x50d0
jmp 0x7dde
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x8(%rsp), %rdi
callq 0x50d0
testb %bpl, %bpl
jne 0x7df2
jmp 0x7dfa
movq %rax, %rbx
movq %r14, %rdi
callq 0x5170
movq %rbx, %rdi
callq 0x5390
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::RInstruction::RInstruction(unsigned char, unsigned char, unsigned char, unsigned char)
RInstruction::RInstruction(byte rs, byte rt, byte rd, byte shamt)
{
	this->rs = rs;
	this->rt = rt;
	this->rd = rd;
	this->shamt = shamt;
}

// Assembly:
leaq 0x866d(%rip), %rax      # 0x10478
movq %rax, (%rdi)
movb %sil, 0x8(%rdi)
movb %dl, 0x9(%rdi)
movb %cl, 0xa(%rdi)
movb %r8b, 0xb(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/Instructions.cpp
// Function: Clarkitechture::MIPS::BranchIInstruction::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void BranchIInstruction::execute(MemoryMap &mem, RegisterMap &reg)
{
    int32_t offset = ((int16_t)constant) << 2;
    branchAddr = reg.PC + offset;
    conditionMet = evaluateCondition(reg);
    if (requiresLink()) { reg.write(31, reg.PC + 4); }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movswl 0xa(%rdi), %eax
shll $0x2, %eax
addl (%rdx), %eax
movl %eax, 0x10(%rdi)
movq (%rdi), %rax
movq %rdx, %rsi
callq *0x18(%rax)
movb %al, 0xc(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
testb %al, %al
je 0x7e8f
movl (%rbx), %edx
addl $0x4, %edx
pushq $0x1f
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8b2e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/MemoryMap.cpp
// Function: Clarkitechture::MIPS::MemoryMap::MemoryMap(Clarkitechture::MIPS::MemoryMap const&)
MemoryMap::MemoryMap(const MemoryMap &a)
{
    memory = a.memory;
    
    instrMemorySize = a.instrMemorySize;
    if (instrMemorySize > 0)
    {
        instrMemory = new byte[instrMemorySize];
        memcpy(instrMemory, a.instrMemory, a.instrMemorySize);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rax, (%rdi)
movq $0x1, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movl $0x3f800000, 0x20(%rdi) # imm = 0x3F800000
movups %xmm0, 0x28(%rdi)
andq $0x0, 0x40(%rdi)
callq 0x8212
movq 0x40(%r14), %r15
movq %r15, 0x40(%rbx)
testq %r15, %r15
je 0x816d
movq %r15, %rdi
callq 0x5030
movq %rax, 0x38(%rbx)
movq 0x38(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x51a0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x8190
movq %r14, %rdi
callq 0x5390
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::ADDInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = reg.read(rt);
    int32_t result = left + right;
    
    bool overflow = sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("ADD encountered an overflow"); }
    
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %r15d
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
leal (%rax,%r15), %edx
xorl %r15d, %eax
js 0x84ce
xorl %edx, %r15d
js 0x84e5
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8b2e
pushq $0x48
popq %rdi
callq 0x50f0
movq %rax, %rbx
leaq 0x2527(%rip), %rsi      # 0xaa1e
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x67c8
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5586
xorl %ebp, %ebp
leaq 0x7859(%rip), %rsi      # 0xfd78
leaq -0x2656(%rip), %rdx     # 0x5ed0
movq %rbx, %rdi
callq 0x5360
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x50d0
testb %bpl, %bpl
jne 0x8545
jmp 0x854d
movq %rax, %r14
movq %rbx, %rdi
callq 0x5170
movq %r14, %rdi
callq 0x5390
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::ADDUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void ADDUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t left = reg.read(rs);
    uint32_t right = reg.read(rt);
    uint32_t result = left + right;
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
addl %eax, %ebp
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x8b2e
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::SUBInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void SUBInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = reg.read(rt);
    int32_t result = left - right;
    
    bool overflow = !sameSign(left, right) && !sameSign(left, result);
    if (overflow) { throw BadArithmeticOperation("SUB encountered an overflow"); }
    
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
movl %ebp, %edx
subl %eax, %edx
xorl %ebp, %eax
jns 0x85c5
xorl %edx, %ebp
js 0x85da
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x8b2e
pushq $0x48
popq %rdi
callq 0x50f0
movq %rax, %rbx
leaq 0x244e(%rip), %rsi      # 0xaa3a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x67c8
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5586
xorl %ebp, %ebp
leaq 0x7764(%rip), %rsi      # 0xfd78
leaq -0x274b(%rip), %rdx     # 0x5ed0
movq %rbx, %rdi
callq 0x5360
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x50d0
testb %bpl, %bpl
jne 0x863a
jmp 0x8642
movq %rax, %r14
movq %rbx, %rdi
callq 0x5170
movq %r14, %rdi
callq 0x5390
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::NORInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void NORInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t left = reg.read(rs);
    uint32_t right = reg.read(rt);
    uint32_t result = ~(left | right);
    reg.write(rd, result);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
orl %eax, %ebp
notl %ebp
movzbl 0xa(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x8b2e
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::MULTInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void MULTInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int64_t left = (int32_t)reg.read(rs);
    int64_t right = (int32_t)reg.read(rt);
    int64_t result = left * right;
    reg.lo = 0xFFFFFFFF & result;
    reg.hi = 0xFFFFFFFF & (result >> 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movslq %eax, %r15
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
cltq
imulq %r15, %rax
rorq $0x20, %rax
movq %rax, 0x4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::MULTUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void MULTUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint64_t left = reg.read(rs);
    uint64_t right = reg.read(rt);
    uint64_t result = left * right;
    reg.lo = 0xFFFFFFFF & result;
    reg.hi = 0xFFFFFFFF & (result >> 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %r15d
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
movl %eax, %eax
imulq %r15, %rax
rorq $0x20, %rax
movq %rax, 0x4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::DIVInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void DIVInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    int32_t left = reg.read(rs);
    int32_t right = reg.read(rt);
    
    if (right != 0)
    {
        int32_t quotient = left / right;
        int32_t remainder = left % right;
        reg.lo = quotient;
        reg.hi = remainder;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
testl %eax, %eax
je 0x881c
movl %eax, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, 0x8(%rbx)
movl %edx, 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/RInstructions.cpp
// Function: Clarkitechture::MIPS::DIVUInstr::execute(Clarkitechture::MIPS::MemoryMap&, Clarkitechture::MIPS::RegisterMap&)
void DIVUInstr::execute(MemoryMap &mem, RegisterMap& reg)
{
    uint32_t left = reg.read(rs);
    uint32_t right = reg.read(rt);
    
    if (right != 0)
    {
        uint32_t quotient = left / right;
        uint32_t remainder = left % right;
        reg.lo = quotient;
        reg.hi = remainder;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movzbl 0x8(%rdi), %esi
movq %rdx, %rdi
callq 0x8acc
movl %eax, %ebp
movzbl 0x9(%r14), %esi
movq %rbx, %rdi
callq 0x8acc
testl %eax, %eax
je 0x8859
movl %eax, %ecx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movl %eax, 0x8(%rbx)
movl %edx, 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/QFSW[P]MIPS1-Simulator/src/Simulator.cpp
// Function: Clarkitechture::MIPS::Simulator::executeNext()
void Simulator::executeNext()
{
    reg.PC += 4;
    size_t index = currInstrIndex();
    std::shared_ptr<Instruction> currentInstr;
    
    if (index < instrCount)
    {
        currentInstr = instrs[index];
        currentInstr->execute(mem, reg);
    }
    else { currentInstr = nullptr; }
    if (previousInstr) { previousInstr->delayedExecute(mem, reg); }
    
    if (!currentInstr && !previousInstr)
    {
        throw BadProgramCounter(reg.PC - 4, "PC was outside of the instruction memory space.");
    }
    
    previousInstr = currentInstr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x30(%rdi), %rbx
addl $0x4, 0x30(%rdi)
callq 0x8f84
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpq (%r14), %rax
jae 0x8e8d
shll $0x4, %eax
addq 0x8(%r14), %rax
movq %rsp, %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x917c
movq (%r15), %rdi
leaq 0xc0(%r14), %rsi
movq (%rdi), %rax
movq %rbx, %rdx
callq *(%rax)
jmp 0x8ea7
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rsp, %rdi
callq 0x94ca
leaq 0x18(%rsp), %rdi
callq 0x9100
leaq 0x20(%r14), %r15
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x8ed0
addq $0xc0, %r14
movq (%rdi), %rax
movq %r14, %rsi
movq %rbx, %rdx
callq *0x8(%rax)
cmpq $0x0, (%r15)
setne %al
jmp 0x8ed2
xorl %eax, %eax
cmpq $0x0, (%rsp)
jne 0x8edd
testb %al, %al
je 0x8efd
movq %rsp, %rsi
movq %r15, %rdi
callq 0x917c
leaq 0x8(%rsp), %rdi
callq 0x9100
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x50
popq %rdi
callq 0x50f0
movq %rax, %r14
movl (%rbx), %ebx
leaq 0x1f37(%rip), %rsi      # 0xae48
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x67c8
addl $-0x4, %ebx
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x5bae
xorl %ebp, %ebp
leaq 0x6eca(%rip), %rsi      # 0xfe08
leaq -0x2f31(%rip), %rdx     # 0x6014
movq %r14, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x50d0
testb %bpl, %bpl
jne 0x8f64
jmp 0x8f71
movq %rax, %rbx
movq %r14, %rdi
callq 0x5170
jmp 0x8f71
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9100
movq %rbx, %rdi
callq 0x5390
nop