LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line.c
// Function: ft_fill
static int	ft_fill(char **line, t_lst *temp)
{
	int		idx[2];
	t_str	*str;

	*line = ft_malloc(((temp->len) - (temp->idx) + 1), sizeof(char));
	if (!(*line))
		return (-1);
	idx[0] = temp->idx;
	idx[1] = 0;
	str = temp->str;
	while (idx[1] < (temp->len) - (temp->idx))
	{
		if (str->s[idx[0]] == '\0')
		{
			str = str->next;
			idx[0] = 0;
		}
		line[0][idx[1]++] = str->s[idx[0]++];
	}
	line[0][idx[1]] = '\0';
	return (ft_clean_lst(temp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0x10(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2530
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2ace
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b73
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x18(%rbp), %rdx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
jge 0x2b58
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x2b26
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x2aea
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
callq 0x2d90
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_utils.c
// Function: ft_str_add
int	ft_str_add(t_lst *dst, char *s, int len)
{
	t_str	*str;
	int		idx;

	if (len < 0 || !s)
		return (-1);
	str = ft_malloc(1, sizeof(t_str));
	if (!str)
		return (-1);
	idx = -1;
	str->next = 0;
	str->s = ft_calloc(len + 1, sizeof(char));
	if (!(str->s))
		return (-1);
	while (++idx < len)
		str->s[idx] = s[idx];
	return (ft_sub(dst, str, len));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x2ba0
cmpq $0x0, -0x18(%rbp)
jne 0x2bac
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c53
movl $0x1, %edi
movl $0x10, %esi
callq 0x2530
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2bd2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c53
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x33a0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2c15
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c53
jmp 0x2c17
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x1c(%rbp), %eax
jge 0x2c40
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x2c17
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x2c60
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_utils.c
// Function: ft_sub
static int	ft_sub(t_lst *dst, t_str *str, int len)
{
	t_str	*temp;

	temp = dst->str;
	if (!temp)
	{
		dst->str = str;
		dst->len = len;
		return (1);
	}
	while (temp->next)
		temp = temp->next;
	temp->next = str;
	dst->len += len;
	return (1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2c9f
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2cda
jmp 0x2ca1
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2cba
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2ca1
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_utils.c
// Function: ft_lst_add
t_lst	*ft_lst_add(t_lst **dst, int fd)
{
	t_lst	*temp;

	temp = ft_malloc(1, sizeof(t_lst));
	if (!temp)
		return (NULL);
	temp->str = 0;
	temp->len = 0;
	temp->fd = fd;
	temp->idx = 0;
	temp->next = 0;
	if (*dst == 0)
		*dst = temp;
	else
	{
		temp->next = *dst;
		*dst = temp;
	}
	return (temp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2530
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2d13
movq $0x0, -0x8(%rbp)
jmp 0x2d83
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2d61
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2d7b
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_utils.c
// Function: ft_clean_lst
int	ft_clean_lst(t_lst *lst)
{
	t_str	*temp;

	lst->idx = 0;
	lst->len = 0;
	while (lst->str)
	{
		temp = lst->str;
		lst->str = lst->str->next;
		ft_free(temp->s);
		ft_free(temp);
	}
	lst->str = 0;
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2df0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2560
movq -0x10(%rbp), %rdi
callq 0x2560
jmp 0x2db2
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_sub.c
// Function: ft_del_lst
int	ft_del_lst(t_lst *target, t_lst **head, int *res)
{
	t_lst	*temp;

	if (res[1] != -1 && target->len)
		return (1);
	if (target == *head)
		return (sub(target, head, res));
	temp = *head;
	while (temp->next != target)
		temp = temp->next;
	temp->next = target->next;
	if (target->str)
		ft_clean_lst(target);
	ft_free(target);
	if (res[1] == -1)
		return (-1);
	return (res[1] == res[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x2e44
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x2e44
movl $0x1, -0x4(%rbp)
jmp 0x2ee5
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x2e67
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2ef0
movl %eax, -0x4(%rbp)
jmp 0x2ee5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x10(%rbp), %rax
je 0x2e8e
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2e72
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2eb1
movq -0x10(%rbp), %rdi
callq 0x2d90
movq -0x10(%rbp), %rdi
callq 0x2560
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x2ecd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ee5
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/get_next_line_sub.c
// Function: sub
static int	sub(t_lst *target, t_lst **head, int *res)
{
	if (target->str)
		ft_clean_lst(target);
	if (target->next)
		*head = target->next;
	else
		*head = 0;
	ft_free(target);
	if (res[1] == -1)
		return (-1);
	return (res[1] && res[0]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2f17
movq -0x10(%rbp), %rdi
callq 0x2d90
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2f33
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2f3e
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x2560
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x2f5a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f81
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x21(%rbp)
je 0x2f76
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_isspace.c
// Function: ft_isspace
int	ft_isspace(char c)
{
	if (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'
		|| c == ' ')
		return (1);
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x5(%rbp)
movsbl -0x5(%rbp), %eax
cmpl $0x9, %eax
je 0x3030
movsbl -0x5(%rbp), %eax
cmpl $0xa, %eax
je 0x3030
movsbl -0x5(%rbp), %eax
cmpl $0xb, %eax
je 0x3030
movsbl -0x5(%rbp), %eax
cmpl $0xc, %eax
je 0x3030
movsbl -0x5(%rbp), %eax
cmpl $0xd, %eax
je 0x3030
movsbl -0x5(%rbp), %eax
cmpl $0x20, %eax
jne 0x3039
movl $0x1, -0x4(%rbp)
jmp 0x3040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque.c
// Function: deque_init
t_deque	*deque_init(void)
{
	t_deque	*deque;

	deque = ft_malloc(1, sizeof(t_deque));
	if (!deque)
		return (deque);
	deque->head = NULL;
	deque->tail = NULL;
	deque->size = 0;
	return (deque);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x18, %esi
callq 0x2530
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x307c
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x30a6
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque.c
// Function: deque_push_back
void	deque_push_back(t_deque *deque, void *ptr)
{
	t_double_list	*temp;

	(deque->size)++;
	temp = double_list_init(ptr);
	if (!temp)
		return ;
	if (deque->size == 1)
	{
		deque->head = temp;
		deque->tail = temp;
		return ;
	}
	temp->last = deque->tail;
	deque->tail->next = temp;
	deque->tail = deque->tail->next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x3300
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x30e3
jmp 0x313a
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x3106
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x313a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque.c
// Function: deque_push_front
void	deque_push_front(t_deque *deque, void *ptr)
{
	t_double_list	*temp;

	(deque->size)++;
	temp = double_list_init(ptr);
	if (!temp)
		return ;
	if (deque->size == 1)
	{
		deque->head = temp;
		deque->tail = temp;
		return ;
	}
	temp->next = deque->head;
	deque->head->last = temp;
	deque->head = deque->head->last;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x3300
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3173
jmp 0x31c6
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x3196
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x31c6
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque.c
// Function: deque_pop_back
void	deque_pop_back(t_deque *deque, void (*f)(void *))
{
	t_double_list	*temp;

	if (deque->size < 1 || !deque->tail)
		return ;
	(deque->size)--;
	temp = deque->tail;
	deque->tail = deque->tail->last;
	if (deque->tail)
		deque->tail->next = NULL;
	if (f)
		f(temp->content);
	ft_free(temp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jl 0x31f5
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x31f7
jmp 0x325c
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x323f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x8(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x3253
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rdi
callq 0x2560
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque.c
// Function: deque_pop_front
void	deque_pop_front(t_deque *deque, void (*f)(void*))
{
	t_double_list	*temp;

	if (deque->size < 1 || !deque->head)
		return ;
	(deque->size)--;
	temp = deque->head;
	deque->head = deque->head->next;
	if (deque->head)
		deque->head->last = NULL;
	if (f)
		f(temp->content);
	ft_free(temp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jl 0x3294
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x3296
jmp 0x32f6
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x32d9
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x32ed
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rdi
callq 0x2560
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/deque_utils.c
// Function: double_list_init
t_double_list	*double_list_init(void *ptr)
{
	t_double_list	*double_list;

	double_list = ft_malloc(1, sizeof(t_double_list));
	if (!double_list)
		return (NULL);
	double_list->content = ptr;
	double_list->next = NULL;
	double_list->last = NULL;
	return (double_list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x2530
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3330
movq $0x0, -0x8(%rbp)
jmp 0x335b
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_calloc.c
// Function: ft_calloc
void	*ft_calloc(size_t elementcount, size_t elementsize)
{
	void	*ans;

	ans = ft_malloc(elementcount, elementsize);
	if (!ans)
	{
		ft_putstr_fd("ERROR_IN_FT_CALLOC\n", 1);
		return (NULL);
	}
	ft_memset(ans, 0, elementcount * elementsize);
	return (ans);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2530
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x33e3
leaq 0xcdb(%rip), %rdi       # 0x40aa
movl $0x1, %esi
callq 0x2350
movq $0x0, -0x8(%rbp)
jmp 0x33ff
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
imulq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x3460
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_strlen.c
// Function: ft_strlen
size_t	ft_strlen(const char *s)
{
	size_t	ans;

	ans = 0;
	if (!s)
		return (0);
	while (s[ans])
		++ans;
	return (ans);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3431
movq $0x0, -0x8(%rbp)
jmp 0x3457
jmp 0x3433
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x344f
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3433
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memset.c
// Function: ft_memset
void	*ft_memset(void *b, int c, size_t len)
{
	unsigned char	*s;

	s = (unsigned char *)b;
	while (len--)
		*(s++) = (unsigned char)c;
	return (b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x18(%rbp)
cmpq $0x0, %rax
je 0x34a4
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x3477
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_substr.c
// Function: ft_substr
char	*ft_substr(char const *s, size_t start, size_t len)
{
	char	*ans;
	size_t	l;
	size_t	ct;

	if (start >= ft_strlen(s))
	{
		ans = ft_calloc(1, sizeof(char));
		return (ans);
	}
	l = (size_t)ft_min((int)(ft_strlen(s) - start), (int)len);
	if (!s)
		return (NULL);
	ans = ft_calloc(l + 1, sizeof(char));
	if (!ans)
		return (NULL);
	ct = -1;
	while (++ct < l)
		ans[ct] = s[start + ct];
	ans[ct] = '\0';
	return (ans);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3410
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jb 0x34ff
movl $0x1, %esi
movq %rsi, %rdi
callq 0x33a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x35a1
movq -0x10(%rbp), %rdi
callq 0x3410
subq -0x18(%rbp), %rax
movl %eax, %edi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x2f90
cltq
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3530
movq $0x0, -0x8(%rbp)
jmp 0x35a1
movq -0x30(%rbp), %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x33a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x3557
movq $0x0, -0x8(%rbp)
jmp 0x35a1
movq $-0x1, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jae 0x358d
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x38(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x355f
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memory.c
// Function: ft_memory
void	*ft_memory(size_t elem_cnt,
size_t elem_size, void *del, t_memory type)
{
	static t_list	*head;
	void			*new_mem;

	if (type == push)
	{
		new_mem = ft_calloc_2(elem_cnt, elem_size);
		if (!new_mem)
			ft_putstr_fd("ERROR_IN_FT_MEMORY_0\n", 1);
		else if (!(ft_lstadd_front(&head, ft_lstnew_2(new_mem))))
			ft_putstr_fd("ERROR_IN_FT_MEMORY_1\n", 1);
		return (new_mem);
	}
	if (type == pop)
		ft_lstdelone_2(&head, ft_lstfind(head, del), free);
	else
		ft_lstclear_2(&head, free);
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x3632
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3690
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x35f8
leaq 0xad2(%rip), %rdi       # 0x40be
movl $0x1, %esi
callq 0x2350
jmp 0x3628
movq -0x30(%rbp), %rdi
callq 0x3700
movq %rax, %rsi
leaq 0x2a4d(%rip), %rdi      # 0x6058
callq 0x3920
cmpl $0x0, %eax
jne 0x3626
leaq 0xab8(%rip), %rdi       # 0x40d4
movl $0x1, %esi
callq 0x2350
jmp 0x3628
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x367b
cmpl $0x1, -0x24(%rbp)
jne 0x3660
movq 0x2a19(%rip), %rdi      # 0x6058
movq -0x20(%rbp), %rsi
callq 0x38d0
movq %rax, %rsi
leaq 0x2a06(%rip), %rdi      # 0x6058
movq 0x2977(%rip), %rdx      # 0x5fd0
callq 0x3770
jmp 0x3673
leaq 0x29f1(%rip), %rdi      # 0x6058
movq 0x2962(%rip), %rsi      # 0x5fd0
callq 0x3850
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memory.c
// Function: ft_calloc_2
static void	*ft_calloc_2(size_t elementcount, size_t elementsize)
{
	void	*ans;

	ans = malloc(elementcount * elementsize);
	if (!ans)
	{
		ft_putstr_fd("ERROR_IN_FT_CALLOC_2\n", 1);
		return (NULL);
	}
	ft_memset(ans, 0, elementcount * elementsize);
	return (ans);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
imulq -0x18(%rbp), %rdi
callq 0x1050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x36d4
leaq 0xa2a(%rip), %rdi       # 0x40ea
movl $0x1, %esi
callq 0x2350
movq $0x0, -0x8(%rbp)
jmp 0x36f0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
imulq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x3460
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memory.c
// Function: ft_lstnew_2
static t_list	*ft_lstnew_2(void *content)
{
	t_list	*nw;

	nw = (t_list *)malloc(sizeof(t_list));
	if (!nw)
	{
		ft_putstr_fd("ERROR_IN_FT_LSTNEW_2\n", 1);
		return (NULL);
	}
	nw->content = content;
	nw->next = NULL;
	return (nw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x10, %edi
callq 0x1050
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x373c
leaq 0x9d8(%rip), %rdi       # 0x4100
movl $0x1, %esi
callq 0x2350
movq $0x0, -0x8(%rbp)
jmp 0x375b
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memory.c
// Function: ft_lstdelone_2
static void	ft_lstdelone_2(t_list **head, t_list *lst, void (*del)(void *))
{
	t_list	*temp;

	if (!lst || !head)
		return ;
	temp = *head;
	if (temp == lst)
		*head = temp->next;
	else
	{
		while (temp && temp->next != lst)
			temp = temp->next;
		if (!temp)
		{
			ft_putstr_fd("ERROR_IN_FT_LSTDELONE_2\n", 1);
			return ;
		}
		temp->next = lst->next;
	}
	if (del)
		del(lst->content);
	free(lst);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3792
cmpq $0x0, -0x8(%rbp)
jne 0x3797
jmp 0x383b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x37bd
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x381e
jmp 0x37bf
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x21(%rbp)
je 0x37dd
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x37e6
jmp 0x37f4
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x37bf
cmpq $0x0, -0x20(%rbp)
jne 0x380e
leaq 0x914(%rip), %rdi       # 0x4116
movl $0x1, %esi
callq 0x2350
jmp 0x383b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x3832
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
callq 0x1070
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_memory.c
// Function: ft_lstclear_2
static void	ft_lstclear_2(t_list **lst, void (*del)(void *))
{
	t_list	*temp;
	t_list	*dd;

	if (!(lst))
	{
		ft_putstr_fd("ERROR_IN_FT_LSTCLEAR_2\n", 1);
		return ;
	}
	temp = *lst;
	*lst = NULL;
	while (temp)
	{
		if (del)
			del(temp->content);
		dd = temp;
		temp = temp->next;
		free(dd);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x387a
leaq 0x8c1(%rip), %rdi       # 0x412f
movl $0x1, %esi
callq 0x2350
jmp 0x38ca
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x38ca
cmpq $0x0, -0x10(%rbp)
je 0x38ab
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1070
jmp 0x3890
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_lstfind.c
// Function: ft_lstfind
t_list	*ft_lstfind(t_list *head, void *target)
{
	while (head)
	{
		if (head->content == target)
			return (head);
		head = head->next;
	}
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3908
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x38fa
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3910
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x38dc
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/LeoFu9487[P]push_swap/libft/ft_lstadd_front.c
// Function: ft_lstadd_front
int	ft_lstadd_front(t_list **lst, t_list *new)
{
	if (!new || !lst)
	{
		ft_putstr_fd("ERROR_IN_FT_LSTADD_FRONT\n", 1);
		return (0);
	}
	if (!*lst)
	{
		*lst = new;
		return (1);
	}
	new->next = *lst;
	*lst = new;
	return (1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x393e
cmpq $0x0, -0x10(%rbp)
jne 0x3958
leaq 0x802(%rip), %rdi       # 0x4147
movl $0x1, %esi
callq 0x2350
movl $0x0, -0x4(%rbp)
jmp 0x3997
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x3976
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x3997
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_providers
int
get_providers(xcb_connection_t * conn, xcb_screen_t * scrn, xcb_randr_provider_t ** ps)
{
	xcb_randr_get_providers_cookie_t pc;
	pc = xcb_randr_get_providers(conn, scrn->root);

	xcb_randr_get_providers_reply_t *pr;
	pr = xcb_randr_get_providers_reply(conn, pc, NULL);
	if (!pr)
		errx(1, "Could not aquire the array of providers.");

	*ps = xcb_randr_get_providers_providers(pr);

	return xcb_randr_get_providers_providers_length(pr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x11d0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1170
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x172a
movl $0x1, %edi
leaq 0x94e(%rip), %rsi       # 0x2071
movb $0x0, %al
callq 0x10a0
movq -0x28(%rbp), %rdi
callq 0x1080
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x1160
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_outputs
int
get_outputs(xcb_connection_t * conn, xcb_randr_provider_t provider, xcb_randr_output_t ** os)
{
	xcb_randr_get_provider_info_cookie_t pic;
	pic = xcb_randr_get_provider_info(conn, provider, 0);

	xcb_randr_get_provider_info_reply_t *pir;
	pir = xcb_randr_get_provider_info_reply(conn, pic, NULL);
	if (!pir)
		errx(1, "Could not aquire the array of outputs.");

	*os = xcb_randr_get_provider_info_outputs(pir);
	return xcb_randr_get_provider_info_outputs_length(pir);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %edx, %edx
callq 0x1040
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x17a8
movl $0x1, %edi
leaq 0x8f9(%rip), %rsi       # 0x209a
movb $0x0, %al
callq 0x10a0
movq -0x28(%rbp), %rdi
callq 0x1050
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x1210
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_output_info
xcb_randr_get_output_info_reply_t *
get_output_info(xcb_connection_t * conn, xcb_randr_output_t output)
{
	xcb_randr_get_output_info_cookie_t oic;

	oic = xcb_randr_get_output_info(conn, output, 0);
	xcb_randr_get_output_info_reply_t *output_info_reply;

	output_info_reply = xcb_randr_get_output_info_reply(conn, oic, NULL);
	if (!output_info_reply)
		errx(1, "Could not get output info.");

	return output_info_reply;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %edx, %edx
callq 0x1220
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x11e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1824
movl $0x1, %edi
leaq 0x8a4(%rip), %rsi       # 0x20c1
movb $0x0, %al
callq 0x10a0
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_output_name
uint8_t*
get_output_name(xcb_connection_t * conn, xcb_randr_output_t output)
{
	xcb_randr_get_output_info_reply_t *r;

	r = get_output_info(conn, output);
	uint8_t *name = xcb_randr_get_output_info_name(r);
	int len = xcb_randr_get_output_info_name_length(r);
	uint8_t *ret  =
		malloc(sizeof(uint8_t) * len + 1);
	int i;
	for (i = 0; i < xcb_randr_get_output_info_name_length(r); i++) {
		ret[i] = name[i];
	}
	ret[len] = '\0';
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x17d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1150
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1060
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rdi
shlq $0x0, %rdi
addq $0x1, %rdi
callq 0x1140
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1060
movl %eax, %ecx
movl -0x38(%rbp), %eax
cmpl %ecx, %eax
jge 0x18bd
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1884
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_focused_window
xcb_window_t
get_focused_window(xcb_connection_t * conn)
{
	xcb_window_t    win = 0;
	xcb_get_input_focus_cookie_t input_focus_cookie;
	xcb_get_input_focus_reply_t *input_focus_reply;

	input_focus_cookie = xcb_get_input_focus(conn);
	input_focus_reply = xcb_get_input_focus_reply(conn, input_focus_cookie, NULL);
	if (!input_focus_reply)
		errx(1, "Cannot get focused window.");
	win = input_focus_reply->focus;
	free(input_focus_reply);
	return win;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10d0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x19b3
movl $0x1, %edi
leaq 0x730(%rip), %rsi       # 0x20dc
movb $0x0, %al
callq 0x10a0
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1030
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_window_geometry
xcb_get_geometry_reply_t *
get_window_geometry(xcb_connection_t * conn, xcb_window_t window)
{
	xcb_get_geometry_cookie_t get_geometry_cookie;
	xcb_get_geometry_reply_t *get_geometry_reply;

	get_geometry_cookie = xcb_get_geometry(conn, window);
	get_geometry_reply = xcb_get_geometry_reply(conn, get_geometry_cookie, NULL);

	if (!get_geometry_reply)
		errx(1, "0x%08x: no such window", window);
	return get_geometry_reply;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1120
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x10e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1a25
movl -0xc(%rbp), %edx
movl $0x1, %edi
leaq 0x6d9(%rip), %rsi       # 0x20f7
movb $0x0, %al
callq 0x10a0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/tudurom[P]disputils/randr.c
// Function: get_primary_output
xcb_randr_get_output_primary_reply_t *
get_primary_output(xcb_connection_t * conn)
{
	xcb_screen_t   *scrn;
	xcb_window_t    root;
	xcb_randr_get_output_primary_cookie_t c;
	xcb_randr_get_output_primary_reply_t *primary_output;

	get_screen(conn, &scrn);
	root = scrn->root;

	c = xcb_randr_get_output_primary(conn, root);
	primary_output = xcb_randr_get_output_primary_reply(conn, c, NULL);

	return primary_output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1670
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x1200
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1070
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/AML_HEVCEncoder.cpp
// Function: Wave4BitIssueCommand(unsigned int, unsigned int, unsigned int)
void Wave4BitIssueCommand(Uint32 coreIdx, Uint32 instanceIndex, Uint32 cmd) {

	(void)instanceIndex;

    VpuWriteReg(coreIdx, W4_VPU_BUSY_STATUS, 1);
    VpuWriteReg(coreIdx, W4_RET_SUCCESS, 0);  //for debug
    //VpuWriteReg(coreIdx, W4_CORE_INDEX, 0);
    //VpuWriteReg(coreIdx, W4_INST_INDEX, (instanceIndex & 0xffff) | (codecMode << 16));

    VpuWriteReg(coreIdx, W4_COMMAND, cmd);
    VpuWriteReg(coreIdx, W4_VPU_HOST_INT_REQ, 1);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x4(%rbp), %edi
movl $0x70, %esi
movl $0x1, %edx
callq 0x2160
movl -0x4(%rbp), %edi
movl $0x110, %esi            # imm = 0x110
xorl %edx, %edx
callq 0x2160
movl -0x4(%rbp), %edi
movl -0xc(%rbp), %edx
movl $0x100, %esi            # imm = 0x100
callq 0x2160
movl -0x4(%rbp), %edi
movl $0x38, %esi
movl $0x1, %edx
callq 0x2160
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/AML_HEVCEncoder.cpp
// Function: Wave4VpuReset(AMVHEVCEncHandle_s*, unsigned int, int)
AMVEnc_Status Wave4VpuReset(AMVHEVCEncHandle *Handle, Uint32 coreIdx, int resetMode) {
    u32 val = 0;

    // VPU doesn't send response. Force to set BUSY flag to 0.
    VpuWriteReg(coreIdx, W4_VPU_BUSY_STATUS, 0);

    if (resetMode == SW_RESET_SAFETY) {
        Wave4VpuSleepWake(Handle, coreIdx, 1, NULL, 0, 0);
    }

    switch (resetMode) {
    case SW_RESET_ON_BOOT:
        val = W4_RST_BLOCK_ALL;
        break;
    case SW_RESET_FORCE:
        val = W4_RST_BLOCK_BCLK_ALL | W4_RST_BLOCK_CCLK_ALL;
        break;
    case SW_RESET_SAFETY:
        val = W4_RST_BLOCK_ACLK_ALL | W4_RST_BLOCK_BCLK_ALL | W4_RST_BLOCK_CCLK_ALL;
        break;
    default:
        return AMVENC_NOT_SUPPORTED;
    }

    if (val) {
        VpuWriteReg(coreIdx, W4_VPU_RESET_REQ, val);
        if (vdi_wait_vpu_busy(coreIdx, VPU_BUSY_CHECK_TIMEOUT, W4_VPU_RESET_STATUS) == -1) {
            VpuWriteReg(coreIdx, W4_VPU_RESET_REQ, 0);
            VLOG(INFO, "Wave4VpuReset time out reset");
            reset_error = 1;
            return AMVENC_TIMEOUT;
        }
        VpuWriteReg(coreIdx, W4_VPU_RESET_REQ, 0);
    }

    if (resetMode == SW_RESET_SAFETY || resetMode == SW_RESET_ON_BOOT) {
        Wave4VpuSleepWake(Handle, coreIdx, 0, NULL, 0, val);
    }
    return AMVENC_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x14(%rbp), %edi
movl $0x70, %esi
xorl %edx, %edx
callq 0x2160
cmpl $0x0, -0x18(%rbp)
jne 0x51e9
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x21e0
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x521b
jmp 0x51f5
movl -0x20(%rbp), %eax
subl $0x1, %eax
je 0x5212
jmp 0x51ff
movl -0x20(%rbp), %eax
subl $0x2, %eax
jne 0x5224
jmp 0x5209
movl $0xfffffff, -0x1c(%rbp) # imm = 0xFFFFFFF
jmp 0x5230
movl $0xffff, -0x1c(%rbp)    # imm = 0xFFFF
jmp 0x5230
movl $0xffffff, -0x1c(%rbp)  # imm = 0xFFFFFF
jmp 0x5230
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x52d7
cmpl $0x0, -0x1c(%rbp)
je 0x52aa
movl -0x14(%rbp), %edi
movl -0x1c(%rbp), %edx
movl $0x50, %esi
callq 0x2160
movl -0x14(%rbp), %edi
movl $0x1388, %esi           # imm = 0x1388
movl $0x54, %edx
callq 0x2060
cmpl $-0x1, %eax
jne 0x529b
movl -0x14(%rbp), %edi
movl $0x50, %esi
xorl %edx, %edx
callq 0x2160
leaq 0x2ab88(%rip), %rdi     # 0x2fdfb
movb $0x0, %al
callq 0x2050
leaq 0x2afe5(%rip), %rdi     # 0x30266
movb $0x0, %al
callq 0x2050
movl $0x1, 0x2df62(%rip)     # 0x331f4
movl $0xffffffdc, -0x4(%rbp) # imm = 0xFFFFFFDC
jmp 0x52d7
movl -0x14(%rbp), %edi
movl $0x50, %esi
xorl %edx, %edx
callq 0x2160
cmpl $0x0, -0x18(%rbp)
je 0x52b6
cmpl $0x2, -0x18(%rbp)
jne 0x52d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x1c(%rbp), %r9d
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %ecx
movl %r8d, %edx
callq 0x21e0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/AML_HEVCEncoder.cpp
// Function: AML_HEVCEncNAL(AMVHEVCEncHandle_s*, unsigned char*, unsigned int*, int*)
AMVEnc_Status AML_HEVCEncNAL(AMVHEVCEncHandle *Handle, unsigned char *buffer, unsigned int *buf_nal_size, int *nal_type) {
    AMVEnc_Status ret = AMVENC_FAIL;
    int end = 0;
    int reset_count = 0;

    if (reset_error)
        return ret;
retry:
    ret = Wave4VpuEncEncPic(Handle, Handle->src_idx, end, buffer, buf_nal_size, nal_type);

    if (ret != AMVENC_SUCCESS) {
        if (ret == AMVENC_OVERFLOW)
            return ret;
        if (reset_mode == 2) {
            Wave4VpuCreateInstance(Handle, 0);
        }
        Wave4VpuEncSeqInit(Handle, 0);
        if (Handle->mGopIdx == 0)
            Wave4VpuEncSeqSet(Handle);
        Handle->src_count = VpuReadReg(Handle->instance_id, W4_RET_ENC_MIN_SRC_BUF_NUM);
        Wave4VpuEncRegisterFrame(Handle, 0);
        Handle->src_idx = 0;
        reset_count++;
        if (reset_count < 5)
            goto retry;

        //ret = AMVENC_REENCODE_PICTURE;
        //return ret;
    }
    Handle->src_idx++;
    Handle->src_idx = Handle->src_idx % Handle->src_count;
    Handle->enc_counter++;

    return AMVENC_PICTURE_READY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x0, 0x2a9d0(%rip)     # 0x331f4
je 0x8831
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8922
jmp 0x8833
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %esi
movl -0x30(%rbp), %edx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
callq 0x2390
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
je 0x88ea
cmpl $-0x27, -0x2c(%rbp)
jne 0x8870
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8922
cmpl $0x2, 0x2a969(%rip)     # 0x331e0
jne 0x8884
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x21c0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x2090
movq -0x10(%rbp), %rax
cmpl $0x0, 0x304(%rax)
jne 0x88a5
movq -0x10(%rbp), %rdi
callq 0x20e0
movq -0x10(%rbp), %rax
movl (%rax), %edi
movl $0x1d8, %esi            # imm = 0x1D8
callq 0x2210
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x2310
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x5, -0x34(%rbp)
jge 0x88e8
jmp 0x8833
jmp 0x88ea
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movq -0x10(%rbp), %rax
movl %edx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/libvp_hevc_codec.cpp
// Function: initEncParams(HEVCEncParams_s*)
int initEncParams(AMVHEVCEncParams * params) {
    memset(params, 0, sizeof(AMVHEVCEncParams));

    params->rate_control = HEVC_OFF;
    params->auto_scd = HEVC_OFF;
    params->out_of_band_param_set = HEVC_OFF;
    params->num_ref_frame = 1;
    params->num_slice_group = 1;
    //handle->mEncParams.nSliceHeaderSpacing = 0;
    params->fullsearch = HEVC_OFF;
    params->search_range = 16;
    //handle->mEncParams.sub_pel = HEVC_OFF;
    //handle->mEncParams.submb_pred = HEVC_OFF;
    params->FreeRun = HEVC_OFF;
    params->MBsIntraRefresh = 0;
    params->MBsIntraOverlap = 0;
    params->encode_once = 1;
    // Set profile and level
    params->profile = HEVC_MAIN;
    params->level = HEVC_LEVEL_NONE; // firmware determines a level.
    params->tier = HEVC_TIER_MAIN;
    params->initQP = 30;
    params->BitrateScale = HEVC_OFF;
    params->refresh_type = HEVC_CRA;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x20f0
movq -0x8(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x14(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movl $0x10, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x58(%rax)
movq -0x8(%rbp), %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x1e, 0x34(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x5c(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/libvp_hevc_codec.cpp
// Function: vl_video_encoder_destroy
int vl_video_encoder_destroy(vl_codec_handle_t codec_handle) {
    AMVHEVCEncHandle *handle = (AMVHEVCEncHandle *)codec_handle;
    AML_HEVCRelease(handle);
    if (handle->mSPSPPSData)
        free(handle->mSPSPPSData);
    if (handle->mEncParams)
        destroyEncParams(handle->mEncParams);
    if (handle)
        delete handle;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2270
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2f0(%rax)
je 0x946b
movq -0x10(%rbp), %rax
movq 0x2f0(%rax), %rdi
callq 0x2200
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2e0(%rax)
je 0x9489
movq -0x10(%rbp), %rax
movq 0x2e0(%rax), %rdi
callq 0x20c0
cmpq $0x0, -0x10(%rbp)
je 0x94ae
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x94ac
movq -0x18(%rbp), %rdi
movl $0x310, %esi            # imm = 0x310
callq 0x21d0
jmp 0x94ae
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/xiane[P]libvphevcodec/vdi.cpp
// Function: vdi_set_clock_gate(unsigned int, unsigned int)
s32 vdi_set_clock_gate(u32 core_idx, u32 enable) {
    vdi_info_t *vdi;
    s32 ret;

    if (core_idx >= MAX_NUM_VPU_CORE)
        return -1;

    vdi = &s_vdi_info[core_idx];
    if (!vdi || vdi->vpu_fd < 0 || vdi->opened == 0)
        return -1;

    vdi->clock_state = enable;
    ret = ioctl(vdi->vpu_fd, VDI_IOCTL_SET_CLOCK_GATE, &enable);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1, -0x8(%rbp)
jb 0x994d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x99b8
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x298b7(%rip), %rax     # 0x33210
imulq $0x2888, %rcx, %rcx     # imm = 0x2888
addq %rcx, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x9985
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0x9985
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0x998e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x99b8
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
movl $0x40045603, %esi       # imm = 0x40045603
leaq -0xc(%rbp), %rdx
movb $0x0, %al
callq 0x2230
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)