LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/include/plugin/module_holder.h
// Function: Boss::ModuleHolder::GetServiceId() const
ServiceId const GetServiceId() const
    {
      typedef RetCode (*PFNBossGetServiceId)(ServiceId *);
      auto *BossGetServiceId = Dll.GetProc<PFNBossGetServiceId>("BossGetServiceId");
      ServiceId SrvId = 0;
      if (BossGetServiceId(&SrvId) != Status::Ok)
        throw ModuleHolderException("Failed to call BossGetServiceId.");
      return SrvId;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0xb2321(%rip), %rsi     # 0xd8ef2
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xa7de0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x27046
movq %rax, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa5530
andl $0x0, (%r14)
leaq 0x8(%rsp), %rdi
callq *%rbx
testl %eax, %eax
jne 0x26c18
movl 0x8(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x28b50
movq %rax, %r14
leaq 0xb22d9(%rip), %rsi     # 0xd8f03
movq %rax, %rdi
callq 0x27132
leaq 0xf4517(%rip), %rsi     # 0x11b150
leaq 0xbd90(%rip), %rdx      # 0x329d0
movq %r14, %rdi
callq 0x29ba0
movq %rax, %rbx
movq %r14, %rdi
callq 0x28bb0
jmp 0x26c67
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa5530
jmp 0x26c67
movq %rax, %rbx
movq %rbx, %rdi
callq 0xd3bc0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/include/plugin/module_holder.h
// Function: Boss::ModuleHolder::GetClassIds() const
ClassIdPool const GetClassIds() const
    {
      typedef RetCode (*PFNBossGetClassCount)(UInt *);
      UInt Count = 0;
      auto *BossGetClassCount = Dll.GetProc<PFNBossGetClassCount>("BossGetClassCount");
      if (BossGetClassCount(&Count) != Status::Ok)
        throw ModuleHolderException("Failed to call BossGetClassCount.");
      typedef RetCode (*PFNBossGetClassId)(UInt, ClassId *);
      auto *BossGetClassId = Dll.GetProc<PFNBossGetClassId>("BossGetClassId");
      ClassIdPool Ids;
      for (UInt i = 0 ; i < Count ; ++i)
      {
        ClassId Id = 0;
        if (BossGetClassId(i, &Id) != Status::Ok)
          throw ModuleHolderException("Failed to call BossGetClassId.");
        Ids.push_back(Id);
      }
      return std::move(Ids);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andl $0x0, 0xc(%rsp)
leaq 0xb22c6(%rip), %rsi     # 0xd8f54
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xa7de0
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x27046
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0xa5530
leaq 0xc(%rsp), %rdi
callq *%r15
testl %eax, %eax
jne 0x26d96
leaq 0xb22ba(%rip), %rsi     # 0xd8f88
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xa7de0
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x27186
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xa5530
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
cmpl 0xc(%rsp), %ebp
jae 0x26d33
andl $0x0, 0x8(%rsp)
movl %ebp, %edi
movq %r12, %rsi
callq *%r14
testl %eax, %eax
jne 0x26d66
movq %r15, %rdi
movq %r12, %rsi
callq 0x1d604
incl %ebp
jmp 0x26d0d
leaq 0x10(%rsp), %rdi
movaps (%rdi), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x1e82a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x28b50
movq %rax, %r14
leaq 0xb221f(%rip), %rsi     # 0xd8f97
movq %rax, %rdi
callq 0x27272
leaq 0xf43c9(%rip), %rsi     # 0x11b150
leaq 0xbc42(%rip), %rdx      # 0x329d0
movq %r14, %rdi
callq 0x29ba0
pushq $0x10
popq %rdi
callq 0x28b50
movq %rax, %r14
leaq 0xb21be(%rip), %rsi     # 0xd8f66
movq %rax, %rdi
callq 0x27170
leaq 0xf4399(%rip), %rsi     # 0x11b150
leaq 0xbc12(%rip), %rdx      # 0x329d0
movq %r14, %rdi
callq 0x29ba0
movq %rax, %rbx
movq %r14, %rdi
callq 0x28bb0
jmp 0x26e07
jmp 0x26dd7
jmp 0x26de6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa5530
jmp 0x26e07
movq %rax, %rbx
jmp 0x26e07
jmp 0x26dfa
movq %rax, %rbx
movq %r14, %rdi
callq 0x28bb0
jmp 0x26dfd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1e82a
movq %rbx, %rdi
callq 0xd3bc0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/include/core/crc32.h
// Function: Boss::Crc32(void const*, unsigned int)
inline UInt Crc32(void const *data, UInt bytes)
  {
    std::uint8_t const *Buf = reinterpret_cast<std::uint8_t const *>(data);
    std::uint32_t Crc = 0;
    Crc = Crc ^ ~0U;
    while (bytes--)
      Crc = Private::Crc32Table::Table[(Crc ^ *Buf++) & 0xFF] ^ (Crc >> 8);
    return Crc ^ ~0U;
  }

// Assembly:
movl %esi, %ecx
pushq $-0x1
popq %rax
xorl %edx, %edx
leaq 0xb251b(%rip), %rsi     # 0xd93d0
cmpl %edx, %ecx
je 0x26ed0
movb (%rdi,%rdx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rsi,%r8,4), %eax
incq %rdx
jmp 0x26eb5
notl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/khashpp/test.cpp
// Function: test_int(unsigned int, unsigned int)
uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	klib::KHash<aux_t, aux_hash, aux_eq> h;
	for (i = 0, x = x0; i < n; ++i) {
		aux_t a;
		size_t k;
		int absent;
		x = hash32(x);
		a.key = get_key(n, x), a.cnt = 0;
		k = h.put(a, &absent);
		z += ++h.at(k).cnt;
	}
	fprintf(stderr, "# unique keys: %d; checksum: %u\n", h.size(), z);
	return h.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r15d
movl %edi, %r14d
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
xorl %ebx, %ebx
leaq 0x4(%rsp), %r12
leaq 0xc(%rsp), %r13
movl %edi, %ebp
subl $0x1, %ebp
jb 0x1507
movl %r15d, %edi
callq 0x121c
movl %eax, %r15d
movl %r14d, %edi
movl %eax, %esi
callq 0x1247
movl %eax, 0x4(%rsp)
andl $0x0, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x155c
movq 0x28(%rsp), %rcx
movl %eax, %eax
movl 0x4(%rcx,%rax,8), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,8)
addl %edx, %ebx
incl %ebx
jmp 0x14bc
movq 0x2ad2(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
leaq 0x10(%rsp), %r14
movl 0x4(%r14), %edx
leaq 0xb54(%rip), %rsi       # 0x2075
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10a0
movl 0x4(%r14), %ebx
movq %r14, %rdi
callq 0x16f6
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x16f6
movq %rbx, %rdi
callq 0x10d0
// File: /workspace/github_cpp_makefile_star2_O2/qmmlib[P]QmmLibrary/predict.c
// Function: main
int main(int argc, char **argv)
{
	FILE *input, *output;
	int i;

	// parse options
	for(i=1;i<argc;i++)
	{
		if(argv[i][0] != '-') break;
		++i;
		switch(argv[i-1][1])
		{
			case 'b':
				flag_predict_probability = atoi(argv[i]);
				break;

			default:
				fprintf(stderr,"unknown option: -%c\n", argv[i-1][1]);
				exit_with_help();
				break;
		}
	}
	if(i>=argc)
		exit_with_help();

	input = fopen(argv[i],"r");
	if(input == NULL)
	{
		fprintf(stderr,"can't open input file %s\n",argv[i]);
		exit(1);
	}

	output = fopen(argv[i+2],"w");
	if(output == NULL)
	{
		fprintf(stderr,"can't open output file %s\n",argv[i+2]);
		exit(1);
	}

	if((model_=load_model(argv[i+1]))==0)
	{
		fprintf(stderr,"can't open model file %s\n",argv[i+1]);
		exit(1);
	}

	x = (struct feature_node *) malloc(max_nr_attr*sizeof(struct feature_node));
	do_predict(input, output);
	free_and_destroy_model(&model_);
	free(line);
	free(x);
	fclose(input);
	fclose(output);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movslq %edi, %r14
pushq $0x1
popq %r12
cmpq %r14, %r12
jge 0x3cb6
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x3be7
movsbl 0x1(%rax), %edx
cmpl $0x62, %edx
jne 0x3c9e
movq 0x8(%rbx,%r12,8), %rdi
callq 0x3360
movl %eax, 0x1468f(%rip)     # 0x18270
addq $0x2, %r12
jmp 0x3bb2
movq (%rbx,%r12,8), %rdi
leaq 0x10526(%rip), %rsi     # 0x14118
callq 0x3260
testq %rax, %rax
je 0x3cbb
movq %rax, %r14
movq 0x10(%rbx,%r12,8), %rdi
leaq 0x10525(%rip), %rsi     # 0x14134
callq 0x3260
testq %rax, %rax
je 0x3cd2
movq %rax, %r15
movq 0x8(%rbx,%r12,8), %rdi
callq 0x113a8
movq %rax, 0x14637(%rip)     # 0x18268
testq %rax, %rax
je 0x3cea
movslq 0x145ff(%rip), %rdi     # 0x18240
shlq $0x4, %rdi
callq 0x32e0
movq %rax, 0x1460f(%rip)     # 0x18260
movq %r14, %rdi
movq %r15, %rsi
callq 0x35af
leaq 0x14605(%rip), %rdi     # 0x18268
callq 0x10d24
movq 0x14609(%rip), %rdi     # 0x18278
callq 0x3270
movq 0x145e5(%rip), %rdi     # 0x18260
callq 0x3270
movq %r14, %rdi
callq 0x31e0
movq %r15, %rdi
callq 0x31e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x14333(%rip), %rax     # 0x17fd8
movq (%rax), %rdi
leaq 0x10454(%rip), %rsi     # 0x14103
xorl %eax, %eax
callq 0x3330
callq 0x3b8b
movq 0x14316(%rip), %rax     # 0x17fd8
movq (%rax), %rdi
movq (%rbx,%r12,8), %rdx
leaq 0x1044a(%rip), %rsi     # 0x1411a
jmp 0x3d00
movq 0x142ff(%rip), %rax     # 0x17fd8
movq (%rax), %rdi
movq 0x10(%rbx,%r12,8), %rdx
leaq 0x1044e(%rip), %rsi     # 0x14136
jmp 0x3d00
movq 0x142e7(%rip), %rax     # 0x17fd8
movq (%rax), %rdi
movq 0x8(%rbx,%r12,8), %rdx
leaq 0x10451(%rip), %rsi     # 0x14151
xorl %eax, %eax
callq 0x3330
pushq $0x1
popq %rdi
callq 0x3280
nop
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/main.cc
// Function: cli::CheckArgv(char**, char**)
void CheckArgv(char **arg_start, char **arg_end) {
  if (HasOption(arg_start, arg_end, "-h") ||
      HasOption(arg_start, arg_end, "--help") ||
      arg_end - arg_start == 1) {
    PrintHelpUtil();
    exit(EXIT_SUCCESS);
  }
  if (arg_end - arg_start != 3) {
    std::cerr << "ERROR: incorrect number of arguments.\n"
              << "Execute `gss --help` for more info."
              << std::endl;
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1c21(%rip), %rsi      # 0x4004
leaq 0x28(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x25e8
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x25d7
testb %al, %al
jne 0x2465
leaq 0x1bf9(%rip), %rsi      # 0x4007
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x25e8
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x25d7
subq %r14, %rbx
cmpq $0x8, %rbx
sete %bpl
orb %al, %bpl
leaq 0x8(%rsp), %rdi
callq 0x21e8
leaq 0x28(%rsp), %rdi
callq 0x21e8
testb %bpl, %bpl
jne 0x246f
cmpq $0x18, %rbx
jne 0x247b
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rsp), %rdi
callq 0x21e8
callq 0x2623
xorl %edi, %edi
callq 0x2170
movq 0x3b6e(%rip), %rdi      # 0x5ff0
leaq 0x1b85(%rip), %rsi      # 0x400e
callq 0x2130
leaq 0x1ba0(%rip), %rsi      # 0x4035
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20b0
pushq $0x1
popq %rdi
callq 0x2170
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21e8
jmp 0x24c1
jmp 0x24be
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x21e8
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/main.cc
// Function: main
int main(int argc, char *argv[]) {
  // Optimize std::cout - this will (hopefully) help us run faster than grep.
  std::ios::sync_with_stdio(false);
  std::cout.tie(nullptr);

  cli::CheckArgv(argv, argv + argc);

  std::string filename(argv[1]);
  std::string search_pattern(argv[2]);
  gss::fileutils::Match(filename, search_pattern);

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x2090
movq 0x3ae1(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
andq $0x0, 0xd8(%rax,%rcx)
movslq %ebp, %rax
leaq (%rbx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x23cc
movq 0x8(%rbx), %rsi
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x25e8
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x25e8
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2180
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2180
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2818
leaq 0x28(%rsp), %rdi
callq 0x21e8
leaq 0x48(%rsp), %rdi
callq 0x21e8
leaq 0x8(%rsp), %rdi
callq 0x21e8
leaq 0x68(%rsp), %rdi
callq 0x21e8
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x21e8
jmp 0x25a7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x21e8
jmp 0x25b6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21e8
jmp 0x25c5
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x21e8
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/main.cc
// Function: cli::PrintHelpUtil()
inline void PrintHelpUtil() {
  std::cout << "gss: Grep for Small Strings\n"
            << "Usage: gss [--help] [FILE] [PATTERN]\n\n"
            << "Flags:\n"
            << "  -h, --help    display this help text and exit"
            << std::endl;
}

// Assembly:
pushq %rax
movq 0x39a5(%rip), %rdi      # 0x5fd0
leaq 0x1a27(%rip), %rsi      # 0x4059
callq 0x2130
leaq 0x1a38(%rip), %rsi      # 0x4076
movq %rax, %rdi
callq 0x2130
leaq 0x1a50(%rip), %rsi      # 0x409d
movq %rax, %rdi
callq 0x2130
leaq 0x1a49(%rip), %rsi      # 0x40a5
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
popq %rax
jmp 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/src/fileutils.cc
// Function: gss::fileutils::CheckAccessible(char const*)
inline void CheckAccessible(const char *filename) {
  struct stat buffer;
  if (stat(filename, &buffer) != 0) {
    std::cerr << "ERROR: `" << filename << "` is not accessible." << std::endl;
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
callq 0x2120
testl %eax, %eax
jne 0x2a70
addq $0x90, %rsp
popq %rbx
retq
movq 0x3579(%rip), %rdi      # 0x5ff0
leaq 0x168c(%rip), %rsi      # 0x410a
callq 0x2130
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2130
leaq 0x167e(%rip), %rsi      # 0x4113
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20b0
pushq $0x1
popq %rdi
callq 0x2170
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/src/kmp.cc
// Function: gss::kmp::ComputePrefix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<int> ComputePrefix(std::string search) {
  std::vector<int> prefix_vals(search.length());
  prefix_vals[0] = 0;
  int current_prefix = 0;

  for (int i = 1; i < static_cast<int>(search.length()); ++i) {
    // Jump by prefix values to try smaller prefixes. This process stops when
    // we either find a match, or reach zero.
    while (current_prefix > 0 && search[i] != search[current_prefix]) {
      current_prefix = prefix_vals[current_prefix - 1];
    }
    if (search[i] == search[current_prefix]) {
      ++current_prefix;
    }
    prefix_vals[i] = current_prefix;
  }

  return prefix_vals;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x7(%rsp), %rdx
callq 0x2cf4
movq (%rbx), %rax
andl $0x0, (%rax)
movslq 0x8(%r14), %rcx
xorl %esi, %esi
pushq $0x1
popq %rdx
cmpq %rcx, %rdx
jge 0x2bb4
movq (%r14), %rdi
testl %esi, %esi
jle 0x2b96
movb (%rdi,%rdx), %r8b
movl %esi, %r10d
movl %r8d, %r9d
cmpb (%rdi,%r10), %r8b
je 0x2ba1
movl -0x4(%rax,%r10,4), %esi
jmp 0x2b7b
movb (%rdi,%rdx), %r9b
movslq %esi, %r8
movb (%rdi,%r8), %r8b
xorl %edi, %edi
cmpb %r8b, %r9b
sete %dil
addl %edi, %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0x2b73
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/maxgodfrey2004[P]gss/src/kmp.cc
// Function: gss::kmp::FindMatches(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<int> FindMatches(std::string search, std::string pattern) {
  if (search == "") {
    std::cerr << "ERROR: text to search must not be blank" << std::endl;
  }

  std::vector<int> prefix_vals = ComputePrefix(search);
  std::vector<int> occurrences;

  int max_length_prefix = 0;
  for (int i = 0; i < static_cast<int>(search.length()); ++i) {
    // Jump by prefix values to try smaller prefixes. Keep jumping until we
    // either find a match, or reach zero.
    while (max_length_prefix > 0 && search[i] != pattern[max_length_prefix]) {
      max_length_prefix = prefix_vals[max_length_prefix - 1];
    }
    if (search[i] == pattern[max_length_prefix]) {
      ++max_length_prefix;
    }
    if (max_length_prefix == static_cast<int>(pattern.length())) {
      // We have found an occurrence of pattern in our search string!
      occurrences.push_back(i - pattern.length() + 1);
      max_length_prefix = prefix_vals[max_length_prefix - 1];
    }
  }

  return occurrences;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x14bf(%rip), %rsi      # 0x409c
movq %r15, %rdi
callq 0x2aad
testb %al, %al
je 0x2c04
movq 0x3400(%rip), %rdi      # 0x5ff0
leaq 0x1531(%rip), %rsi      # 0x4128
callq 0x2130
movq %rax, %rdi
callq 0x20b0
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x2b4c
leaq 0x28(%rsp), %rdi
callq 0x21e8
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %r13d, %r13d
leaq 0xc(%rsp), %r12
xorl %ebp, %ebp
movslq 0x8(%r15), %rax
cmpq %rax, %r13
jge 0x2cac
movq 0x10(%rsp), %rdx
movq (%r15), %rcx
movq (%r14), %rax
testl %ebp, %ebp
jle 0x2c6a
movb (%rcx,%r13), %sil
movl %ebp, %edi
cmpb (%rax,%rdi), %sil
je 0x2c6e
movl -0x4(%rdx,%rdi,4), %ebp
jmp 0x2c54
movb (%rcx,%r13), %sil
movslq %ebp, %rcx
xorl %edx, %edx
cmpb (%rax,%rcx), %sil
sete %dl
addl %edx, %ebp
cmpl 0x8(%r14), %ebp
jne 0x2ca7
incq %r13
movl %r13d, %eax
subl %ebp, %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2e16
movq 0x10(%rsp), %rax
movslq %ebp, %rcx
movl -0x4(%rax,%rcx,4), %ebp
jmp 0x2c40
incq %r13
jmp 0x2c40
leaq 0x10(%rsp), %rdi
callq 0x2ac6
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x21e8
jmp 0x2cec
movq %rax, %r14
movq %rbx, %rdi
callq 0x2ac6
leaq 0x10(%rsp), %rdi
callq 0x2ac6
movq %r14, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/exprtk_maze_generator.cpp
// Function: shuffle<double>::shuffle()
shuffle()
   : exprtk::igeneric_function<T>("V")
   {
      std::random_device device;
      std::array<unsigned int,std::mt19937::state_size> seed;
      std::generate_n(seed.data(), seed.size(), std::ref(device));
      std::seed_seq seq(std::begin(seed), std::end(seed));
      generator.seed(seq);
   }

// Assembly:
pushq %r14
pushq %rbx
subq $0x1d68, %rsp           # imm = 0x1D68
movq %rdi, %rbx
leaq 0x132f38(%rip), %rsi    # 0x247206
leaq 0x9e0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x113308
leaq 0x9e0(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1158ac
leaq 0x9e0(%rsp), %rdi
callq 0x111608
leaq 0x25d29a(%rip), %rax    # 0x3715a0
movq %rax, (%rbx)
leaq 0x48(%rbx), %r14
movq %r14, %rdi
callq 0x1158e2
xorps %xmm0, %xmm0
movhps 0x12cce9(%rip), %xmm0   # xmm0 = xmm0[0,1],mem[0,1]
movups %xmm0, 0x13d0(%rbx)
leaq 0x9e0(%rsp), %rdi
callq 0x1158ec
leaq 0x20(%rsp), %rdi
leaq 0x9e0(%rsp), %rdx
movl $0x270, %esi            # imm = 0x270
callq 0x115941
leaq 0x9e0(%rsp), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x115970
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1159de
leaq 0x8(%rsp), %rdi
callq 0x115d3e
leaq 0x9e0(%rsp), %rdi
callq 0x115a58
addq $0x1d68, %rsp           # imm = 0x1D68
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x115d3e
jmp 0x1143a4
jmp 0x1143a1
movq %rax, %r14
leaq 0x9e0(%rsp), %rdi
callq 0x115a58
jmp 0x1143b8
jmp 0x1143b5
movq %rax, %r14
movq %rbx, %rdi
callq 0x1157ac
movq %r14, %rdi
callq 0x111330
movq %rax, %r14
leaq 0x9e0(%rsp), %rdi
callq 0x111608
jmp 0x1143c0
movq %rax, %r14
jmp 0x1143c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/./exprtk.hpp
// Function: exprtk::function_compositor<double>::function::vars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline function& vars(const std::string& v0,
                               const std::string& v1,
                               const std::string& v2)
         {
            v_.push_back(v0);
            v_.push_back(v1);
            v_.push_back(v2);
            return (*this);
         }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0x40(%rdi), %r12
movq %r12, %rdi
callq 0x120360
movq %r12, %rdi
movq %r14, %rsi
callq 0x120360
movq %r12, %rdi
movq %rbx, %rsi
callq 0x120360
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/CPU.cc
// Function: CPU::~CPU()
CPU::~CPU() {
  // Free up Mapped Opcode Execute Methods
  for (auto key: this->oMap) {
    delete key.second;
  }
  for (auto key: this->pMap) {
    delete key.second;
  }
  delete this->ppu;
  cpuExecDump.close();

  // Clean up Debug Data
  for (auto &p : this->instr_iters) {
    delete p.second;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xb8(%rdi), %r12
pushq $0x50
popq %r14
movq (%r12), %r12
testq %r12, %r12
je 0x23456
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x23449
movq %r15, %rdi
callq 0x2d10e
movq %r15, %rdi
movq %r14, %rsi
callq 0xc0d0
jmp 0x2342e
leaq 0xf0(%rbx), %r12
pushq $0x50
popq %r14
movq (%r12), %r12
testq %r12, %r12
je 0x23489
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x2347c
movq %r15, %rdi
callq 0x2d10e
movq %r15, %rdi
movq %r14, %rsi
callq 0xc0d0
jmp 0x23461
movq (%rbx), %rdi
pushq $0x28
popq %rsi
callq 0xc0d0
leaq 0x10158(%rbx), %r14
movq %r14, %rdi
callq 0xc7f0
leaq 0x80(%rbx), %r12
pushq $0x10
popq %r15
movq (%r12), %r12
testq %r12, %r12
je 0x234c6
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0xc0d0
jmp 0x234ae
leaq 0x70(%rbx), %r15
leaq 0xe0(%rbx), %r12
leaq 0xa8(%rbx), %r13
movq %r14, %rdi
callq 0xc700
leaq 0x138(%rbx), %rdi
callq 0x2d4a4
movq %r12, %rdi
callq 0x2d4da
movq %r13, %rdi
callq 0x2d4da
movq %r15, %rdi
callq 0x2d598
addq $0x10, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2d09c
movq %rax, %rdi
callq 0x2d132
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/CPU.cc
// Function: CPU::tick()
void CPU::tick() {
  if (!halted)
    ppu->execute();
  else
    handleInterrupt();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x12a(%rdi)
je 0x23539
popq %rbp
jmp 0x23542
movq (%rdi), %rdi
popq %rbp
jmp 0x300b2
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/CPU.cc
// Function: CPU::handleInterrupt()
void CPU::handleInterrupt() {
  if (this->IME) {
    std::cout << "CPU INTERRUPTED!\n";

    // Memory Registers Required
    uint8_t IE = this->memory.read(0xFFFF);
    uint8_t IF = this->memory.read(0xFF0F);
    uint8_t IH = (IE & IF) & 0x1F;

    // Least Significant bit gets highest priority
    if (IH & 0x01) {          // Bit0: V-Blank
      // Basically CALL without the offset
      this->PUSH(&PC);
      PC = 0x0040;

      // Consume CPU Cycles + 2 (internal timing NOPs)
      cyclesLeft -= 5;
      updateTimers(5);

      // Unset Handled Bit
      IF &= ~0x01;

      // Dispatch Handled
      IME = false;
    } else if (IH & 0x02) {   // Bit1: LCD STAT
      this->PUSH(&PC);
      PC = 0x0048;
      cyclesLeft -= 5;
      updateTimers(5);
      IF &= ~0x02;
      IME = false;
    } else if (IH & 0x04) {   // Bit2: Timer
      this->PUSH(&PC);
      PC = 0x0050;
      cyclesLeft -= 5;
      updateTimers(5);
      IF &= ~0x04;
      IME = false;
    } else if (IH & 0x08) {   // Bit3: Serial
      this->PUSH(&PC);
      PC = 0x0058;
      cyclesLeft -= 5;
      updateTimers(5);
      IF &= ~0x08;
      IME = false;
    } else if (IH & 0x10) {   // Bit4: Joypad
      this->PUSH(&PC);
      PC = 0x0060;
      cyclesLeft -= 5;
      updateTimers(5);
      IF &= ~0x10;
      IME = false;
    }

    // Update IF
    this->memory.write(0xFF0F, IF);
  }

  // Check IME Delayed Enable (EI)
  else if (delayed_IME) {
    delayed_IME = false;
    IME = true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x128(%rdi)
jne 0x235cb
movq 0xbb99d(%rip), %rdi     # 0xdef00
leaq 0x74c0e(%rip), %rsi     # 0x98178
callq 0xc520
leaq 0x130(%rbx), %r14
movq %r14, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x2fc3a
movl %eax, %r12d
movq %r14, %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x2fc3a
movl %eax, %r15d
andb %al, %r12b
testb $0x1, %r12b
jne 0x235ec
andb $0x1f, %r12b
testb $0x2, %r12b
jne 0x235f6
testb $0x4, %r12b
jne 0x23600
testb $0x8, %r12b
jne 0x2360a
movzbl %r12b, %eax
testl %eax, %eax
je 0x23642
movb $-0x11, %r12b
movw $0x60, %r13w
jmp 0x23612
cmpb $0x1, 0x129(%rbx)
jne 0x235dd
movw $0x1, 0x128(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $-0x2, %r12b
movw $0x40, %r13w
jmp 0x23612
movb $-0x3, %r12b
movw $0x48, %r13w
jmp 0x23612
movb $-0x5, %r12b
movw $0x50, %r13w
jmp 0x23612
movb $-0x9, %r12b
movw $0x58, %r13w
leaq 0x12c(%rbx), %rsi
movq %rbx, %rdi
callq 0x2f210
movw %r13w, 0x12c(%rbx)
addl $-0x5, 0x8(%rbx)
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x24474
andb %r12b, %r15b
movb $0x0, 0x128(%rbx)
movzbl %r15b, %edx
movq %r14, %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/CPU.cc
// Function: CPU::updateTimers(unsigned char)
void CPU::updateTimers(uint8_t cyclesPassed) {
  // Keep track of Cycles passed for each of the Timers
  this->timerCycles.div += cyclesPassed;

  // Get TAC Configuration
  uint8_t TAC = this->memory.read(0xFF07);


  if (this->timerCycles.div >= 64) {
    uint8_t DIV = this->memory.read(0xFF04);
    memory.memory[0xFF04] = ++DIV;
    this->timerCycles.div -= 64;
  }



  // TAC-Enabled, Tick TIMA
  // TODO: Figure out what happens if TAC changes interval while TAC enabled.
  if (TAC & (1 << 2)) {
    this->timerCycles.tima += cyclesPassed;
    uint8_t TIMA_OLD = this->memory.read(0xFF05);
    uint8_t TIMA = TIMA_OLD;

    switch (TAC & 0x03) {
      case 0x00:
        if (timerCycles.tima >= 256) {
          TIMA++;
          timerCycles.tima -= 256;
        }
        break;
      case 0x01:
        if (timerCycles.tima >= 4) {
          TIMA++;
          timerCycles.tima -= 4;
        }
        break;
      case 0x10:
        if (timerCycles.tima >= 16) {
          TIMA++;
          timerCycles.tima -= 16;
        }
        break;
      case 0x11:
        if (timerCycles.tima >= 64) {
          TIMA++;
          timerCycles.tima -= 64;
        }
        break;
    }

    // CHECK IF OVERFLOW
    if (TIMA < TIMA_OLD) {
      // Request Timer Interrupt
      uint8_t IF = this->memory.read(0xFF0F);
      this->memory.write(0xFF0F, IF |= 0x04);

      // Set TIMA = TAC
      TIMA = this->memory.read(0xFF06);
    }


    this->memory.write(0xFF05, TIMA);
  }


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %r14
addl %esi, 0x120(%rdi)
leaq 0x130(%rdi), %rbx
movq %rbx, %rdi
movl $0xff07, %esi           # imm = 0xFF07
callq 0x2fc3a
movl %eax, %r12d
cmpl $0x40, 0x120(%r14)
jb 0x244ca
movq %rbx, %rdi
movl $0xff04, %esi           # imm = 0xFF04
callq 0x2fc3a
incb %al
movb %al, 0x10054(%r14)
addl $-0x40, 0x120(%r14)
testb $0x4, %r12b
jne 0x244d9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movzbl %r12b, %r12d
addl %r15d, 0x124(%r14)
movq %rbx, %rdi
movl $0xff05, %esi           # imm = 0xFF05
callq 0x2fc3a
andl $0x3, %r12d
cmpl $0x1, %r12d
je 0x24517
testl %r12d, %r12d
jne 0x2455d
movl 0x124(%r14), %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x2455d
addl $0xffffff00, %ecx       # imm = 0xFFFFFF00
jmp 0x24526
movl 0x124(%r14), %ecx
cmpl $0x4, %ecx
jb 0x2455d
addl $-0x4, %ecx
movl %ecx, 0x124(%r14)
incb %al
jne 0x2455d
movq %rbx, %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x2fc3a
orb $0x4, %al
movzbl %al, %edx
movq %rbx, %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
callq 0x2fc46
movq %rbx, %rdi
movl $0xff06, %esi           # imm = 0xFF06
callq 0x2fc3a
movzbl %al, %edx
movq %rbx, %rdi
movl $0xff05, %esi           # imm = 0xFF05
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/CPU.cc
// Function: CPU::getCpuStateSnapshot()
const CPU_State CPU::getCpuStateSnapshot() {
  return {
    reg,
    SP,
    PC,
    ppu->getLY(),
    IME,
    halted,
    running
  };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
movq (%rdi), %rdi
movq 0x118(%r15), %rbx
movzwl 0x12e(%r15), %r12d
movl 0x12c(%r15), %r14d
callq 0x300a8
movzbl 0x128(%r15), %ecx
movzwl 0x12a(%r15), %edx
shlq $0x30, %rdx
shlq $0x28, %rcx
orq %rdx, %rcx
movzbl %al, %eax
shlq $0x20, %rax
orq %rcx, %rax
shll $0x10, %r14d
orq %rax, %r14
orq %r12, %r14
movq %rbx, %rax
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::ADC(unsigned char)
void CPU::ADC(uint8_t u8) {                 // ADC A, u8
  uint8_t result = this->reg.A + ((this->reg.F & 0x10) >> 4) + u8;

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(false);   // Unset N Flag
  this->checkHalfCarry(result, this->reg.A);
  this->checkCarry(this->reg.A, result);

  // Set new A Value
  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movzbl 0x11d(%rdi), %eax
btl $0x4, %eax
adcb 0x118(%rdi), %r14b
sete %al
movzbl %al, %esi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movzbl 0x118(%rbx), %edx
movzbl %r14b, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x236d2
movzbl 0x118(%rbx), %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x23700
movb %r14b, 0x118(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::ADD(unsigned char)
void CPU::ADD(uint8_t u8) {                 // ADD A, u8
  uint8_t result = this->reg.A + u8;

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(false);   // Unset N Flag
  this->checkHalfCarry(result, this->reg.A);
  this->checkCarry(this->reg.A, result);

  // New A Value
  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
xorl %esi, %esi
addb 0x118(%rdi), %r14b
sete %sil
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movzbl 0x118(%rbx), %edx
movzbl %r14b, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x236d2
movzbl 0x118(%rbx), %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x23700
movb %r14b, 0x118(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::AND(unsigned char)
void CPU::AND(uint8_t u8) {                 // AND A, u8
  uint8_t result = this->reg.A & u8;

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(false);   // Unset N Flag
  this->setHalfCarryFlag(true); // Set H Flag
  this->setCarryFlag(false);    // Unset C Flag

  // New A Value
  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %esi, %esi
andb 0x118(%rdi), %bl
sete %sil
callq 0x23662
movq %r14, %rdi
xorl %esi, %esi
callq 0x2367e
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2369a
movq %r14, %rdi
xorl %esi, %esi
callq 0x236b6
movb %bl, 0x118(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::CP(unsigned char)
void CPU::CP(uint8_t u8) {                  // CP A, u8
  uint8_t result = this->reg.A - u8;

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(true);  // Set N Flag
  this->checkHalfCarry(this->reg.A, result); // Set if borrow from bit 4
  this->checkCarry(u8, this->reg.A); // Set if borrow
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movb 0x118(%rdi), %r15b
xorl %esi, %esi
subb %bl, %r15b
sete %sil
callq 0x23662
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2367e
movzbl 0x118(%r14), %esi
movzbl %r15b, %edx
movq %r14, %rdi
callq 0x236d2
movzbl 0x118(%r14), %edx
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x23700
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::DEC(unsigned char*)
void CPU::DEC(uint8_t *r8) {                // DEC r8
  uint8_t result = *r8 - 1;

  // Set Flags
  this->setZeroFlag(result == 0);   // Zero Flag
  this->setAddSubFlag(true);  // Set N Flag
  this->checkHalfCarry(*r8, result); // Set if borrow from bit 4

  // New r8 value
  *r8 = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb (%rsi), %r15b
xorl %esi, %esi
decb %r15b
sete %sil
callq 0x23662
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2367e
movzbl (%rbx), %esi
movzbl %r15b, %r15d
movq %r14, %rdi
movl %r15d, %edx
callq 0x236d2
movb %r15b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::DEC(unsigned short)
void CPU::DEC(uint16_t a16) {               // DEC [HL]
  uint8_t result = this->memory.read(a16) - 1;

  // Set Flags
  this->setZeroFlag(result == 0);   // Zero Flag
  this->setAddSubFlag(true);  // Set N Flag
  this->checkHalfCarry(this->memory.read(a16), result); // Set if borrow from bit 4

  this->memory.write(a16, result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
leaq 0x130(%rdi), %r14
movq %r14, %rdi
callq 0x2fc3a
movl %eax, %r12d
xorl %esi, %esi
decb %r12b
sete %sil
movq %r15, %rdi
callq 0x23662
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x2367e
movq %r14, %rdi
movl %ebx, %esi
callq 0x2fc3a
movzbl %r12b, %r12d
movzbl %al, %esi
movq %r15, %rdi
movl %r12d, %edx
callq 0x236d2
movq %r14, %rdi
movl %ebx, %esi
movl %r12d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::INC(unsigned char*)
void CPU::INC(uint8_t *r8) {                // INC r8
  uint8_t result = *r8 + 1;

  // Set Flags
  this->setZeroFlag(result == 0);   // Zero Flag
  this->setAddSubFlag(false);       // Unset N Flag
  this->checkHalfCarry(*r8, result);     // Set if overflow from bit 3

  // New r8 value
  *r8 = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb (%rsi), %r15b
xorl %esi, %esi
incb %r15b
sete %sil
callq 0x23662
movq %r14, %rdi
xorl %esi, %esi
callq 0x2367e
movzbl (%rbx), %esi
movzbl %r15b, %r15d
movq %r14, %rdi
movl %r15d, %edx
callq 0x236d2
movb %r15b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::INC(unsigned short)
void CPU::INC(uint16_t a16) {               // INC [HL]
  uint8_t result = this->memory.read(a16) + 1;

  // Set Flags
  this->setZeroFlag(result == 0);   // Zero Flag
  this->setAddSubFlag(false);  // Unset N Flag
  this->checkHalfCarry(this->memory.read(a16), result); // Set if overflow from bit 3

  this->memory.write(a16, result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
leaq 0x130(%rdi), %r14
movq %r14, %rdi
callq 0x2fc3a
movl %eax, %r12d
xorl %esi, %esi
incb %r12b
sete %sil
movq %r15, %rdi
callq 0x23662
movq %r15, %rdi
xorl %esi, %esi
callq 0x2367e
movq %r14, %rdi
movl %ebx, %esi
callq 0x2fc3a
movzbl %r12b, %r12d
movzbl %al, %esi
movq %r15, %rdi
movl %r12d, %edx
callq 0x236d2
movq %r14, %rdi
movl %ebx, %esi
movl %r12d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::SBC(unsigned char)
void CPU::SBC(uint8_t u8) {                 // SBC A, u8
  uint8_t result = this->reg.A - u8 - ((this->reg.F & 0x10) >> 4);

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(true);  // Set N Flag
  this->checkHalfCarry(this->reg.A, result);
  this->checkCarry(u8 + ((this->reg.F & 0x10) >> 4), this->reg.A);  // Check Carry for Subtraction

  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movzbl 0x11d(%rdi), %eax
btl $0x4, %eax
movl %r14d, %eax
adcb $0x0, %al
movb 0x118(%rdi), %r15b
xorl %esi, %esi
subb %al, %r15b
sete %sil
callq 0x23662
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2367e
movzbl 0x118(%rbx), %esi
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %edx
callq 0x236d2
movzbl 0x11d(%rbx), %eax
btl $0x4, %eax
adcb $0x0, %r14b
movzbl 0x118(%rbx), %edx
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0x23700
movb %r15b, 0x118(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::SUB(unsigned char)
void CPU::SUB(uint8_t u8) {                 // SUB A, u8
  uint8_t result = this->reg.A - u8;

  // Set Flags
  this->setZeroFlag(result == 0);      // Zero Flag
  this->setAddSubFlag(true);  // Set N Flag
  this->checkHalfCarry(this->reg.A, result);
  this->checkCarry(u8, this->reg.A);  // Check Carry for Subtraction

  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movb 0x118(%rdi), %r15b
xorl %esi, %esi
subb %r14b, %r15b
sete %sil
callq 0x23662
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2367e
movzbl 0x118(%rbx), %esi
movzbl %r15b, %r15d
movq %rbx, %rdi
movl %r15d, %edx
callq 0x236d2
movzbl 0x118(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x23700
movb %r15b, 0x118(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::XOR(unsigned char)
void CPU::XOR(uint8_t u8) {                 // XOR A, u8
  uint8_t result = this->reg.A ^ u8;

  // Set Flags
  this->reg.F = 0x00;                // Reset Flags
  this->setZeroFlag(result == 0);     // Zero Flag

  this->reg.A = result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movb 0x118(%rdi), %cl
movl %ecx, %r14d
xorb %sil, %r14b
movb $0x0, 0x11d(%rdi)
xorl %eax, %eax
cmpb %sil, %cl
sete %al
movl %eax, %esi
callq 0x23662
movb %r14b, 0x118(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::ADDHL(unsigned short)
void CPU::ADDHL(uint16_t r16) {             // ADD HL, r16
  uint16_t HL = (this->reg.H << 8) | this->reg.L;
  uint16_t result = HL + r16;

  // Set Flags
  this->setAddSubFlag(false);  // Unset N Flag
  this->checkHalfCarry(HL >> 8, result >> 8);
  this->checkCarry_16(HL, HL + r16);

  this->reg.H = result >> 8;
  this->reg.L = result & 0xFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x11e(%rdi), %r14d
movl %r14d, %eax
shll $0x8, %eax
movzbl 0x11f(%rdi), %r15d
orl %eax, %r15d
leal (%rsi,%r15), %r13d
xorl %esi, %esi
callq 0x2367e
movl %r13d, %r12d
andl $0xffff, %r12d          # imm = 0xFFFF
movl %r12d, %edx
shrl $0x8, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x236d2
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x23720
rolw $0x8, %r13w
movw %r13w, 0x11e(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::BIT(unsigned char, unsigned char*)
void CPU::BIT(uint8_t u3, uint8_t *r8) {     // BIT u3, r8
  // Check bit at u3 in r8's Bytes
  // Shift byte to u3 Bit to check if R8 Bit is set
  if ( ((1 << u3) & *r8) == 0 ) {
    this->setZeroFlag(true);
  }
  this->setAddSubFlag(false);
  this->setHalfCarryFlag(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl (%rdx), %eax
btl %esi, %eax
jb 0x2e964
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2369a
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::BIT(unsigned char, unsigned short)
void CPU::BIT(uint8_t u3, uint16_t a16) {    // BIT u3, [HL]
  uint8_t value = this->memory.read(a16);
  this->BIT(u3, &value);
  this->memory.write(a16, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x130(%rdi), %r12
movq %r12, %rdi
movl %edx, %esi
callq 0x2fc3a
movl %eax, %r13d
leaq -0x29(%rbp), %rdx
movb %al, (%rdx)
movq %r15, %rdi
movl %r14d, %esi
callq 0x2e948
movzbl %r13b, %edx
movq %r12, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::RES(unsigned char, unsigned short)
void CPU::RES(uint8_t u3, uint16_t a16) {    // RES u3, [HL]
  uint8_t value = this->memory.read(a16);
  this->RES(u3, &value);
  this->memory.write(a16, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
addq $0x130, %r15            # imm = 0x130
movq %r15, %rdi
movl %edx, %esi
callq 0x2fc3a
pushq $0x1
popq %rdx
movl %r14d, %ecx
shll %cl, %edx
notb %dl
andb %al, %dl
movzbl %dl, %edx
movq %r15, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::SWAP(unsigned char*)
void CPU::SWAP(uint8_t *r8) {               // SWAP r8
  uint8_t L = *r8 >> 4;
  uint8_t R = *r8 << 4;
  uint8_t result = L | R;

  // Set Flags
  this->setZeroFlag(result == 0);     // Zero Flag
  this->setAddSubFlag(false);     // Unset N Flag
  this->setHalfCarryFlag(false);  // Unset Half Carry Flag
  this->setCarryFlag(false);      // Unset Carry Flag
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
cmpb $0x0, (%rsi)
sete %al
movl %eax, %esi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2369a
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x236b6
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::SWAP(unsigned short)
void CPU::SWAP(uint16_t a16) {             // SWAP [HL]
  uint8_t value = this->memory.read(a16);
  this->SWAP(&value);
  this->memory.write(a16, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x130(%rdi), %r15
movq %r15, %rdi
callq 0x2fc3a
movl %eax, %r12d
leaq -0x21(%rbp), %rsi
movb %al, (%rsi)
movq %r14, %rdi
callq 0x2ea88
movzbl %r12b, %edx
movq %r15, %rdi
movl %ebx, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::RL(unsigned char*)
void CPU::RL(uint8_t *r8) {                // RL r8
  uint8_t carry = (this->reg.F & 0x10) << 3;

  // Set Carry flag according to 7th Bit
  this->setCarryFlag((*r8 & 0x80) != 0);

  *r8 = (*r8 << 1) | carry;  // Set right most bit

  // Set Flags
  if (*r8 == 0)
    this->setZeroFlag(true);
  this->setAddSubFlag(false);
  this->setHalfCarryFlag(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb 0x11d(%rdi), %r15b
shlb $0x3, %r15b
andb $-0x80, %r15b
movb (%rsi), %al
shrb $0x7, %al
movzbl %al, %esi
callq 0x236b6
movb (%r14), %al
addb %al, %al
orb %r15b, %al
movb %al, (%r14)
jne 0x2eb56
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2369a
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::RL(unsigned short)
void CPU::RL(uint16_t a16) {               // RL [HL]
  uint8_t value = this->memory.read(a16);
  this->RL(&value);
  this->memory.write(a16, value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x130(%rdi), %r15
movq %r15, %rdi
callq 0x2fc3a
leaq -0x21(%rbp), %r12
movb %al, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x2eb12
movzbl (%r12), %edx
movq %r15, %rdi
movl %ebx, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2fc46
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::RLC(unsigned char*)
void CPU::RLC(uint8_t *r8) {               // RLC r8
  // Set Carry flag according to 7th Bit
  this->setCarryFlag((*r8 & 0x80) != 0);

  // Carry 7th Bit over
  *r8 = (*r8 << 1) | ((this->reg.F & 0x10) >> 4);

  // Set Flags
  if (*r8 == 0)
    this->setZeroFlag(true);
  this->setAddSubFlag(false);
  this->setHalfCarryFlag(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
shrb $0x7, %al
movzbl %al, %esi
callq 0x236b6
movb (%r14), %al
addb %al, %al
movb 0x11d(%rbx), %cl
shrb $0x4, %cl
andb $0x1, %cl
orb %al, %cl
movb %cl, (%r14)
jne 0x2ec29
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2369a
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/Instructions.cc
// Function: CPU::RR(unsigned char*)
void CPU::RR(uint8_t *r8) {                // RR r8
  uint8_t carry = (this->reg.F & 0x10) << 3; // Set to Top Bit

  // Set Carry flag according to 7th Bit
  this->setCarryFlag((*r8 & 0x01) != 0);

  *r8 = (*r8 >> 1) | carry;  // Set left most bit

  // Set Flags
  if (*r8 == 0)
    this->setZeroFlag(true);
  this->setAddSubFlag(false);
  this->setHalfCarryFlag(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb 0x11d(%rdi), %r15b
shlb $0x3, %r15b
andb $-0x80, %r15b
movzbl (%rsi), %esi
andl $0x1, %esi
callq 0x236b6
movb (%r14), %al
shrb %al
orb %r15b, %al
movb %al, (%r14)
jne 0x2ecfc
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x23662
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2367e
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2369a