LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_dir.c
// Function: hm_dir_it_next
const hm_pair_t *hm_dir_it_next(hm_dir_it_t *it)
{
	const hm_pair_t *pair = NULL;

	size_t i;

	// step 1: find minimal in reverse order to find most recent.
	for(i = it->dir->count; i > 0; --i){
		const hm_pair_t *pair2 = it->p[i - 1].pair;

		// skip pair
		if (pair2 == NULL)
			continue;

		// initialize pair
		if (pair == NULL){
			pair = pair2;
			continue;
		}

		// compare and swap pair
		if (hm_pair_cmppair(pair, pair2) > 0)
			pair = pair2;
	}

	if (pair == NULL)
		return NULL;

	// step 2: increase all duplicates
	for(i = 0; i < it->dir->count; ++i){
		const hm_pair_t *pair2 = it->p[i].pair;

		if (pair2 && hm_pair_cmppair(pair, pair2) == 0){
			const hm_disktable_t *file = & it->dir->files[i];

			it->p[i].pair = hm_disktable_getat(file, ++it->p[i].pos);
		}
	}

	return pair;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jbe 0x1dbb
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq 0x18(%rsp), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x1d77
jmp 0x1dab
cmpq $0x0, 0x20(%rsp)
jne 0x1d8b
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x1dab
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2250
cmpl $0x0, %eax
jle 0x1da9
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x1dab
movq 0x18(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x1d43
cmpq $0x0, 0x20(%rsp)
jne 0x1dd1
movq $0x0, 0x30(%rsp)
jmp 0x1ea7
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x1e9d
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq 0x18(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x1e88
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2250
cmpl $0x0, %eax
jne 0x1e88
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x18(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq 0x18(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0x2680
movq %rax, %rcx
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq 0x18(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
jmp 0x1e8a
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x1dda
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_dir.c
// Function: hm_dir_printf
void hm_dir_printf(const hm_dir_t *dir)
{
	size_t i;
	for(i = 0; i < dir->count; ++i){
		hm_disktable_t *file = & dir->files[i];

		printf("%5zu : %s\n", i, file->filename);
	}
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x1f22
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
imulq $0x28, 0x8(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rsi
movq (%rsp), %rax
movq (%rax), %rdx
leaq 0x2221(%rip), %rdi      # 0x412c
movb $0x0, %al
callq 0x1080
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x1ed2
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_pair.c
// Function: hm_pair_createnx
hm_pair_t *hm_pair_createnx(const char*key, const char*val, hm_valsize_t vallen, uint32_t expires){
	/*
	Assumptions:
	1. key   is string, up to uint16_t
	2. value is blob up to uint32_t
	3. after the key we store \0 byte, so we can use it as C string.
	4. after the value we store \0 byte, so we can use it as C string.
	*/

	if (key == NULL)
		return NULL;

	// because we need to to thombstones someday, we allow empty values
	// we do not need to change the val
	if (val == NULL)
		vallen = 0;

	hm_keysize_t keylen = strlen(key);

	if (keylen >= MAX_KEYSIZE || vallen >= MAX_VALSIZE)
		return NULL;

	hm_pair_t *pair = xmalloc(sizeof(hm_pair_t) + keylen + 1 + vallen + 1);

	if (pair == NULL)
		return NULL;

#ifdef HM_PAIR_EXPIRATION
	pair->created	= htobe64(_hm_pair_now());
	pair->expires	= htobe32(expires);
#endif

	pair->keylen	= htobe16(keylen);
	pair->vallen	= htobe32(vallen);

	// memcpy so we can switch to blobs later...
	memcpy(& pair->buffer[0], key, keylen);
	pair->buffer[keylen] = '\0';

	// this is safe with NULL pointer.
	memcpy(& pair->buffer[keylen + 1], val, vallen);
	pair->buffer[keylen + 1 + vallen] = '\0';

	// this is dummy method if no checksum
	hm_pair_checksummake(pair);

#if 0
	printf("hm_pair_t @ %12p\nbuffer %12p\nkey %u\nval %u\n", pair, pair->buffer, keylen, vallen);
	size_t i;
	for(i = 0; i < keylen + 1 + vallen + 1; i++)
		printf("%3zu | %3u | %2X | %c\n", i, pair->buffer[i], pair->buffer[i], pair->buffer[i]);
#endif

	return pair;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x1f5c
movq $0x0, 0x30(%rsp)
jmp 0x2079
cmpq $0x0, 0x20(%rsp)
jne 0x1f6c
movl $0x0, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1060
movw %ax, 0x16(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jge 0x1f8e
cmpl $-0x1, 0x1c(%rsp)
jb 0x1f9c
movq $0x0, 0x30(%rsp)
jmp 0x2079
movzwl 0x16(%rsp), %eax
movl %eax, %edi
addq $0x7, %rdi
addq $0x1, %rdi
movl 0x1c(%rsp), %eax
addq %rax, %rdi
addq $0x1, %rdi
callq 0x1120
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x1fd6
movq $0x0, 0x30(%rsp)
jmp 0x2079
movzwl 0x16(%rsp), %edi
callq 0x2090
movw %ax, %cx
movq 0x8(%rsp), %rax
movw %cx, 0x4(%rax)
movl 0x1c(%rsp), %edi
callq 0x20c0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x8(%rsp), %rdi
addq $0x7, %rdi
movq 0x28(%rsp), %rsi
movzwl 0x16(%rsp), %eax
movl %eax, %edx
callq 0x10f0
movq 0x8(%rsp), %rax
movzwl 0x16(%rsp), %ecx
movb $0x0, 0x7(%rax,%rcx)
movq 0x8(%rsp), %rdi
addq $0x7, %rdi
movzwl 0x16(%rsp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %eax
movl %eax, %edx
callq 0x10f0
movq 0x8(%rsp), %rax
movzwl 0x16(%rsp), %ecx
addl $0x1, %ecx
addl 0x1c(%rsp), %ecx
movl %ecx, %ecx
movb $0x0, 0x7(%rax,%rcx)
movq 0x8(%rsp), %rdi
callq 0x2100
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_pair.c
// Function: hm_pair_printf
int hm_pair_printf(const hm_pair_t *pair){
	printf("| %s | %-12p | %-20s | %-20s |\n",
			"hm_pair_t",
			pair,
			hm_pair_getkey(pair),
			hm_pair_getval(pair)
	);

	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
callq 0x2190
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0x21a0
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %rax, %r8
leaq 0x1d99(%rip), %rdi      # 0x4137
leaq 0x1db2(%rip), %rsi      # 0x4157
movb $0x0, %al
callq 0x1080
xorl %eax, %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_pair.c
// Function: hm_pair_checksum_real
static hm_checksum_t _hm_pair_checksum_real(const char *data2, size_t len){
	// NMEA 0183 like checksum
	const hm_checksum_t *data = (const hm_checksum_t *) data2;
	hm_checksum_t sum = 0;

	size_t i;
	for(i = 0; i < len; i++)
		sum = sum ^ data[i];

	return sum;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movb $0x0, -0x19(%rsp)
movq $0x0, -0x28(%rsp)
movq -0x28(%rsp), %rax
cmpq -0x10(%rsp), %rax
jae 0x2417
movzbl -0x19(%rsp), %eax
movq -0x18(%rsp), %rcx
movq -0x28(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, -0x19(%rsp)
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rsp)
jmp 0x23e2
movb -0x19(%rsp), %al
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_open
hm_disktable_t *hm_disktable_open(hm_disktable_t *mmf, const char *filename)
{
	FILE *F = fopen(filename, "r");

	if (F == NULL)
		return NULL;

	fseek(F, 0, SEEK_END);

	off_t size = ftello(F);

	char *mem = mmap(NULL, size, PROT_READ, MAP_SHARED, fileno(F), /* offset */ 0);

	if (mem == MAP_FAILED){
		fclose(F);
		return NULL;
	}

	//printf("%s %llu %p\n", filename, size, mem);

	mmf->F = F;
	mmf->filename = filename;
	mmf->size = size;
	mmf->mem = mem;

	// memoize count instead to read it from the disk each time
	mmf->count = _hm_disktable_getcount(mem);

	return mmf;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1d27(%rip), %rsi      # 0x4161
callq 0x10d0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x245a
movq $0x0, 0x30(%rsp)
jmp 0x2529
movq 0x18(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x1130
movq 0x18(%rsp), %rdi
callq 0x10a0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x1100
movq (%rsp), %rsi
movl %eax, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %ecx
movq %r9, %rdi
movl %ecx, %edx
callq 0x1110
movq %rax, 0x8(%rsp)
movq $-0x1, %rax
cmpq %rax, 0x8(%rsp)
jne 0x24d2
movq 0x18(%rsp), %rdi
callq 0x1040
movq $0x0, 0x30(%rsp)
jmp 0x2529
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rdi
callq 0x2540
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_opena
hm_disktable_t *hm_disktable_opena(const char *filename)
{
	hm_disktable_t *mmf = malloc(sizeof(hm_disktable_t));

	if (mmf == NULL)
		return NULL;

	if (hm_disktable_open(mmf, filename))
		return mmf;

	free(mmf);

	return NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x28, %edi
callq 0x1120
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x2599
movq $0x0, 0x10(%rsp)
jmp 0x25ca
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x2420
cmpq $0x0, %rax
je 0x25b8
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x25ca
movq (%rsp), %rdi
callq 0x1030
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_getat
const void *hm_disktable_getat(const hm_disktable_t *mmf, uint64_t pos)
{
	if (pos >= mmf->count)
		return NULL;

	const char *mem = mmf->mem;

	const hm_disktable_fileformat_t *head = (hm_disktable_fileformat_t *) mem;

	const uint64_t ptr = be64toh( head->data[pos] );
	const void *pair = & mem[ptr];

	return pair;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jb 0x26a9
movq $0x0, 0x30(%rsp)
jmp 0x26f1
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x2700
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
addq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_it_open
hm_disktable_it_t *hm_disktable_it_open(const hm_disktable_t *mmf)
{
	hm_disktable_it_t *it = malloc(sizeof(hm_disktable_it_t));

	if (it == NULL)
		return NULL;

	it->mmf = mmf;
	it->pos = 0;

	return it;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x10, %edi
callq 0x1120
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x27d9
movq $0x0, 0x10(%rsp)
jmp 0x27fa
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_createfrommemtable
int hm_disktable_createfrommemtable(const hm_memtable_t *memtable, const char *filename_to_write)
{
	FILE *F = fopen(filename_to_write, "w");
	if (F == NULL){
		printf("Can not create a file %s...\n", filename_to_write);
		return 1;
	}

	int result = hm_disktable_createfrommemtablef(memtable, F);

	fclose(F);

	return result;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x18d9(%rip), %rsi      # 0x4163
callq 0x10d0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x28b9
movq 0x10(%rsp), %rsi
leaq 0x18bd(%rip), %rdi      # 0x4165
movb $0x0, %al
callq 0x1080
movl $0x1, 0x24(%rsp)
jmp 0x28de
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x28f0
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rdi
callq 0x1040
movl 0x4(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_createfrommemtablef
int hm_disktable_createfrommemtablef(const hm_memtable_t *memtable, FILE *F)
{
	uint64_t be;

	const uint64_t datacount = hm_memtable_count(memtable);
	const size_t header_size = sizeof(hm_disktable_fileformat_t);
	const size_t table_size  = sizeof(uint64_t) * datacount;

	/* preallocating the file do not really speed up the fwrite process.

	const size_t total_size  = header_size + table_size + hm_memtable_sizeof(memtable);
	posix_fallocate(fileno(F), 0, total_size);
	*/

	size_t current_place = header_size + table_size;


	// write table header (currently size only)
	hm_disktable_fileformat_t header;
	header.size = htobe64(datacount);
	fwrite(& header, sizeof(header), 1, F);

	hm_memtable_it_t *it = hm_memtable_it_open(memtable);

	if (it == NULL)
		return 1;

	const hm_pair_t *pair;

	// traverse and write the table.
	for(pair = hm_memtable_it_first(it); pair; pair = hm_memtable_it_next(it)){
		be = htobe64(current_place);
		fwrite(& be, sizeof(uint64_t), 1, F);

		current_place += hm_pair_sizeof(pair);
	}

	// traverse and write the data.
	for(pair = hm_memtable_it_first(it); pair; pair = hm_memtable_it_next(it)){
		hm_pair_fwrite(pair, F);
	}

	hm_memtable_it_close(it);

	return 0;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x3630
movq %rax, 0x30(%rsp)
movq $0x8, 0x28(%rsp)
movq 0x30(%rsp), %rax
shlq $0x3, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
callq 0x2700
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rcx
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x1160
movq 0x48(%rsp), %rdi
callq 0x3650
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x297e
movl $0x1, 0x54(%rsp)
jmp 0x2a23
movq 0x8(%rsp), %rdi
callq 0x3670
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x29de
movq 0x18(%rsp), %rdi
callq 0x2700
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x1160
movq (%rsp), %rdi
callq 0x2170
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%rsp), %rdi
callq 0x3680
movq %rax, (%rsp)
jmp 0x298c
movq 0x8(%rsp), %rdi
callq 0x3670
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x2a11
movq (%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x2320
movq 0x8(%rsp), %rdi
callq 0x3680
movq %rax, (%rsp)
jmp 0x29ec
movq 0x8(%rsp), %rdi
callq 0x3660
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_disktable.c
// Function: hm_disktable_locate_bsearch
static const void *_hm_disktable_locate_bsearch(const hm_disktable_t *mmf, const char *key, uint64_t *ppos)
{
	if (key == NULL)
		return NULL;

	uint64_t start = 0;
	uint64_t end = mmf->count;

	while (start < end){
		uint64_t mid = start + ((end - start) >> 1);

		const void *pair = hm_disktable_getat(mmf, mid);

		// This is highly unlikely, but better check it.
		if (pair == NULL)
			return NULL;

		//printf("| %lu %lu %lu | %lu | %lx | %s\n", start, mid, end, ptr, ptr, hm_pair_getkey(pair));

		const int cmp = strcmp(hm_pair_getkey(pair), key);

		if (cmp == 0){
			if (ppos)
				*ppos = mid;

			return pair;
		}

		if (cmp < 0){
			// go right
			start = mid + 1;
		}else{
			// go left
			end = mid;
		}
	}

	return NULL;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x2a59
movq $0x0, 0x40(%rsp)
jmp 0x2b33
movq $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x2b2a
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
subq 0x20(%rsp), %rcx
shrq %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2680
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x2ac1
movq $0x0, 0x40(%rsp)
jmp 0x2b33
movq 0x8(%rsp), %rdi
callq 0x2190
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x10b0
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jne 0x2b04
cmpq $0x0, 0x28(%rsp)
je 0x2af8
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x2b33
cmpl $0x0, 0x4(%rsp)
jge 0x2b1b
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2b25
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x2a70
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_create
hm_skiplist_t *hm_skiplist_create(hm_skiplist_t *l, hm_skiplist_height_t height)
{
	if (height == 0 || height > MAX_HEIGHT)
		height = DEF_HEIGHT;


	l->height = height;

	l->heads = malloc(2 * sizeof(void *) * (height + 1));

	if (l->heads == NULL)
		return NULL;

	l->loc = & l->heads[height];

	return _hm_skiplist_clear(l);
}

// Assembly:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x8(%rsp)
movb %al, 0x7(%rsp)
movzbl 0x7(%rsp), %eax
cmpl $0x0, %eax
je 0x2b64
movzbl 0x7(%rsp), %eax
cmpl $0x40, %eax
jle 0x2b69
movb $0x20, 0x7(%rsp)
movb 0x7(%rsp), %cl
movq 0x8(%rsp), %rax
movb %cl, 0x10(%rax)
movzbl 0x7(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x1120
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2bac
movq $0x0, 0x10(%rsp)
jmp 0x2bd9
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movzbl 0x7(%rsp), %eax
shlq $0x3, %rax
addq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rdi
callq 0x2bf0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_clear
static hm_skiplist_t *_hm_skiplist_clear(hm_skiplist_t *l)
{
	l->datasize = 0;
	l->datacount = 0;

	memset(l->heads, 0, l->height * sizeof(void *) );

	// no need to clean l->loc

	return l;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movq $0x0, (%rax)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rsp), %rax
movzbl 0x10(%rax), %eax
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x1090
movq (%rsp), %rax
popq %rcx
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_createa
hm_skiplist_t *hm_skiplist_createa(hm_skiplist_height_t height)
{
	hm_skiplist_t *l = malloc(sizeof(hm_skiplist_t));

	if (l == NULL)
		return NULL;

	if (hm_skiplist_create(l, height))
		return l;

	free(l);

	return NULL;
}

// Assembly:
subq $0x18, %rsp
movb %dil, %al
movb %al, 0xf(%rsp)
movl $0x28, %edi
callq 0x1120
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x2c5b
movq $0x0, 0x10(%rsp)
jmp 0x2c8c
movq (%rsp), %rdi
movzbl 0xf(%rsp), %esi
callq 0x2b40
cmpq $0x0, %rax
je 0x2c7a
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2c8c
movq (%rsp), %rdi
callq 0x1030
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_removeall
void hm_skiplist_removeall(hm_skiplist_t *l)
{
	hm_skiplist_node_t *copy;
	hm_skiplist_node_t *node;
	for(node = l->heads[0]; node; ){
		copy = node;

		node = node->next[0];

		hm_pair_free(copy->data);
		free(copy);
	}

	_hm_skiplist_clear(l);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x2d0e
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x2120
movq 0x8(%rsp), %rdi
callq 0x1030
jmp 0x2cd9
movq 0x10(%rsp), %rdi
callq 0x2bf0
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_locate
static const hm_skiplist_node_t *_hm_skiplist_locate(const hm_skiplist_t *l, const char *key, int complete_evaluation)
{
	// it is extremly dangerous to have key == NULL here.
	if (key == NULL){
		_hm_error("FATAL ERROR", __FILE__, __LINE__);
	}

	// smart over-optimizations, such skip NULL lanes or
	// start from the middle of the list did not pay off.

	int cmp = 1;

	const hm_skiplist_node_t *node = NULL;
	const hm_skiplist_node_t *prev = NULL;

	hm_skiplist_height_t height = l->height;
	while(height){
		node = prev ? prev : l->heads[height - 1];

		while(node){
			cmp = strcmp(hm_pair_getkey(node->data), key);

			if (cmp >= 0)
				break;

			prev = node;
			node = node->next[height - 1];
		}


		if (cmp == 0 && complete_evaluation == 0)
			return node;

		l->loc[height - 1] = (void *) prev;

		--height;
	}

	return cmp ? NULL : node;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl %edx, 0x2c(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x2fa2
leaq 0x11ff(%rip), %rdi      # 0x4190
leaq 0x1204(%rip), %rsi      # 0x419c
movl $0x110, %edx            # imm = 0x110
callq 0x3690
movl $0x1, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x38(%rsp), %rax
movb 0x10(%rax), %al
movb %al, 0x17(%rsp)
cmpb $0x0, 0x17(%rsp)
je 0x30a9
cmpq $0x0, 0x18(%rsp)
je 0x2fe7
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x3004
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movzbl 0x17(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x3063
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x2190
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x10b0
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jl 0x303d
jmp 0x3063
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movzbl 0x17(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
jmp 0x300e
cmpl $0x0, 0x28(%rsp)
jne 0x307d
cmpl $0x0, 0x2c(%rsp)
jne 0x307d
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x30ca
movq 0x18(%rsp), %rdx
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movzbl 0x17(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movb 0x17(%rsp), %al
addb $-0x1, %al
movb %al, 0x17(%rsp)
jmp 0x2fc8
cmpl $0x0, 0x28(%rsp)
je 0x30b8
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x30c1
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_height
static unsigned char _hm_skiplist_height(const hm_skiplist_t *l)
{
	// This gives slightly better performance,
	// than divide by 3 or multply by 0.33
	int part = RAND_MAX >> 1;

	// We execute rand() inside the loop,
	// but performance is fast enought.

	hm_skiplist_height_t h = 1;
	while(h < l->height && rand() > part)
		++h;

	return h;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x3fffffff, 0xc(%rsp)  # imm = 0x3FFFFFFF
movb $0x1, 0xb(%rsp)
movzbl 0xb(%rsp), %ecx
movq 0x10(%rsp), %rax
movzbl 0x10(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xa(%rsp)
jge 0x311e
callq 0x1180
cmpl 0xc(%rsp), %eax
setg %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x3128
jmp 0x3134
movb 0xb(%rsp), %al
addb $0x1, %al
movb %al, 0xb(%rsp)
jmp 0x30f6
movb 0xb(%rsp), %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_get
const hm_pair_t *hm_skiplist_get(const hm_skiplist_t *l, const char *key)
{
	if (key == NULL)
		return NULL;

	const hm_skiplist_node_t *node = _hm_skiplist_locate(l, key, 0);

	if (node)
		return node->data;

	return NULL;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x3161
movq $0x0, 0x20(%rsp)
jmp 0x3197
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2f70
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x318e
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x3197
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_remove
int hm_skiplist_remove(hm_skiplist_t *l, const char *key)
{
	if (key == NULL)
		return 0;

	hm_skiplist_node_t *node = (hm_skiplist_node_t *) _hm_skiplist_locate(l, key, 1);

	if ( ! node){
		// the key does not exists in the list.
		return 1;
	}

	hm_skiplist_height_t i;
	for(i = 0; i < l->height; ++i){
		hm_skiplist_node_t *prev = l->loc[i];

		if (prev){
			// check if lane go to this node...
			if (prev->next[i] == node)
				prev->next[i] = node->next[i];
		}else{
			// must be first
			if (l->heads[i] == node)
				l->heads[i] = node->next[i];
		}
	}

	l->datasize -= hm_pair_sizeof(node->data);
	l->datacount--;

	hm_pair_free(node->data);
	free(node);

	return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x31d3
movl $0x0, 0x34(%rsp)
jmp 0x330c
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x2f70
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x3201
movl $0x1, 0x34(%rsp)
jmp 0x330c
movb $0x0, 0x17(%rsp)
movzbl 0x17(%rsp), %eax
movq 0x28(%rsp), %rcx
movzbl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jge 0x32be
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movzbl 0x17(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x3271
movq 0x8(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movq 0x10(%rax,%rcx,8), %rax
cmpq 0x18(%rsp), %rax
jne 0x326f
movq 0x18(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movq 0x10(%rax,%rcx,8), %rdx
movq 0x8(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movq %rdx, 0x10(%rax,%rcx,8)
jmp 0x32ad
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movzbl 0x17(%rsp), %ecx
movq (%rax,%rcx,8), %rax
cmpq 0x18(%rsp), %rax
jne 0x32ab
movq 0x18(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movq 0x10(%rax,%rcx,8), %rdx
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movzbl 0x17(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x32ad
jmp 0x32af
movb 0x17(%rsp), %al
addb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0x3206
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x2170
movq %rax, %rdx
movq 0x28(%rsp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x2120
movq 0x18(%rsp), %rdi
callq 0x1030
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_printf_lanes
void hm_skiplist_printf_lanes(const hm_skiplist_t *l)
{
	hm_skiplist_height_t i;
	for(i = l->height; i >= 0; --i){
		printf("Lane # %5u :\n", i - 1);
		_hm_skiplist_printf_lane(l, i - 1);
	}
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movb 0x10(%rax), %al
movb %al, 0xf(%rsp)
movzbl 0xf(%rsp), %eax
cmpl $0x0, %eax
jl 0x3396
movzbl 0xf(%rsp), %esi
subl $0x1, %esi
leaq 0xe14(%rip), %rdi       # 0x4182
movb $0x0, %al
callq 0x1080
movq 0x10(%rsp), %rdi
movzbl 0xf(%rsp), %eax
subl $0x1, %eax
movzbl %al, %esi
callq 0x33a0
movb 0xf(%rsp), %al
addb $-0x1, %al
movb %al, 0xf(%rsp)
jmp 0x3355
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_printf_lane
static void _hm_skiplist_printf_lane(const hm_skiplist_t *l, hm_skiplist_height_t lane)
{
	unsigned char i = 0;
	const hm_skiplist_node_t *node;
	for(node = l->heads[lane]; node; node = node->next[lane]){
		hm_pair_printf(node->data);

		if (i > 16)
			break;

		++i;
	}
}

// Assembly:
subq $0x18, %rsp
movb %sil, %al
movq %rdi, 0x10(%rsp)
movb %al, 0xf(%rsp)
movb $0x0, 0xe(%rsp)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movzbl 0xf(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x3408
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x2360
movzbl 0xe(%rsp), %eax
cmpl $0x10, %eax
jle 0x33ea
jmp 0x3408
movb 0xe(%rsp), %al
addb $0x1, %al
movb %al, 0xe(%rsp)
movq (%rsp), %rax
movzbl 0xf(%rsp), %ecx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, (%rsp)
jmp 0x33cb
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_it_open
const hm_skiplist_it_t *hm_skiplist_it_open(const hm_skiplist_t *l)
{
	hm_skiplist_it_t *it = malloc(sizeof(hm_skiplist_it_t));
	if (it == NULL)
		return NULL;

	it->l = l;
	it->node = NULL;

	return it;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x10, %edi
callq 0x1120
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x3439
movq $0x0, 0x10(%rsp)
jmp 0x345a
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nmmmnu[P]HM2/hm_skiplist.c
// Function: hm_skiplist_it_next
const hm_pair_t *hm_skiplist_it_next(hm_skiplist_it_t *it)
{
	if (it->node == NULL)
		return NULL;

	const hm_skiplist_node_t *node = it->node;
	node = node->next[0];
	it->node = node;

	return node ? node->data : NULL;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x34ec
movq $0x0, -0x8(%rsp)
jmp 0x3540
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, -0x18(%rsp)
je 0x352d
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x3536
xorl %eax, %eax
movq %rax, -0x20(%rsp)
jmp 0x3536
movq -0x20(%rsp), %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_restore.c
// Function: main
int main(int argc, const char * argv[]) {
    if(argc != 3) {
        fprintf(stderr, "Usage: <image file name> <absolute path of rm file>\n");
        exit(1);
    }
    int fd = open(argv[1], O_RDWR);
    
    // map disk img into memory
    disk = mmap(NULL, 128 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
    if(disk == MAP_FAILED) {
        perror("mmap");
        exit(1);
    }
    
    // Init utils
    ext2_utils_init();
    
    //
    unsigned long path_len = strlen(argv[2]) + 1;
    char path[path_len];
    char path_parent[path_len];
    char path_name[EXT2_NAME_LEN];
    
    strcpy(path, argv[2]);
    clear_end_slash(path);
    cut_path(path, path_parent, path_name);
    
    // check if exist
    int parent_inode_num = get_inode_number_by_path(path_parent);
    if (parent_inode_num < 0) {
        return ENOENT;
    }
    
    struct ext2_inode *parent_inode = inode_table + parent_inode_num - 1;
    
    if (restore_from_dir_entry(parent_inode, path_name)) {
        return ENOENT;
    }
    
    
    
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x1271
movq 0x4da2(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x2da4(%rip), %rsi      # 0x4004
movb $0x0, %al
callq 0x10c0
movl $0x1, %edi
callq 0x1120
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x1100
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x20000, %esi          # imm = 0x20000
movl $0x3, %edx
movl $0x1, %ecx
movq %r9, %rdi
callq 0x1080
movq %rax, 0x4e01(%rip)      # 0x60b0
movq $-0x1, %rax
cmpq %rax, 0x4df3(%rip)      # 0x60b0
jne 0x12d5
leaq 0x2d73(%rip), %rdi      # 0x4039
callq 0x1110
movl $0x1, %edi
callq 0x1120
callq 0x1400
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1070
incq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rsp, %rcx
movq %rcx, -0x28(%rbp)
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x160(%rbp)
movq %rdi, %rsp
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x158(%rbp)
movq %rcx, %rsp
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x1060
movq -0x160(%rbp), %rdi
callq 0x2b10
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x2b70
movq -0x158(%rbp), %rdi
callq 0x18a0
movl %eax, -0x144(%rbp)
cmpl $0x0, -0x144(%rbp)
jge 0x139c
movl $0x2, -0x4(%rbp)
movl $0x1, -0x148(%rbp)
jmp 0x13f1
movq 0x4d15(%rip), %rax      # 0x60b8
movslq -0x144(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
addq $-0x80, %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x22c0
cmpl $0x0, %eax
je 0x13e7
movl $0x2, -0x4(%rbp)
movl $0x1, -0x148(%rbp)
jmp 0x13f1
movl $0x0, -0x148(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: ext2_utils_init
void ext2_utils_init() {
    // Init global varible.
    // setup sb, gdt, block_bitmap, inode_bitmap, inode_table
    sb = (struct ext2_super_block *)(disk + EXT2_BLOCK_SIZE);
    gdt = (struct ext2_group_desc *)(disk + EXT2_BLOCK_SIZE + sizeof(struct ext2_super_block));
    block_bitmap = (unsigned char *)(disk + (gdt->bg_block_bitmap * EXT2_BLOCK_SIZE));
    inode_bitmap = (unsigned char *)(disk + (gdt->bg_inode_bitmap * EXT2_BLOCK_SIZE));
    inode_table = (struct ext2_inode *)(disk + (gdt->bg_inode_table * EXT2_BLOCK_SIZE));
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x4ca5(%rip), %rax      # 0x60b0
movq (%rax), %rcx
addq $0x400, %rcx            # imm = 0x400
leaq 0x4ca4(%rip), %rax      # 0x60c0
movq %rcx, (%rax)
leaq 0x4c8a(%rip), %rax      # 0x60b0
movq (%rax), %rcx
addq $0x400, %rcx            # imm = 0x400
addq $0x400, %rcx            # imm = 0x400
leaq 0x4c8a(%rip), %rax      # 0x60c8
movq %rcx, (%rax)
leaq 0x4c68(%rip), %rax      # 0x60b0
movq (%rax), %rcx
leaq 0x4c76(%rip), %rax      # 0x60c8
movq (%rax), %rax
movl (%rax), %eax
shll $0xa, %eax
movl %eax, %eax
addq %rax, %rcx
leaq 0x4c6a(%rip), %rax      # 0x60d0
movq %rcx, (%rax)
leaq 0x4c40(%rip), %rax      # 0x60b0
movq (%rax), %rcx
leaq 0x4c4e(%rip), %rax      # 0x60c8
movq (%rax), %rax
movl 0x4(%rax), %eax
shll $0xa, %eax
movl %eax, %eax
addq %rax, %rcx
leaq 0x4c49(%rip), %rax      # 0x60d8
movq %rcx, (%rax)
leaq 0x4c17(%rip), %rax      # 0x60b0
movq (%rax), %rcx
leaq 0x4c25(%rip), %rax      # 0x60c8
movq (%rax), %rax
movl 0x8(%rax), %eax
shll $0xa, %eax
movl %eax, %eax
addq %rax, %rcx
leaq 0x4c00(%rip), %rax      # 0x60b8
movq %rcx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: get_inode_number_by_name
int get_inode_number_by_name(int in_which_dir_num,
                             char *name)
{
    // Inode index = inode number - 1
    // Get inode by inode index.
    struct ext2_inode *in_which_inode = inode_table + in_which_dir_num - 1;
    
    int curr_i_block = 0;
    int *in_which_inode_i_block_array = read_i_block_into_array(in_which_inode);
    // walk through each datablock of parent dir
    while (in_which_inode_i_block_array[curr_i_block] != -1) {
        unsigned char *in_which_inode_data = disk + EXT2_BLOCK_SIZE * in_which_inode_i_block_array[curr_i_block];
        
        // Dir entry struct
        struct ext2_dir_entry *entry;
        // Offset in data block
        int curr_entry_off = 0;
        // walk through datablock
        while (curr_entry_off < EXT2_BLOCK_SIZE) {
            entry = (struct ext2_dir_entry *)(in_which_inode_data + curr_entry_off);
            if (strncmp(entry->name, name, entry->name_len) == 0) {
                return entry->inode;
            }
            curr_entry_off += entry->rec_len;
        }
        curr_i_block++;
    }
    // If reach here no match found
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x4be2(%rip), %rax      # 0x60b8
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
addq $-0x80, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x15b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0x159c
leaq 0x4b97(%rip), %rax      # 0x60b0
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shll $0xa, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x400, -0x3c(%rbp)     # imm = 0x400
jge 0x158e
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rax
movzbl 0x6(%rax), %eax
movl %eax, %edx
callq 0x1050
cmpl $0x0, %eax
jne 0x157e
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x15a3
movq -0x38(%rbp), %rax
movzwl 0x4(%rax), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x153b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1500
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: read_i_block_into_array
int *read_i_block_into_array(struct ext2_inode *inode)
{
    int total_blocks = inode->i_blocks/2;
    int *result = malloc(sizeof(int) * (total_blocks + 1));
    int num_block_read = 0;
    int i;
    
    for (i = 0; i < 12; i++) {
        result[i] = inode->i_block[i];
        num_block_read++;
        if (num_block_read == total_blocks) {
            result[i + 1] = -1;
            return result;
        }
    }
    
    // If reach here, go into indirect_block
    num_block_read++;
    
    // Since disk size is 128kb, only consider the cases that
    //      there is only one indirect block.
    unsigned int *indirect_block = (unsigned int *)(disk + EXT2_BLOCK_SIZE * inode->i_block[12]);
    for (i = 0; i < EXT2_BLOCK_SIZE/4; i++) {
        result[12 + i] = indirect_block[i];
        num_block_read++;
        if (num_block_read == total_blocks) {
            result[12 + i + 1] = -1;
            return result;
        }
    }
    
    // If reach here, error
    free(result);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x10f0
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0xc, -0x28(%rbp)
jge 0x1648
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl 0x28(%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x163b
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16e9
jmp 0x163d
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x15ec
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
leaq 0x4a58(%rip), %rax      # 0x60b0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %ecx
shll $0xa, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x100, -0x28(%rbp)     # imm = 0x100
jge 0x16d8
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0xc, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x16cb
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0xc, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16e9
jmp 0x16cd
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1675
movq -0x20(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: get_inode_number_by_path
int get_inode_number_by_path(char *path)
{
    // Invaild path not start with '/'
    if (path[0] != '/') {
        return -1;
    }
    
    // Case: path = "/"
    if (strlen(path) == 1) {
        return 2;
    }
    
    return get_inode_number_by_path_helper(path + 1, 2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x18c1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18ee
movq -0x10(%rbp), %rdi
callq 0x1070
cmpq $0x1, %rax
jne 0x18d9
movl $0x2, -0x4(%rbp)
jmp 0x18ee
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl $0x2, %esi
callq 0x1700
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: ialloc
int ialloc(void) {
    if (gdt->bg_free_inodes_count == 0) {
        return -1;
    }
    
    unsigned char *inode_bitmap_ptr;
    int curr_byte = 0;
    int vaild_byte_count = sb->s_inodes_count/8;
    int curr_inode_num = 0;
    int i;
    
    while (curr_byte < vaild_byte_count) {
        inode_bitmap_ptr = inode_bitmap + curr_byte;
        for (i = 0; i < 8; i++) {
            curr_inode_num++;
            if (!((*inode_bitmap_ptr)>>i & 1)){
                // Set inode bitmap
                *inode_bitmap_ptr = *inode_bitmap_ptr | (1 << i);
                // Set gdt
                gdt->bg_free_inodes_count--;
                sb->s_free_inodes_count--;
                return curr_inode_num;
            }
            
        }
        curr_byte++;
    }
    
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x462d(%rip), %rax      # 0x60c8
movq (%rax), %rax
movzwl 0xe(%rax), %eax
cmpl $0x0, %eax
jne 0x1ab3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1b8e
movl $0x0, -0x14(%rbp)
leaq 0x45ff(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl (%rax), %eax
shrl $0x3, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1b87
leaq 0x45f2(%rip), %rax      # 0x60d8
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x8, -0x20(%rbp)
jge 0x1b79
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x20(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1b6c
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x20(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x4586(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xe(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xe(%rax)
leaq 0x4568(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1b8e
jmp 0x1b6e
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1afb
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ad3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: dalloc
int dalloc(void) {
    if (gdt->bg_free_blocks_count == 0) {
        return -1;
    }
    
    unsigned char *block_bitmap_ptr;
    int curr_byte = 0;
    int vaild_byte_count = sb->s_blocks_count/8;
    int curr_inode_num = 0;
    int i;
    
    while (curr_byte < vaild_byte_count) {
        block_bitmap_ptr = block_bitmap + curr_byte;
        for (i = 0; i < 8; i++) {
            if (!((*block_bitmap_ptr)>>i & 1)){
                // Update block bitmap
                *block_bitmap_ptr = *block_bitmap_ptr | (1 << i);
                // Update gdt
                gdt->bg_free_blocks_count--;
                sb->s_free_blocks_count--;
                return curr_inode_num;
            }
            curr_inode_num++;
        }
        curr_byte++;
    }
    
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x451d(%rip), %rax      # 0x60c8
movq (%rax), %rax
movzwl 0xc(%rax), %eax
cmpl $0x0, %eax
jne 0x1bc3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c9d
movl $0x0, -0x14(%rbp)
leaq 0x44ef(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0x4(%rax), %eax
shrl $0x3, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1c96
leaq 0x44d9(%rip), %rax      # 0x60d0
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x8, -0x20(%rbp)
jge 0x1c88
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x20(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1c74
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x20(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x447e(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xc(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xc(%rax)
leaq 0x4460(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1c9d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1c0c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1be4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)