LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/utils/Tester.cpp
// Function: Tester::cleanup_harness()
void Tester::cleanup_harness() {
	int umount_res;
	int err;
	do {
		umount_res = umount_device();
		if (umount_res < 0) {
			err = errno;
			usleep(500);
		}
	}while (umount_res < 0 && err == EBUSY);

	if (umount_res < 0) {
		cerr << "Unable to unmount device" << endl;
		test_unload_class();
		return; 
	}

	test_unload_class();
	if (fs_commands_ != NULL) {
		delete fs_commands_;
		fs_commands_ = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x53f0(%rip), %r14      # 0x151f2
movq %r14, %rdi
callq 0x5600
testl %eax, %eax
js 0xfe17
movb $0x0, 0xf0(%rbx)
jmp 0xfe1e
movb $0x1, 0xf0(%rbx)
testl %eax, %eax
jns 0xfe92
callq 0x5060
movl (%rax), %r15d
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x55f0
cmpl $0x10, %r15d
je 0xfe02
movq 0xc1af(%rip), %r14      # 0x1bff0
leaq 0x5524(%rip), %rsi      # 0x1536c
movl $0x18, %edx
movq %r14, %rdi
callq 0x54f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
addq $0x10, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x102f2
leaq 0x10(%rbx), %rdi
callq 0x102f2
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xfeb1
callq 0x5460
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/utils/Tester.cpp
// Function: operator<<(std::ostream&, Tester::time_stats)
std::ostream& operator<<(std::ostream& os, Tester::time_stats time) {
	switch (time) {
		case Tester::SNAPSHOT_TIME:
			os << "snapshot restore time";
			break;
		case Tester::TEST_CASE_TIME:
			os << "test case time";
			break;
		case Tester::MOUNT_TIME:
			os << "mount/umount time";
			break;
		case Tester::TOTAL_TIME:
			os << "total time";
			break;
		default:
			os.setstate(std::ios_base::failbit);
	}
	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
decl %esi
cmpl $0x5, %esi
ja 0xff74
leaq 0x5079(%rip), %rax      # 0x14f9c
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5452(%rip), %rsi      # 0x15385
movl $0x15, %edx
jmp 0xff62
leaq 0x5469(%rip), %rsi      # 0x153aa
movl $0x11, %edx
jmp 0xff62
leaq 0x544c(%rip), %rsi      # 0x1539b
movl $0xe, %edx
jmp 0xff62
leaq 0x545f(%rip), %rsi      # 0x153bc
movl $0xa, %edx
movq %rbx, %rdi
callq 0x54f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x4, %esi
callq 0x5770
jmp 0xff6a
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/utils/ClassLoader.h
// Function: void utils::ClassLoader<tests::BaseTestCase>::unload_class<void (*)(tests::BaseTestCase*)>()
void unload_class() {
    if (loader_handle != NULL && instance != NULL) {
      ((DF)(defactory))(instance);
      dlclose(loader_handle);
      factory = NULL;
      defactory = NULL;
      loader_handle = NULL;
      instance = NULL;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpq $0x0, (%rdi)
je 0x1031f
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x1031f
callq *0x10(%rbx)
movq (%rbx), %rdi
callq 0x5390
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: fileAttributes::fileAttributes()
fileAttributes::fileAttributes() {
  md5sum = "";
  // Initialize dir_attr entries
  dir_attr.d_ino = -1;
  dir_attr.d_off = -1;
  dir_attr.d_reclen = -1;
  dir_attr.d_type = -1;
  dir_attr.d_name[0] = '\0';
  // Initialize stat_attr entried
  stat_attr.st_ino == -1;
  stat_attr.st_mode = -1;
  stat_attr.st_nlink = -1;
  stat_attr.st_uid = -1;
  stat_attr.st_gid = -1;
  stat_attr.st_size = -1;
  stat_attr.st_blksize = -1;
  stat_attr.st_blocks = -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1a8(%rdi), %r14
leaq 0x1b8(%rdi), %r15
movq %r15, 0x1a8(%rdi)
movq $0x0, 0x1b0(%rdi)
movb $0x0, 0x1b8(%rdi)
leaq 0x3961(%rip), %rcx      # 0x1410c
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x56b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xf(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rbx)
movb $0x0, 0x13(%rbx)
movdqu %xmm0, 0x128(%rbx)
movl %eax, 0x138(%rbx)
movdqu %xmm0, 0x148(%rbx)
movq $-0x1, 0x158(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x1080a
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: fileAttributes::set_dir_attr(dirent*)
void fileAttributes::set_dir_attr(struct dirent* a) {
  dir_attr.d_ino = a->d_ino;
  dir_attr.d_off = a->d_off;
  dir_attr.d_reclen = a->d_reclen;
  dir_attr.d_type = a->d_type;
  strncpy(dir_attr.d_name, a->d_name, sizeof(a->d_name));
  dir_attr.d_name[sizeof(a->d_name) - 1] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq %rax, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movzwl 0x10(%rsi), %eax
movw %ax, 0x10(%rdi)
movb 0x12(%rsi), %al
movb %al, 0x12(%rdi)
addq $0x13, %rdi
addq $0x13, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5250
movb $0x0, 0x112(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: fileAttributes::set_stat_attr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void fileAttributes::set_stat_attr(string path, bool islstat) {
  if (islstat) {
    lstat(path.c_str(), &stat_attr);
  } else {
    stat(path.c_str(), &stat_attr);
  }
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq (%rsi), %rdi
addq $0x118, %rax            # imm = 0x118
movq %rax, %rsi
testl %edx, %edx
je 0x10897
popq %rbp
jmp 0x5880
popq %rbp
jmp 0x5410
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: fileAttributes::set_md5sum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void fileAttributes::set_md5sum(string file_path) {
  FILE *fp;
  string command = "md5sum " + file_path;
  char md5[100];
  fp = popen(command.c_str(), "r");
  fscanf(fp, "%s", md5);
  fclose(fp);
  md5sum = string(md5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x4e0e(%rip), %rsi      # 0x156c9
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0xd239
movq (%r14), %rdi
leaq 0x3ba3(%rip), %rsi      # 0x14474
callq 0x5150
movq %rax, %r14
leaq 0x4c49(%rip), %rsi      # 0x15529
leaq -0xc0(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x5810
movq %r14, %rdi
callq 0x5490
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq -0xc0(%rbp), %r14
movq %r14, %rdi
callq 0x51f0
leaq (%rax,%rbp), %rdx
addq $-0xc0, %rdx
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x80ec
addq $0x1a8, %rbx            # imm = 0x1A8
leaq -0x38(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5520
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x1094a
callq 0x5460
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1095c
callq 0x5460
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1096c
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10981
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: fileAttributes::compare_dir_attr(dirent)
bool fileAttributes::compare_dir_attr(struct dirent a) {

  return ((dir_attr.d_ino == a.d_ino) &&
    (dir_attr.d_off == a.d_off) &&
    (dir_attr.d_reclen == a.d_reclen) &&
    (dir_attr.d_type == a.d_type) &&
    (strcmp(dir_attr.d_name, a.d_name) == 0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
cmpq 0x10(%rbp), %rax
jne 0x109cb
leaq 0x10(%rbp), %rsi
movq 0x8(%rdi), %rax
cmpq 0x8(%rsi), %rax
jne 0x109cb
movzwl 0x10(%rdi), %eax
cmpw 0x10(%rsi), %ax
jne 0x109cb
movb 0x12(%rdi), %al
cmpb 0x12(%rsi), %al
jne 0x109cb
addq $0x13, %rdi
addq $0x13, %rsi
callq 0x55c0
testl %eax, %eax
sete %al
jmp 0x109cd
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: DiskContents::mount_disk()
int DiskContents::mount_disk() {
  // Construct and set mount_point
  mount_point = "/mnt/";
  mount_point += disk_path.substr(5);
  // Create the mount directory with read/write/search permissions for owner and group, 
  // and with read/search permissions for others.
  int ret = mkdir(mount_point.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
  if (ret == -1 && errno != EEXIST) {
    cout << "creating mountpoint failed" << endl;
    return -1;
  }
  // Mount the disk
  if (mount(disk_path.c_str(), mount_point.c_str(), fs_type.c_str(), MS_RDONLY, NULL) < 0) {
    return -1;
  }
  // sleep after mount
  unsigned int to_sleep = 0;
  do {
    to_sleep = sleep(to_sleep);
  } while (to_sleep > 0);

  device_mounted = true;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq 0x30(%rdi), %rdx
leaq 0x47e7(%rip), %rcx      # 0x15616
movl $0x5, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x56b0
leaq 0x8(%rbx), %rsi
leaq -0x38(%rbp), %r15
movl $0x5, %edx
movq %r15, %rdi
movq $-0x1, %rcx
callq 0x54c0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x5160
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e7c
callq 0x5460
movq (%r14), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x5200
cmpl $-0x1, %eax
jne 0x10e98
callq 0x5060
cmpl $0x11, (%rax)
jne 0x10ece
movq 0x8(%rbx), %rdi
movq 0x28(%rbx), %rsi
movq 0x48(%rbx), %rdx
xorl %r14d, %r14d
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x5840
testl %eax, %eax
js 0x10f10
movl %r14d, %edi
callq 0x5350
movl %eax, %r14d
testl %eax, %eax
jne 0x10eb8
movb $0x1, (%rbx)
xorl %eax, %eax
jmp 0x10f15
movq 0xb0f3(%rip), %rbx      # 0x1bfc8
leaq 0x4740(%rip), %rsi      # 0x1561c
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x54f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10f35
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: DiskContents::unmount_and_delete_mount_point()
int DiskContents::unmount_and_delete_mount_point() {
  // umount till successful
  int umount_res;
  int err;
  string command = "umount ";
  command += mount_point;
  do {
    umount_res = system(command.c_str());
    if (umount_res < 0) {
      err = errno;
      usleep(500);
    }
  } while (umount_res < 0 && err == EBUSY);

  // Delete the mount directory
  if (unlink(mount_point.c_str()) != 0) {
    return -1;
  }
  device_mounted = false;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x46d8(%rip), %rsi      # 0x15637
leaq 0x46d8(%rip), %rdx      # 0x1563e
leaq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x80ec
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
movq %r14, %rdi
callq 0x5160
movq -0x40(%rbp), %rdi
callq 0x53e0
movl %eax, %r14d
movl $0x10, %r12d
testl %eax, %eax
jns 0x10faa
callq 0x5060
movl (%rax), %r12d
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x55f0
testl %r14d, %r14d
jns 0x10fb5
cmpl $0x10, %r12d
je 0x10f82
movq 0x28(%rbx), %rdi
callq 0x5210
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x10fce
movb $0x0, (%rbx)
xorl %r14d, %r14d
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x10fdc
callq 0x5460
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10fee
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x10fff
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: isEmptyDirOrFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool isEmptyDirOrFile(string path) {
  DIR *directory = opendir(path.c_str());
  if (directory == NULL) {
    return true;
  }

  struct dirent *dir_entry;
  int num_dir_entries = 0;
  while (dir_entry = readdir(directory)) {
    if (++num_dir_entries > 2) {
      break;
    }
  }
  closedir(directory);
  if (num_dir_entries <= 2) {
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rdi
callq 0x5660
testq %rax, %rax
je 0x12d15
movq %rax, %rbx
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x5690
testq %rax, %rax
je 0x12d04
incl %r14d
cmpl $0x3, %r14d
jne 0x12ce8
movl $0x3, %r14d
movq %rbx, %rdi
callq 0x56f0
cmpl $0x3, %r14d
setb %al
jmp 0x12d17
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/williewillus[P]panda_scratchpad/src/checker/DiskContents.cpp
// Function: isFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool isFile(string path) {
  struct stat sb;
  if (stat(path.c_str(), &sb) < 0) {
    cout << __func__ << ": Failed stating " << path << endl;
    return false;
  }
  if (S_ISDIR(sb.st_mode)) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5410
testl %eax, %eax
js 0x12d55
movl $0xf000, %eax           # imm = 0xF000
andl -0x88(%rbp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
setne %al
jmp 0x12dbf
movq 0x926c(%rip), %r14      # 0x1bfc8
leaq 0x29f8(%rip), %rsi      # 0x1575b
movl $0x6, %edx
movq %r14, %rdi
callq 0x54f0
leaq 0x29eb(%rip), %rsi      # 0x15762
movl $0x11, %edx
movq %r14, %rdi
callq 0x54f0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x54f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: is_newPath()
bool is_newPath(){
	uint8_t *digest = sha256((unsigned char*)shmAddr, 0x1000);

	for (int i = 0; i < path.size(); i++){
		if (!memcmp(digest, path[i], 32)) return false;
	}

	path.push_back(digest);
	totalpath++;
	
	// debug
	// cout << "Path : " << totalpath << endl;
	// char buf[2*SHA256::DIGEST_SIZE+1];
    // buf[2*SHA256::DIGEST_SIZE] = 0;
    // for (int i = 0; i < SHA256::DIGEST_SIZE; i++)
    //     sprintf(buf+i*2, "%02x", digest[i]);
	// cout << buf << endl;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x4bdf(%rip), %rdi      # 0x71e8
movl $0x1000, %esi           # imm = 0x1000
callq 0x3d68
movq 0x4c5e(%rip), %rsi      # 0x7278
movq 0x4c4f(%rip), %rdx      # 0x7270
movq %rsi, %rcx
movq %rax, -0x10(%rbp)
subq %rdx, %rcx
sete %bl
je 0x26c6
sarq $0x3, %rcx
cmpq $0x1, %rcx
movq %rcx, %rdi
adcq $0x0, %rdi
movq (%rdx), %r8
movdqu (%rax), %xmm0
movdqu 0x10(%rax), %xmm1
movdqu (%r8), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r8), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %r8d
cmpl $0xffff, %r8d           # imm = 0xFFFF
je 0x26f2
movl $0x1, %r9d
movq %r9, %r8
cmpq %r9, %rdi
je 0x26c0
movq (%rdx,%r8,8), %r9
movdqu (%rax), %xmm0
movdqu 0x10(%rax), %xmm1
movdqu (%r9), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r9), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %r10d
leaq 0x1(%r8), %r9
cmpl $0xffff, %r10d          # imm = 0xFFFF
jne 0x267a
cmpq %r8, %rcx
setbe %bl
jmp 0x26f2
cmpq %r8, %rcx
setbe %bl
cmpq 0x4bb3(%rip), %rsi      # 0x7280
je 0x26dc
movq %rax, (%rsi)
addq $0x8, 0x4b9e(%rip)      # 0x7278
jmp 0x26ec
leaq 0x4b8d(%rip), %rdi      # 0x7270
leaq -0x10(%rbp), %rdx
callq 0x34ee
incl 0x4b06(%rip)            # 0x71f8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: Add_state(int)
void Add_state(int state){
	ofstream out("out/crash_log", ios::app);
	out << "======================================" << endl;
	out << "crash " << crash << endl;
	out << "  signal : " << (int)WTERMSIG(state) << endl;
	out.close();
	crash++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %edi, %ebx
leaq 0x166a(%rip), %rsi      # 0x4048
leaq -0x210(%rbp), %r14
movq %r14, %rdi
movl $0x1, %edx
callq 0x21d0
leaq 0x165d(%rip), %rsi      # 0x4056
movl $0x26, %edx
movq %r14, %rdi
callq 0x21f0
movq -0x210(%rbp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
leaq -0x210(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x1641(%rip), %rsi      # 0x407d
leaq -0x210(%rbp), %rdi
movl $0x6, %edx
callq 0x21f0
movl 0x47ad(%rip), %esi      # 0x7200
leaq -0x210(%rbp), %rdi
callq 0x2310
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x15f4(%rip), %rsi      # 0x4084
leaq -0x210(%rbp), %rdi
movl $0xb, %edx
callq 0x21f0
andl $0x7f, %ebx
leaq -0x210(%rbp), %rdi
movl %ebx, %esi
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq -0x210(%rbp), %rdi
callq 0x2280
incl 0x4712(%rip)            # 0x7200
movq 0x44db(%rip), %rax      # 0x6fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x208(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x210(%rbp,%rcx)
callq 0x2160
leaq -0x118(%rbp), %rdi
callq 0x20a0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: Add_to_corpus()
void Add_to_corpus(){
	ifstream in("out/cur_input.j2k", ios::ate);
	if (in.fail()){
        perror("open cur_input error!\n");
        exit(-1);
    }
	uint32_t length = in.tellg();
	in.seekg(0, ios::beg);

	uint8_t* buf = new uint8_t[length+1+4];
    memcpy(buf, &length, 4);
	in.read((char*)buf+4, length);
	corpus.insert(corpus.begin(), buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq 0x15a7(%rip), %rsi      # 0x411b
leaq -0x218(%rbp), %rbx
movq %rbx, %rdi
movl $0x2, %edx
callq 0x2350
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
jne 0x2c08
leaq -0x218(%rbp), %rdi
callq 0x2320
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
leal 0x5(%rbx), %edi
callq 0x2030
movq %rax, -0x10(%rbp)
movl %ebx, (%rax)
addq $0x4, %rax
movl %ebx, %edx
leaq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0x2230
movq 0x4676(%rip), %rsi      # 0x7258
leaq 0x466f(%rip), %rdi      # 0x7258
leaq -0x10(%rbp), %rdx
callq 0x3188
leaq -0x218(%rbp), %rdi
callq 0x2060
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %rbp
retq
callq 0x2398
jmp 0x2c13
jmp 0x2c13
jmp 0x2c13
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: run_target(char*, char**)
void run_target(char* target, char* argvs[]){

	pid_t pid = fork();
	int state;

	if (pid < 0){
		perror("fork() error!\n");
		exit(-1);
	}
	else if (pid == 0){
		execv(target, argvs);
		totalexec++;
		exit(0);
	}
	else {
		wait(&state);

		// Check if the testcase causes crash.
		if (is_crashed(state)){
			Add_to_report(state);
		}


		// Check if the testcase hits new code path.
		if (is_newPath()){
			// If it hits new code path, Add to corpus.
			Add_to_corpus();	
		}

		//printf("status : %d\n", state);
		//printf("child exited!\n");
	}	
	
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2070
testl %eax, %eax
js 0x2c8b
je 0x2c90
leaq -0x14(%rbp), %rbx
movq %rbx, %rdi
callq 0x2220
movl (%rbx), %ebx
movl %ebx, %eax
andl $0x7f, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x2c74
callq 0x2716
movl %ebx, %edi
callq 0x29c7
callq 0x25fc
testb %al, %al
je 0x2c82
callq 0x2b61
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x23b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2190
incl 0x455b(%rip)            # 0x71fc
xorl %edi, %edi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: shared_memory_init()
void shared_memory_init(){
	int shmID;
	
	if ((shmID = shmget((key_t)1337, 0x1000, IPC_CREAT | 0666)) < 0 ){
		perror("shmget() error!\n");
		exit(-1);
	}
	
	if ((shmAddr = shmat(shmID, (void*)0, 0)) == (void*)-1){
		perror("shmat() error!\n");
		exit(-1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1000, %esi           # imm = 0x1000
movl $0x539, %edi            # imm = 0x539
movl $0x3b6, %edx            # imm = 0x3B6
callq 0x2100
testl %eax, %eax
js 0x2cde
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
movq %rax, 0x4512(%rip)      # 0x71e8
cmpq $-0x1, %rax
je 0x2ce3
popq %rbp
retq
callq 0x23e0
callq 0x23c8
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: create_input()
void create_input(){
	// make cur_input file by <vector>input
	uint8_t* data = input.front();
	uint32_t length;

	memcpy((char*)&length, data, 4);

	ofstream out("out/cur_input.j2k", ios::binary);
	out.write((char*)data + 4, length);
	out.close();
	input.pop();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x4257(%rip), %rax      # 0x7218
movq (%rax), %rbx
movl (%rbx), %r14d
leaq 0x114d(%rip), %rsi      # 0x411b
leaq -0x218(%rbp), %r15
movq %r15, %rdi
movl $0x4, %edx
callq 0x21d0
addq $0x4, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2240
leaq -0x218(%rbp), %rdi
callq 0x2280
leaq 0x4201(%rip), %rdi      # 0x7208
callq 0x3956
movq 0x3fbd(%rip), %rax      # 0x6fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x210(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x218(%rbp,%rcx)
callq 0x2160
leaq -0x120(%rbp), %rdi
callq 0x20a0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/main.cc
// Function: main
int main(int argc, char* argv[]){

	char* target = TARGET;
	char* argvs[] = {TARGET, "-i", "out/cur_input.j2k", "-o", "out/tmp.pgm", NULL};

	printf("[+] target : %s\n", target);

	shared_memory_init();
	init_corpus();

	while (true){
	
		for (int i = 0; i < corpus.size(); i++){
			mutation(corpus[i]);

			// run target with the input created by mutation.
			int input_size = input.size();
			for (int j = 0; j < input_size; j++){
				create_input();
				//use_radamsa();
				run_target(target, argvs);
			}
		}
	}

	// cout << corpus.size() << endl;
	// int len = corpus.size();
	// for (int i = 0; i < len; i++){
	// 	char* tmp = corpus.front();
	// 	corpus.pop();
	// 	printf("%p\n", tmp);
	// 	printf("%s\n", tmp);
	// }

	// char* Data = reinterpret_cast<char*>(shmAddr);
	// printf("%p\n", shmAddr);
	// printf("%p\n", Data);

	// printf("Result : %s\n", shmAddr);
	// for (int i = 0; i < 0x100; i++){
	// 	if (i % 0x10 == 0) printf("\n");
	// 	printf("%x ", Data[i]);
	// }

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movaps 0x3d23(%rip), %xmm0     # 0x6da0
leaq -0x50(%rbp), %rbx
movaps %xmm0, 0x20(%rbx)
movaps 0x3d04(%rip), %xmm0     # 0x6d90
movaps %xmm0, 0x10(%rbx)
movaps 0x3ce9(%rip), %xmm0     # 0x6d80
movaps %xmm0, (%rbx)
leaq 0x10ca(%rip), %rdi      # 0x416b
leaq 0x1085(%rip), %r14      # 0x412d
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
callq 0x2ca8
callq 0x2ce8
movq 0x4195(%rip), %rax      # 0x7258
cmpq %rax, 0x4196(%rip)      # 0x7260
je 0x30bc
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
callq 0x2f64
movq 0x4171(%rip), %rax      # 0x7250
movl 0x414b(%rip), %ecx      # 0x7230
movl %eax, %edx
subl %ecx, %edx
shrl $0x3, %edx
cmpq $0x1, %rax
adcl $-0x1, %edx
shll $0x6, %edx
movq 0x413b(%rip), %rax      # 0x7238
subq 0x413c(%rip), %rax      # 0x7240
shrq $0x3, %rax
movq 0x4119(%rip), %r12      # 0x7228
subq 0x4102(%rip), %r12      # 0x7218
shrq $0x3, %r12
addl %eax, %r12d
addl %edx, %r12d
testl %r12d, %r12d
jle 0x313a
callq 0x2faa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c2a
decl %r12d
jne 0x3125
incq %r15
movq 0x411c(%rip), %rcx      # 0x7260
movq 0x410d(%rip), %rax      # 0x7258
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x30cf
jmp 0x30bc
// File: /workspace/github_cpp_makefile_star2_O1/ch4rli3kop[P]ch4rli3-fuzzer/sha256.cpp
// Function: sha256(unsigned char*, int)
unsigned char* sha256(unsigned char* input, int length)
{
    unsigned char* digest = new unsigned char[SHA256::DIGEST_SIZE];
    memset(digest,0,SHA256::DIGEST_SIZE);
 
    SHA256 ctx = SHA256();
    ctx.init();
    ctx.update(input, length);
    ctx.final(digest);
 
    return digest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movl %esi, %r14d
movq %rdi, %r15
movl $0x20, %edi
callq 0x2030
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
leaq -0xc8(%rbp), %r12
movl $0xa8, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x20f0
movaps 0x50c(%rip), %xmm0      # 0x42c0
movups %xmm0, 0x88(%r12)
movaps 0x50c(%rip), %xmm0      # 0x42d0
movups %xmm0, 0x98(%r12)
movq $0x0, (%r12)
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x3bc6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3c78
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Sequence.cpp
// Function: Sequence::setSize(int)
void Sequence::setSize(int _size) {
    if(_size > 16 || _size < 0) throw "Invalid capacity\n";
    if(size != _size) {
        unsigned char* temp = new unsigned char[_size];
        for(int i=0; i< _size; i++)
            temp[i] = sq[i];
        delete[] sq;
        sq = temp;
        size = _size;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x11, %esi
jae 0x3259
movl %esi, %ebx
movq %rdi, %r14
cmpl %esi, 0x8(%rdi)
je 0x324d
movl %ebx, %r12d
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
testl %ebx, %ebx
je 0x3239
movq (%r14), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
cmpq %rcx, %r12
jne 0x322a
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3246
callq 0x22b0
movq %r15, (%r14)
movl %ebx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x8, %edi
callq 0x2120
leaq 0x411c(%rip), %rcx      # 0x7386
movq %rcx, (%rax)
movq 0x7d4c(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Sequence.cpp
// Function: Sequence::updateSequence(Sequence)
void Sequence::updateSequence(Sequence seq) {
    if(size == (seq).getSize()) {
        for(int i=0; i < (seq).getSize(); i++)
            sq[i] = (seq).getSequence()[i];
    } else
        throw "Sequences of different size";   
}

// Assembly:
pushq %rax
cmpl %edx, 0x8(%rdi)
jne 0x32a0
testl %edx, %edx
jle 0x329e
movl %edx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
movq (%rdi), %r8
movb %dl, (%r8,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x328c
popq %rax
retq
movl $0x8, %edi
callq 0x2120
leaq 0x40e7(%rip), %rcx      # 0x7398
movq %rcx, (%rax)
movq 0x7d05(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Sequence.cpp
// Function: operator<<(std::ostream&, Sequence&)
ostream& operator<<(ostream& os, Sequence& seq) {
    for (int i=0; i < seq.getSize(); i++) 
        os << hex <<(int)seq.getSequence()[i]<< ' ';
    os << endl;
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x8(%rsi)
jle 0x3327
movq %rsi, %r14
xorl %r12d, %r12d
leaq 0x7(%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq (%r14), %rax
movzbl (%rax,%r12), %esi
movq %rbx, %rdi
callq 0x23e0
movb $0x20, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2260
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x32e1
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Sequence.cpp
// Function: operator^(Sequence&, Sequence&)
Sequence& operator^(Sequence& a, Sequence& b) {
    int m = min(a.getSize(), b.getSize());
    for (int i=0; i < m; i++) {
        a.getSequence()[i] ^= b.getSequence()[i];
    }
    return a;
}

// Assembly:
movq %rdi, %rax
movl 0x8(%rdi), %ecx
movl 0x8(%rsi), %edx
cmpl %ecx, %edx
cmovll %edx, %ecx
testl %ecx, %ecx
jle 0x3389
movl %ecx, %ecx
xorl %edx, %edx
movq (%rsi), %rdi
movb (%rdi,%rdx), %dil
movq (%rax), %r8
xorb %dil, (%r8,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x3373
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: Block::Block(std::vector<unsigned char, std::allocator<unsigned char>>*, bool)
Block::Block(vector<unsigned char>* input, bool pad) {
    if(pad) padding(input);
    Sequence sq = ((*input).size() >= 16) ? Sequence(16) : Sequence((*input).size());
    int j = 0;
    for (int i=0; i < (*input).size(); i++) {
        sq.getSequence()[j] = (unsigned) (*input).at(i);
        if (i%16==15) {
            sequenceVct.push_back(sq);      //Append 128 bits, and restart
            sq = (((*input).size()-(i+1)) >= 16) ? Sequence(16) : Sequence(((*input).size()-(i+1)));
            j = -1;
        }
        j++;
    }
    if (j != 0) sequenceVct.push_back(sq);       //Left over is padding was avoided
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
testl %edx, %edx
je 0x33ba
movq %r14, %rsi
callq 0x34ee
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x10, %rax
movl $0x10, %esi
cmovbl %eax, %esi
leaq 0x8(%rsp), %rdi
callq 0x31dc
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x34b7
xorl %r13d, %r13d
movq $-0x1, %rbp
xorl %r12d, %r12d
movb (%rax,%r13), %r15b
leaq 0x8(%rsp), %rdi
callq 0x31f0
movq (%rax), %rax
movslq %r12d, %rcx
movb %r15b, (%rax,%rcx)
movl %r13d, %eax
notl %eax
testb $0xf, %al
jne 0x3470
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x342b
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3438
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x364e
movq 0x8(%r14), %rsi
subq (%r14), %rsi
addq %rbp, %rsi
cmpq $0x10, %rsi
movl $0x10, %eax
cmovael %eax, %esi
leaq 0x18(%rsp), %rdi
callq 0x31dc
movl 0x20(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
incl %r12d
incq %r13
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
decq %rbp
cmpq %r13, %rcx
ja 0x33f1
testl %r12d, %r12d
je 0x34b7
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x34aa
movups 0x8(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x34b7
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x364e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x34ce
jmp 0x34ce
jmp 0x34ce
jmp 0x34ce
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x34e5
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r14, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: Block::~Block()
Block::~Block() {
    try {
        sequenceVct.clear();
        sequenceVct.shrink_to_fit();
    } catch (...) {
        cout<<"Could not clear the vector from memory!"<<endl;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x353f
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x3551
movq %rbx, %rdi
callq 0x378e
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3566
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
popq %rbx
jmp 0x2250
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Block.cpp
// Function: operator<<(std::ostream&, Block const&)
ostream& operator<<(ostream& os, const Block& block) {
    for (Sequence sq: block.sequenceVct) {
        for (int i = 0; i < sq.getSize(); i++) {
            os << hex << (int)sq.getSequence()[i]<<" ";
        }
        os << endl;
    }
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rsi), %r12
movq 0x8(%rsi), %r13
cmpq %r13, %r12
je 0x3630
movq %rsp, %r14
leaq 0x3c76(%rip), %r15      # 0x720d
movups (%r12), %xmm0
movaps %xmm0, (%rsp)
movq %r14, %rdi
callq 0x31f4
testl %eax, %eax
jle 0x35fc
xorl %ebp, %ebp
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rax
movzbl (%rax,%rbp), %esi
movq %rbx, %rdi
callq 0x23e0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2260
incq %rbp
movq %r14, %rdi
callq 0x31f4
cltq
cmpq %rax, %rbp
jl 0x35ae
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
addq $0x10, %r12
cmpq %r13, %r12
jne 0x3597
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/State.cpp
// Function: State::State(Sequence*)
State::State(Sequence* sq): s(new unsigned char*[4]) {
    for (int i=0; i < 4; i++) {
        s[i] = new unsigned char[4];
    }
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            s[i][j] = sq->getSequence()[i + 4*j];
        }
    }
}

/*
 * Destructor for cleanup
 */
State::~State() {
    try {
        for (int i=0; i < 4; i++) 
            for (int j=0; j < 4; j++) s[i][j] = 0;
    } catch (...) {
        throw "Failed to override the used State!\n";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x2030
movq %rax, (%r14)
xorl %r15d, %r15d
movl $0x4, %edi
callq 0x2030
movq (%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq $0x4, %r15
jne 0x39fe
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x31f0
movq (%rax), %rax
addq %r15, %rax
movb (%rax,%r12,4), %al
movq (%r14), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
incq %r12
cmpq $0x4, %r12
jne 0x3a1e
incq %r15
cmpq $0x4, %r15
jne 0x3a1b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/State.cpp
// Function: State::toSequence() const
Sequence State::toSequence() const {
    Sequence sq(16);
    for(int column = 0; column < 4; column++) {
        for(int row = 0; row < 4; row++){    
            sq.getSequence()[row + 4*column] = s[row][column];
        }
    }
    return sq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %esi
callq 0x31dc
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rax
movq (%rax,%r13,8), %rax
movb (%rax,%r12), %bpl
movq %r14, %rdi
callq 0x31f0
movq (%rax), %rax
addq %r15, %rax
movb %bpl, (%r13,%rax)
incq %r13
cmpq $0x4, %r13
jne 0x3aac
incq %r12
addq $0x4, %r15
cmpq $0x4, %r12
jne 0x3aa9
movq 0x8(%rsp), %rax
movl 0x10(%rsp), %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/State.cpp
// Function: operator<<(std::ostream&, State const&)
ostream& operator<<(ostream& os, const State& state) {
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            os << hex <<(int)state.s[i][j] << ' ';
        }
        os << endl;
    }
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0xf(%rsp), %r15
xorl %r13d, %r13d
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movzbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x23e0
movb $0x20, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2260
incq %r13
cmpq $0x4, %r13
jne 0x3b1a
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
incq %r12
cmpq $0x4, %r12
jne 0x3b17
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/State.cpp
// Function: operator^(State&, State&)
State& operator^(State& a, State& b) {
    for (int i=0; i < 4; i++) {
        for (int j=0; j < 4; j++) {
            a.s[i][j] ^= b.s[i][j];
        }
    }
    return a;
}

// Assembly:
movq %rdi, %rax
xorl %ecx, %ecx
xorl %edx, %edx
movq (%rsi), %rdi
movq (%rdi,%rcx,8), %rdi
movb (%rdi,%rdx), %dil
movq (%rax), %r8
movq (%r8,%rcx,8), %r8
xorb %dil, (%r8,%rdx)
incq %rdx
cmpq $0x4, %rdx
jne 0x3ba9
incq %rcx
cmpq $0x4, %rcx
jne 0x3ba7
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::Cipher(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int*, bool, bool)
Cipher::Cipher(string* _textPath, int* keyLength, bool padding, bool encrypt): 
        textPath(_textPath) {
    try {
        if(!fileExists(textPath)) throw "File given in path '-p' wasn't found\n";
        cryptoDir();
        setBlockRoundCombinations(keyLength, true);
        getKey(encrypt, &aesKeyPath, &aesKeyExp);
        getKey(encrypt, &macKeyPath, &macKeyExp);
        vector<unsigned char> inpVct;
        readText(&inpVct);
        inputBlock = new Block(&inpVct, padding);
    } catch(const char* str) {
        throw str;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %r13
movq %rdi, %rbx
movq %rsi, 0x28(%rdi)
leaq 0x40(%rdi), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x30(%rdi)
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movb %al, 0x40(%rdi)
leaq 0x50(%rdi), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x60(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movq %rcx, 0x50(%rdi)
movq %rax, 0x58(%rdi)
movb %al, 0x60(%rdi)
leaq 0x70(%rdi), %r15
leaq 0x80(%rdi), %r14
movq %r14, 0x70(%rdi)
movq %rax, 0x78(%rdi)
movb %al, 0x80(%rdi)
movq (%rsi), %rdi
leaq 0x20(%rsp), %rsi
callq 0x21f0
testl %eax, %eax
jne 0x3cfc
movq %rbx, %rdi
callq 0x3e0c
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x3e9e
movzbl %r12b, %r12d
movq %rbx, %rdi
movl %r12d, %esi
movq 0x18(%rsp), %rdx
movq %rbx, %rcx
callq 0x42a0
leaq 0x8(%rbx), %rcx
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x42a0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x447c
movl $0x18, %edi
callq 0x2240
movq %rax, %r12
movzbl %bpl, %edx
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x338c
movq %r12, 0x10(%rbx)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3cea
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x2120
leaq 0x390d(%rip), %rcx      # 0x761a
movq %rcx, (%rax)
movq 0x72a9(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
jmp 0x3d8c
movq %rdx, %r13
movq %rax, %rbp
movl $0x18, %esi
movq %r12, %rdi
callq 0x2250
jmp 0x3d3e
movq %rdx, %r13
movq %rax, %rbp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3d5d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x3d5d
movq %rdx, %r13
movq %rax, %rbp
cmpl $0x1, %r13d
jne 0x3d94
movq %rbp, %rdi
callq 0x20d0
movq %rax, %r12
movl $0x8, %edi
callq 0x2120
movq %r12, (%rax)
movq 0x723e(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
movq %rax, %rbp
callq 0x23a0
movq (%r15), %rdi
cmpq %r14, %rdi
je 0x3da7
movq (%r14), %rsi
incq %rsi
callq 0x2250
movq 0x18(%rsp), %rax
movq (%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x3dc6
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x30(%rbx), %rdi
cmpq 0x10(%rsp), %rdi
je 0x3de1
movq 0x10(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq %rbp, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::cryptoDir()
void Cipher::cryptoDir() {
    struct stat info;
    home = getenv("HOME");
    home += "/.crypto";
    char *pathname = &home[0];
    if(stat(pathname, &info) != 0) {
        mkdir(pathname, 0770);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x388a(%rip), %rdi      # 0x76ae
callq 0x2290
movq %rax, %r14
leaq 0x30(%rbx), %r15
movq 0x38(%rbx), %r12
movq %rax, %rdi
callq 0x20e0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x2360
leaq 0x385d(%rip), %rsi      # 0x76b3
movq %r15, %rdi
callq 0x2430
movq 0x30(%rbx), %rbx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x21f0
testl %eax, %eax
je 0x3e8e
movq %rbx, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20f0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::readText(std::vector<unsigned char, std::allocator<unsigned char>>*)
void Cipher::readText(vector<unsigned char>* inpVct) {
    ifstream input(*textPath, ios::binary);
    streampos textSize;             //Size of the file
    input.seekg(0, ios::end);
    textSize = input.tellg();
    input.seekg(0, ios::beg);
    inpVct->reserve(textSize);      //The vector will have enough space for all elements
    inpVct->insert(inpVct->begin(), 
        (istreambuf_iterator<char>(input)),
        (istreambuf_iterator<char>()));
    input.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq 0x28(%rdi), %rsi
movq %rsp, %r14
movq %r14, %rdi
movl $0x4, %edx
callq 0x2380
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
movq %rsp, %rdi
callq 0x23f0
movq %rax, %r14
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x62b8
movq (%rbx), %rsi
movq (%rsp), %rax
movq -0x18(%rax), %rax
movq 0xe8(%rsp,%rax), %rdx
movq %rbx, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x6550
movq %rsp, %rdi
callq 0x2050
movq %rsp, %rdi
callq 0x2070
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
jmp 0x4516
jmp 0x4516
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::getKeySize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
int Cipher::getKeySize(string* aesKey, string* macKey){
    ifstream aes(*aesKey, ios::binary);
    aes.seekg(0, ios::end);
    int aes_size = aes.tellg();
    ifstream mac(*macKey, ios::binary);
    mac.seekg(0, ios::end);
    int mac_size = mac.tellg();
    if(aes_size != mac_size)
        throw "AES and MAC key must be of the same size\n";
    return aes_size*8;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdx, %r14
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movl $0x4, %edx
callq 0x2380
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
leaq 0x210(%rsp), %rdi
callq 0x23f0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x2380
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
leaq 0x8(%rsp), %rdi
callq 0x23f0
cmpl %eax, %ebx
jne 0x4853
shll $0x3, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2070
leaq 0x210(%rsp), %rdi
callq 0x2070
movl %ebx, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
movl $0x8, %edi
callq 0x2120
leaq 0x2e20(%rip), %rcx      # 0x7684
movq %rcx, (%rax)
movq 0x6752(%rip), %rsi      # 0xafc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
jmp 0x487c
jmp 0x487c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2070
jmp 0x4892
jmp 0x488f
jmp 0x488f
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2400
nop
// File: /workspace/github_cpp_makefile_star2_O1/lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::~Cipher()
Cipher::~Cipher() {
    try {
        inputBlock->~Block();
        for(int j=0; j<4*(Nr+1); j++) {
            std::fill_n(aesKeyExp[j], 4, 0);
            delete[] aesKeyExp[j];
            std::fill_n(macKeyExp[j], 4, 0);
            delete[] macKeyExp[j];
        }
        delete[] aesKeyExp, macKeyExp;
    } catch (...) {
        cout<<"Could not clear the keyExpansion from memory!"<<endl;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x352e
movl 0x1c(%rbx), %eax
leal 0x4(,%rax,4), %eax
testl %eax, %eax
jle 0x4b5b
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rax
movl $0x0, (%rax)
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4b27
callq 0x22b0
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rax
movl $0x0, (%rax)
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4b47
callq 0x22b0
incq %r14
movl 0x1c(%rbx), %eax
leal 0x4(,%rax,4), %eax
cltq
cmpq %rax, %r14
jl 0x4b09
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4b68
callq 0x22b0
movq 0x70(%rbx), %rdi
leaq 0x80(%rbx), %rax
cmpq %rax, %rdi
je 0x4b83
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x50(%rbx), %rdi
leaq 0x60(%rbx), %rax
cmpq %rax, %rdi
je 0x4b9b
movq (%rax), %rsi
incq %rsi
callq 0x2250
movq 0x30(%rbx), %rdi
addq $0x40, %rbx
cmpq %rbx, %rdi
je 0x4bba
movq (%rbx), %rsi
incq %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
addq $0x8, %rsp
popq %rbx
popq %r14
retq