LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: gshkl_free_context
void gshkl_free_context(greshunkel_ctext *ctext) {
	unsigned int i;
	for (i = 0; i < ctext->values->count; i++) {
		greshunkel_tuple *next = (greshunkel_tuple *)vector_get(ctext->values, i);
		if (next->type == GSHKL_ARR) {
			_gshkl_free_arr(next);
		} else if (next->type == GSHKL_SUBCTEXT) {
			gshkl_free_context((struct greshunkel_ctext *)next->value.sub_ctext);
		}
	}
	vector_free(ctext->values);
	vector_free(ctext->filter_functions);

	free(ctext);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
movl %ebp, %eax
movq (%rbx), %rdi
cmpq %rax, 0x10(%rdi)
jbe 0x237c
movl %ebp, %esi
callq 0x44dc
movl 0x20(%rax), %ecx
cmpl $0x2, %ecx
je 0x236f
testl %ecx, %ecx
jne 0x2378
movq 0x28(%rax), %rdi
callq 0x4603
jmp 0x2378
movq 0x28(%rax), %rdi
callq 0x233e
incl %ebp
jmp 0x2346
callq 0x4603
movq 0x8(%rbx), %rdi
callq 0x4603
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: regexec_2_0_beta
static int regexec_2_0_beta(const regex_t *preg, const char *string, size_t nmatch, match_t pmatch[]) {
	unsigned int i;
	regmatch_t matches[nmatch];
	memset(matches, 0, sizeof(matches));

	if (regexec(preg, string, nmatch, matches, 0) != 0) {
		return 1;
	}
	for (i = 0; i < nmatch; i++) {
		pmatch[i].rm_so = matches[i].rm_so;
		pmatch[i].rm_eo = matches[i].rm_eo;
		pmatch[i].len = matches[i].rm_eo - matches[i].rm_so;
		pmatch[i].start = string + matches[i].rm_so;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movq %rsp, %r12
leaq 0xf(,%rdx,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
leaq (,%rdx,8), %rdx
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x1120
movq -0x30(%rbp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x11c0
testl %eax, %eax
je 0x35d7
pushq $0x1
popq %rax
jmp 0x35e1
movslq (%r12,%rax,8), %rcx
imulq $0x18, %rax, %rdx
movl %ecx, (%rbx,%rdx)
movl 0x4(%r12,%rax,8), %esi
movl %esi, 0x4(%rbx,%rdx)
subl %ecx, %esi
movslq %esi, %rsi
movq %rsi, 0x8(%rbx,%rdx)
addq %r15, %rcx
movq %rcx, 0x10(%rbx,%rdx)
leal 0x1(%rax), %r13d
movl %r13d, %eax
cmpq %r14, %rax
jb 0x35ad
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: find_needle
static const void *find_needle(const greshunkel_ctext *ctext, const char *needle, int find_values) {
	const greshunkel_ctext *current_ctext = ctext;
	while (current_ctext != NULL) {
		vector *current_vector;
		current_vector = (find_values) ? current_ctext->values : current_ctext->filter_functions;
		unsigned int i;
		for (i = 0; i < current_vector->count; i++) {
			const greshunkel_named_item *item = (greshunkel_named_item *)vector_get(current_vector, i);
			assert(item->name != NULL);
			const size_t larger = strlen(item->name) > strlen(needle) ? strlen(item->name) : strlen(needle);
			if (strncmp(item->name, needle, larger) == 0)
				return item;
		}
		current_ctext = current_ctext->parent;
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %r14d, %r14d
testl %edx, %edx
sete %r14b
shll $0x3, %r14d
testq %rdi, %rdi
je 0x366e
movq %rdi, (%rsp)
movq (%rdi,%r14), %r15
xorl %ebp, %ebp
movl %ebp, %eax
cmpq %rax, 0x10(%r15)
jbe 0x3664
movq %r15, %rdi
movl %ebp, %esi
callq 0x44dc
testq %rax, %rax
je 0x3683
movq %rax, %r12
movq %rax, %rdi
callq 0x10c0
movq %rax, %r13
movq %rbx, %rdi
callq 0x10c0
cmpq %rax, %r13
cmovbeq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1060
incl %ebp
testl %eax, %eax
jne 0x361a
jmp 0x3671
movq (%rsp), %rdi
movq 0x10(%rdi), %rdi
jmp 0x360b
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30c3(%rip), %rdi      # 0x674d
leaq 0x2bad(%rip), %rsi      # 0x623e
leaq 0x30c8(%rip), %rcx      # 0x6760
movl $0x139, %edx            # imm = 0x139
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: is_truthy
static inline int _is_truthy(const greshunkel_tuple *tuple) {
	const int is_string = tuple->type == GSHKL_STR ? 1 : 0;
	const int is_loop = tuple->type == GSHKL_ARR ? 1 : 0;
	const int is_subcontext = tuple->type == GSHKL_SUBCTEXT ? 1 : 0;
	int is_null = 0;
	if (is_string) {
		is_null = strnlen(tuple->value.str, MAX_GSHKL_STR_SIZE) == 0 ? 1 : 0;
	} else if (is_loop) {
		is_null = tuple->value.arr == NULL;
	} else if (is_subcontext) {
		is_null = 0;
	}

	if (!is_null) {
		if (is_string) {
			const int says_false = strncmp(tuple->value.str, "FALSE", strlen("FALSE")) == 0 ? 1 : 0;
			m38_log_msg(LOG_DEBUG, "_is_truthy: !is_null is_string SF: %i", !says_false);
			return !says_false;
		} else if (is_loop) {
			const int has_items = tuple->value.arr->count > 0;
			m38_log_msg(LOG_DEBUG, "_is_truthy: !is_null is_loop has_items: %i", has_items);
			return has_items;
		}
		m38_log_msg(LOG_DEBUG, "_is_truthy: !is_null  is_subcontext: %i", is_subcontext);
		return is_subcontext;
	}

	int rc = (is_string || is_subcontext) && !is_null;
	m38_log_msg(LOG_DEBUG, "_is_truthy: complex: %i %i %i %i", rc, is_string, is_subcontext, !is_null);
	return rc;
}

// Assembly:
pushq %rbx
movl 0x20(%rdi), %edx
xorl %ebx, %ebx
cmpl $0x2, %edx
sete %bl
xorl %ecx, %ecx
cmpl $0x1, %edx
sete %al
jne 0x36e1
cmpb $0x0, 0x28(%rdi)
je 0x3716
addq $0x28, %rdi
leaq 0x1955(%rip), %rsi      # 0x501e
pushq $0x5
popq %rdx
callq 0x1060
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
leaq 0x31c8(%rip), %rsi      # 0x68a7
jmp 0x3708
testl %edx, %edx
je 0x36ee
leaq 0x320c(%rip), %rsi      # 0x68f8
jmp 0x3708
movq 0x28(%rdi), %rdx
testq %rdx, %rdx
je 0x3716
xorl %ebx, %ebx
cmpq $0x0, 0x10(%rdx)
setne %bl
leaq 0x31c5(%rip), %rsi      # 0x68cd
pushq $0x1
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x419c
jmp 0x3733
movb %al, %cl
leaq 0x3201(%rip), %rsi      # 0x6920
pushq $0x1
popq %rdi
xorl %edx, %edx
movl %ebx, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x419c
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: is_falsey
static inline int _is_falsey(const greshunkel_tuple *tuple) {
	const int is_string = tuple->type == GSHKL_STR ? 1 : 0;
	const int is_loop = tuple->type == GSHKL_ARR ? 1 : 0;
	const int is_subcontext = tuple->type == GSHKL_SUBCTEXT ? 1 : 0;

	int is_null = 0;
	if (is_string) {
		is_null = strnlen(tuple->value.str, MAX_GSHKL_STR_SIZE) == 0 ? 1 : 0;
	} else if (is_loop) {
		is_null = tuple->value.arr == NULL;
	} else if (is_subcontext) {
		is_null = 0;
	}
	if (!is_null) {
		if (is_string) {
			const int says_false = strncmp(tuple->value.str, "FALSE", strlen("FALSE")) == 0 ? 1 : 0;
			m38_log_msg(LOG_DEBUG, "_is_falsey: is_string SF: %i", says_false);
			return says_false;
		} else if (is_loop) {
			const int has_items = tuple->value.arr->count > 0;
			m38_log_msg(LOG_DEBUG, "_is_falsey: s_string is_loop has_items: %i", !has_items);
			return !has_items;
		}
		m38_log_msg(LOG_DEBUG, "_is_falsey: !is_null is_subcontext: %i", !is_subcontext);
		return !is_subcontext;
	}

	m38_log_msg(LOG_DEBUG, "_is_falsey: return 0");
	return 0;
}

// Assembly:
pushq %rbx
movl 0x20(%rdi), %eax
testl %eax, %eax
je 0x376d
cmpl $0x1, %eax
jne 0x3789
cmpb $0x0, 0x28(%rdi)
je 0x37a6
addq $0x28, %rdi
leaq 0x18c9(%rip), %rsi      # 0x501e
pushq $0x5
popq %rdx
callq 0x1060
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
leaq 0x31d6(%rip), %rsi      # 0x6941
jmp 0x3798
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x37a6
xorl %ebx, %ebx
cmpq $0x0, 0x10(%rax)
sete %bl
leaq 0x31d7(%rip), %rsi      # 0x695e
jmp 0x3798
xorl %ebx, %ebx
cmpl $0x2, %eax
setne %bl
leaq 0x31f1(%rip), %rsi      # 0x6989
pushq $0x1
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x419c
jmp 0x37b9
leaq 0x3203(%rip), %rsi      # 0x69b0
xorl %ebx, %ebx
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x419c
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/greshunkel.c
// Function: vishnu
static void vishnu(line *new_line_to_add, const match_t match, const char *result, const line *operating_line) {
	char *p;
	const size_t sizes[3] = {match.rm_so, strlen(result), operating_line->size - match.rm_eo};

	new_line_to_add->size = sizes[0] + sizes[1] + sizes[2];
	new_line_to_add->data = p = calloc(1, new_line_to_add->size + 1);

	memcpy(p, operating_line->data, sizes[0]);
	p += sizes[0];
	memcpy(p, result, sizes[1]);
	p += sizes[1];
	memcpy(p, operating_line->data + match.rm_eo, sizes[2]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
movslq 0x50(%rsp), %rbp
movq %rsi, %rdi
callq 0x10c0
movq %rax, %r15
movq (%r12), %rbx
movslq 0x54(%rsp), %rax
movq %rax, 0x8(%rsp)
subq %rax, %rbx
leaq (%r15,%rbp), %rax
leaq (%rax,%rbx), %rcx
movq %rcx, (%r13)
leaq (%rbx,%rax), %rsi
incq %rsi
pushq $0x1
popq %rdi
callq 0x1160
movq %rax, %r14
movq %rax, 0x8(%r13)
movq 0x8(%r12), %r12
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1190
addq %rbp, %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x1190
addq %r15, %r14
addq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/vector.c
// Function: vector_new
vector *vector_new(const size_t item_size, const size_t initial_element_count) {
	vector _vec = {
		.item_size = item_size,
		.max_size = initial_element_count,
		.count = 0,
		.items = calloc(1, initial_element_count * item_size + 1)
	};

	vector *to_return = calloc(1, sizeof(vector));
	memcpy(to_return, &_vec, sizeof(vector));

	return to_return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
imulq %rdi, %rsi
incq %rsi
pushq $0x1
popq %r15
movq %r15, %rdi
callq 0x1160
movq %rax, %r12
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x1160
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movq %r12, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/vector.c
// Function: vector_append
inline int vector_append(vector *vec, const void *item, const size_t item_size) {
	if (vec == NULL)
		return 0;

	if (item_size > vec->item_size)
		return 0;

	if (vec->count == vec->max_size) {
		vec->max_size *= 2;
		void *array = realloc(vec->items, vec->max_size * vec->item_size + 1);
		if (!array)
			return 0;
		vec->items = array;
	}

	if (item_size != 0 && item != NULL) {
		memcpy(nth(vec->count), item, item_size);
		memset(nth(vec->count) + item_size, '\0', sizeof(char));
	} else {
		/* Just zero out the memory so we can check for NULLs. */
		memset(nth(vec->count), 0, vec->item_size);
	}
	vec->count++;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x446a
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rdx, %rax
jb 0x446a
movq %rsi, %r15
movq 0x10(%rbx), %rsi
cmpq 0x8(%rbx), %rsi
jne 0x441f
addq %rsi, %rsi
movq %rsi, 0x8(%rbx)
movq 0x18(%rbx), %rdi
imulq %rax, %rsi
incq %rsi
callq 0x11d0
testq %rax, %rax
je 0x446a
movq %rax, 0x18(%rbx)
testq %r14, %r14
sete %al
testq %r15, %r15
sete %cl
movq (%rbx), %rdx
movq 0x10(%rbx), %rdi
imulq %rdx, %rdi
addq 0x18(%rbx), %rdi
orb %al, %cl
jne 0x445c
movq %r15, %rsi
movq %r14, %rdx
callq 0x1190
movq (%rbx), %rax
imulq 0x10(%rbx), %rax
addq 0x18(%rbx), %rax
movb $0x0, (%r14,%rax)
jmp 0x4463
xorl %esi, %esi
callq 0x1120
incq 0x10(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/vector.c
// Function: vector_append_ptr
inline int vector_append_ptr(vector *vec, const void *pointer) {
	if (vec == NULL)
		return 0;

	if (vec->item_size != sizeof(pointer))
		return 0;

	if (vec->count == vec->max_size) {
		vec->max_size *= 2;
		void *array = realloc(vec->items, (vec->max_size * vec->item_size));
		if (!array)
			return 0;
		vec->items = array;
	}

	memcpy(nth(vec->count), &pointer, sizeof(void *));
	vec->count++;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x44d5
movq %rdi, %rbx
cmpq $0x8, (%rdi)
jne 0x44d5
movq %rsi, %r14
movq 0x10(%rbx), %rsi
cmpq 0x8(%rbx), %rsi
jne 0x44bf
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x4, %rsi
callq 0x11d0
testq %rax, %rax
je 0x44d5
movq %rax, 0x18(%rbx)
movq (%rbx), %rcx
movq 0x10(%rbx), %rsi
jmp 0x44c6
movq 0x18(%rbx), %rax
pushq $0x8
popq %rcx
imulq %rsi, %rcx
movq %r14, (%rax,%rcx)
incq 0x10(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]38-Moths/src/vector.c
// Function: vector_reverse
int vector_reverse(vector *vec) {
	if (vec == NULL)
		return 0;

	const size_t item_size = vec->item_size;
	unsigned int i = 0;

	unsigned char *buf = malloc(item_size);
	if (!buf)
		return 0;

	for (;i < (unsigned int)(vec->count / 2); i++) {
		const void *item = vector_get(vec, i);
		const unsigned int offset = vec->count - i - 1;
		if (!memcpy(buf, vector_get(vec, offset), item_size))
			return 0;

		if (!memcpy(nth(offset), item, item_size))
			return 0;

		if (!memcpy(nth(i), buf, item_size))
			return 0;
	}
	free(buf);

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $0x0, (%rsp)
testq %rdi, %rdi
je 0x45f0
movq %rdi, %r15
movq (%rdi), %r13
movq %r13, %rdi
callq 0x11a0
testq %rax, %rax
je 0x45f0
movq %rax, %rbx
pushq $-0x1
popq %r12
xorl %r14d, %r14d
movq %r13, 0x8(%rsp)
movq 0x10(%r15), %rax
movq %rax, %rcx
shrq %rcx
movl %ecx, %ecx
cmpq %rcx, %r14
jae 0x45e1
movq (%r15), %r13
movq 0x8(%r15), %rcx
movq 0x18(%r15), %rsi
movq %r13, %rbp
imulq %r14, %rbp
addq %rsi, %rbp
movq %rsi, 0x10(%rsp)
xorl %edi, %edi
cmpq %r14, %rcx
cmovbq %rdi, %rbp
addl %r12d, %eax
imulq %rax, %r13
addq %rsi, %r13
cmpq %rax, %rcx
movq %r13, %rsi
movl $0x0, %eax
movq %rax, (%rsp)
cmovbq %rdi, %rsi
movq %rbx, %rdi
movq 0x8(%rsp), %rdx
callq 0x1190
movq %r13, %rdi
movq 0x8(%rsp), %r13
movq %rbp, %rsi
movq %r13, %rdx
callq 0x1190
cmpq $0x0, 0x10(%rsp)
je 0x45f0
movq 0x18(%r15), %rbp
movq (%r15), %rdi
imulq %r14, %rdi
addq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1190
incq %r14
decq %r12
testq %rbp, %rbp
jne 0x453a
jmp 0x45f0
movq %rbx, %rdi
callq 0x1030
pushq $0x1
popq %rax
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2recover.c
// Function: bsOpenReadStream
static BitStream* bsOpenReadStream ( FILE* stream )
{
   BitStream *bs = malloc ( sizeof(BitStream) );
   if (bs == NULL) mallocFail ( sizeof(BitStream) );
   bs->handle = stream;
   bs->buffer = 0;
   bs->buffLive = 0;
   bs->mode = 'r';
   return bs;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x10b0
testq %rax, %rax
je 0x1956
movq %rbx, (%rax)
andq $0x0, 0x8(%rax)
movb $0x72, 0x10(%rax)
popq %rbx
retq
callq 0x1a96
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2recover.c
// Function: bsGetBit
static Int32 bsGetBit ( BitStream* bs )
{
   if (bs->buffLive > 0) {
      bs->buffLive --;
      return ( ((bs->buffer) >> (bs->buffLive)) & 0x1 );
   } else {
      Int32 retVal = getc ( bs->handle );
      if ( retVal == EOF ) {
         if (errno != 0) readError();
         return 2;
      }
      bs->buffLive = 7;
      bs->buffer = retVal;
      return ( ((bs->buffer) >> 7) & 0x1 );
   }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %ecx
testl %ecx, %ecx
jle 0x1978
decl %ecx
movl %ecx, 0xc(%rbx)
movl 0x8(%rbx), %edx
xorl %eax, %eax
btl %ecx, %edx
setb %al
jmp 0x19a4
movq (%rbx), %rdi
callq 0x1130
cmpl $-0x1, %eax
je 0x1997
movl $0x7, 0xc(%rbx)
movl %eax, 0x8(%rbx)
shrl $0x7, %eax
andl $0x1, %eax
jmp 0x19a4
callq 0x1040
cmpl $0x0, (%rax)
jne 0x19a6
pushq $0x2
popq %rax
popq %rbx
retq
callq 0x1adb
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2recover.c
// Function: bsClose
static void bsClose ( BitStream* bs )
{
   Int32 retVal;

   if ( bs->mode == 'w' ) {
      while ( bs->buffLive < 8 ) {
         bs->buffLive++;
         bs->buffer <<= 1;
      };
      retVal = putc ( (UChar) (bs->buffer), bs->handle );
      if (retVal == EOF) writeError();
      bytesOut++;
      retVal = fflush ( bs->handle );
      if (retVal == EOF) writeError();
   }
   retVal = fclose ( bs->handle );
   if (retVal == EOF) {
      if (bs->mode == 'w') writeError(); else readError();
   }
   free ( bs );
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x77, 0x10(%rdi)
jne 0x19ec
movl 0xc(%rbx), %eax
cmpl $0x7, %eax
jg 0x19c7
incl %eax
movl %eax, 0xc(%rbx)
shll 0x8(%rbx)
jmp 0x19b8
movzbl 0x8(%rbx), %edi
movq (%rbx), %rsi
callq 0x1090
cmpl $-0x1, %eax
je 0x1a08
incq 0x26e1(%rip)            # 0x40c0
movq (%rbx), %rdi
callq 0x10c0
cmpl $-0x1, %eax
je 0x1a08
movq (%rbx), %rdi
callq 0x1060
cmpl $-0x1, %eax
je 0x1a02
movq %rbx, %rdi
popq %rbx
jmp 0x1030
cmpb $0x77, 0x10(%rbx)
jne 0x1a0d
callq 0x1b2c
callq 0x1adb
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2recover.c
// Function: bsPutBit
static void bsPutBit ( BitStream* bs, Int32 bit )
{
   if (bs->buffLive == 8) {
      Int32 retVal = putc ( (UChar) bs->buffer, bs->handle );
      if (retVal == EOF) writeError();
      bytesOut++;
      bs->buffLive = 1;
      bs->buffer = bit & 0x1;
   } else {
      bs->buffer = ( (bs->buffer << 1) | (bit & 0x1) );
      bs->buffLive++;
   };
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %eax
cmpl $0x8, %eax
jne 0x1a4f
movzbl %cl, %edi
movq (%rbx), %rsi
callq 0x1090
cmpl $-0x1, %eax
je 0x1a67
incq 0x2682(%rip)            # 0x40c0
movl $0x1, 0xc(%rbx)
andl $0x1, %r14d
movl %r14d, 0x8(%rbx)
jmp 0x1a5f
andl $0x1, %r14d
leal (%r14,%rcx,2), %ecx
movl %ecx, 0x8(%rbx)
incl %eax
movl %eax, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x1b2c
// File: /workspace/github_c_makefile_star2_O2/coapp-packages[P]bzip2/bzip2recover.c
// Function: readError
static void readError ( void )
{
   fprintf ( stderr,
             "%s: I/O error reading `%s', possible reason follows.\n",
            progName, inFileName );
   perror ( progName );
   fprintf ( stderr, "%s: warning: output file(s) may be incomplete.\n",
             progName );
   exit ( 1 );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x2512(%rip), %r14      # 0x3ff8
movq (%r14), %rdi
leaq 0x78b(%rip), %rsi       # 0x227b
leaq 0x25d9(%rip), %rbx      # 0x40d0
leaq 0x3572(%rip), %rcx      # 0x5070
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10a0
movq %rbx, %rdi
callq 0x10e0
movq (%r14), %rdi
leaq 0x731(%rip), %rsi       # 0x224b
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10a0
pushq $0x1
popq %rdi
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_unicode2wchar
static const wchar_t *regf_unicode2wchar(const void *ptr, unsigned len)
{
#define __MAX_LEN	50
	static wchar_t __obuf[__MAX_LEN + 4 + 1];
	uint16_t __ibuf[__MAX_LEN * 2];
	unsigned __len;
	char *ibuf = (char *)__ibuf;
	char *obuf = (char *)__obuf;
	size_t ilen, olen, res;

	__len = len / 2 > __MAX_LEN ? __MAX_LEN : len / 2;

	memcpy(__ibuf, ptr, __len * sizeof(__ibuf[0]));

	ilen = __len * sizeof(__ibuf[0]);
	olen = __len * sizeof(__obuf[0]);

	iconv(st.icd, NULL, NULL, NULL, NULL);	/* Reset descriptor */

	res = iconv(st.icd, &ibuf, &ilen, &obuf, &olen);
	if (res == (size_t)-1)
		return L"<error>";

	if (__len != len / 2) {
		__obuf[__MAX_LEN + 0] = '.';
		__obuf[__MAX_LEN + 1] = '.';
		__obuf[__MAX_LEN + 2] = '.';
		__obuf[__MAX_LEN + 3] = '\0';
	} else {
		__obuf[__len] = '\0';
	}

	return __obuf;
#undef __MAX_LEN
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %esi, %ebp
movq %rdi, %rsi
leaq 0x20(%rsp), %rdi
movq %rsp, %rax
movq %rdi, (%rax)
leaq 0x5371(%rip), %rbx      # 0x7140
leaq 0x18(%rsp), %r15
movq %rbx, (%r15)
movl %ebp, %eax
shrl %eax
cmpl $0x66, %ebp
pushq $0x32
popq %r14
cmovbl %eax, %r14d
movl %r14d, %r12d
addl %r12d, %r12d
movq %r12, %rdx
callq 0x10e0
leaq 0x10(%rsp), %r13
movq %r12, (%r13)
leaq (,%r14,4), %rax
leaq 0x8(%rsp), %r12
movq %rax, (%r12)
movq 0x52db(%rip), %rdi      # 0x70f0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1050
movq 0x52c6(%rip), %rdi      # 0x70f0
movq %rsp, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x1050
cmpq $-0x1, %rax
je 0x1e6a
cmpl $0x66, %ebp
jb 0x1e73
movabsq $0x2e0000002e, %rax     # imm = 0x2E0000002E
movq %rax, 0x53b1(%rip)      # 0x7208
movl $0x2e, 0x53af(%rip)     # 0x7210
leaq 0x53ac(%rip), %rax      # 0x7214
jmp 0x1e77
leaq 0x303b(%rip), %rbx      # 0x4eac
jmp 0x1e7a
leaq (%rbx,%r14,4), %rax
andl $0x0, (%rax)
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_lst
static int regf_parse_lst(const char *pref, unsigned off)
{
	const struct regf_cell *rc = st.data + off;
	const struct regf_lst *lst = (void *)rc->data;

	if (regf_cell_check_len(st.data, off, "lst", sizeof(*lst)))
		return -1;

	printf("%s%.2s.{off,len} = 0x%08X, 0x%08X\n", pref, lst->sign, off, -rc->sz);

	if (strncmp(lst->sign, "lf", 2) == 0) {
		return regf_parse_lst_lf(pref, off);
	} else if (strncmp(lst->sign, "lh", 2) == 0) {
		return regf_parse_lst_lh(pref, off);
	} else if (strncmp(lst->sign, "li", 2) == 0) {
		return regf_parse_lst_li(pref, off);
	} else if (strncmp(lst->sign, "ri", 2) == 0) {
		return regf_parse_lst_ri(pref, off);
	} else {
		PR_ERR(off, "lst", "unexpected list signature\n");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x5260(%rip), %r15      # 0x7100
leaq 0x2e5c(%rip), %rdx      # 0x4d03
pushq $0x4
popq %rcx
movq %r15, %rdi
callq 0x3152
testl %eax, %eax
jne 0x1f5a
movl %ebx, %eax
addq %rax, %r15
leaq 0x4(%r15), %rdx
xorl %r8d, %r8d
subl (%r15), %r8d
leaq 0x2821(%rip), %rdi      # 0x46f1
movq %r14, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10a0
movzbl 0x4(%r15), %eax
cmpl $0x72, %eax
je 0x1f01
cmpl $0x6c, %eax
jne 0x1f43
cmpb $0x66, 0x5(%r15)
jne 0x1f17
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x2093
cmpb $0x69, 0x5(%r15)
jne 0x1f43
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x2383
cmpb $0x68, 0x5(%r15)
jne 0x1f2d
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x2199
cmpb $0x69, 0x5(%r15)
jne 0x1f43
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x2292
leaq 0x27d6(%rip), %rdi      # 0x4720
leaq 0x2db2(%rip), %rdx      # 0x4d03
movl %ebx, %esi
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_vlst
static int regf_parse_vlst(const char *pref, unsigned off, unsigned num)
{
#define VLST_PR_WARN(__fmt, ...)	PR_WARN(off, "vlst", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const uint32_t *vals = (void *)rc->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	unsigned i;
	int res, ret = 0;

	if (regf_cell_check_len(st.data, off, "vlst", num * sizeof(vals[0])))
		return -1;

	printf("%svals.{off,len} = 0x%08X, 0x%08X\n", pref, off, -rc->sz);

	snprintf(__pref, sizeof(__pref), "%s  ", pref);

	for (i = 0; i < num; ++i) {
		printf("%svals[%u] = 0x%08X\n", pref, i, vals[i]);
		cell = cache_cell_find(vals[i]);
		if (!cell) {
			VLST_PR_WARN("could not find value cell 0x%08X\n",
				     vals[i]);
			ret = -1;
			continue;
		}
		cache_cell_updref(cell, CT_VK);
		res = regf_parse_vk(__pref, vals[i]);
		if (res) {
			VLST_PR_WARN("could not parse value key in cell 0x%08X\n",
				     vals[i]);
			ret = -1;
			continue;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r14
movq 0x517d(%rip), %r15      # 0x7100
callq 0x1080
movq %rsp, %r13
movq %rax, -0x30(%rbp)
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq %rbx, -0x38(%rbp)
leal (,%rbx,4), %ecx
leaq 0x2942(%rip), %rdx      # 0x48f1
movq %r15, %rdi
movl %r12d, %esi
callq 0x3152
testl %eax, %eax
je 0x1fd2
pushq $-0x1
popq %rbx
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %eax
addq %rax, %r15
movq -0x30(%rbp), %rbx
addq $0x3, %rbx
xorl %ecx, %ecx
subl (%r15), %ecx
leaq 0x290a(%rip), %rdi      # 0x48f6
movq %r14, %rsi
movl %r12d, -0x30(%rbp)
movl %r12d, %edx
xorl %eax, %eax
callq 0x10a0
leaq 0x22f8(%rip), %rdx      # 0x42fc
movq %r13, -0x40(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movl -0x38(%rbp), %r12d
xorl %r13d, %r13d
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x1fc1
movl 0x4(%r15,%r13,4), %ecx
leaq 0x28e7(%rip), %rdi      # 0x4919
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10a0
movl 0x4(%r15,%r13,4), %edi
callq 0x1859
leaq 0x28de(%rip), %rdi      # 0x492e
testq %rax, %rax
je 0x2075
incl 0x24(%rax)
orb $0x40, 0x28(%rax)
movl 0x4(%r15,%r13,4), %esi
movq -0x40(%rbp), %rdi
callq 0x2474
leaq 0x28ef(%rip), %rdi      # 0x4960
testl %eax, %eax
je 0x208e
movl 0x4(%r15,%r13,4), %ecx
movl -0x30(%rbp), %esi
leaq 0x286d(%rip), %rdx      # 0x48f1
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %rbx
incq %r13
jmp 0x2021
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_lst_lf
static int regf_parse_lst_lf(const char *pref, unsigned off)
{
#define LF_PR_WARN(__fmt, ...)	PR_WARN(off, "lf", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_lst *lst = (void *)rc->data;
	const struct regf_lf_elem *elems = (void *)lst->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	int i, res, ret = 0;

	snprintf(__pref, sizeof(__pref), "%s  ", pref);

	printf("%slf.nelem = %u\n", pref, lst->nelem);
	for (i = 0; i < lst->nelem; ++i) {
		printf("%slf.elem[%u]{off,hint} = 0x%08X, %.4s\n",
		       pref, i, elems[i].off, elems[i].hint);
		cell = cache_cell_find(elems[i].off);
		if (!cell) {
			LF_PR_WARN("could not find key cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
		cache_cell_updref(cell, CT_NK);
		res = regf_parse_nk(pref, elems[i].off);
		if (res) {
			LF_PR_WARN("could not parse subkey in cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x5052(%rip), %r15      # 0x7100
movl %esi, -0x2c(%rbp)
movl %esi, %r12d
callq 0x1080
leaq 0x3(%rax), %rsi
movq %rsp, %rdi
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %rdi
movq %rdi, %rsp
leaq 0x2227(%rip), %rdx      # 0x42fc
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movq %r15, -0x38(%rbp)
movq %r12, %rbx
addq %r12, %r15
addq $0xc, %r15
movzwl -0x6(%r15), %edx
leaq 0x2651(%rip), %rdi      # 0x474a
movq %r14, %rsi
xorl %eax, %eax
callq 0x10a0
xorl %r13d, %r13d
xorl %r12d, %r12d
movq -0x38(%rbp), %rax
movzwl 0x6(%rax,%rbx), %eax
cmpq %rax, %r13
jae 0x2187
movl -0x4(%r15), %ecx
leaq 0x2639(%rip), %rdi      # 0x475b
movq %r14, %rsi
movl %r13d, %edx
movq %r15, %r8
xorl %eax, %eax
callq 0x10a0
movl -0x4(%r15), %edi
callq 0x1859
leaq 0x2641(%rip), %rdi      # 0x4783
testq %rax, %rax
je 0x2165
incl 0x24(%rax)
orb $0x2, 0x28(%rax)
movl -0x4(%r15), %esi
movq %r14, %rdi
callq 0x187a
leaq 0x2652(%rip), %rdi      # 0x47b3
testl %eax, %eax
je 0x217e
movl -0x4(%r15), %ecx
movl -0x2c(%rbp), %esi
leaq 0x25a1(%rip), %rdx      # 0x4714
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %r12
incq %r13
addq $0x8, %r15
jmp 0x2109
movl %r12d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_lst_lh
static int regf_parse_lst_lh(const char *pref, unsigned off)
{
#define LH_PR_WARN(__fmt, ...)	PR_WARN(off, "lh", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_lst *lst = (void *)rc->data;
	const struct regf_lh_elem *elems = (void *)lst->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	int i, res, ret = 0;

	snprintf(__pref, sizeof(__pref), "%s  ", pref);

	printf("%slh.nelem = %u\n", pref, lst->nelem);
	for (i = 0; i < lst->nelem; ++i) {
		printf("%slh.elem[%u]{off,hash} = 0x%08X, 0x%08X\n",
		       pref, i, elems[i].off, elems[i].hash);
		cell = cache_cell_find(elems[i].off);
		if (!cell) {
			LH_PR_WARN("could not find key cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
		cache_cell_updref(cell, CT_NK);
		res = regf_parse_nk(pref, elems[i].off);
		if (res) {
			LH_PR_WARN("could not parse subkey in cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x4f4f(%rip), %rax      # 0x7100
movl %esi, -0x2c(%rbp)
movl %esi, %ecx
leaq (%rax,%rcx), %r15
leaq (%rax,%rcx), %rbx
addq $0x8, %rbx
callq 0x1080
leaq 0x3(%rax), %rsi
movq %rsp, %rdi
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %rdi
movq %rdi, %rsp
leaq 0x2119(%rip), %rdx      # 0x42fc
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movzwl -0x2(%rbx), %edx
leaq 0x25f2(%rip), %rdi      # 0x47ea
movq %r14, %rsi
xorl %eax, %eax
callq 0x10a0
xorl %r13d, %r13d
xorl %r12d, %r12d
movzwl 0x6(%r15), %eax
cmpq %rax, %r13
jae 0x2280
movl (%rbx,%r13,8), %ecx
movl 0x4(%rbx,%r13,8), %r8d
leaq 0x25d9(%rip), %rdi      # 0x47fb
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10a0
movl (%rbx,%r13,8), %edi
callq 0x1859
leaq 0x2544(%rip), %rdi      # 0x4783
testq %rax, %rax
je 0x2262
incl 0x24(%rax)
orb $0x2, 0x28(%rax)
movl (%rbx,%r13,8), %esi
movq %r14, %rdi
callq 0x187a
leaq 0x2555(%rip), %rdi      # 0x47b3
testl %eax, %eax
je 0x227b
movl (%rbx,%r13,8), %ecx
movl -0x2c(%rbp), %esi
leaq 0x24a7(%rip), %rdx      # 0x4717
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %r12
incq %r13
jmp 0x2208
movl %r12d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_lst_li
static int regf_parse_lst_li(const char *pref, unsigned off)
{
#define LI_PR_WARN(__fmt, ...)	PR_WARN(off, "li", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_lst *lst = (void *)rc->data;
	const struct regf_li_elem *elems = (void *)lst->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	int i, res, ret = 0;

	snprintf(__pref, sizeof(__pref), "%s  ", pref);

	printf("%sli.nelem = %u\n", pref, lst->nelem);
	for (i = 0; i < lst->nelem; ++i) {
		printf("%sli.elem[%u].off = 0x%08X\n",
		       pref, i, elems[i].off);
		cell = cache_cell_find(elems[i].off);
		if (!cell) {
			LI_PR_WARN("could not find key cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
		cache_cell_updref(cell, CT_NK);
		res = regf_parse_nk(pref, elems[i].off);
		if (res) {
			LI_PR_WARN("could not parse subkey in cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x4e54(%rip), %r12      # 0x7100
movl %esi, %r13d
leaq (%r12,%r13), %r15
callq 0x1080
leaq 0x3(%rax), %rsi
movq %rsp, %rdi
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %rdi
movq %rdi, %rsp
leaq 0x2028(%rip), %rdx      # 0x42fc
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movzwl 0x6(%r12,%r13), %edx
leaq 0x253a(%rip), %rdi      # 0x4825
movq %r14, %rsi
xorl %eax, %eax
callq 0x10a0
xorl %r13d, %r13d
xorl %r12d, %r12d
movzwl 0x6(%r15), %eax
cmpq %rax, %r13
jae 0x2371
movl 0x8(%r15,%r13,4), %ecx
leaq 0x2525(%rip), %rdi      # 0x4836
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10a0
movl 0x8(%r15,%r13,4), %edi
callq 0x1859
leaq 0x2454(%rip), %rdi      # 0x4783
testq %rax, %rax
je 0x2353
incl 0x24(%rax)
orb $0x2, 0x28(%rax)
movl 0x8(%r15,%r13,4), %esi
movq %r14, %rdi
callq 0x187a
leaq 0x2464(%rip), %rdi      # 0x47b3
testl %eax, %eax
je 0x236c
movl 0x8(%r15,%r13,4), %ecx
movl %ebx, %esi
leaq 0x23b9(%rip), %rdx      # 0x471a
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %r12
incq %r13
jmp 0x22fb
movl %r12d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_parse_lst_ri
static int regf_parse_lst_ri(const char *pref, unsigned off)
{
#define RI_PR_WARN(__fmt, ...)	PR_WARN(off, "ri", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_lst *lst = (void *)rc->data;
	const struct regf_ri_elem *elems = (void *)lst->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	int i, res, ret = 0;

	snprintf(__pref, sizeof(__pref), "%s  ", pref);

	printf("%sri.nelem = %u\n", pref, lst->nelem);
	for (i = 0; i < lst->nelem; ++i) {
		printf("%sri.elem[%u].off = 0x%08X\n",
		       pref, i, elems[i].off);
		cell = cache_cell_find(elems[i].off);
		if (!cell) {
			RI_PR_WARN("could not find keys list cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
		cache_cell_updref(cell, CT_LST);
		res = regf_parse_lst(pref, elems[i].off);
		if (res) {
			RI_PR_WARN("could not parse subkey list in cell 0x%08X\n",
				   elems[i].off);
			ret = -1;
			continue;
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x4d63(%rip), %r12      # 0x7100
movl %esi, %r13d
leaq (%r12,%r13), %r15
callq 0x1080
leaq 0x3(%rax), %rsi
movq %rsp, %rdi
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %rdi
movq %rdi, %rsp
leaq 0x1f37(%rip), %rdx      # 0x42fc
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movzwl 0x6(%r12,%r13), %edx
leaq 0x2476(%rip), %rdi      # 0x4852
movq %r14, %rsi
xorl %eax, %eax
callq 0x10a0
xorl %r13d, %r13d
xorl %r12d, %r12d
movzwl 0x6(%r15), %eax
cmpq %rax, %r13
jae 0x2462
movl 0x8(%r15,%r13,4), %ecx
leaq 0x2461(%rip), %rdi      # 0x4863
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x10a0
movl 0x8(%r15,%r13,4), %edi
callq 0x1859
leaq 0x245f(%rip), %rdi      # 0x487f
testq %rax, %rax
je 0x2444
incl 0x24(%rax)
orb $0x10, 0x28(%rax)
movl 0x8(%r15,%r13,4), %esi
movq %r14, %rdi
callq 0x1e8f
leaq 0x2475(%rip), %rdi      # 0x48b5
testl %eax, %eax
je 0x245d
movl 0x8(%r15,%r13,4), %ecx
movl %ebx, %esi
leaq 0x22cb(%rip), %rdx      # 0x471d
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %r12
incq %r13
jmp 0x23ec
movl %r12d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_print_data
static int regf_print_data(const char *pref, const void *p, unsigned type,
			   unsigned len)
{
	switch (type) {
	case REGF_VK_T_DWORD:
		printf("%sdword: %s\n", pref, regf_dword2str(p, len));
		break;
	case REGF_VK_T_QWORD:
		printf("%sqword: %s\n", pref, regf_qword2str(p, len));
		break;
	case REGF_VK_T_SZ:
		printf("%sstr: %ls\n", pref, regf_unicode2wchar(p, len));
		break;
	case REGF_VK_T_EXPAND_SZ:
		printf("%sestr: %ls\n", pref, regf_unicode2wchar(p, len));
		break;
	default:
		printf("%shex: %s\n", pref, regf_hexdump(p, len));
		break;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x1, %edx
je 0x2929
cmpl $0x2, %edx
je 0x28df
cmpl $0xb, %edx
je 0x28f2
cmpl $0x4, %edx
jne 0x2945
testl %ecx, %ecx
je 0x29d2
cmpl $0x4, %ecx
jne 0x29e4
movl (%r14), %ecx
leaq 0x4a5d(%rip), %r14      # 0x7320
leaq 0x2352(%rip), %rdx      # 0x4c1c
pushq $0x20
popq %rsi
movq %r14, %rdi
movl %ecx, %r8d
xorl %eax, %eax
callq 0x10b0
jmp 0x29eb
movq %r14, %rdi
movl %ecx, %esi
callq 0x1da7
leaq 0x2312(%rip), %rdi      # 0x4c02
jmp 0x293a
testl %ecx, %ecx
je 0x29db
cmpl $0x8, %ecx
jne 0x29f4
movq (%r14), %rcx
leaq 0x4a33(%rip), %r14      # 0x7340
leaq 0x2325(%rip), %rdx      # 0x4c39
pushq $0x40
popq %rsi
movq %r14, %rdi
movq %rcx, %r8
xorl %eax, %eax
callq 0x10b0
jmp 0x29fb
movq %r14, %rdi
movl %ecx, %esi
callq 0x1da7
leaq 0x22bc(%rip), %rdi      # 0x4bf6
movq %rbx, %rsi
movq %rax, %rdx
jmp 0x2a08
movq %rbx, 0x10(%rsp)
cmpl $0x10, %ecx
pushq $0x10
popq %r13
movl %ecx, 0xc(%rsp)
cmovbl %ecx, %r13d
leaq 0x4a20(%rip), %rbx      # 0x7380
leaq 0x22e1(%rip), %r12      # 0x4c48
xorl %ebp, %ebp
movq %rbx, %r15
cmpq %rbp, %r13
je 0x2997
movq %rbx, %rsi
subq %r15, %rsi
addq $0x35, %rsi
movzbl (%r14,%rbp), %ecx
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10b0
cltq
addq %rax, %r15
incq %rbp
jmp 0x296c
cmpl $0x11, 0xc(%rsp)
jb 0x29bd
leaq 0x49db(%rip), %rsi      # 0x7380
subq %r15, %rsi
addq $0x35, %rsi
leaq 0x229b(%rip), %rdx      # 0x4c4e
movq %r15, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x224b(%rip), %rdi      # 0x4c0f
leaq 0x49b6(%rip), %rdx      # 0x7381
movq 0x10(%rsp), %rsi
jmp 0x2a08
leaq 0x2241(%rip), %r14      # 0x4c1a
jmp 0x29eb
leaq 0x2238(%rip), %r14      # 0x4c1a
jmp 0x29fb
leaq 0x223d(%rip), %r14      # 0x4c28
leaq 0x21ea(%rip), %rdi      # 0x4bdc
jmp 0x2a02
leaq 0x222d(%rip), %r14      # 0x4c28
leaq 0x21e7(%rip), %rdi      # 0x4be9
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_predecessor
struct rbtree_head *rbtree_predecessor(const struct rbtree *t,
				       const struct rbtree_head *node)
{
	struct rbtree_head *tmp;

	if (!rbt_is_nil(t, node->left))
		return rbtree_maximum(t, node->left);

	tmp = rbt_get_p(node);
	while (!rbt_is_nil(t, tmp) && node == tmp->left) {
		node = tmp;
		tmp = rbt_get_p(tmp);
	}

	return tmp;
}

// Assembly:
movq 0x8(%rsi), %rcx
addq $0x8, %rdi
cmpq %rcx, %rdi
je 0x2a79
movq %rcx, %rax
movq 0x10(%rcx), %rcx
cmpq %rcx, %rdi
jne 0x2a62
jmp 0x2a85
cmpq 0x8(%rax), %rsi
movq %rax, %rsi
jne 0x2a85
movq (%rsi), %rax
andq $-0x2, %rax
cmpq %rax, %rcx
jne 0x2a70
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_successor
struct rbtree_head *rbtree_successor(const struct rbtree *t,
				     const struct rbtree_head *node)
{
	struct rbtree_head *tmp;

	if (!rbt_is_nil(t, node->right))
		return rbtree_minimum(t, node->right);

	tmp = rbt_get_p(node);
	while (!rbt_is_nil(t, tmp) && node == tmp->right) {
		node = tmp;
		tmp = rbt_get_p(tmp);
	}

	return tmp;
}

// Assembly:
movq 0x10(%rsi), %rcx
addq $0x8, %rdi
cmpq %rcx, %rdi
je 0x2aaa
movq %rcx, %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rdi
jne 0x2a93
jmp 0x2ab6
cmpq 0x10(%rax), %rsi
movq %rax, %rsi
jne 0x2ab6
movq (%rsi), %rax
andq $-0x2, %rax
cmpq %rax, %rcx
jne 0x2aa1
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_left_rotate
void rbtree_left_rotate(struct rbtree *t, struct rbtree_head *node)
{
	struct rbtree_head *n;

	if (rbt_is_nil(t, node->right))
		return;

	n = node->right;

	node->right = n->left;
	if (!rbt_is_nil(t, n->left))
		rbt_set_p(n->left, node);

	rbt_set_p(n, rbt_get_p(node));
	if (rbt_is_nil(t, rbt_get_p(node))) {
		t->rbt_root = n;
	} else {
		if (rbt_get_p(node)->left == node)
			rbt_get_p(node)->left = n;
		else
			rbt_get_p(node)->right = n;
	}

	n->left = node;
	rbt_set_p(node, n);
}

// Assembly:
movq 0x10(%rsi), %rax
leaq 0x8(%rdi), %rcx
cmpq %rax, %rcx
je 0x2b2c
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsi)
cmpq %rdx, %rcx
je 0x2ae5
movq %rsi, %r8
andq $-0x2, %r8
movq (%rdx), %r9
andl $0x1, %r9d
orq %r8, %r9
movq %r9, (%rdx)
movq (%rsi), %rdx
andq $-0x2, %rdx
movq (%rax), %r8
andl $0x1, %r8d
orq %rdx, %r8
movq %r8, (%rax)
movq (%rsi), %rdx
movq %rdx, %r8
andq $-0x2, %r8
cmpq %r8, %rcx
je 0x2b18
leaq 0x8(%r8), %rcx
leaq 0x10(%r8), %rdi
cmpq %rsi, 0x8(%r8)
cmoveq %rcx, %rdi
movq %rax, (%rdi)
movq %rsi, 0x8(%rax)
andq $-0x2, %rax
andl $0x1, %edx
orq %rax, %rdx
movq %rdx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_right_rotate
void rbtree_right_rotate(struct rbtree *t, struct rbtree_head *node)
{
	struct rbtree_head *n;

	if (rbt_is_nil(t, node->left))
		return;

	n = node->left;

	node->left = n->right;
	if (!rbt_is_nil(t, n->right))
		rbt_set_p(n->right, node);

	rbt_set_p(n, rbt_get_p(node));
	if (rbt_is_nil(t, rbt_get_p(node))) {
		t->rbt_root = n;
	} else {
		if (rbt_get_p(node)->left == node)
			rbt_get_p(node)->left = n;
		else
			rbt_get_p(node)->right = n;
	}

	n->right = node;
	rbt_set_p(node, n);
}

// Assembly:
movq 0x8(%rsi), %rax
leaq 0x8(%rdi), %rcx
cmpq %rax, %rcx
je 0x2ba2
movq 0x10(%rax), %rdx
movq %rdx, 0x8(%rsi)
cmpq %rdx, %rcx
je 0x2b5b
movq %rsi, %r8
andq $-0x2, %r8
movq (%rdx), %r9
andl $0x1, %r9d
orq %r8, %r9
movq %r9, (%rdx)
movq (%rsi), %rdx
andq $-0x2, %rdx
movq (%rax), %r8
andl $0x1, %r8d
orq %rdx, %r8
movq %r8, (%rax)
movq (%rsi), %rdx
movq %rdx, %r8
andq $-0x2, %r8
cmpq %r8, %rcx
je 0x2b8e
leaq 0x8(%r8), %rcx
leaq 0x10(%r8), %rdi
cmpq %rsi, 0x8(%r8)
cmoveq %rcx, %rdi
movq %rax, (%rdi)
movq %rsi, 0x10(%rax)
andq $-0x2, %rax
andl $0x1, %edx
orq %rax, %rdx
movq %rdx, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_insert
void rbtree_insert(struct rbtree *t, struct rbtree_head *node)
{
	struct rbtree_head *prev = &t->rbt_nil;
	struct rbtree_head *n = t->rbt_root;

	while (!rbt_is_nil(t, n)) {
		prev = n;
		n = node->key < n->key ? n->left : n->right;
	}

	if (!rbt_is_nil(t, prev)) {
		rbt_set_p(node, prev);
		if (node->key < prev->key)
			prev->left = node;
		else
			prev->right = node;
	} else {
		rbt_set_p(node, &t->rbt_nil);
		t->rbt_root = node;
	}

	rbt_set_color(node, RBT_RED);	/* Color new node in red */
	node->left = &t->rbt_nil;
	node->right = &t->rbt_nil;

	__rbtree_insert_fixup(t, node);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movq %rax, %rcx
movq %rdi, %rsi
movq (%rsi), %rdx
cmpq %rdx, %rax
je 0x2bda
movl 0x18(%r14), %ecx
xorl %esi, %esi
cmpl 0x18(%rdx), %ecx
setae %sil
leaq (%rdx,%rsi,8), %rsi
addq $0x8, %rsi
movq %rdx, %rcx
jmp 0x2bb8
movq %rbx, %rdx
movq %rax, %r15
cmpq %rcx, %rax
je 0x2bfb
movl 0x18(%r14), %edx
cmpl 0x18(%rcx), %edx
jae 0x2bf4
leaq 0x8(%rcx), %rdx
jmp 0x2bf8
leaq 0x10(%rcx), %rdx
movq %rcx, %r15
movq %r14, (%rdx)
orq $0x1, %r15
movq %r15, (%r14)
movq %rax, 0x8(%r14)
movq %rax, 0x10(%r14)
andq $-0x2, %r15
movq (%r15), %rax
testb $0x1, %al
je 0x2d07
andq $-0x2, %rax
movq 0x8(%rax), %rcx
cmpq %r15, %rcx
je 0x2c81
testb $0x1, (%rcx)
jne 0x2cd9
cmpq 0x8(%r15), %r14
jne 0x2c54
movq %r15, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2b2d
movq (%r15), %r15
andq $-0x2, %r15
movq (%r15), %rax
andq $-0x2, %rax
movq %rax, (%r15)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %rax
andq $-0x2, %rax
orq $0x1, (%rax)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %rsi
andq $-0x2, %rsi
movq %rbx, %rdi
callq 0x2ab7
jmp 0x2cff
movq 0x10(%rax), %rcx
testb $0x1, (%rcx)
jne 0x2cd9
cmpq 0x10(%r15), %r14
jne 0x2cac
movq %r15, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2ab7
movq (%r15), %r15
andq $-0x2, %r15
movq (%r15), %rax
andq $-0x2, %rax
movq %rax, (%r15)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %rax
andq $-0x2, %rax
orq $0x1, (%rax)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %rsi
andq $-0x2, %rsi
movq %rbx, %rdi
callq 0x2b2d
jmp 0x2cff
movq %rax, (%r15)
andb $-0x2, (%rcx)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %rax
andq $-0x2, %rax
orq $0x1, (%rax)
movq (%r14), %rax
andq $-0x2, %rax
movq (%rax), %r14
andq $-0x2, %r14
movq (%r14), %r15
jmp 0x2c0d
movq (%rbx), %rax
andq $-0x2, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/rbtree.c
// Function: rbtree_lookup
struct rbtree_head *rbtree_lookup(struct rbtree *t, uint32_t key)
{
	struct rbtree_head *n = t->rbt_root;

	while (!rbt_is_nil(t, n)) {
		if (n->key == key)
			return n;
		else if (n->key > key)
			n = n->left;
		else
			n = n->right;
	}

	return &t->rbt_nil;
}

// Assembly:
leaq 0x8(%rdi), %rax
movq (%rdi), %rcx
cmpq %rcx, %rax
je 0x2fd9
cmpl %esi, 0x18(%rcx)
je 0x2fd6
setbe %dl
movzbl %dl, %edx
leaq (%rcx,%rdx,8), %rdi
addq $0x8, %rdi
jmp 0x2fb9
movq %rcx, %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/oobmsg.c
// Function: oob_print
void oob_print(const char *fmt, ...)
{
	va_list val;

	fflush(stdout);	/* Syncronize stdout stream */

	va_start(val, fmt);

	vfprintf(stderr, fmt, val);

	fflush(stderr);	/* Syncronize stderr stream */

	va_end(val);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x303d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x3f94(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
callq 0x1100
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq 0x3f85(%rip), %r14      # 0x6ff8
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x1150
movq (%r14), %rdi
callq 0x1100
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regf_cmn.c
// Function: _regf_cell_check_basic
static inline int __regf_cell_check_basic(const struct regf_cell *cell,
					  unsigned off, const char *cell_type)
{
	if (off % 8) {
		PR_ERR(off, cell_type, "unaligned cell offset\n");
		return -1;
	}

	if (cell->sz > 0) {
		PR_ERR(off, cell_type, "cell is marked as free\n");
		return -1;
	}

	if (cell->sz == 0) {
		PR_ERR(off, cell_type, "zero cell size\n");
		return -1;
	}

	if (-cell->sz % 8) {
		PR_ERR(off, cell_type, "unaligned cell length 0x%08X\n",
		       -cell->sz);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rax
testb $0x7, %sil
je 0x30ab
leaq 0x1e53(%rip), %rdi      # 0x4efc
jmp 0x30b8
movl (%rdi), %ecx
testl %ecx, %ecx
jle 0x30c4
leaq 0x1e6a(%rip), %rdi      # 0x4f22
xorl %eax, %eax
callq 0x2fdc
pushq $-0x1
popq %rax
popq %rcx
retq
je 0x30dd
negl %ecx
testb $0x7, %cl
je 0x30e6
leaq 0x1e94(%rip), %rdi      # 0x4f68
xorl %eax, %eax
callq 0x2fdc
jmp 0x30bf
leaq 0x1e65(%rip), %rdi      # 0x4f49
jmp 0x30b8
xorl %eax, %eax
jmp 0x30c2
// File: /workspace/github_c_makefile_star2_O2/rsa9000[P]regfanalysistools/regf_cmn.c
// Function: regf_cell_check_sign_len
int regf_cell_check_sign_len(const void *base, unsigned off, const char *sign,
			     unsigned data_min_len)
{
	const struct regf_cell *cell = base + off;

	if (__regf_cell_check_basic(cell, off, sign))
		return -1;

	if (__regf_cell_check_sign(cell, off, sign))
		return -1;

	return __regf_cell_check_len(cell, off, sign, data_min_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl %esi, %eax
addq %rax, %r15
movq %r15, %rdi
callq 0x309b
testl %eax, %eax
jne 0x31fe
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x311d
testl %eax, %eax
je 0x320c
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3198