LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_lstdelone.c
// Function: ft_lstdelone
void	ft_lstdelone(t_list *lst, void (*del)(void *))
{
	if (lst)
	{
		if (del)
			del(lst->content);
		free(lst);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x9e3c
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x9e33
movq (%rbx), %rdi
callq *%rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strichr.c
// Function: ft_strichr
int	ft_strichr(const char *str, char c)
{
	int index;

	index = 0;
	if (!str)
		return (-1);
	while (str[index])
	{
		if (str[index] == c)
			return (index);
		index++;
	}
	return (-1);
}

// Assembly:
pushq $-0x1
popq %rax
testq %rdi, %rdi
je 0x9ed1
xorl %ecx, %ecx
movb (%rdi,%rcx), %dl
testb %dl, %dl
je 0x9ed1
cmpb %sil, %dl
je 0x9ecf
incq %rcx
jmp 0x9ebe
movl %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_array_free.c
// Function: ft_array_free
void	*ft_array_free(char **ptr, int k)
{
	if (!ptr)
		return (NULL);
	while (--k >= 0)
	{
		free(ptr[k]);
		ptr[k] = NULL;
	}
	free(ptr);
	ptr = NULL;
	return (NULL);
}

// Assembly:
testq %rdi, %rdi
je 0x9f0f
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
testl %r14d, %r14d
jle 0x9f02
leaq -0x1(%r14), %r15
movq -0x8(%rbx,%r14,8), %rdi
callq 0x2230
andq $0x0, -0x8(%rbx,%r14,8)
movq %r15, %r14
jmp 0x9ee4
movq %rbx, %rdi
callq 0x2230
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_stristr.c
// Function: ft_stristr
int	ft_stristr(const char *str, char *stack)
{
	int i;
	int j;

	if (!str || !stack)
		return (-1);
	i = 0;
	j = 0;
	while (str[i])
	{
		j = 0;
		while (stack[j])
		{
			if (str[i] == stack[j])
				return (i);
			j++;
		}
		i++;
	}
	return (-1);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
pushq $-0x1
popq %rax
orb %cl, %dl
jne 0x9f4c
xorl %ecx, %ecx
movb (%rdi,%rcx), %dl
testb %dl, %dl
je 0x9f4c
movq %rsi, %r8
movb (%r8), %r9b
testb %r9b, %r9b
je 0x9f45
incq %r8
cmpb %r9b, %dl
jne 0x9f33
jmp 0x9f4a
incq %rcx
jmp 0x9f29
movl %ecx, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strappend.c
// Function: ft_strappend
int	ft_strappend(char **str, char c)
{
	char *char_str;

	char_str = (char	[2]){c, '\0'};
	if (!*str)
	{
		if (!(*str = ft_strdup(char_str)))
			return (0);
	}
	else if (!(*str = ft_strjoin_free(*str, char_str, 1)))
		return (0);
	return (1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb %sil, 0xe(%rsp)
movb $0x0, 0xf(%rsp)
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x9f91
leaq 0xe(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x9b9c
jmp 0x9f9b
leaq 0xe(%rsp), %rdi
callq 0x9aec
movq %rax, (%rbx)
testq %rax, %rax
je 0x9fa8
pushq $0x1
popq %rax
jmp 0x9faa
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strcmp.c
// Function: ft_strcmp
int	ft_strcmp(const char *s1, const char *s2)
{
	int i;

	i = 0;
	while (s1[i] == s2[i])
	{
		if (s1[i] == '\0')
			return (0);
		i++;
	}
	return ((unsigned)s1[i] - (unsigned)s2[i]);
}

// Assembly:
xorl %ecx, %ecx
movsbl (%rdi,%rcx), %eax
movsbl (%rsi,%rcx), %edx
cmpb %dl, %al
jne 0xa014
incq %rcx
testb %al, %al
jne 0x9ffe
xorl %eax, %eax
retq
subl %edx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strcadd.c
// Function: ft_strcadd
int	ft_strcadd(char **str, char c, size_t index)
{
	size_t	tt_len;
	char	*new;
	size_t	j;

	tt_len = ft_strlen(*str) + 1;
	j = 0;
	if (!(new = (char*)malloc(sizeof(char) * (tt_len + 1))))
	{
		ft_free((void **)str);
		return (0);
	}
	new[tt_len] = '\0';
	while (j < index && j < (tt_len - 1))
	{
		new[j] = str[0][j];
		j++;
	}
	new[j] = c;
	while (++j < tt_len)
		new[j] = str[0][j - 1];
	ft_free((void**)str);
	*str = new;
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9be0
movq %rax, %r14
leaq 0x2(%rax), %rdi
callq 0x2180
testq %rax, %rax
je 0xa0a4
movq %rax, %r15
leaq 0x1(%r14), %rax
movb $0x0, 0x1(%r15,%r14)
cmpq %r14, %r12
cmovbq %r12, %r14
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0xa087
movq (%rbx), %rdx
movb (%rdx,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0xa06b
movq (%rbx), %rcx
movb -0x1(%rcx,%r14), %bpl
incq %r14
movb %bpl, -0x1(%r15,%r14)
cmpq %rax, %r14
jb 0xa07f
movq %rbx, %rdi
callq 0xa018
movq %r15, (%rbx)
pushq $0x1
popq %rax
jmp 0xa0ae
movq %rbx, %rdi
callq 0xa018
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strcdel.c
// Function: ft_strcdel
void	ft_strcdel(char *str, size_t i)
{
	size_t	len;

	if (!str || !ft_strlen(str))
		return ;
	len = ft_strlen(str);
	if (i >= len)
		return ;
	ft_memmove(str + i, str + i + 1, len - i);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa0f8
movq %rsi, %rbx
movq %rdi, %r14
callq 0x9be0
testq %rax, %rax
je 0xa0f8
movq %r14, %rdi
callq 0x9be0
subq %rbx, %rax
jbe 0xa0f8
leaq (%r14,%rbx), %rdi
leaq (%r14,%rbx), %rsi
incq %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9568
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_strstradd.c
// Function: ft_strstradd
int			ft_strstradd(char **dst, int start, char *src)
{
	int len;

	if (!dst || !src)
	{
		ft_free((void**)dst);
		return (0);
	}
	len = ft_strlen(*dst);
	if (start > len)
		start = len;
	if (!(*dst))
	{
		if (!(*dst = ft_strdup(src)))
			return (0);
	}
	else if (!ft_strstradd_assist(dst, start, src))
	{
		ft_free((void**)dst);
		return (0);
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
je 0xa181
movq %rdx, %r14
movl %esi, %ebp
movq (%rbx), %rdi
callq 0x9be0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa197
cmpl %ebp, %eax
cmovll %eax, %ebp
movslq %ebp, %r15
xorl %ebp, %ebp
xorl %esi, %esi
movq %r15, %rdx
callq 0x9d48
testq %rax, %rax
je 0xa18d
pushq $0x1
popq %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x9b9c
testq %rax, %rax
je 0xa18d
addq (%rbx), %r15
pushq $0x1
popq %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x9b9c
testq %rax, %rax
je 0xa18d
movq %rax, %r14
movq %rbx, %rdi
callq 0xa018
movq %r14, (%rbx)
jmp 0xa1a7
movq %rbx, %rdi
callq 0xa018
xorl %ebp, %ebp
jmp 0xa1aa
movq %rbx, %rdi
callq 0xa018
jmp 0xa1aa
movq %r14, %rdi
callq 0x9aec
movq %rax, (%rbx)
testq %rax, %rax
je 0xa189
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstadd_front.c
// Function: ft_dlstadd_front
void	ft_dlstadd_front(t_dlist **alst, t_dlist *new)
{
	if (!alst || !new)
		return ;
	if (*alst)
	{
		(*alst)->previous = new;
		new->next = *alst;
	}
	*alst = new;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xa1fe
movq (%rdi), %rax
testq %rax, %rax
je 0xa1fb
movq %rsi, 0x10(%rax)
movq (%rdi), %rax
movq %rax, 0x8(%rsi)
movq %rsi, (%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstclear.c
// Function: ft_dlstclear
void	ft_dlstclear(t_dlist **lst, void (*del)(void *))
{
	t_dlist	*current;
	t_dlist	*then;

	if (!lst || !*lst)
		return ;
	if (*lst)
	{
		current = (*lst)->next;
		while (current)
		{
			then = current->next;
			ft_dlstdelone(current, del);
			current = then;
		}
	}
	current = *lst;
	while (current)
	{
		then = current->previous;
		ft_dlstdelone(current, del);
		current = then;
	}
	*lst = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0xa254
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0xa24f
movq %rsi, %r14
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0xa232
movq 0x8(%rdi), %r15
movq %r14, %rsi
callq 0xa258
movq %r15, %rdi
jmp 0xa21c
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa24b
movq 0x10(%rdi), %r15
movq %r14, %rsi
callq 0xa258
movq %r15, %rdi
jmp 0xa235
andq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstdelone.c
// Function: ft_dlstdelone
void	ft_dlstdelone(t_dlist *lst, void (*del)(void *))
{
	if (lst)
	{
		if (del)
			del(lst->content);
		free(lst);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xa274
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0xa26b
movq (%rbx), %rdi
callq *%rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstpop_front.c
// Function: ft_dlstpop_front
void	ft_dlstpop_front(t_dlist **head, void (*del)(void*))
{
	t_dlist *new_head;

	if (!head || !del || !*head)
		return ;
	new_head = (*head)->next;
	ft_dlstdelone(*head, del);
	*head = NULL;
	*head = new_head;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xa2aa
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa2a3
movq 0x8(%rdi), %r14
callq 0xa258
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstpop_back.c
// Function: ft_dlstpop_back
void	ft_dlstpop_back(t_dlist **head, void (*del)(void*))
{
	t_dlist **current;
	t_dlist *then;

	if (!head || !del || !*head)
		return ;
	current = head;
	while (*current)
	{
		then = (*current)->next;
		if (!then)
		{
			ft_dlstdelone(*current, del);
			*current = NULL;
			return ;
		}
		current = &(*current)->next;
	}
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xa2e5
movq (%rdi), %rcx
testq %rcx, %rcx
je 0xa2e5
pushq %rbx
movq %rdi, %rbx
movq %rcx, %rax
leaq 0x8(%rcx), %rdi
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0xa2c5
movq %rax, %rdi
callq 0xa258
andq $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_dlstclearback_addr.c
// Function: ft_dlstclearback_addr
void	ft_dlstclearback_addr(t_dlist **lst, void (*del)(void **))
{
	t_dlist	*then;

	if (!lst || !*lst)
		return ;
	while ((*lst)->next)
		(*lst) = (*lst)->next;
	while (*lst)
	{
		then = (*lst)->previous;
		if (del)
			del(&(*lst)->content);
		ft_free((void **)lst);
		(*lst) = then;
	}
}

// Assembly:
testq %rdi, %rdi
je 0xa334
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa32f
movq %rsi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0xa32a
movq %rax, (%r14)
movq %rax, %rdi
jmp 0xa300
movq 0x10(%rdi), %r15
testq %rbx, %rbx
je 0xa31c
callq *%rbx
movq %r14, %rdi
callq 0xa018
movq %r15, (%r14)
movq %r15, %rdi
testq %rdi, %rdi
jne 0xa311
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/ft_lstremove_if.c
// Function: ft_lstremove_if
void	ft_lstremove_if(t_list **begin_list, void *data_ref, int (*cmp)(),
		void (*free_fct)(void *))
{
	t_list	*current;
	t_list	*to_delete;

	while (*begin_list && !((*cmp)((*begin_list)->content, data_ref)))
	{
		to_delete = *begin_list;
		*begin_list = to_delete->next;
		ft_lstdelone(to_delete, free_fct);
	}
	current = *begin_list;
	while (current != NULL)
	{
		if (current->next && !((*cmp)(current->next->content, data_ref)))
		{
			to_delete = current->next;
			current->next = current->next->next;
			ft_lstdelone(to_delete, free_fct);
		}
		else
			current = current->next;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movq (%r13), %rax
testq %rax, %rax
je 0xa37f
movq (%rax), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq *%r14
movq (%r13), %r12
testl %eax, %eax
jne 0xa3b8
movq 0x8(%r12), %rax
movq %rax, (%r13)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9e20
jmp 0xa34d
xorl %r12d, %r12d
jmp 0xa3b8
movq 0x8(%r12), %rax
testq %rax, %rax
je 0xa37f
movq (%rax), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq *%r14
movq 0x8(%r12), %rdi
testl %eax, %eax
jne 0xa3b5
movq 0x8(%rdi), %rax
movq %rax, 0x8(%r12)
movq %rbx, %rsi
callq 0x9e20
jmp 0xa3b8
movq %rdi, %r12
testq %r12, %r12
jne 0xa384
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/btree_depth.c
// Function: btree_depth
int		btree_depth(t_btree *root)
{
	int	max[3];

	if (!root)
		return (0);
	max[0] = btree_depth(root->left);
	max[1] = btree_depth(root->right);
	max[2] = (max[0] > max[1] ? max[0] : max[1]);
	return (max[2] + 1);
}

// Assembly:
testq %rdi, %rdi
je 0xa3f4
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xa3c8
movl %eax, %ebp
movq 0x8(%rbx), %rdi
callq 0xa3c8
cmpl %eax, %ebp
cmovgl %ebp, %eax
incl %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/btree_clear.c
// Function: btree_clear
void	btree_clear(t_btree **node, void (*del)(void *))
{
	if (!*node)
		return ;
	btree_clear(&(*node)->left, del);
	btree_clear(&(*node)->right, del);
	btree_delone(node, del);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa450
movq %rsi, %rbx
callq 0xa418
movq (%r14), %rdi
addq $0x8, %rdi
movq %rbx, %rsi
callq 0xa418
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa458
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/libft/btree_delone.c
// Function: btree_delone
void	btree_delone(t_btree **node, void (*del)(void *))
{
	if (!*node)
		return ;
	if (del)
		del((*node)->item);
	ft_free((void **)node);
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0xa478
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0xa46f
movq 0x10(%rax), %rdi
callq *%rsi
movq %rbx, %rdi
popq %rbx
jmp 0xa018
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/sha256.c
// Function: sha256Input
int sha256Input(SHA256Context *ctx, const uint8_t *msg, unsigned int len)
{
    if(!ctx)
        return SHA_NULL;
    if(!len)
        return SHA_SUCCESS;
    if(!msg)
        return SHA_NULL;

    if(ctx->Computed) return ctx->Corrupted = SHA_ERR;
    if(ctx->Corrupted) return ctx->Corrupted;

    while(len--){
        ctx->msg_block[ctx->msg_block_idx++] = *msg;
        if((SHA256_add_len(ctx, 8) == SHA_SUCCESS) && (ctx->msg_block_idx == SHA256_Message_Block_Size))
            sha256Process(ctx);
        ++msg;
    }
    return SHA_SUCCESS;
}

// Assembly:
pushq $0x1
popq %rax
testq %rdi, %rdi
je 0x129e
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
testl %edx, %edx
je 0x1297
movq %rsi, %r15
testq %rsi, %rsi
je 0x1299
movq %rdi, %r14
cmpl $0x0, 0x6c(%rdi)
je 0x1235
movl $0x3, 0x70(%r14)
pushq $0x3
popq %rax
jmp 0x1299
movl 0x70(%r14), %eax
testl %eax, %eax
jne 0x1299
jmp 0x1290
movb (%r15), %al
movswq 0x28(%r14), %rcx
leal 0x1(%rcx), %edx
movw %dx, 0x28(%r14)
movb %al, 0x2a(%r14,%rcx)
movl 0x24(%r14), %eax
movzbl %al, %ecx
cmpl %ecx, %ebx
adcl $0x0, %eax
movl %eax, 0x24(%r14)
je 0x1276
incl 0x20(%r14)
jne 0x1276
movl $0x2, 0x70(%r14)
jmp 0x128d
cmpl $0x0, 0x70(%r14)
jne 0x128d
cmpw $0x40, 0x28(%r14)
jne 0x128d
movq %r14, %rdi
callq 0x129f
incq %r15
decl %ebx
cmpl $-0x1, %ebx
jne 0x123f
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/sha256.c
// Function: sha256FinalizeBits
int sha256FinalizeBits(SHA256Context *ctx, uint8_t msg_bits, unsigned int len)
{
    static uint8_t mask[8] = {
        /* 0 0b00000000 */ 0x00, /* 1 0b10000000 */ 0x80,
        /* 2 0b11000000 */ 0xC0, /* 3 0b11100000 */ 0xE0,
        /* 4 0b11110000 */ 0xF0, /* 5 0b11111000 */ 0xF8,
        /* 6 0b11111100 */ 0xFC, /* 7 0b11111110 */ 0xFE
    };
    static uint8_t markbit[8] = {
        /* 0 0b10000000 */ 0x80, /* 1 0b01000000 */ 0x40,
        /* 2 0b00100000 */ 0x20, /* 3 0b00010000 */ 0x10,
        /* 4 0b00001000 */ 0x08, /* 5 0b00000100 */ 0x04,
        /* 6 0b00000010 */ 0x02, /* 7 0b00000001 */ 0x01
    };

    if(!ctx) return SHA_NULL;
    if(!len) return SHA_SUCCESS;
    if(ctx->Corrupted) return ctx->Corrupted;
    if(ctx->Computed) return SHA_ERR;
    if(len >= 8) return ctx->Corrupted = SHA_BAD_PARAM;

    SHA256_add_len(ctx, len);
    sha256Finalize(ctx, (uint8_t)((msg_bits & mask[len])| markbit[len]));

    return ctx->Corrupted;
}

// Assembly:
testq %rdi, %rdi
je 0x1478
testl %edx, %edx
je 0x147c
pushq %rbx
movq %rdi, %rbx
movl 0x70(%rdi), %eax
testl %eax, %eax
jne 0x148e
cmpl $0x0, 0x6c(%rbx)
je 0x147f
pushq $0x3
jmp 0x148d
pushq $0x1
popq %rax
retq
xorl %eax, %eax
retq
cmpl $0x8, %edx
jb 0x1490
movl $0x4, 0x70(%rbx)
pushq $0x4
popq %rax
popq %rbx
retq
movl 0x24(%rbx), %eax
movzbl %al, %ecx
xorl %edi, %edi
cmpl %edx, %ecx
seta %dil
addl %eax, %edi
movl %edi, 0x24(%rbx)
je 0x14af
incl 0x20(%rbx)
jne 0x14af
pushq $0x2
popq %rax
jmp 0x14b1
xorl %eax, %eax
movl %eax, 0x70(%rbx)
movl %edx, %eax
leaq 0xb73(%rip), %rcx       # 0x2030
andb (%rax,%rcx), %sil
leaq 0xb70(%rip), %rcx       # 0x2038
orb (%rax,%rcx), %sil
movzbl %sil, %esi
movq %rbx, %rdi
callq 0x14dd
movl 0x70(%rbx), %eax
jmp 0x148e
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/sha256.c
// Function: sha256Finalize
static void sha256Finalize(SHA256Context *ctx, uint8_t pad_byte)
{
    sha256PadMsg(ctx, pad_byte);
    for(int i=0; i< SHA256_Message_Block_Size; ++i){
        ctx->msg_block[i] = 0;
    }
    ctx->ll = ctx->hl = 0;
    ctx->Computed = 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movswq 0x28(%rdi), %rcx
leal 0x1(%rcx), %eax
movw %ax, 0x28(%rdi)
cmpq $0x38, %rcx
jl 0x1514
movb %sil, 0x2a(%rbx,%rcx)
cmpw $0x3f, %ax
jg 0x151b
leal 0x1(%rax), %ecx
movw %cx, 0x28(%rbx)
movswq %ax, %rax
movb $0x0, 0x2a(%rbx,%rax)
movzwl 0x28(%rbx), %eax
jmp 0x14f8
movb $0x0, 0x2a(%rbx,%rcx)
jmp 0x1523
movq %rbx, %rdi
callq 0x129f
movl 0x20(%rbx), %eax
movl 0x24(%rbx), %ecx
bswapl %eax
movl %eax, 0x62(%rbx)
bswapl %ecx
movl %ecx, 0x66(%rbx)
movq %rbx, %rdi
callq 0x129f
xorl %eax, %eax
cmpq $0x40, %rax
je 0x154d
movb $0x0, 0x2a(%rbx,%rax)
incq %rax
jmp 0x153d
andq $0x0, 0x20(%rbx)
movl $0x1, 0x6c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/sha256.c
// Function: sha256Result
extern int sha256Result(SHA256Context *ctx, uint8_t msgDigest[SHA256_Hash_Size])
{
    if(!ctx) return SHA_NULL;
    if(!msgDigest) return SHA_NULL;
    if(ctx->Corrupted) return ctx->Corrupted;
    if(!ctx->Computed)
        sha256Finalize(ctx, 0x80);

    for(int i = 0; i < SHA256_Hash_Size; ++i)
        msgDigest[i] = (uint8_t) (ctx->h[i>>2]>> 8*(3-(i&0x03)));

    return SHA_SUCCESS;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x156f
pushq $0x1
popq %rax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x70(%rdi), %eax
testl %eax, %eax
je 0x1585
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
cmpl $0x0, 0x6c(%r14)
jne 0x159c
movq %r14, %rdi
movl $0x80, %esi
callq 0x14dd
xorl %eax, %eax
xorl %edx, %edx
xorl %esi, %esi
cmpq $0x20, %rsi
je 0x157d
movl %esi, %ecx
andl $-0x4, %ecx
movl (%r14,%rcx), %edi
movl %edx, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %edi
movb %dil, (%rbx,%rsi)
incq %rsi
addl $0x8, %edx
jmp 0x15a2
nop
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/main.c
// Function: help
void help()
{
  printf("\t\t\t...HELP...\t\t\t\n");
  printf("usage: ./sha -i <filename> -h <hashing_val>\n");
  printf("\t-i  input file\n");
  printf("\t-h  256/512 hashing value\n");
}

// Assembly:
pushq %rax
leaq 0xb81(%rip), %rdi       # 0x2151
callq 0x1050
leaq 0xb86(%rip), %rdi       # 0x2162
callq 0x1050
leaq 0xba6(%rip), %rdi       # 0x218e
callq 0x1050
leaq 0xbaa(%rip), %rdi       # 0x219e
popq %rax
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/main.c
// Function: init_sha_256
void init_sha_256(char *infile)
{
  SHA256Context ctx;
  char msg[1000];
  uint8_t msgDigest[SHA256_Hash_Size];
  FILE *fp = fopen(infile, "r+");
  if(NULL == fp){
    printf("error: file doesn't exist.\n");
    return;
  }
  sha256Init(&ctx);
  while(!feof(fp)){
    fscanf(fp, "%s", msg);
    sha256Input(&ctx, (uint8_t *)msg, strlen(msg));
  }
  sha256FinalizeBits(&ctx, 0x80, 3);
  sha256Result(&ctx, msgDigest);
    
  for(int i = 0; i < SHA256_Hash_Size; ++i){
    printf("%.2x ", msgDigest[i]);
  }
  printf("\n");
  fclose(fp);  
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
leaq 0xb31(%rip), %rsi       # 0x2140
callq 0x10a0
testq %rax, %rax
je 0x16d2
movq %rax, %rbx
leaq 0x2c(%rsp), %r14
movq %r14, %rdi
callq 0x11cc
leaq 0xb0f(%rip), %r15       # 0x2143
leaq 0xa0(%rsp), %r12
movq %rbx, %rdi
callq 0x1090
testl %eax, %eax
jne 0x166f
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1040
movq %r12, %rdi
callq 0x1070
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x11fc
jmp 0x163c
leaq 0x2c(%rsp), %r14
pushq $0x3
popq %rdx
movq %r14, %rdi
movl $0x80, %esi
callq 0x145a
movq %rsp, %rsi
movq %r14, %rdi
callq 0x155b
leaq 0xab0(%rip), %r14       # 0x2146
xorl %r15d, %r15d
cmpq $0x20, %r15
je 0x16b3
movzbl (%rsp,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
incq %r15
jmp 0x1699
pushq $0xa
popq %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1060
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xae0(%rip), %rdi       # 0x21b9
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/dubeyalok7[P]crypto-algo/sha/main.c
// Function: main
int main(int argc, char *argv[])
{
  int opt, hash_val = 0;
  extern char *optarg;
  char *infile;
  if(argc<5){
    help();
    return 0;
  }
  while((opt = getopt(argc, argv, "i:h:")) != -1){
    switch (opt)
    {
      case 'i':
        infile = optarg;
        break;
      case 'h':
        hash_val = atoi(optarg);      
        break;
    }
  }
  if(256 == hash_val){
    init_sha_256(infile);
  } else if(512 == hash_val){
    init_sha_512(infile);
  }  
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x5, %edi
jge 0x1704
callq 0x15c8
jmp 0x175b
movq %rsi, %rbx
movl %edi, %ebp
xorl %r12d, %r12d
leaq 0xa39(%rip), %r15       # 0x214c
movq 0x28c6(%rip), %r13      # 0x3fe0
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10b0
cmpl $-0x1, %eax
je 0x174a
cmpl $0x68, %eax
je 0x173c
cmpl $0x69, %eax
jne 0x171a
movq (%r13), %r14
jmp 0x171a
movq (%r13), %rdi
callq 0x10c0
movl %eax, %r12d
jmp 0x171a
cmpl $0x100, %r12d           # imm = 0x100
jne 0x175b
movq %r14, %rdi
callq 0x15fa
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/rd_net.c
// Function: rd_net_read
int rd_net_read(pNetwork_t pNetwork, void *connect, char *buffer, int len, int timeout_ms)
{
    if (RD_NET_WEBSOCKET == pNetwork->type) {
        if (NULL != connect) {
            return ws_nopoll_read(connect, buffer, len, timeout_ms);
        } else {
            return ws_nopoll_read(pNetwork->handle, buffer, len, timeout_ms);
        }
    } else {
        log_debug("unsupport connect type: %d ", pNetwork->type);
        return -1;
    }
}

// Assembly:
movl (%rdi), %r9d
testl %r9d, %r9d
je 0x273b
pushq %rax
leaq 0x58e8(%rip), %rsi      # 0x8004
leaq 0x58e7(%rip), %rdx      # 0x800a
leaq 0x58fa(%rip), %r8       # 0x8024
pushq $0xe
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
popq %rcx
retq
testq %rsi, %rsi
je 0x2745
movq %rsi, %rdi
jmp 0x2749
movq 0x38(%rdi), %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
jmp 0x29e4
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/rd_net.c
// Function: rd_net_write
int rd_net_write(pNetwork_t pNetwork, void *connect, const char *buffer, int len, int timeout_ms)
{
    if (RD_NET_WEBSOCKET == pNetwork->type) {
        if (NULL != connect) {
            return ws_nopoll_write(connect, buffer, len, timeout_ms);
        } else {
            return ws_nopoll_write(pNetwork->handle, buffer, len, timeout_ms);
        }
    } else {
        log_debug("unsupport connect type: %d ", pNetwork->type);
        return -1;
    }
}

// Assembly:
movl (%rdi), %r9d
testl %r9d, %r9d
je 0x2785
pushq %rax
leaq 0x589e(%rip), %rsi      # 0x8004
leaq 0x589d(%rip), %rdx      # 0x800a
leaq 0x58b0(%rip), %r8       # 0x8024
pushq $0x1c
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
popq %rcx
retq
testq %rsi, %rsi
je 0x278f
movq %rsi, %rdi
jmp 0x2793
movq 0x38(%rdi), %rdi
movq %rdx, %rsi
movl %ecx, %edx
movl %r8d, %ecx
jmp 0x29ef
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/rd_net.c
// Function: rd_net_connect
int rd_net_connect(pNetwork_t pNetwork)
{
    if (RD_NET_WEBSOCKET == pNetwork->type) {
        pNetwork->handle = (void *)ws_nopoll_connect(pNetwork->debug_on, pNetwork->host, pNetwork->port, 
                                pNetwork->get_url, pNetwork->tls_on, pNetwork->ca_crt);
        if (NULL != pNetwork->handle) {
            return 0;
        }
        return -1;
    } else {
        log_debug("unsupport connect type: %d ", pNetwork->type);
        return -1;
    }
}

// Assembly:
pushq %rbx
movl (%rdi), %r9d
testl %r9d, %r9d
je 0x2807
leaq 0x581c(%rip), %rsi      # 0x8004
leaq 0x581b(%rip), %rdx      # 0x800a
leaq 0x582e(%rip), %r8       # 0x8024
pushq $0x35
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
jmp 0x2835
movq %rdi, %rbx
movl 0x34(%rdi), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movl 0x30(%rbx), %r8d
movq 0x20(%rbx), %r9
callq 0x2b19
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/rd_net.c
// Function: rd_net_listener
int rd_net_listener(pNetwork_t pNetwork)
{
    if (RD_NET_WEBSOCKET == pNetwork->type) {
        pNetwork->handle = (void *)ws_nopoll_listener(pNetwork->debug_on, pNetwork->host, pNetwork->port, 
                                pNetwork->tls_on, pNetwork->ca_crt, pNetwork->pri_key);
        if (NULL != pNetwork->handle) {
            return 0;
        }
        return -1;
    } else {
        log_debug("unsupport connect type: %d ", pNetwork->type);
        return -1;
    }
}

// Assembly:
pushq %rbx
movl (%rdi), %r9d
testl %r9d, %r9d
je 0x2866
leaq 0x57bd(%rip), %rsi      # 0x8004
leaq 0x57bc(%rip), %rdx      # 0x800a
leaq 0x57cf(%rip), %r8       # 0x8024
pushq $0x44
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
jmp 0x2893
movq %rdi, %rbx
movl 0x34(%rdi), %edi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movl 0x30(%rbx), %ecx
movq 0x20(%rbx), %r8
movq 0x28(%rbx), %r9
callq 0x2d52
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/rd_net.c
// Function: rd_net_get_conn_info
int rd_net_get_conn_info (pNetwork_t pNetwork, void *connect, ConnectInfo_t *connInfo)
{
    if (RD_NET_WEBSOCKET == pNetwork->type) {
        if (NULL != connect) {
            return ws_nopoll_get_conn_info(connect, connInfo);
        } else {
            return ws_nopoll_get_conn_info(pNetwork->handle, connInfo);
        }
    } else {
        log_debug("unsupport connect type: %d ", pNetwork->type);
        return -1;
    }
}

// Assembly:
movl (%rdi), %r9d
testl %r9d, %r9d
je 0x296b
pushq %rax
leaq 0x56b8(%rip), %rsi      # 0x8004
leaq 0x56b7(%rip), %rdx      # 0x800a
leaq 0x56ca(%rip), %r8       # 0x8024
pushq $0x70
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
popq %rcx
retq
testq %rsi, %rsi
je 0x2975
movq %rsi, %rdi
jmp 0x2979
movq 0x38(%rdi), %rdi
movq %rdx, %rsi
jmp 0x30ee
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_write
int ws_nopoll_write(void *handle, const char *buffer, int len, int timeout_ms)
{
    noPollConn *conn = (noPollConn *)handle;
    int tries = 0;
    int bytes_written = 0;

    if ((NULL != buffer) && (len > 0)) {
        bytes_written = nopoll_conn_send_binary (conn, buffer, len);
        if (bytes_written == len) {
            //log_debug ("send all. ");
            return bytes_written;
        }

        while (tries < 5 && errno == NOPOLL_EWOULDBLOCK 
          && nopoll_conn_pending_write_bytes (conn) > 0) {
            nopoll_sleep (10000); 
            if (0 == nopoll_conn_complete_pending_write (conn)) {
                log_debug ("send complete. ");
                return len;
            }
            tries++;
        }
        log_debug ("send len: %d, try: %d. ", bytes_written, tries);
        return  bytes_written;
    } else {
        log_debug ("ERROR: content is NULL or len <= 0 ");
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
sete %al
testl %edx, %edx
setle %cl
orb %al, %cl
jne 0x2a1c
movl %edx, %ebx
movq %rdi, %r14
movl %edx, %edx
callq 0x2460
cmpl %ebx, %eax
jne 0x2a42
movl %ebx, %ebp
jmp 0x2aa6
leaq 0x55e1(%rip), %rsi      # 0x8004
leaq 0x5616(%rip), %rdx      # 0x8040
leaq 0x5654(%rip), %r8       # 0x8085
pushq $0x38
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rbp
jmp 0x2aa6
movl %eax, %ebp
xorl %r15d, %r15d
cmpl $0x5, %r15d
je 0x2a7e
callq 0x2400
cmpl $0xb, (%rax)
jne 0x2a7e
movq %r14, %rdi
callq 0x2190
testl %eax, %eax
jle 0x2a7e
movl $0x2710, %edi           # imm = 0x2710
callq 0x25b0
movq %r14, %rdi
callq 0x2240
testl %eax, %eax
je 0x2ab3
incl %r15d
jmp 0x2a47
movl %r15d, (%rsp)
leaq 0x557b(%rip), %rsi      # 0x8004
leaq 0x55b0(%rip), %rdx      # 0x8040
leaq 0x55d6(%rip), %r8       # 0x806d
pushq $0x35
popq %rcx
xorl %edi, %edi
movl %ebp, %r9d
xorl %eax, %eax
callq 0x403f
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x554a(%rip), %rsi      # 0x8004
leaq 0x557f(%rip), %rdx      # 0x8040
leaq 0x5595(%rip), %r8       # 0x805d
pushq $0x30
popq %rcx
xorl %edi, %edi
xorl %eax, %eax
callq 0x403f
jmp 0x2a15
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_destroy
int ws_nopoll_destroy(void *handle)
{
    noPollConn *conn = (noPollConn *)handle;
    noPollCtx *ctx = NULL;

	/* finish connection */
	if (NULL != conn) {
        ctx = nopoll_conn_ctx(conn);
    	nopoll_conn_close(conn);
	}
	
	/* finish */
	if (NULL != ctx) {
    	nopoll_loop_stop(ctx);
        nopoll_ctx_unref(ctx);
	}

	/* call to cleanup */
	nopoll_cleanup_library ();

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2b0a
movq %rdi, %r14
callq 0x2040
movq %rax, %rbx
movq %r14, %rdi
callq 0x2060
testq %rbx, %rbx
je 0x2b0a
movq %rbx, %rdi
callq 0x2550
movq %rbx, %rdi
callq 0x25e0
callq 0x2200
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_loop_wait
int ws_nopoll_loop_wait(void *handle)
{
    noPollConn *conn = (noPollConn *)handle;
    noPollCtx *ctx = NULL;

    if (NULL == conn) {
        log_debug("ERROR: conn is NULL ");
        return -1;
    }

    ctx = nopoll_conn_ctx(conn);
    if (NULL == ctx) {
        log_debug("ERROR: ctx is NULL ");
        return -1;
    }

    nopoll_loop_wait(ctx, 0);
	return 0;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2f15
callq 0x2040
testq %rax, %rax
je 0x2f33
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
callq 0x22b0
jmp 0x2f59
leaq 0x50e8(%rip), %rsi      # 0x8004
leaq 0x511d(%rip), %rdx      # 0x8040
leaq 0x53a6(%rip), %r8       # 0x82d0
xorl %edi, %edi
movl $0xd8, %ecx
jmp 0x2f4f
leaq 0x50ca(%rip), %rsi      # 0x8004
leaq 0x50ff(%rip), %rdx      # 0x8040
leaq 0x539d(%rip), %r8       # 0x82e5
xorl %edi, %edi
movl $0xde, %ecx
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_set_on_ready
int ws_nopoll_set_on_ready(void *handle, noPollActionHandler on_ready)
{
    noPollConn *conn = (noPollConn *)handle;
    noPollCtx *ctx = NULL;

    if (NULL == conn) {
        log_debug("ERROR: conn is NULL ");
        return -1;
    }

    ctx = nopoll_conn_ctx(conn);
    if (NULL == ctx) {
        log_debug("ERROR: ctx is NULL ");
        return -1;
    }

    /* set on connect ready */
	if (NULL != on_ready) {
    	nopoll_ctx_set_on_ready (ctx, on_ready, NULL);
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2f8a
movq %rsi, %rbx
callq 0x2040
testq %rax, %rax
je 0x2fa8
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x2fcf
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2070
jmp 0x2fcf
leaq 0x5073(%rip), %rsi      # 0x8004
leaq 0x50a8(%rip), %rdx      # 0x8040
leaq 0x5331(%rip), %r8       # 0x82d0
xorl %edi, %edi
movl $0xec, %ecx
jmp 0x2fc4
leaq 0x5055(%rip), %rsi      # 0x8004
leaq 0x508a(%rip), %rdx      # 0x8040
leaq 0x5328(%rip), %r8       # 0x82e5
xorl %edi, %edi
movl $0xf2, %ecx
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_set_on_msg
int ws_nopoll_set_on_msg(void *handle, noPollOnMessageHandler on_message)
{
    noPollConn *conn = (noPollConn *)handle;
    noPollCtx *ctx = NULL;

    if (NULL == conn) {
        log_debug("ERROR: conn is NULL ");
        return -1;
    }

    ctx = nopoll_conn_ctx(conn);
    if (NULL == ctx) {
        log_debug("ERROR: ctx is NULL ");
        return -1;
    }

	/* set on message received */
	if (NULL != on_message) {
    	nopoll_ctx_set_on_msg (ctx, on_message, NULL);
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3007
movq %rsi, %rbx
callq 0x2040
testq %rax, %rax
je 0x3025
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x304c
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2490
jmp 0x304c
leaq 0x4ff6(%rip), %rsi      # 0x8004
leaq 0x502b(%rip), %rdx      # 0x8040
leaq 0x52b4(%rip), %r8       # 0x82d0
xorl %edi, %edi
movl $0x104, %ecx            # imm = 0x104
jmp 0x3041
leaq 0x4fd8(%rip), %rsi      # 0x8004
leaq 0x500d(%rip), %rdx      # 0x8040
leaq 0x52ab(%rip), %r8       # 0x82e5
xorl %edi, %edi
movl $0x10a, %ecx            # imm = 0x10A
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_accept
noPollConn *ws_nopoll_accept(void *handle)
{
    noPollConn *master = (noPollConn *)handle;
    noPollConn *conn = NULL;
    noPollCtx *ctx = NULL;

    if (NULL == master) {
        log_debug("ERROR: master conn is NULL ");
        return NULL;
    }

    ctx = nopoll_conn_ctx(master);
    if (NULL == ctx) {
        log_debug("ERROR: ctx is NULL ");
        return NULL;
    }

    conn = nopoll_conn_accept(ctx, master);
	if (!nopoll_conn_is_ok (conn)) {
		log_debug("ERROR: expected to find proper listener status (connection accepted), but found failure.. ");
		return NULL;
	}

	return conn;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x30a4
movq %rdi, %rbx
callq 0x2040
testq %rax, %rax
je 0x30c4
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2280
movq %rax, %rbx
movq %rax, %rdi
callq 0x2320
testl %eax, %eax
jne 0x30e9
leaq 0x4f79(%rip), %rsi      # 0x8004
leaq 0x4fae(%rip), %rdx      # 0x8040
leaq 0x527c(%rip), %r8       # 0x8315
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x129, %ecx            # imm = 0x129
jmp 0x30e2
leaq 0x4f59(%rip), %rsi      # 0x8004
leaq 0x4f8e(%rip), %rdx      # 0x8040
leaq 0x5240(%rip), %r8       # 0x82f9
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x11d, %ecx            # imm = 0x11D
jmp 0x30e2
leaq 0x4f39(%rip), %rsi      # 0x8004
leaq 0x4f6e(%rip), %rdx      # 0x8040
leaq 0x520c(%rip), %r8       # 0x82e5
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x123, %ecx            # imm = 0x123
xorl %eax, %eax
callq 0x403f
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_get_conn_info
int ws_nopoll_get_conn_info(void *handle, ConnectInfo_t *connInfo)
{
    if (NULL == connInfo) {
        log_debug("ERROR: connInfo is NULL ");
        return -1;
    }

    noPollConn *conn = (noPollConn *)handle;
    if (NULL != conn) {
        connInfo->sockfd = (int) nopoll_conn_socket(conn);
        connInfo->host = nopoll_conn_host(conn);
        connInfo->port = nopoll_conn_port(conn);
        connInfo->origin = nopoll_conn_get_origin(conn);
        //printf("----> origin:  %s\n", connInfo->origin);
        connInfo->get_url = nopoll_conn_get_requested_url(conn);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x3142
movq %rdi, %r15
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x3168
movq %rsi, %r14
movq %r15, %rdi
callq 0x2430
movl %eax, (%r14)
movq %r15, %rdi
callq 0x2290
movq %rax, 0x8(%r14)
movq %r15, %rdi
callq 0x2210
movq %rax, 0x10(%r14)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x18(%r14)
movq %r15, %rdi
callq 0x22c0
movq %rax, 0x20(%r14)
jmp 0x3168
leaq 0x4ebb(%rip), %rsi      # 0x8004
leaq 0x4ef0(%rip), %rdx      # 0x8040
leaq 0x5219(%rip), %r8       # 0x8370
xorl %edi, %edi
movl $0x133, %ecx            # imm = 0x133
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/json/json_parser.c
// Function: json_get_object
char* json_get_object(int type, char* str) {
    char* pos = 0;
    char ch = (type == JOBJECT) ? '{' : '[';
    while (str != 0 && *str != 0) {
        if (*str == ' ') {
            str++;
            continue;
        }
        pos = (*str == ch) ? str : 0;
        break;
    }
    return pos;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x31a1
movzbl (%rsi), %ecx
cmpl $0x20, %ecx
jne 0x3184
incq %rsi
jmp 0x3172
testl %ecx, %ecx
je 0x31a1
movsbl %cl, %ecx
xorl %edx, %edx
cmpl $0x1, %edi
sete %dl
shll $0x5, %edx
orl $0x5b, %edx
xorl %eax, %eax
cmpl %ecx, %edx
cmoveq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/json/json_parser.c
// Function: json_parse_name_value
int json_parse_name_value(char *p_cJsonStr, int iStrLen, json_parse_cb pfnCB, void *p_CBData)
{
    char *pos=0, *key=0, *val=0;
    int klen=0, vlen=0, vtype=0;
    char last_char=0;
    int ret = JSON_RESULT_ERR;

    if (p_cJsonStr==NULL || iStrLen==0 || pfnCB==NULL)
        return ret;

    backup_json_str_last_char(p_cJsonStr, iStrLen, last_char);

    json_object_for_each_kv(p_cJsonStr, pos, key, klen, val, vlen, vtype) {
        if (key && klen && val && vlen) {
            ret = JSON_RESULT_OK;
            if (JSON_PARSE_FINISH == pfnCB(key, klen, val, vlen, vtype, p_CBData)) {	//catch the ball
                break;
            }
        }
    }

    restore_json_str_last_char(p_cJsonStr, iStrLen, last_char);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
andq $0x0, 0x28(%rsp)
andq $0x0, 0x20(%rsp)
andl $0x0, 0x1c(%rsp)
andl $0x0, 0x18(%rsp)
movq %rdi, %rbx
andl $0x0, 0x14(%rsp)
testq %rdi, %rdi
sete %al
testl %esi, %esi
sete %dil
orb %al, %dil
testq %rdx, %rdx
sete %al
orb %dil, %al
je 0x35e9
pushq $-0x1
popq %rdx
jmp 0x36c9
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movslq %esi, %rax
movb (%rbx,%rax), %cl
movb %cl, 0xf(%rsp)
movq %rax, 0x40(%rsp)
movb $0x0, (%rbx,%rax)
pushq $0x1
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3170
movq %rax, %r12
pushq $-0x1
popq %rdx
leaq 0x1c(%rsp), %r14
leaq 0x20(%rsp), %r15
leaq 0x18(%rsp), %r13
movl %edx, 0x10(%rsp)
testq %r12, %r12
je 0x36b9
cmpb $0x0, (%r12)
je 0x36b9
leaq 0x14(%rsp), %rax
movq %rax, (%rsp)
movl %ebp, %edi
movq %r12, %rsi
leaq 0x28(%rsp), %rdx
movq %r14, %rcx
movq %r15, %r8
movq %r13, %r9
callq 0x31a2
testq %rax, %rax
je 0x36b9
movq %rax, %r12
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
setne %al
movl 0x1c(%rsp), %esi
testl %esi, %esi
setne %r8b
andb %al, %r8b
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
setne %al
movl 0x18(%rsp), %ecx
testl %ecx, %ecx
setne %r9b
andb %al, %r9b
andb %r8b, %r9b
cmpb $0x1, %r9b
jne 0x362c
movl 0x14(%rsp), %r8d
movq 0x38(%rsp), %r9
callq *0x30(%rsp)
xorl %edx, %edx
cmpl $0x2, %eax
jne 0x3628
jmp 0x36bd
movl 0x10(%rsp), %edx
movq 0x40(%rsp), %rax
movb 0xf(%rsp), %cl
movb %cl, (%rbx,%rax)
movl %edx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/json/json_parser.c
// Function: json_get_value_by_name
char *json_get_value_by_name(char *p_cJsonStr, int iStrLen, char *p_cName, int *p_iValueLen, int *p_iValueType)
{
    JSON_NV stNV = { 0, 0, 0, 0 };
    stNV.pN = p_cName;
    stNV.nLen = strlen(p_cName);
    if (JSON_RESULT_OK == json_parse_name_value(p_cJsonStr, iStrLen, json_get_value_by_name_cb, (void *)&stNV)) {
        if (p_iValueLen)
            *p_iValueLen = stNV.vLen;
        if (p_iValueType)
            *p_iValueType = stNV.vType;
    }
    return stNV.pV;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r15
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %rdx, 0x10(%r12)
movq %rdx, %rdi
callq 0x2270
movl %eax, (%r12)
leaq -0x80(%rip), %rdx       # 0x36da
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rcx
callq 0x359b
testl %eax, %eax
jne 0x3782
testq %r14, %r14
je 0x3777
movl 0x4(%rsp), %eax
movl %eax, (%r14)
testq %rbx, %rbx
je 0x3782
movl 0x8(%rsp), %eax
movl %eax, (%rbx)
movq 0x18(%rsp), %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/json/json_parser.c
// Function: json_get_array_size
int json_get_array_size(char *json_str, int str_len)
{
    char *pos, *entry;

    char last_char = 0;
    backup_json_str_last_char(json_str, str_len, last_char);

    int len, type, size = 0;
    json_array_for_each_entry(json_str, pos, entry, len, type){
        size++;
    }
    restore_json_str_last_char(json_str, str_len, last_char);

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movb (%rdi,%rax), %cl
movb %cl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, (%rdi,%rax)
pushq $0x2
popq %rbp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3170
xorl %r14d, %r14d
leaq 0x18(%rsp), %r13
leaq 0x20(%rsp), %r15
leaq 0x1c(%rsp), %r12
testq %rax, %rax
je 0x3806
cmpb $0x0, (%rax)
je 0x3806
incq %rax
movq %r13, (%rsp)
movl %ebp, %edi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x31a2
testq %rax, %rax
je 0x3806
incl %r14d
jmp 0x37d7
movq 0x10(%rsp), %rax
movb 0xf(%rsp), %cl
movb %cl, (%rbx,%rax)
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/misc/misc.c
// Function: dump_hex
void dump_hex(char *p , int len)
{
    int i = 0;

    for(i = 0; i < len; i++){
        printf("0x%x ",(unsigned char)p[i]) ; 
        if(i != 0 && i % 10 == 0)
            printf("\n");
    }
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %ebx
movq %rdi, %r14
pushq $0xa
popq %rbp
leaq 0x4b64(%rip), %r15      # 0x83a9
xorl %r12d, %r12d
movl %r12d, %eax
xorl %edx, %edx
divl %ebp
cmpq %r12, %rbx
je 0x3880
movl %eax, %r13d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
testq %r12, %r12
je 0x387b
imull $-0xa, %r13d, %eax
addl %r12d, %eax
jne 0x387b
movl %ebp, %edi
callq 0x2120
incq %r12
jmp 0x3848
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/misc/misc.c
// Function: get_dev_ip
int get_dev_ip(char *buf, int size)
{
    FILE *fp = NULL;
    char bufTmp[256];
    int len = 0, j = 0, i = 0;

    if (NULL == buf || size < 256) {
        return 0;
    }
    
    fp = popen(SHELL_GET_IP, "r");
    if(fp == NULL)
        return 0;

    memset(buf, 0x0, size);
    memset(bufTmp, 0x0, sizeof(bufTmp));
    fgets(bufTmp, sizeof(bufTmp), fp);

    for(i = 0; i < strlen(bufTmp); i++) {
        if (bufTmp[i] != '[' && bufTmp[i] != ']') {
            buf[j] = bufTmp[i];
            j++;
        }
    }
    len = strlen(buf);
    if(len > 0) {
        if (buf[len - 1] == '\n' || buf[len - 1] == '\r') {
            buf[len - 1] = '\0';
        }
    }

    pclose(fp);

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
testq %rdi, %rdi
sete %al
cmpl $0x100, %esi            # imm = 0x100
setl %cl
xorl %r15d, %r15d
orb %al, %cl
jne 0x396e
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x4ae4(%rip), %rdi      # 0x83af
leaq 0x4fd0(%rip), %rsi      # 0x88a2
callq 0x2560
testq %rax, %rax
je 0x396e
movq %rax, %r14
movl %ebp, %edx
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
movq %rsp, %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x2090
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x21e0
movq %r15, %rdi
callq 0x2270
xorl %ecx, %ecx
cmpq %r12, %rax
jbe 0x393f
movzbl (%rsp,%r12), %edx
cmpl $0x5b, %edx
je 0x393a
cmpl $0x5d, %edx
je 0x393a
movslq %ecx, %rcx
movb %dl, (%rbx,%rcx)
incl %ecx
incq %r12
jmp 0x391e
movq %rbx, %rdi
callq 0x2270
movq %rax, %r15
testl %r15d, %r15d
jle 0x3966
movl %r15d, %eax
decl %eax
movzbl (%rbx,%rax), %ecx
cmpl $0xd, %ecx
je 0x3962
cmpl $0xa, %ecx
jne 0x3966
movb $0x0, (%rbx,%rax)
movq %r14, %rdi
callq 0x22a0
movl %r15d, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/misc/misc.c
// Function: rand_string_alloc
char* rand_string_alloc(size_t size)
{
    char *s = malloc(size + 1);
    if (s) {
        _rand_string(s, size);
    }
    return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
incq %rdi
callq 0x2150
movq %rax, %r14
testq %rax, %rax
je 0x39a3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x39ae
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/misc/misc.c
// Function: rand_string
static char *_rand_string(char *str, size_t size)
{
    const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    if (size) {
        --size;
        size_t n = 0;
        for (n = 0; n < size; n++) {
            int key = rand() % (int) (sizeof charset - 1);
            str[n] = charset[key];
        }
        str[size] = '\0';
    }
    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x39f3
movq %rsi, %r14
decq %r14
xorl %r15d, %r15d
pushq $0x3e
popq %rbp
leaq 0x4a0f(%rip), %r12      # 0x83e0
cmpq %r15, %r14
je 0x39ee
callq 0x2520
cltd
idivl %ebp
movslq %edx, %rax
movb (%rax,%r12), %al
movb %al, (%rbx,%r15)
incq %r15
jmp 0x39d1
movb $0x0, (%rbx,%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq