LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort
int tt_sort(struct tt_sort_input *input)
{
	tt_assert(input->alg >= 0 && input->alg < TT_SORT_MAX);

	_tt_key_select(&input->num);

	struct tt_sort_stat stat;
	memset(&stat, 0, sizeof(struct tt_sort_stat));
	stat.tail = input->count - 1;	/* Only for quick sort */
	int ret = tt_sort_internal[input->alg](input, &stat);

	tt_debug("time: %u, space: %u", stat.time, stat.space);

	return ret;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x2c(%rcx)
movb %al, 0x7(%rsp)
jb 0x43aa
movq 0x20(%rsp), %rax
cmpl $0x4, 0x2c(%rax)
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x43ea
xorl %edi, %edi
leaq 0x4156(%rip), %rsi      # 0x8520
leaq 0x3dbb(%rip), %rdx      # 0x818c
leaq 0x4150(%rip), %rcx      # 0x8528
movl $0x131, %r8d            # imm = 0x131
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x43ec
movq 0x20(%rsp), %rdi
callq 0x3a20
leaq 0xc(%rsp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x10b0
movq 0x20(%rsp), %rax
movl 0x28(%rax), %eax
subl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movl 0x2c(%rax), %eax
movl %eax, %ecx
leaq 0x6cb9(%rip), %rax      # 0xb0e0
movq (%rax,%rcx,8), %rax
movq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq *%rax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movl $0x3, %edi
leaq 0x40d0(%rip), %rsi      # 0x8520
leaq 0x40e3(%rip), %rdx      # 0x853a
movb $0x0, %al
callq 0x3600
movl 0x8(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort_insert
static int tt_sort_insert(struct tt_sort_input *in, struct tt_sort_stat *stat)
{
	/* Allocate buffer for one temporary element */
	char tmp[in->num.size] _tt_align(8);
	stat->space += 1;

	void *p = in->data;
	for (int i = 1; i < in->count; i++) {
		p += in->num.size;
		/* tmp = data[i] */
		in->num._set(&in->num, tmp, p);
		/* Insert data[i] into sorted list data[0] ~ data[i-1] */
		void *q = p - in->num.size;
		for (int j = i - 1; j >= 0; q -= in->num.size, j--) {
			stat->time++;	/* Compare */
			/* if (tmp < data[j]) */
			if (in->num.cmp(&in->num, tmp, q) < 0) {
				/* data[j+1] = data[j] */
				in->num._set(&in->num, q + in->num.size, q);
				stat->time++;	/* Set */
			} else {
				break;
			}
		}
		/* data[j+1] = tmp */
		in->num._set(&in->num, q + in->num.size, tmp);
		stat->time++;	/* Set */
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x18(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jae 0x45e0
movq -0x48(%rbp), %rsi
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
callq *%rax
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x45a7
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
callq *%rax
cmpl $0x0, %eax
jge 0x457c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
addq %rcx, %rsi
movq -0x38(%rbp), %rdx
callq *%rax
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x457e
jmp 0x45a7
jmp 0x4580
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x4523
movq -0x48(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
addq %rcx, %rsi
callq *%rax
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x44c9
movq -0x18(%rbp), %rax
movq %rax, %rsp
xorl %eax, %eax
movq %rbp, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort_heap
static int tt_sort_heap(struct tt_sort_input *in, struct tt_sort_stat *stat)
{
	struct tt_heap heap = {
		.num	= in->num,
		.data	= in->data,
		.cap	= in->count,
		.htype	= TT_HEAP_MAX,
	};

	int ret = tt_heap_init(&heap);
	if (ret)
		return ret;

	/* Build heap */
	tt_heap_build(&heap, heap.cap);

	void *head = heap.data;
	heap.__heaplen--;
	void *end = sort_ptr(&heap, heap.__heaplen);
	for (; heap.__heaplen >= 1; heap.__heaplen--) {
		/* NOTE: Heap length is __heaplen+1 */
		/* Swap [0] with [__heaplen] */
		heap.num.swap(&heap.num, head, end);
		end -= heap.num.size;
		/* [__heaplen] is OK, let's heapify [0] ~ [__heaplen-1] */
		tt_heap_heapify(&heap, 0);
	}

	return 0;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movl 0x28(%rax), %eax
movl %eax, 0x40(%rsp)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x5e90
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0x4974
movl 0x14(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x4a02
movl 0x40(%rsp), %esi
leaq 0x18(%rsp), %rdi
callq 0x50b0
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x48(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x48(%rsp)
movq 0x38(%rsp), %rax
movl 0x48(%rsp), %ecx
imull 0x18(%rsp), %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, (%rsp)
cmpl $0x1, 0x48(%rsp)
jb 0x49fa
movq 0x28(%rsp), %rax
leaq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
callq *%rax
movl 0x18(%rsp), %ecx
movq (%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x5150
movl 0x48(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x49ae
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/include/tt/common/heap.h
// Function: tt_heap_build
static inline void tt_heap_build(struct tt_heap *heap, uint len)
{
	tt_assert(len <= heap->cap);
	heap->__heaplen = len;
	for (int i = len / 2 - 1; i >= 0; i--)
		tt_heap_heapify(heap, i);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x28(%rcx), %eax
setbe %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x5108
xorl %edi, %edi
leaq 0x3466(%rip), %rsi      # 0x854e
leaq 0x309d(%rip), %rdx      # 0x818c
leaq 0x3466(%rip), %rcx      # 0x855c
movl $0x2a, %r8d
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x510a
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x30(%rax)
movl 0xc(%rsp), %eax
shrl %eax
subl $0x1, %eax
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jl 0x5145
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %esi
callq 0x5150
movl 0x8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x5123
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_init
int tt_stack_init(struct tt_stack *stack)
{
	if (stack->cap) {
		/* Allocate fixed array */
		stack->_data = malloc(stack->esize * stack->cap);
		if (!stack->_data)
			return TT_ENOMEM;
		stack->_top = stack->_data;
		stack->_push = tt_stack_push_array;
		stack->_pop = tt_stack_pop_array;
		tt_debug("Stack created, max elements = %u", stack->cap);
	} else {
		/* XXX: Allocate tt_list struct before element,
		 * the stack element only ensures 8-bytes alignment
		 */
		tt_assert(sizeof(struct tt_list) % 8 == 0);
		/* Initialize list head */
		tt_list_init(&stack->_head);
		stack->_push = tt_stack_push_list;
		stack->_pop = tt_stack_pop_list;
		tt_debug("Dynamic stack created");
	}

	stack->_count = 0;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, (%rax)
je 0x522a
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x8(%rsp), %rcx
imull (%rcx), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x1120
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x51d5
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x528a
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
leaq 0xad(%rip), %rcx        # 0x52a0
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
leaq 0x13d(%rip), %rcx       # 0x5340
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
movl (%rax), %ecx
movl $0x3, %edi
leaq 0x338f(%rip), %rsi      # 0x85a9
leaq 0x3396(%rip), %rdx      # 0x85b7
movb $0x0, %al
callq 0x3600
jmp 0x5276
jmp 0x522c
jmp 0x522e
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x53e0
movq 0x8(%rsp), %rax
leaq 0x1b8(%rip), %rcx       # 0x5400
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
leaq 0x238(%rip), %rcx       # 0x5490
movq %rcx, 0x28(%rax)
movl $0x3, %edi
leaq 0x3341(%rip), %rsi      # 0x85a9
leaq 0x3369(%rip), %rdx      # 0x85d8
movb $0x0, %al
callq 0x3600
movq 0x8(%rsp), %rax
movl $0x0, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_push_array
static int tt_stack_push_array(struct tt_stack *stack, const void *e)
{
	if (stack->_count >= stack->cap) {
		tt_debug("Overflow");
		return TT_EOVERFLOW;
	}
	memcpy(stack->_top, e, stack->esize);
	stack->_top += stack->esize;

	stack->_count++;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x8(%rsp), %rcx
cmpl (%rcx), %eax
jb 0x52e2
movl $0x3, %edi
leaq 0x3342(%rip), %rsi      # 0x860c
leaq 0x334f(%rip), %rdx      # 0x8620
movb $0x0, %al
callq 0x3600
movl $0xfffffffd, 0x14(%rsp) # imm = 0xFFFFFFFD
jmp 0x532e
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_pop_array
static int tt_stack_pop_array(struct tt_stack *stack, void *e)
{
	if (stack->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	stack->_top -= stack->esize;
	memcpy(e, stack->_top, stack->esize);

	stack->_count--;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x537c
movl $0x3, %edi
leaq 0x32c5(%rip), %rsi      # 0x8629
leaq 0x32d1(%rip), %rdx      # 0x863c
movb $0x0, %al
callq 0x3600
movl $0xfffffffc, 0x14(%rsp) # imm = 0xFFFFFFFC
jmp 0x53cf
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
movl %edx, %esi
xorl %edx, %edx
subq %rsi, %rdx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_push_list
static int tt_stack_push_list(struct tt_stack *stack, const void *e)
{
	void *se = malloc(sizeof(struct tt_list) + stack->esize);
	if (!se)
		return TT_EOVERFLOW;
	memcpy(se + sizeof(struct tt_list), e, stack->esize);
	tt_list_add(se, &stack->_head);

	stack->_count++;
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
addq $0x10, %rdi
callq 0x1120
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x5438
movl $0xfffffffd, 0x24(%rsp) # imm = 0xFFFFFFFD
jmp 0x547e
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
callq 0x55e0
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_pop_list
static int tt_stack_pop_list(struct tt_stack *stack, void *e)
{
	if (stack->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	void *top = stack->_head.prev;
	memcpy(e, top + sizeof(struct tt_list), stack->esize);
	tt_list_del(top);
	free(top);

	stack->_count--;
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x54cd
movl $0x3, %edi
leaq 0x3191(%rip), %rsi      # 0x8646
leaq 0x3180(%rip), %rdx      # 0x863c
movb $0x0, %al
callq 0x3600
movl $0xfffffffc, 0x24(%rsp) # imm = 0xFFFFFFFC
jmp 0x5522
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rdi
callq 0x5660
movq 0x8(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_free
void tt_stack_free(struct tt_stack *stack)
{
	if (stack->cap) {
		/* Free the array */
		free(stack->_data);
		stack->_data = NULL;
	} else {
		/* Free the list */
		struct tt_list *pos, *tmp;
		tt_list_for_each_safe(pos, tmp, &stack->_head)
			free(pos);
	}

	tt_debug("Stack destroyed");
	stack->_count = 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
je 0x5560
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x55b2
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
je 0x55b0
movq 0x8(%rsp), %rdi
callq 0x1030
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
jmp 0x557b
jmp 0x55b2
movl $0x3, %edi
leaq 0x3030(%rip), %rsi      # 0x85ee
leaq 0x3037(%rip), %rdx      # 0x85fc
movb $0x0, %al
callq 0x3600
movq 0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/include/tt/common/list.h
// Function: _tt_list_add
static inline void __tt_list_add(struct tt_list *entry,
		struct tt_list *prev, struct tt_list *next)
{
	next->prev = entry;
	entry->next = next;
	entry->prev = prev;
	prev->next = entry;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, (%rax)
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, (%rax)
movq -0x8(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_init
int tt_queue_init(struct tt_queue *queue)
{
	if (queue->cap) {
		/* Allocate fixed array */
		queue->_data = malloc(queue->esize * queue->cap);
		if (!queue->_data)
			return TT_ENOMEM;
		queue->_qhead = queue->_qtail = queue->_data;
		queue->_enque = tt_queue_enque_array;
		queue->_deque = tt_queue_deque_array;
		tt_debug("Queue created, max elements = %u", queue->cap);
	} else {
		/* XXX: Allocate tt_list struct before element,
		 * the queue element only ensures 8-bytes alignment
		 */
		tt_assert(sizeof(struct tt_list) % 8 == 0);
		/* Initialize list head */
		tt_list_init(&queue->_head);
		queue->_enque = tt_queue_enque_list;
		queue->_deque = tt_queue_deque_list;
		tt_debug("Dynamic queue created");
	}

	queue->_count = 0;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, (%rax)
je 0x5783
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x8(%rsp), %rcx
imull (%rcx), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x1120
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x5725
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x57e3
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
leaq 0xa4(%rip), %rcx        # 0x57f0
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
leaq 0x174(%rip), %rcx       # 0x58d0
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movl (%rax), %ecx
movl $0x3, %edi
leaq 0x2ee5(%rip), %rsi      # 0x8658
leaq 0x2eec(%rip), %rdx      # 0x8666
movb $0x0, %al
callq 0x3600
jmp 0x57cf
jmp 0x5785
jmp 0x5787
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x59b0
movq 0x8(%rsp), %rax
leaq 0x22f(%rip), %rcx       # 0x59d0
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
leaq 0x2af(%rip), %rcx       # 0x5a60
movq %rcx, 0x30(%rax)
movl $0x3, %edi
leaq 0x2e97(%rip), %rsi      # 0x8658
leaq 0x2ebf(%rip), %rdx      # 0x8687
movb $0x0, %al
callq 0x3600
movq 0x8(%rsp), %rax
movl $0x0, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_enque_array
static int tt_queue_enque_array(struct tt_queue *queue, const void *e)
{
	if (queue->_count >= queue->cap) {
		tt_debug("Overflow");
		return TT_EOVERFLOW;
	}
	memcpy(queue->_qtail, e, queue->esize);
	queue->_qtail += queue->esize;
	/* Wrap to head */
	if (queue->_qtail >= queue->_data + queue->cap * queue->esize)
		queue->_qtail = queue->_data;

	queue->_count++;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x8(%rsp), %rcx
cmpl (%rcx), %eax
jb 0x5835
movl $0x3, %edi
leaq 0x2ea1(%rip), %rsi      # 0x86bb
leaq 0x2dff(%rip), %rdx      # 0x8620
movb $0x0, %al
callq 0x3600
movl $0xfffffffd, 0x14(%rsp) # imm = 0xFFFFFFFD
jmp 0x58bf
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rsp), %rdx
movl (%rdx), %edx
movq 0x8(%rsp), %rsi
imull 0x4(%rsi), %edx
movl %edx, %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x58a9
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_deque_array
static int tt_queue_deque_array(struct tt_queue *queue, void *e)
{
	if (queue->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	memcpy(e, queue->_qhead, queue->esize);
	queue->_qhead += queue->esize;
	/* Wrap to head */
	if (queue->_qhead >= queue->_data + queue->cap * queue->esize)
		queue->_qhead = queue->_data;

	queue->_count--;
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x590f
movl $0x3, %edi
leaq 0x2ddc(%rip), %rsi      # 0x86d0
leaq 0x2d41(%rip), %rdx      # 0x863c
movb $0x0, %al
callq 0x3600
movl $0xfffffffc, 0x14(%rsp) # imm = 0xFFFFFFFC
jmp 0x5999
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rsp), %rdx
movl (%rdx), %edx
movq 0x8(%rsp), %rsi
imull 0x4(%rsi), %edx
movl %edx, %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x5983
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_enque_list
static int tt_queue_enque_list(struct tt_queue *queue, const void *e)
{
	void *qe = malloc(sizeof(struct tt_list) + queue->esize);
	if (!qe)
		return TT_EOVERFLOW;
	memcpy(qe + sizeof(struct tt_list), e, queue->esize);
	tt_list_add(qe, &queue->_head);

	queue->_count++;
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edi
addq $0x10, %rdi
callq 0x1120
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x5a08
movl $0xfffffffd, 0x24(%rsp) # imm = 0xFFFFFFFD
jmp 0x5a4e
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
callq 0x5bb0
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_deque_list
static int tt_queue_deque_list(struct tt_queue *queue, void *e)
{
	if (queue->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	void *qe = queue->_head.next;
	memcpy(e, qe + sizeof(struct tt_list), queue->esize);
	tt_list_del(qe);
	free(qe);

	queue->_count--;
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x5a9d
movl $0x3, %edi
leaq 0x2c60(%rip), %rsi      # 0x86e5
leaq 0x2bb0(%rip), %rdx      # 0x863c
movb $0x0, %al
callq 0x3600
movl $0xfffffffc, 0x24(%rsp) # imm = 0xFFFFFFFC
jmp 0x5af2
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x10, %rsi
movq 0x18(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
callq 0x1100
movq 0x8(%rsp), %rdi
callq 0x5c30
movq 0x8(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_free
void tt_queue_free(struct tt_queue *queue)
{
	if (queue->cap) {
		/* Free the array */
		free(queue->_data);
		queue->_data = NULL;
	} else {
		/* Free the list */
		struct tt_list *pos, *tmp;
		tt_list_for_each_safe(pos, tmp, &queue->_head)
			free(pos);
	}

	tt_debug("Queue destroyed");
	queue->_count = 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
je 0x5b30
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x5b82
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
je 0x5b80
movq 0x8(%rsp), %rdi
callq 0x1030
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
jmp 0x5b4b
jmp 0x5b82
movl $0x3, %edi
leaq 0x2b0f(%rip), %rsi      # 0x869d
leaq 0x2b16(%rip), %rdx      # 0x86ab
movb $0x0, %al
callq 0x3600
movq 0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_adjust
int tt_heap_adjust(struct tt_heap *heap, int index, const void *v)
{
	tt_assert(index < heap->__heaplen);
	/* Verify new value
	 * max-heap: increase, min-heap: decrease
	 */
	int d = heap->num.cmp(&heap->num, heap_ptr(heap, index), v);
	if (d == 0)
		return 0;
	if ((heap->htype == TT_HEAP_MAX && d > 0) ||
			(heap->htype == TT_HEAP_MIN && d < 0)) {
		tt_error("Invalid new value");
		return TT_EINVAL;
	}

	heap->_adjust(heap, index);
	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq %rdx, 0x8(%rsp)
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x30(%rcx), %eax
setb %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x5cfd
xorl %edi, %edi
leaq 0x2a1c(%rip), %rsi      # 0x86f9
leaq 0x24a8(%rip), %rdx      # 0x818c
leaq 0x2a1d(%rip), %rcx      # 0x8708
movl $0x5f, %r8d
movb $0x0, %al
callq 0x3600
callq 0x1040
jmp 0x5cff
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rdi
movq 0x18(%rsp), %rcx
movq 0x20(%rcx), %rsi
movl 0x14(%rsp), %ecx
movq 0x18(%rsp), %rdx
imull (%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rsi
movq 0x8(%rsp), %rdx
callq *%rax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jne 0x5d44
movl $0x0, 0x24(%rsp)
jmp 0x5da5
movq 0x18(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x5d56
cmpl $0x0, 0x4(%rsp)
jg 0x5d68
movq 0x18(%rsp), %rax
cmpl $0x1, 0x2c(%rax)
jne 0x5d89
cmpl $0x0, 0x4(%rsp)
jge 0x5d89
xorl %edi, %edi
leaq 0x2988(%rip), %rsi      # 0x86f9
leaq 0x29a2(%rip), %rdx      # 0x871a
movb $0x0, %al
callq 0x3600
movl $0xfffffffe, 0x24(%rsp) # imm = 0xFFFFFFFE
jmp 0x5da5
movq 0x18(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
callq *%rax
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_extract
int tt_heap_extract(struct tt_heap *heap, void *v)
{
	if (heap->__heaplen == 0)
		return TT_EUNDERFLOW;
	heap->num._set(&heap->num, v, heap->data);

	heap->__heaplen--;
	if (heap->__heaplen) {
		heap->num._set(&heap->num, heap->data,
				heap_ptr(heap, heap->__heaplen));
		tt_heap_heapify(heap, 0);
	}

	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x5dd5
movl $0xfffffffc, 0x14(%rsp) # imm = 0xFFFFFFFC
jmp 0x5e57
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rdx
callq *%rax
movq 0x8(%rsp), %rax
movl 0x30(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x30(%rax)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x30(%rax)
je 0x5e4f
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rdx
movq 0x8(%rsp), %rcx
movl 0x30(%rcx), %ecx
movq 0x8(%rsp), %r8
imull (%r8), %ecx
movl %ecx, %ecx
addq %rcx, %rdx
callq *%rax
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x5e60
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_init
int tt_heap_init(struct tt_heap *heap)
{
	int ret = _tt_key_select(&heap->num);
	if (ret)
		return ret;

	if (heap->htype == TT_HEAP_MIN) {
		tt_debug("Min-heap initialized");
		heap->_heapify = tt_heap_heapify_min;
		heap->_adjust = tt_heap_adjust_min;
	} else {
		tt_debug("Max-heap initialized");
		heap->_heapify = tt_heap_heapify_max;
		heap->_adjust = tt_heap_adjust_max;
	}

	heap->__heaplen = 0;

	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x3a20
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x5ebb
movl 0x4(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x5f50
movq 0x8(%rsp), %rax
cmpl $0x1, 0x2c(%rax)
jne 0x5f02
movl $0x3, %edi
leaq 0x285a(%rip), %rsi      # 0x872c
leaq 0x2860(%rip), %rdx      # 0x8739
movb $0x0, %al
callq 0x3600
movq 0x8(%rsp), %rax
leaq 0x74(%rip), %rcx        # 0x5f60
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rax
leaq 0x94(%rip), %rcx        # 0x5f90
movq %rcx, 0x40(%rax)
jmp 0x5f3c
movl $0x3, %edi
leaq 0x281e(%rip), %rsi      # 0x872c
leaq 0x2839(%rip), %rdx      # 0x874e
movb $0x0, %al
callq 0x3600
movq 0x8(%rsp), %rax
leaq 0x98(%rip), %rcx        # 0x5fc0
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rax
leaq 0xb8(%rip), %rcx        # 0x5ff0
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x30(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_heapify_internal
static inline void tt_heap_heapify_internal(
		struct tt_heap *heap, int index,
		int (*cmp)(const struct tt_key *, const void *, const void*))
{
	while (index < heap->__heaplen / 2) {
		/* Compare and swap with [2*index+1], [2*index+2] */
		void *iptr = heap_ptr(heap, index);
		index = index * 2 + 1;	/* Left child */
		void *lptr = heap_ptr(heap, index);
		void *rptr = lptr + heap->num.size;

		void *swaptr = iptr;
		if (cmp(&heap->num, swaptr, lptr) < 0)
			swaptr = lptr;
		if (index < heap->__heaplen - 1 &&
				cmp(&heap->num, swaptr, rptr) < 0) {
			swaptr = rptr;
			index++;	/* Right child */
		}
		if (swaptr != iptr)
			heap->num.swap(&heap->num, iptr, swaptr);
		else
			break;
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movl 0x2c(%rsp), %eax
movq 0x30(%rsp), %rcx
movl 0x30(%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jae 0x6144
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x2c(%rsp), %ecx
movq 0x30(%rsp), %rdx
imull (%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x2c(%rsp), %ecx
movq 0x30(%rsp), %rdx
imull (%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rdi
movq (%rsp), %rsi
movq 0x10(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
jge 0x60d6
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl 0x2c(%rsp), %eax
movq 0x30(%rsp), %rcx
movl 0x30(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x6117
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
jge 0x6117
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq (%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x613d
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%rsp), %rdx
callq *%rax
jmp 0x613f
jmp 0x6144
jmp 0x6032
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_adjust_internal
static inline void tt_heap_adjust_internal(
		struct tt_heap *heap, int index,
		int (*cmp)(const struct tt_key *, const void *, const void*))
{
	/* Buffer for one element */
	char tmp[heap->num.size] _tt_align(8);	/* C99 VLA, huha! */
	void *v = heap_ptr(heap, index);
	heap->num._set(&heap->num, tmp, v);

	while (index > 0) {
		int parent = (index - 1) / 2;
		void *pv = heap_ptr(heap, parent);
		if (cmp(&heap->num, tmp, pv) <= 0)
			break;
		heap->num._set(&heap->num, v, pv);
		v = pv;
		index = parent;
	}

	heap->num._set(&heap->num, v, tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rsi
subq %rcx, %rsi
movq %rsi, -0x48(%rbp)
movq %rsi, %rsp
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rdx
imull (%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
callq *%rax
cmpl $0x0, -0xc(%rbp)
jle 0x626c
movq -0x48(%rbp), %rsi
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x34(%rbp), %ecx
movq -0x8(%rbp), %rdx
imull (%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x0, %eax
jg 0x6246
jmp 0x626c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x61fa
movq -0x48(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq *%rax
movq -0x20(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_bintree_init
void tt_bintree_init(struct tt_bintree *tree)
{
	if (!tree->ops) {
		tt_debug("Red-Black tree initialized");
		tree->ops = &tt_rbtree_ops;
	} else {
		tt_debug("Binary tree initialized");
	}

	if (!tree->knum.swap)
		tree->knum.swap = tt_bintree_swap_dummy;
	_tt_key_select(&tree->knum);

	tree->_root = NULL;
	tree->_count = 0;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x62cb
movl $0x3, %edi
leaq 0x24b7(%rip), %rsi      # 0x8763
leaq 0x24c0(%rip), %rdx      # 0x8773
movb $0x0, %al
callq 0x3600
movq (%rsp), %rax
leaq 0x4e3b(%rip), %rcx      # 0xb100
movq %rcx, 0x20(%rax)
jmp 0x62e5
movl $0x3, %edi
leaq 0x248c(%rip), %rsi      # 0x8763
leaq 0x24b0(%rip), %rdx      # 0x878e
movb $0x0, %al
callq 0x3600
movq (%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x62ff
movq (%rsp), %rax
leaq 0x35(%rip), %rcx        # 0x6330
movq %rcx, 0x10(%rax)
movq (%rsp), %rdi
callq 0x3a20
movq (%rsp), %rax
movq $0x0, 0x28(%rax)
movq (%rsp), %rax
movl $0x0, 0x30(%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_bintree_free_internal
static void tt_bintree_free_internal(struct tt_bintree_node *node)
{
	if (node) {
		tt_bintree_free_internal(node->left);
		tt_bintree_free_internal(node->right);
		free(node);
	}
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
cmpq $0x0, (%rsp)
je 0x63cf
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x63a0
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x63a0
movq (%rsp), %rdi
callq 0x1030
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_min
static inline struct tt_bintree_node *tt_rbtree_min(
		struct tt_bintree_node *node)
{
	if (node) {
		while (node->left)
			node = node->left;
	}
	return node;
}

// Assembly:
movq %rdi, -0x8(%rsp)
cmpq $0x0, -0x8(%rsp)
je 0x640d
jmp 0x63ef
movq -0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x640b
movq -0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x63ef
jmp 0x640d
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_max
static inline struct tt_bintree_node *tt_rbtree_max(
		struct tt_bintree_node *node)
{
	if (node) {
		while (node->right)
			node = node->right;
	}
	return node;
}

// Assembly:
movq %rdi, -0x8(%rsp)
cmpq $0x0, -0x8(%rsp)
je 0x644d
jmp 0x642f
movq -0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x644b
movq -0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x642f
jmp 0x644d
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_search
static struct tt_bintree_node *tt_rbtree_search(
		const struct tt_bintree *tree, const void *key)
{
	struct tt_bintree_node *node = tree->_root;
	while (node) {
		int c = tree->knum.cmp(&tree->knum, key, node->key);
		if (c == 0)
			break;
		else if (c < 0)
			node = node->left;
		else
			node = node->right;
	}
	return node;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x64d7
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
callq *%rax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x64ae
jmp 0x64d7
cmpl $0x0, 0xc(%rsp)
jge 0x64c5
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x64d3
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x64d5
jmp 0x647c
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_walk_in
static int tt_rbtree_walk_in(const struct tt_bintree_node *node, void *context,
		bool (*walk)(const void *key, const void *v, void *context))
{
	while (node) {
		if (tt_rbtree_walk_in(node->left, context, walk))
			return TT_ESTOP;
		if (!walk(node->key, node->data, context))
			return TT_ESTOP;
		node = node->right;
	}

	return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x6e2d
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x6db0
cmpl $0x0, %eax
je 0x6df2
movl $0x5, 0x24(%rsp)
jmp 0x6e35
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rdi
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq 0x10(%rsp), %rdx
callq *%rax
testb $0x1, %al
jne 0x6e1d
movl $0x5, 0x24(%rsp)
jmp 0x6e35
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x6dc3
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_rotate_left
static void tt_rbtree_rotate_left(struct tt_bintree *tree,
		struct tt_bintree_node *x)
{
	struct tt_bintree_node *y = x->right;
	x->right = y->left;
	if (y->left)
		y->left->parent = x;
	y->parent = x->parent;
	if (!x->parent)
		tree->_root = y;
	else if (x == x->parent->left)
		x->parent->left = y;
	else
		x->parent->right = y;
	y->left = x;
	x->parent = y;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x6e88
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x6eb6
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x6ef2
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x6ede
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x6ef0
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x6ef2
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_rotate_right
static void tt_rbtree_rotate_right(struct tt_bintree *tree,
		struct tt_bintree_node *y)
{
	struct tt_bintree_node *x = y->left;
	y->left = x->right;
	if (x->right)
		x->right->parent = y;
	x->parent = y->parent;
	if (!y->parent)
		tree->_root = x;
	else if (y == y->parent->left)
		y->parent->left = x;
	else
		y->parent->right = x;
	x->right = y;
	y->parent = x;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x6f58
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x6f86
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x6fc2
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x6fae
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x6fc0
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x6fc2
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cyb70289[P]tt/src/common/tree.c
// Function: tt_rbtree_trans
static void tt_rbtree_trans(struct tt_bintree *tree,
		struct tt_bintree_node *u, struct tt_bintree_node *v)
{
	if (!u->parent)
		tree->_root = v;
	else if (u == u->parent->left)
		u->parent->left = v;
	else
		u->parent->right = v;
	if (v)
		v->parent = u->parent;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x700b
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x7047
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0x7033
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x7045
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x7047
cmpq $0x0, -0x18(%rsp)
je 0x7061
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: dhara_map_init
void dhara_map_init(struct dhara_map *m, const struct dhara_nand *n,
		    uint8_t *page_buf, uint8_t gc_ratio)
{
	if (!gc_ratio)
		gc_ratio = 1;

	dhara_journal_init(&m->journal, n, page_buf);
	m->gc_ratio = gc_ratio;
}

// Assembly:
subq $0x28, %rsp
movb %cl, %al
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movb %al, 0xf(%rsp)
cmpb $0x0, 0xf(%rsp)
jne 0x11e5
movb $0x1, 0xf(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x2430
movb 0xf(%rsp), %cl
movq 0x20(%rsp), %rax
movb %cl, 0x38(%rax)
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: dhara_map_resume
int dhara_map_resume(struct dhara_map *m, dhara_error_t *err)
{
	if (dhara_journal_resume(&m->journal, err) < 0) {
		m->count = 0;
		return -1;
	}

	m->count = ck_get_count(dhara_journal_cookie(&m->journal));
	return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x25a0
cmpl $0x0, %eax
jge 0x1246
movq 0x8(%rsp), %rax
movl $0x0, 0x3c(%rax)
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x126a
movq 0x8(%rsp), %rdi
callq 0x1290
movq %rax, %rdi
callq 0x1280
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x3c(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: dhara_map_capacity
dhara_sector_t dhara_map_capacity(const struct dhara_map *m)
{
	const dhara_sector_t cap = dhara_journal_capacity(&m->journal);
	const dhara_sector_t reserve = cap / (m->gc_ratio + 1);
	const dhara_sector_t safety_margin =
		DHARA_MAX_RETRIES << m->journal.nand->log2_ppb;

	if (reserve + safety_margin >= cap)
		return 0;

	return cap - reserve - safety_margin;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2e90
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
movzbl 0x38(%rcx), %ecx
addl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movzbl 0x1(%rax), %ecx
movl $0x8, %eax
shll %cl, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
addl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jb 0x133e
movl $0x0, 0x24(%rsp)
jmp 0x134e
movl 0x14(%rsp), %eax
subl 0x10(%rsp), %eax
subl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: dhara_map_read
int dhara_map_read(struct dhara_map *m, dhara_sector_t s,
		   uint8_t *data, dhara_error_t *err)
{
	const struct dhara_nand *n = m->journal.nand;
	dhara_error_t my_err;
	dhara_page_t p;

	if (dhara_map_find(m, s, &p, &my_err) < 0) {
		if (my_err == DHARA_E_NOT_FOUND) {
			memset(data, 0xff, 1 << n->log2_page_size);
			return 0;
		}

		dhara_set_error(err, my_err);
		return -1;
	}

	return dhara_nand_read(n, p, 0, 1 << n->log2_page_size, data, err);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movq %rsp, %rdx
leaq 0x4(%rsp), %rcx
callq 0x1360
cmpl $0x0, %eax
jge 0x1679
cmpl $0x6, 0x4(%rsp)
jne 0x1661
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rdx
movl $0xff, %esi
callq 0x1070
movl $0x0, 0x34(%rsp)
jmp 0x16aa
movq 0x10(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x16c0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x16aa
movq 0x8(%rsp), %rdi
movl (%rsp), %esi
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
xorl %eax, %eax
movl %eax, %edx
callq 0x52d0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: dhara_map_write
int dhara_map_write(struct dhara_map *m, dhara_sector_t dst,
		    const uint8_t *data, dhara_error_t *err)
{
	for (;;) {
		uint8_t meta[DHARA_META_SIZE];
		dhara_error_t my_err;
		const dhara_sector_t old_count = m->count;

		if (prepare_write(m, dst, meta, err) < 0)
			return -1;

		if (!dhara_journal_enqueue(&m->journal, data, meta, &my_err))
			break;

		m->count = old_count;

		if (try_recover(m, my_err, err) < 0)
			return -1;
	}

	return 0;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb8(%rsp)
movl %esi, 0xb4(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movq 0xb8(%rsp), %rax
movl 0x3c(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0xb8(%rsp), %rdi
movl 0xb4(%rsp), %esi
leaq 0x10(%rsp), %rdx
movq 0xa0(%rsp), %rcx
callq 0x17d0
cmpl $0x0, %eax
jge 0x1748
movl $0xffffffff, 0xc4(%rsp) # imm = 0xFFFFFFFF
jmp 0x17b8
movq 0xb8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x34c0
cmpl $0x0, %eax
jne 0x176e
jmp 0x17ad
movl 0x8(%rsp), %ecx
movq 0xb8(%rsp), %rax
movl %ecx, 0x3c(%rax)
movq 0xb8(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0xa0(%rsp), %rdx
callq 0x18c0
cmpl $0x0, %eax
jge 0x17a8
movl $0xffffffff, 0xc4(%rsp) # imm = 0xFFFFFFFF
jmp 0x17b8
jmp 0x1706
movl $0x0, 0xc4(%rsp)
movl 0xc4(%rsp), %eax
addq $0xc8, %rsp
retq
nopw (%rax,%rax)