LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: write_timeout
int write_timeout( int fd, int sec )
{
	fd_set fds;
	int ret;
	struct timeval t;	
	
	if ( sec <= 0)
		return 0;

	FD_ZERO(&fds);
	FD_SET( fd , &fds);
	
	t.tv_sec = sec;
	t.tv_usec = 0;
	
	do
	{
		ret = select( fd+1, NULL , &fds, NULL , &t);
	}while(ret < 0 && errno == EINTR);
		
	if (ret < 0)
	{
		return -1;
	}
	else if ( ret == 0)
	{
		errno = ETIMEDOUT;
		return -1;
	}
	return 0;
}

// Assembly:
testl %esi, %esi
jle 0xac95
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %r14
movaps %xmm0, 0x70(%r14)
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
leal 0x3f(%rbx), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
sarl $0x6, %eax
cltq
orq %rdx, -0xb0(%rbp,%rax,8)
movl %esi, %eax
leaq -0x28(%rbp), %r15
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
incl %ebx
movl %ebx, %edi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x82d0
testl %eax, %eax
jns 0xac98
callq 0x8050
cmpl $0x4, (%rax)
je 0xac74
jmp 0xaca9
xorl %eax, %eax
retq
je 0xac9e
xorl %eax, %eax
jmp 0xacae
callq 0x8050
movl $0x6e, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: accept_timeout
int accept_timeout( int fd , struct sockaddr_in *addr , int sec)
{
	fd_set fds;
	struct timeval t;
	int ret;
	socklen_t len = sizeof( struct sockaddr_in);
	
	if ( sec <= 0 )
		return 0;

	FD_ZERO(&fds);
	FD_SET(fd,&fds);
	
	t.tv_sec = sec;
	t.tv_usec = 0;

	do
	{
		ret = select( fd +1, &fds, NULL , NULL ,&t);
	}while( ret < 0 && errno == EINTR);

	if ( ret < 0)
	{
		return -1;
	}
	else if ( ret == 0)
	{
		errno = ETIMEDOUT;
		return -1;
	}
		
	memset( addr , 0 , sizeof( struct sockaddr_in));
	if ( (ret = accept( fd , (struct sockaddr*) addr,&len)) < 0 )
		return -1;
	 
	return ret;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl $0x10, -0x2c(%rbp)
testl %edx, %edx
jle 0xad76
movq %rsi, %rbx
movl %edi, %r14d
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %r15
movaps %xmm0, 0x70(%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
leal 0x3f(%r14), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %esi
andl $-0x40, %esi
movl %edi, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
sarl $0x6, %eax
cltq
orq %rsi, -0xc0(%rbp,%rax,8)
movl %edx, %eax
leaq -0x40(%rbp), %r12
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
leal 0x1(%r14), %r13d
movl %r13d, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x82d0
testl %eax, %eax
jns 0xad7a
callq 0x8050
cmpl $0x4, (%rax)
je 0xad54
jmp 0xadaa
xorl %eax, %eax
jmp 0xadaf
je 0xad9f
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq -0x2c(%rbp), %rdx
movl %r14d, %edi
movq %rbx, %rsi
callq 0x80c0
movl %eax, %ecx
testl %eax, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnsl %ecx, %eax
jmp 0xadaf
callq 0x8050
movl $0x6e, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: connect_timeout
int connect_timeout( int fd , struct sockaddr_in *addr, int sec)
{
	fd_set fds;
	int ret;
	struct timeval t;
	
	if ( sec <= 0)
		return 0;	
	
	setnonblock(fd);

	ret = connect( fd , (struct sockaddr*) addr , sizeof( struct sockaddr_in));
	if ( ret < 0  && errno == EINPROGRESS)
	{
		FD_ZERO(&fds);
		FD_SET(fd,&fds);
		
		t.tv_sec = sec;
		t.tv_usec = 0;
		
		do
		{
			ret = select( fd+1 , NULL , &fds, NULL , &t);
		}while(ret < 0 && errno == EINTR );	
		
		if ( ret > 0)
		{
			int err;
			int len;
			if ( getsockopt( fd , SOL_SOCKET, SO_ERROR ,(void *)&err , &len) == 0 )
				ret = 0;
			else
				ret =  -1;
		}
		else if ( ret == 0)
		{
			errno = ETIMEDOUT;
			ret = -1;
		}
		else
		{
			ret = -1;
		}
		
	}

	setblock(fd);	

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
testl %edx, %edx
jle 0xaecd
movl %edx, %r15d
movq %rsi, %r14
movl %edi, %ebx
callq 0xaaa8
movl %ebx, %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x8230
movl %eax, %r12d
testl %eax, %eax
jns 0xaee1
callq 0x8050
cmpl $0x73, (%rax)
jne 0xaee1
movq %rax, %r14
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %r12
movaps %xmm0, 0x70(%r12)
movaps %xmm0, 0x60(%r12)
movaps %xmm0, 0x50(%r12)
movaps %xmm0, 0x40(%r12)
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
leal 0x3f(%rbx), %eax
testl %ebx, %ebx
cmovnsl %ebx, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %ebx, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
sarl $0x6, %eax
cltq
orq %rdx, -0xc0(%rbp,%rax,8)
movl %r15d, %eax
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
leal 0x1(%rbx), %r13d
movl %r13d, %edi
xorl %esi, %esi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x82d0
testl %eax, %eax
jns 0xaea6
cmpl $0x4, (%r14)
je 0xae8a
testl %eax, %eax
jle 0xaed2
leaq -0x30(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movl %ebx, %edi
movl $0x1, %esi
movl $0x4, %edx
callq 0x81e0
xorl %r12d, %r12d
negl %eax
sbbl %r12d, %r12d
jmp 0xaee1
xorl %r12d, %r12d
jmp 0xaee8
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jne 0xaee1
movl $0x6e, (%r14)
movl %ebx, %edi
callq 0xaae6
movl %r12d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: readn
int readn( int fd , void *buf ,int bufsize, int size)
{
	int leftn = size;
	char *p = buf;
	int ret;
	
	if ( buf == NULL || bufsize < size || size < 0)
		return -1;

	if (size == 0 )
		return 0;

	while(leftn > 0)
	{
		ret = read( fd , p ,leftn);
		if ( ret <0 && errno == EINTR)
		{
			continue;
		}
		else if ( ret == 0 )
		{
			break;
		}
		else
		{
			leftn -= ret;
			p += ret;
		}
	
	}
	return size - leftn;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0xaf7e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpl %ecx, %edx
setl %sil
testl %ecx, %ecx
sets %dl
orb %sil, %dl
jne 0xaf70
testl %ecx, %ecx
je 0xaf6e
movl %edi, %r15d
movl %ecx, -0x2c(%rbp)
movl %ecx, %ebx
movl %ebx, %r13d
movl %r15d, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x8420
movq %rax, %r12
testl %r12d, %r12d
jns 0xaf57
callq 0x8050
cmpl $0x4, (%rax)
je 0xaf37
testl %r12d, %r12d
je 0xaf67
movslq %r12d, %rax
addq %rax, %r14
subl %r12d, %ebx
jg 0xaf34
movl -0x2c(%rbp), %eax
subl %ebx, %eax
jmp 0xaf70
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_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: writen
int writen( int fd , void * buf , int size)
{
	int leftn = size;
	char *p = buf;
	int ret;
	
	if ( buf == NULL || size < 0 )
		return -1;
	
	if ( size == 0)
		return 0;	

	while( leftn > 0)
	{
		ret = write( fd , p , leftn);
		if ( ret < 0 && errno == EINTR)
		{
			continue;
		}
		else 
		{
			leftn -= ret;
			p += ret;	
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
sete %al
testl %edx, %edx
sets %cl
orb %al, %cl
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jne 0xafde
movl %edx, %ebx
xorl %r12d, %r12d
testl %edx, %edx
jle 0xafde
movq %rsi, %r14
movl %edi, %r15d
movl %ebx, %ebx
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x80f0
movq %rax, %r13
testl %r13d, %r13d
jns 0xafd3
callq 0x8050
cmpl $0x4, (%rax)
je 0xafb3
movslq %r13d, %rax
addq %rax, %r14
subl %r13d, %ebx
jg 0xafb1
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/SockTool/sockutils.c
// Function: readline
int readline( int fd , void *buf , int bufsize)
{
	int leftn = bufsize;
	char *p = buf;
	char *t = NULL;
	int ret;
	int readlen;
	if (buf == NULL)
		return -1;

	while( leftn > 0 )
	{
		ret = recv( fd , p , leftn , MSG_PEEK );
		if ( ret < 0 && errno == EINTR)
		{
			continue;
		}
		else if ( ret == 0 )
		{
			return -1;
		}
		
		if ( (t = strchr( p , '\n')) != NULL)
		{
			
			readlen = readn( fd, p , t - p +1, t -p +1);
			p[readlen] = '\0';	
			return 0;
		}

		readn( fd , p , ret , ret);
		leftn -= ret;
		p += ret;
	}
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
sete %al
testl %edx, %edx
setle %cl
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
orb %al, %cl
jne 0xb099
movl %edx, %r12d
movq %rsi, %rbx
movl %edi, %r14d
movl %r12d, %r12d
movl %r14d, %edi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x2, %ecx
callq 0x80d0
movq %rax, %r13
testl %r13d, %r13d
jns 0xb048
callq 0x8050
cmpl $0x4, (%rax)
je 0xb023
testl %r13d, %r13d
je 0xb099
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8100
testq %rax, %rax
jne 0xb07d
movl %r14d, %edi
movq %rbx, %rsi
movl %r13d, %edx
movl %r13d, %ecx
callq 0xaefd
movslq %r13d, %rax
addq %rax, %rbx
subl %r13d, %r12d
jg 0xb020
jmp 0xb099
subl %ebx, %eax
incl %eax
movl %r14d, %edi
movq %rbx, %rsi
movl %eax, %edx
movl %eax, %ecx
callq 0xaefd
cltq
movb $0x0, (%rbx,%rax)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: initThreadPool
int initThreadPool( ThreadPool **tp , int poolsize)
{
	ThreadPool_t *p;
	int i;
	if (tp == NULL || poolsize < 1)
	{
		return -1;
	}

	p = (ThreadPool_t *)malloc( sizeof( ThreadPool_t) + sizeof(pthread_t)*poolsize);

	if ( p == NULL)
	{
		return -1;
	}
	
//	p->lock = PTHREAD_MUTEX_INITIALIZER;
//	p->cond = PTHREAD_COND_INITIALIZER;
	pthread_mutex_init(&(p->lock),NULL);
	pthread_cond_init(&(p->cond),NULL);
	p->ids = (pthread_t*)(p + 1);
	p->count = 0;
	p->head.next = NULL;
	p->isdestroy = 0;
	
	for( i = 0 ; i < poolsize ; i++ )
	{
		pthread_create( &(p->ids[i]) , NULL , work , p);
		pthread_detach( p->ids[i] );
	}

	*tp = p;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jne 0x7851c
movl %esi, %r12d
movq %rdi, %rbx
movl %esi, %r13d
leaq 0x88(,%r13,8), %rdi
callq 0x83e0
testq %rax, %rax
je 0x7851c
movq %rax, %r15
movq %rbx, -0x30(%rbp)
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
callq 0x8470
leaq 0x28(%r15), %rdi
xorl %esi, %esi
callq 0x8360
movq %r15, %rax
addq $0x88, %rax
movq %rax, 0x58(%r15)
movl %r14d, 0x60(%r15)
movq $0x0, 0x78(%r15)
movl %r14d, 0x80(%r15)
testl %r12d, %r12d
jle 0x78515
shlq $0x3, %r13
xorl %ebx, %ebx
leaq 0x43(%rip), %r12        # 0x7852e
movq 0x58(%r15), %rdi
addq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x8530
movq 0x58(%r15), %rax
movq (%rax,%rbx), %rdi
callq 0x81a0
addq $0x8, %rbx
cmpq %rbx, %r13
jne 0x784eb
movq -0x30(%rbp), %rax
movq %r15, (%rax)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: work
static void *work( void* arg)
{
	ThreadPool_t * pool = ( ThreadPool_t*)arg;
	ThreadPoolTask *t;	
//	printf("start:%x\n",pthread_self());
	while(1)
	{
		pthread_mutex_lock(&(pool->lock));
		while(pool->head.next== NULL && !pool->isdestroy)
		{
			pthread_cond_wait(&(pool->cond),&(pool->lock));
		}
		pool->count++;
		if( pool->isdestroy)
		{
			pthread_mutex_unlock(&(pool->lock));
			break;
		}
		

		t = pool->head.next;
		pool->head.next = t->next;

		pthread_mutex_unlock(&(pool->lock));
		
		//printf("Task:%x\n",pthread_self());
		// run task
		t->task(t->arg);
		if ( t != NULL )
		{
			free(t);
		}
		//task end
		pthread_mutex_lock( &(pool->lock) );
		pool->count--;
		pthread_mutex_unlock( &(pool->lock ) );
	}
//	printf("threadend:%x\n",pthread_self());
	return (void*)0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %rbx, %rdi
callq 0x8440
movq 0x78(%rbx), %r15
testq %r15, %r15
jne 0x78566
cmpl $0x0, 0x80(%rbx)
jne 0x78566
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8480
jmp 0x78547
incl 0x60(%rbx)
cmpl $0x0, 0x80(%rbx)
jne 0x785a6
movq 0x10(%r15), %rax
movq %rax, 0x78(%rbx)
movq %rbx, %rdi
callq 0x81f0
movq 0x8(%r15), %rdi
callq *(%r15)
movq %r15, %rdi
callq 0x8350
movq %rbx, %rdi
callq 0x8440
decl 0x60(%rbx)
movq %rbx, %rdi
callq 0x81f0
jmp 0x7853f
movq %rbx, %rdi
callq 0x81f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: destroyThreadPool
int destroyThreadPool( ThreadPool **tp  )
{
	ThreadPool_t *p = (ThreadPool_t *)*tp;
	int i;
	if ( tp == NULL )
		return -1;
	if ( p == NULL)
		return 0;
	p->isdestroy = 1;
	pthread_cond_broadcast(&(p->cond));
	
/*	for( i = 0; i < p->count; i++)
	{
		pthread_join(p->ids[i],NULL);
	}
*/
	pthread_mutex_destroy(&(p->lock));
	pthread_cond_destroy(&(p->cond));
	if ( p != NULL )
	{
		free(p);
		*tp = NULL;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x78606
movq %rdi, %rbx
movl $0x1, 0x80(%r14)
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x80e0
movq %r14, %rdi
callq 0x8330
movq %r15, %rdi
callq 0x8540
movq %r14, %rdi
callq 0x8350
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/TaskControl/threadpool.c
// Function: addTask
int addTask( ThreadPool *tp , void (*func)(void*) , void*arg)
{
	ThreadPool_t *p = (ThreadPool_t*) tp;
	ThreadPoolTask *mtask,*t;
	if ( p == NULL || func == NULL )
		return -1;

	t = (ThreadPoolTask*)malloc(sizeof(ThreadPoolTask));
	if ( t  == NULL)
		return -1;
	t->task = func;
	t->arg = arg;

	mtask = &(p->head);
	pthread_mutex_lock(&(p->lock));
	while(	mtask->next != NULL)
	{
		mtask = mtask->next;
	}
	t->next = NULL;
	mtask->next = t;
	pthread_mutex_unlock(&(p->lock));
	
	pthread_cond_signal(&(p->cond));
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jne 0x78694
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x18, %edi
callq 0x83e0
testq %rax, %rax
je 0x78694
movq %rax, %r14
movq %r12, (%rax)
movq %r15, 0x8(%rax)
leaq 0x68(%rbx), %r15
movq %rbx, %rdi
callq 0x8440
movq %r15, %rax
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x78665
movq $0x0, 0x10(%r14)
movq %r14, 0x10(%rax)
movq %rbx, %rdi
callq 0x81f0
addq $0x28, %rbx
movq %rbx, %rdi
callq 0x8030
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/theandrew168[P]skylark/src/op_test.c
// Function: test_operation_CLS_00E0
bool
test_operation_CLS_00E0(void)
{
    struct chip8 chip8 = { 0 };
    chip8_init(&chip8);

    struct instruction inst = {
        .opcode = OPCODE_CLS_00E0,
    };

    // manually turn on all pixels
    for (long i = 0; i < CHIP8_DISPLAY_WIDTH * CHIP8_DISPLAY_HEIGHT; i++) {
        chip8.display[i] = true;
    }

    uint16_t pc_before = chip8.pc;
    int rc = operation_CLS_00E0(&chip8, &inst);
    if (rc != CHIP8_OK) {
        fprintf(stderr, "operation_CLS_00E0 returned an error: %s\n", operation_error_message(rc));
        return false;
    }

    for (long i = 0; i < CHIP8_DISPLAY_WIDTH * CHIP8_DISPLAY_HEIGHT; i++) {
        if (chip8.display[i] == true) {
            fprintf(stderr, "operation_CLS_00E0 failed to clear all pixels\n");
            return false;
        }
    }

    if (chip8.pc != pc_before + 2) {
        fprintf(stderr, "operation_CLS_00E0 failed to increment program counter\n");
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x1848, %rsp           # imm = 0x1848
movq %rsp, %rbx
movl $0x1848, %edx           # imm = 0x1848
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1050
movq %rbx, %rdi
callq 0x1c88
leaq 0x1046(%rsp), %rbx
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1050
movzwl -0x34(%rbx), %ebp
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1050
addl $0x2, %ebp
movw %bp, -0x34(%rbx)
movl $0x1046, %eax           # imm = 0x1046
cmpb $0x1, (%rsp,%rax)
je 0x151f
incq %rax
cmpq $0x1846, %rax           # imm = 0x1846
jne 0x14f6
movzwl 0x1012(%rsp), %ecx
movb $0x1, %al
cmpl %ecx, %ebp
jne 0x1526
addq $0x1848, %rsp           # imm = 0x1848
popq %rbx
popq %rbp
retq
callq 0x1102
jmp 0x152b
callq 0x10e0
xorl %eax, %eax
jmp 0x1515
// File: /workspace/github_c_makefile_star2_O1/theandrew168[P]skylark/src/main_test.c
// Function: main
int
main(int argc, char* argv[])
{
    long num_tests = sizeof(TESTS) / sizeof(*TESTS);

    long successful_tests = 0;
    long failed_tests = 0;

    for (long i = 0; i < num_tests; i++) {
        test_func test = TESTS[i];
        if (test()) {
            successful_tests++;
        } else {
            failed_tests++;
        }
    }

    printf("%ld successful %s, %ld failed %s\n",
        successful_tests,
        successful_tests == 1 ? "test" : "tests",
        failed_tests,
        failed_tests == 1 ? "test" : "tests");

    return failed_tests == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %r15d, %r15d
leaq 0x3717(%rip), %r12      # 0x4dc0
xorl %r14d, %r14d
xorl %ebx, %ebx
callq *(%r15,%r12)
movzbl %al, %ecx
xorb $0x1, %al
movzbl %al, %eax
addq %rax, %rbx
addq %rcx, %r14
addq $0x8, %r15
cmpq $0x30, %r15
jne 0x16ae
cmpq $0x1, %r14
leaq 0xe4b(%rip), %rax       # 0x2520
leaq 0xe49(%rip), %r8        # 0x2525
movq %r8, %rdx
cmoveq %rax, %rdx
cmpq $0x1, %rbx
cmoveq %rax, %r8
leaq 0xe0c(%rip), %rdi       # 0x24fe
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1030
xorl %eax, %eax
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/dvb_print_si.c
// Function: handle_pmt_es
static void handle_pmt_es(uint8_t *p_pmt, bool b_select)
{
    pmt_each_es(p_pmt, p_es) {
        uint16_t i_pid = pmtn_get_pid(p_es);
        uint8_t i_type = pmtn_get_streamtype(p_es);

        switch (i_type) {
            case PMT_STREAMTYPE_PRIVATE_PSI:
                pmtn_each_desc(p_es, p_desc) {
                    uint8_t tag = desc_get_tag(p_desc);

                    switch (tag) {
                        case 0x6f:
                            if (b_select)
                                p_pids[i_pid].i_psi_refcount++;
                            else
                                p_pids[i_pid].i_psi_refcount--;
                            break;
                        default:
                            break;
                    }
                }
                break;
            case PMT_STREAMTYPE_SCTE_35:
                if (b_select)
                    p_pids[i_pid].i_psi_refcount++;
                else
                    p_pids[i_pid].i_psi_refcount--;
                break;
            default:
                break;
        }
    }
}

// Assembly:
movzbl 0x1(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0x2(%rdi), %ecx
leal (%rcx,%rax), %edx
decl %edx
movzbl 0xa(%rdi), %eax
andl $0xf, %eax
shll $0x8, %eax
movzbl 0xb(%rdi), %ecx
leaq (%rax,%rcx), %r8
addq $0xc, %r8
movzwl %dx, %edx
cmpq %rdx, %r8
jge 0x8c55
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
orq %rcx, %rax
leaq (%rdi,%rax), %rcx
addq $0xc, %rcx
movzbl %sil, %eax
decl %eax
orl $0x1, %eax
movzbl 0x1(%rdi), %edx
andl $0xf, %edx
shll $0x8, %edx
movzbl 0x2(%rdi), %r8d
addl %r8d, %edx
decl %edx
movzwl %dx, %edx
leaq 0x155fc(%rip), %r8      # 0x1e150
xorl %r9d, %r9d
movzbl 0x1(%rcx), %r10d
andl $0x1f, %r10d
shll $0x8, %r10d
movzbl 0x2(%rcx), %r11d
orq %r10, %r11
movzbl (%rcx), %r10d
cmpl $0x86, %r10d
je 0x8bfd
cmpl $0x5, %r10d
jne 0x8c09
movzbl 0x3(%rcx), %r10d
movzbl 0x4(%rcx), %ebx
andl $0xf, %r10d
shll $0x8, %r10d
orl %ebx, %r10d
cmpl $0x2, %r10d
jb 0x8c09
movzwl %r11w, %r10d
testb %sil, %sil
cmovneq %r10, %r11
leaq 0x5(%rcx), %r10
leaq (%r11,%r11,2), %r11
leaq (%r8,%r11,8), %r11
movq %r10, %rbx
cmpb $0x6f, (%rbx)
jne 0x8bc3
addl %eax, (%r11)
movzbl 0x3(%rcx), %r15d
movzbl 0x4(%rcx), %r12d
movzbl 0x1(%rbx), %r14d
andl $0xf, %r15d
shll $0x8, %r15d
orq %r12, %r15
leaq (%rbx,%r14), %r12
addq $0x4, %r12
addq %r10, %r15
cmpq %r15, %r12
ja 0x8bf4
leaq 0x2(%rbx,%r14), %rbx
jmp 0x8bf9
movl $0x0, %ebx
jbe 0x8bbb
jmp 0x8c09
movzwl %r11w, %r10d
leaq (%r10,%r10,2), %r10
addl %eax, (%r8,%r10,8)
movq %rcx, %r10
subq %rdi, %r10
addq $0x5, %r10
cmpq %rdx, %r10
jle 0x8c1c
xorl %ecx, %ecx
jmp 0x8c45
movzbl 0x3(%rcx), %r10d
andl $0xf, %r10d
shll $0x8, %r10d
movzbl 0x4(%rcx), %r11d
orq %r10, %r11
addq %r11, %rcx
addq $0x5, %rcx
movq %rcx, %r10
subq %rdi, %r10
cmpq %rdx, %r10
cmovgeq %r9, %rcx
testq %rcx, %rcx
jne 0x8b57
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/dvb_print_si.c
// Function: print_wrapper
static void print_wrapper(void *_unused, const char *psz_format, ...)
{
    char psz_fmt[strlen(psz_format) + 2];
    va_list args;
    va_start(args, psz_format);
    strcpy(psz_fmt, psz_format);
    strcat(psz_fmt, "\n");
    vprintf(psz_fmt, args);
    va_end(args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
leaq -0xf0(%rbp), %r12
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x8cb6
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %rsi, %rdi
callq 0x30a0
movq %rsp, %r14
addq $0x11, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
leaq -0x40(%rbp), %r15
movq %r12, 0x10(%r15)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3050
movq %r14, %rdi
callq 0x30a0
movw $0xa, (%rax,%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3170
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/./bitstream/mpeg/psi/cat_print.h
// Function: cat_table_print
static inline void cat_table_print(uint8_t **pp_sections, f_print pf_print,
                                   void *opaque, print_type_t i_print_type)
{
    uint8_t i_last_section = psi_table_get_lastsection(pp_sections);
    uint8_t i;
    const char *psz_table_name = "CAT";

    if (psi_get_tableid(psi_table_get_section(pp_sections, 0)) == TSDT_TABLE_ID)
        psz_table_name = "TSDT";

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(opaque, "<%s version=\"%hhu\" current_next=\"%d\">",
                 psz_table_name,
                 psi_table_get_version(pp_sections),
                 !psi_table_get_current(pp_sections) ? 0 : 1);
        break;
    default:
        pf_print(opaque, "new %s version=%hhu%s",
                 psz_table_name,
                 psi_table_get_version(pp_sections),
                 !psi_table_get_current(pp_sections) ? " (next)" : "");
    }

    for (i = 0; i <= i_last_section; i++) {
        uint8_t *p_section = psi_table_get_section(pp_sections, i);

        descl_print(cat_get_descl(p_section), cat_get_desclength(p_section),
                    pf_print, opaque, NULL, NULL, i_print_type);
    }

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(opaque, "</%s>", psz_table_name);
        break;
    default:
        pf_print(opaque, "end %s", psz_table_name);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rax
movb 0x7(%rax), %r15b
cmpb $0x3, (%rax)
leaq 0x9f23(%rip), %rcx      # 0x12c5f
leaq 0x9f18(%rip), %rbx      # 0x12c5b
cmoveq %rcx, %rbx
movzbl 0x5(%rax), %r8d
movl %r8d, %ecx
shrl %ecx
andl $0x1f, %ecx
andl $0x1, %r8d
cmpl $0x1, %esi
jne 0x8d70
leaq 0x9f00(%rip), %rsi      # 0x12c64
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8c56
jmp 0x8d96
testb %r8b, %r8b
leaq 0x9e50(%rip), %rax      # 0x12bca
leaq 0x10ee1(%rip), %r8      # 0x19c62
cmoveq %rax, %r8
leaq 0x9efe(%rip), %rsi      # 0x12c8a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8c56
xorl %r12d, %r12d
movzbl %r12b, %r12d
movq (%r14,%r12,8), %rax
leaq 0x8(%rax), %rdi
movzbl 0x1(%rax), %ecx
andl $0xf, %ecx
shll $0x8, %ecx
movzbl 0x2(%rax), %eax
addl %ecx, %eax
addl $-0x9, %eax
movzwl %ax, %esi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x8df3
incb %r12b
cmpb %r15b, %r12b
jbe 0x8d99
cmpl $0x1, %ebp
leaq 0x9eca(%rip), %rax      # 0x12ca0
leaq 0x9ec9(%rip), %rsi      # 0x12ca6
cmoveq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8c56
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/./bitstream/mpeg/psi/descriptors.h
// Function: desc_print_begin
static inline void desc_print_begin(const uint8_t *p_desc, f_print pf_print,
                                    void *opaque, print_type_t i_print_type)
{

    switch (i_print_type) {
    case PRINT_XML:
    {
        uint8_t i, i_length = desc_get_length(p_desc);
        char psz_value[2 * i_length + 1];

        for (i = 0; i < i_length; i++)
            sprintf(psz_value + 2 * i, "%2.2hhx", p_desc[2 + i]);
        psz_value[2 * i] = '\0';

        pf_print(opaque, "<DESC id=\"0x%02x\" length=\"%u\" value=\"%s\">",
                 desc_get_tag(p_desc), i_length, psz_value);
        break;
    }
    default:
        break;
    }
}

// Assembly:
cmpl $0x1, %esi
jne 0x10611
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r15
movzbl 0x1(%rdi), %r14d
leal 0x10(,%r14,2), %eax
andl $-0x10, %eax
movq %rsp, %r8
subq %rax, %r8
movq %r8, %rsp
testl %r14d, %r14d
je 0x105e5
movq %r15, -0x38(%rbp)
leaq 0x26ff(%rip), %r12      # 0x12cad
movq %r8, -0x30(%rbp)
movq %r8, %r13
xorl %r15d, %r15d
movzbl 0x2(%rbx,%r15), %edx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x31e0
incq %r15
addq $0x2, %r13
cmpq %r15, %r14
jne 0x105b8
leal (%r14,%r14), %eax
movq -0x38(%rbp), %r15
movq -0x30(%rbp), %r8
jmp 0x105e7
xorl %eax, %eax
movb $0x0, (%r8,%rax)
movzbl (%rbx), %edx
leaq 0x26bf(%rip), %rsi      # 0x12cb5
movl %r14d, %ecx
xorl %eax, %eax
callq 0x8c56
movq %r15, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/./bitstream/mpeg/psi/descriptors.h
// Function: desc46_print
static inline uint8_t *desc_check(const uint8_t *p_desc,
                                  const uint8_t *p_desc_n,
                                  uint8_t size)
{
    if (!p_desc || !p_desc_n ||
        p_desc_n < p_desc + DESC_HEADER_SIZE ||
        p_desc_n + size > p_desc + DESC_HEADER_SIZE + desc_get_length(p_desc))
        return NULL;
    return (uint8_t *)p_desc_n;
}

// Assembly:
cmpb $0x5, 0x1(%rdi)
jb 0x1091d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x2(%rdi), %rbp
leaq 0x5659(%rip), %r15      # 0x15e56
leaq 0x5603(%rip), %r12      # 0x15e07
movq %rbp, %r13
movzbl (%r14), %edx
cmpl $0x1, %ebx
jne 0x10841
leaq 0x55e2(%rip), %rax      # 0x15df9
cmpl $0x46, %edx
je 0x10823
leaq 0x55da(%rip), %rax      # 0x15dfd
movzbl 0x3(%r13), %edi
movl %edi, %r8d
shrl $0x3, %r8d
cmpl $0x28, %edi
jae 0x1086e
leaq 0xd545(%rip), %rcx      # 0x1dd80
movq (%rcx,%r8,8), %r9
jmp 0x10882
movq %r15, %rcx
cmpl $0x46, %edx
je 0x10850
leaq 0x560a(%rip), %rcx      # 0x15e5a
movzbl 0x3(%r13), %edi
movl %edi, %r9d
shrl $0x3, %r9d
cmpl $0x28, %edi
jae 0x108a7
leaq 0xd518(%rip), %rax      # 0x1dd80
movq (%rax,%r9,8), %r10
jmp 0x108bb
leaq 0x564b(%rip), %r9       # 0x15ec0
cmpb $0x5, %r8b
je 0x10882
leaq 0x289d(%rip), %r9       # 0x1311f
andl $0x7, %edi
movzbl 0x4(%r13), %r10d
leaq 0x551c(%rip), %rsi      # 0x15dad
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
pushq %r10
pushq %rdi
callq 0x8c56
addq $0x10, %rsp
jmp 0x108dd
leaq 0x5612(%rip), %r10      # 0x15ec0
cmpb $0x5, %r9b
je 0x108bb
leaq 0x2864(%rip), %r10      # 0x1311f
andl $0x7, %edi
movzbl 0x4(%r13), %r11d
subq $0x8, %rsp
movq %r12, %rsi
movq %r13, %r8
xorl %eax, %eax
pushq %r11
pushq %rdi
pushq %r10
callq 0x8c56
addq $0x20, %rsp
leaq 0x5(%r13), %rax
cmpq %rax, %rbp
jbe 0x108eb
xorl %r13d, %r13d
jmp 0x10906
addq $0xa, %r13
movzbl 0x1(%r14), %ecx
addq %rbp, %rcx
cmpq %rcx, %r13
movl $0x0, %ecx
cmovaq %rcx, %rax
movq %rax, %r13
testq %r13, %r13
jne 0x10807
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/./bitstream/dvb/si/desc_7f06.h
// Function: desc7f06_print
static inline void desc7f06_print(const uint8_t *p_desc, f_print pf_print,
                                  void *opaque, print_type_t i_print_type)
{
    uint8_t language_code_present = desc7f06_get_language_code_present(p_desc);
    char language_code[4];
    if (language_code_present) {
        uint32_t v = desc7f06_opt_get_language_code(p_desc);
        language_code[0] = v >> 16;
        language_code[1] = v >> 8;
        language_code[2] = v;
        language_code[3] = '\0';
    } else {
        language_code[0] = '\0';
    }

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(opaque,
                 "<SUPPLEMENTARY_AUDIO_DESC"
                 " mix_type=\"%u\""
                 " editorial_classification=\"%u\""
                 ">",
                 desc7f06_get_mix_type(p_desc),
                 desc7f06_get_editorial_classification(p_desc)
                );
        if (language_code_present)
            pf_print(opaque,
                     "<SUPPLEMENTARY_AUDIO_LANG code=\"%s\"/>",
                     language_code
                    );
        pf_print(opaque, "</SUPPLEMENTARY_AUDIO_DESC>");
        break;
    default:
        pf_print(opaque,
                 "    - desc 7f06 supplementary_audio"
                 " mix_type=%u"
                 " editorial_classification=%u",
                 desc7f06_get_mix_type(p_desc),
                 desc7f06_get_editorial_classification(p_desc)
                );
        if (language_code_present)
            pf_print(opaque,
                     "        - language code=\"%s\"", language_code);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movzbl 0x3(%rdi), %ebx
testb $0x1, %bl
jne 0x10b78
movb $0x0, 0xc(%rsp)
jmp 0x10bb6
addq $0x4, %rdi
xorl %r9d, %r9d
movl $0x20, %ecx
movl %r9d, %eax
movl %r9d, %r8d
shll $0x8, %r8d
movzbl (%rdi), %edx
leal (%r8,%rdx), %r9d
incq %rdi
addl $-0x8, %ecx
cmpl $0x8, %ecx
ja 0x10b84
shrl $0x10, %r8d
movb %r8b, 0xc(%rsp)
movb %al, 0xd(%rsp)
movb %dl, 0xe(%rsp)
movb $0x0, 0xf(%rsp)
movl %ebx, %edx
shrl $0x7, %edx
movl %ebx, %eax
shrb $0x2, %al
andb $0x1f, %al
movzbl %al, %ecx
cmpl $0x1, %esi
jne 0x10c00
leaq 0x839d(%rip), %rsi      # 0x18f6e
xorl %eax, %eax
callq 0x8c56
testb $0x1, %bl
je 0x10bf0
leaq 0x83d1(%rip), %rsi      # 0x18fb5
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x8c56
leaq 0x83e4(%rip), %rsi      # 0x18fdb
xorl %eax, %eax
callq 0x8c56
jmp 0x10c26
leaq 0x83f0(%rip), %rsi      # 0x18ff7
xorl %eax, %eax
callq 0x8c56
testb $0x1, %bl
je 0x10c26
leaq 0x8429(%rip), %rsi      # 0x19043
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x8c56
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/./bitstream/dvb/si/desc_7f15.h
// Function: desc7f15_print
static inline void desc7f15_print(const uint8_t *p_desc, f_print pf_print,
                                  void *opaque, print_type_t i_print_type)
{
    uint8_t config = desc7f15_get_ac4_config_flag(p_desc);

    switch (i_print_type) {
    case PRINT_XML:
        pf_print(opaque, "<AC4_DESC ac4_toc=\"%u\">",
                 desc7f15_get_ac4_toc_flag(p_desc));
        if (config)
            pf_print(opaque,
                     "<AC4_CONFIG"
                     " ac4_dialog_enhancement_enabled=\"%u\""
                     " ac4_channel_mode=\"%s\"/>",
                     desc7f15_get_ac4_dialog_enhancement_enabled(p_desc),
                     desc7f15_ac4_channel_mode_str(
                         desc7f15_get_ac4_channel_mode(p_desc))
                    );
        pf_print(opaque, "</AC4_DESC>");
        break;
    default:
        pf_print(opaque, "    - desc 7f15 ac-4%s",
                 desc7f15_get_ac4_toc_flag(p_desc) ?  " ac4_toc" : "");
        if (config)
            pf_print(opaque, "        - config%s ac4_channel_mode=\"%s\"",
                     desc7f15_get_ac4_dialog_enhancement_enabled(p_desc) ?
                     " ac4_dialog_enhancement_enabled" : "",
                     desc7f15_ac4_channel_mode_str(
                         desc7f15_get_ac4_channel_mode(p_desc)));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x3(%rdi), %r15d
cmpl $0x1, %esi
jne 0x10cb6
movl %r15d, %edx
shrl $0x6, %edx
andl $0x1, %edx
leaq 0x83d2(%rip), %rsi      # 0x19060
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x8c56
testb %r15b, %r15b
jns 0x10d34
movb 0x3(%rbx), %al
testb %al, %al
jns 0x10cae
movzbl 0x4(%rbx), %ebp
shrl $0x7, %ebp
testb %al, %al
js 0x10d0f
xorl %eax, %eax
jmp 0x10d19
testb $0x40, %r15b
leaq 0x8fa1(%rip), %r14      # 0x19c62
leaq 0x841b(%rip), %rdx      # 0x190e3
cmoveq %r14, %rdx
leaq 0x83f9(%rip), %rsi      # 0x190cc
xorl %eax, %eax
callq 0x8c56
testb %r15b, %r15b
js 0x10cea
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb 0x3(%rbx), %al
testb %al, %al
jns 0x10d07
cmpb $0x0, 0x4(%rbx)
leaq 0x8f66(%rip), %rcx      # 0x19c62
leaq 0x8412(%rip), %r14      # 0x19115
cmovnsq %rcx, %r14
testb %al, %al
js 0x10d4c
xorl %eax, %eax
jmp 0x10d56
movzbl 0x4(%rbx), %eax
shrl $0x5, %eax
andl $0x3, %eax
leaq 0xd088(%rip), %rcx      # 0x1dda8
movq (%rcx,%rax,8), %rcx
leaq 0x834d(%rip), %rsi      # 0x19078
movl %ebp, %edx
xorl %eax, %eax
callq 0x8c56
leaq 0x8385(%rip), %rsi      # 0x190c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8c56
movzbl 0x4(%rbx), %eax
shrl $0x5, %eax
andl $0x3, %eax
leaq 0xd04b(%rip), %rcx      # 0x1dda8
movq (%rcx,%rax,8), %rcx
leaq 0x8384(%rip), %rsi      # 0x190ec
movq %r14, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8c56
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_byte
ULONG emit_byte(UBYTE byte, ULONG operation)
{
    static UBYTE buffer[EMIT_BYTEBUF_SIZE];
    static ULONG in_pos, out_pos;
    ULONG success;

    switch( operation ) {
    case EMIT_BYTE_INIT:
        in_pos  = 0;
        out_pos = 0;
        return 1;

    case EMIT_BYTE_ADD:
#ifdef DBG
        printf("<%02x>",byte&0x00FF);
#endif
        buffer[in_pos] = byte;
        in_pos = (in_pos+1) & (EMIT_BYTEBUF_SIZE-1);

        if( in_pos==out_pos ) { // overflow!
            printf("mhmt-emit.c:emit_byte() buffer overflow!\n");
            return 0;
        }

        return 1;

    case EMIT_BYTE_FLUSH:
        if( in_pos==out_pos ) // nothing to do?
            return 1;

        else if( in_pos>out_pos ) { // no index wraparound
            success = emit_file( &buffer[out_pos], in_pos-out_pos );

        } else { // in_pos<out_pos - wraparound
            success = emit_file( &buffer[out_pos], EMIT_BYTEBUF_SIZE-out_pos );

            if( in_pos )
                success = success && emit_file( &buffer[0], in_pos );
        }

        out_pos=in_pos;
        return success;

    default:
        printf("mhmt-emit.c:emit_byte() encountered invalid arguments!\n");
        return 0;
    }
}

// Assembly:
pushq %rax
cmpl $0x2, %esi
je 0x17a8
cmpl $0x1, %esi
je 0x177d
testl %esi, %esi
jne 0x17da
xorl %eax, %eax
movl %eax, 0x9ba3(%rip)      # 0xb310
movl %eax, 0x9ba1(%rip)      # 0xb314
movl $0x1, %eax
jmp 0x181c
movl 0x9b8d(%rip), %esi      # 0xb310
movl 0x9b8b(%rip), %ecx      # 0xb314
movl $0x1, %eax
cmpl %ecx, %esi
je 0x181c
leaq 0x9a73(%rip), %rdi      # 0xb210
addq %rcx, %rdi
cmpl %ecx, %esi
jbe 0x17ea
subl %ecx, %esi
jmp 0x180b
movl 0x9b62(%rip), %eax      # 0xb310
leaq 0x9a5b(%rip), %rcx      # 0xb210
movb %dil, (%rax,%rcx)
incl %eax
movzbl %al, %ecx
movl %ecx, 0x9b4c(%rip)      # 0xb310
movl $0x1, %eax
cmpl 0x9b45(%rip), %ecx      # 0xb314
jne 0x181c
leaq 0x4a16(%rip), %rdi      # 0x61ee
jmp 0x17e1
leaq 0x4a36(%rip), %rdi      # 0x6217
callq 0x1120
xorl %eax, %eax
jmp 0x181c
movl $0x100, %esi            # imm = 0x100
subl %ecx, %esi
callq 0x15fc
movl 0x9b14(%rip), %esi      # 0xb310
testl %esi, %esi
je 0x1810
testl %eax, %eax
je 0x181e
leaq 0x9a05(%rip), %rdi      # 0xb210
callq 0x15fc
movl 0x9afa(%rip), %ecx      # 0xb310
movl %ecx, 0x9af8(%rip)      # 0xb314
popq %rcx
retq
xorl %eax, %eax
jmp 0x1810
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-emit.c
// Function: emit_bits_flush
ULONG emit_bits_flush(ULONG bits)
{
    UBYTE store_byte;
    ULONG success = 1;

    if( wrk.wordbit ) { // 16bits
        if( wrk.bigend ) { // big endian
            store_byte = 0x00FF & (bits >> 8);
            success = success && emit_file( &store_byte, 1);
            store_byte = 0x00FF & bits;
            success = success && emit_file( &store_byte, 1);

        } else { // little endian
            store_byte = 0x00FF & bits;
            success = success && emit_file( &store_byte, 1);
            store_byte = 0x00FF & (bits >> 8);
            success = success && emit_file( &store_byte, 1);
        }

    } else { // 8bits
        store_byte = 0x00FF & bits;
        success = success && emit_file( &store_byte, 1);
    }

    return success;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x8c82(%rip), %rax      # 0xb320
cmpl $0x0, 0x10(%rax)
je 0x26c5
cmpl $0x0, 0x14(%rax)
je 0x26cb
movb %bh, 0x7(%rsp)
leaq 0x7(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x15fc
movb %bl, (%r14)
jmp 0x26e0
movb %bl, 0x7(%rsp)
jmp 0x26e4
leaq 0x7(%rsp), %rdi
movb %bl, (%rdi)
movl $0x1, %esi
callq 0x15fc
movb %bh, 0x7(%rsp)
testl %eax, %eax
je 0x26f5
leaq 0x7(%rsp), %rdi
movl $0x1, %esi
callq 0x15fc
jmp 0x26f7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-globals.c
// Function: free_globals
void free_globals(void)
{
    if( wrk.indata ) free( wrk.indata );

    if( wrk.file_out ) fclose( wrk.file_out );

    if( wrk.file_in )  fclose( wrk.file_in );

    if( wrk.fname_out ) free( wrk.fname_out );

    if( wrk.fname_in )  free( wrk.fname_in );
}

// Assembly:
pushq %rax
movq 0x8c19(%rip), %rdi      # 0xb360
testq %rdi, %rdi
je 0x2751
callq 0x10c0
movq 0x8c00(%rip), %rdi      # 0xb358
testq %rdi, %rdi
je 0x2762
callq 0x1080
movq 0x8be7(%rip), %rdi      # 0xb350
testq %rdi, %rdi
je 0x2773
callq 0x1080
movq 0x8bce(%rip), %rdi      # 0xb348
testq %rdi, %rdi
je 0x2784
callq 0x10c0
movq 0x8bb5(%rip), %rdi      # 0xb340
testq %rdi, %rdi
je 0x2796
popq %rax
jmp 0x10c0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-hash.c
// Function: build_hash
UBYTE * build_hash(UBYTE * data, ULONG length)
{
    UBYTE * hash;
    ULONG i;
    UBYTE *src,*dst;
    UBYTE curr,prev,prev2;

    if( !length )
        return NULL;

    hash=(UBYTE *)malloc( length );

    if( !hash )
        return NULL;

    prev=curr=0;
    i=length;
    src = data;
    dst = hash;

    do {
        prev2 = (UBYTE)( (prev>>1) | (prev<<7) );
        prev  = (UBYTE)( (curr>>1) | (curr<<7) );
        curr  = *(src++);
        *(dst++) = curr^prev^prev2;
    } while( --i );

    return hash;
}

// Assembly:
testl %esi, %esi
je 0x27e7
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
movq %r14, %rdi
callq 0x10e0
xorl %ecx, %ecx
testq %rax, %rax
je 0x27ea
xorl %edx, %edx
xorl %esi, %esi
movzbl %cl, %edi
shrl %edi
shll $0x7, %ecx
orl %edi, %ecx
movzbl %sil, %edi
movl %edi, %esi
shrl %esi
shll $0x7, %edi
orl %esi, %edi
movzbl (%rbx,%rdx), %esi
xorl %edi, %ecx
xorl %esi, %ecx
movb %cl, (%rax,%rdx)
incq %rdx
movl %edi, %ecx
cmpl %edx, %r14d
jne 0x27b9
jmp 0x27ec
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-lz.c
// Function: get_lz_price_megalz
ULONG get_lz_price_megalz(ULONG position, struct lzcode * lzcode)
{
    ULONG varbits,varlen;
    LONG length,disp;
    length = lzcode->length;
    disp   = lzcode->disp;

    if( length==1 ) {
        if( disp==0 )
            return 9;

        else if( (-8)<=disp && disp<=(-1) )
            return 6;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( length==2 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 11;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( length==3 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 12;

        else if( (-4352)<=disp && disp<(-256) )
            return 16;

        else
            goto INVALID_CODE_MEGALZ;

    } else if( 4<=length && length<=255 ) {
        varlen = 0;
        varbits = (length-2)>>1;

        while( varbits ) {
            varbits >>= 1;
            varlen+=2;
        }

        if( (-256)<=disp && disp<=(-1) )
            varlen += 9;

        else if( (-4352)<=disp && disp<(-256) )
            varlen += 13;

        else
            goto INVALID_CODE_MEGALZ;

        return varlen+3;

    } else {
INVALID_CODE_MEGALZ:
        printf("mhmt-lz.c:get_lz_price_megalz(): Found invalid code length=%d, displacement=%d\n",length, disp);
        return 0;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movl (%rsi), %esi
movl 0x4(%rax), %edx
cmpl $0x3, %esi
je 0x2b5e
cmpl $0x2, %esi
je 0x2b4f
cmpl $0x1, %esi
jne 0x2b7f
testl %edx, %edx
je 0x2bdf
movl $0x6, %ebx
cmpl $-0x9, %edx
jbe 0x2bcb
jmp 0x2bdb
movl $0xb, %ebx
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x2bcb
jmp 0x2bdb
movl $0xc, %ebx
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
ja 0x2bdb
leal 0x1100(%rdx), %eax
movl $0x10, %ebx
cmpl $0x1000, %eax           # imm = 0x1000
jae 0x2bcb
jmp 0x2bdb
leal -0x4(%rsi), %eax
cmpl $0xfb, %eax
ja 0x2bcb
leal -0x2(%rsi), %ecx
xorl %eax, %eax
cmpl $0x2, %ecx
jb 0x2ba3
xorl %eax, %eax
movl %ecx, %edi
shrl %edi
addl $0x2, %eax
cmpl $0x3, %ecx
movl %edi, %ecx
ja 0x2b97
movl $0x9, %ecx
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
ja 0x2bc3
leal 0x1100(%rdx), %edi
movl $0xd, %ecx
cmpl $0xfff, %edi            # imm = 0xFFF
ja 0x2bcb
leal (%rax,%rcx), %ebx
addl $0x3, %ebx
jmp 0x2bdb
leaq 0x37b9(%rip), %rdi      # 0x638b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
movl %ebx, %eax
popq %rbx
retq
movl $0x9, %ebx
jmp 0x2bdb
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-lz.c
// Function: get_lz_price_hrum
ULONG get_lz_price_hrum(ULONG position, struct lzcode * lzcode)
{
    ULONG varlen;
    LONG length,disp;
    length = lzcode->length;
    disp   = lzcode->disp;

    if( length==1 ) {
        if( disp==0 )
            return 9;

        else if( (-8)<=disp && disp<=(-1) )
            return 6;

        else
            goto INVALID_CODE_HRUM;

    } else if( length==2 ) {
        if( (-256)<=disp && disp<=(-1) )
            return 11;

        else
            goto INVALID_CODE_HRUM;

    } else if (3<=length && length<=255) {
        varlen = 3;

        if( 4<=length && length<=15 ) {
            varlen = 5;

            if( length>=6 ) varlen += 2;

            if( length>=9 ) varlen += 2;

            if( length>=12) varlen += 2;

        } else if( 15<length && length<=255 ) {
            varlen = 13;
        }

        if( (-256)<=disp && disp<=(-1) )
            varlen += 9;

        else if( (-4096)<=disp && disp<(-256) )
            varlen += 13;

        else
            goto INVALID_CODE_HRUM;

        return varlen;

    } else {
INVALID_CODE_HRUM:
        printf("mhmt-lz.c:get_lz_price_hrum(): Found invalid code length=%d, displacement=%d\n",length, disp);
        return 0;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movl (%rsi), %esi
movl 0x4(%rax), %edx
cmpl $0x2, %esi
je 0x2c10
cmpl $0x1, %esi
jne 0x2c1f
testl %edx, %edx
je 0x2c55
movl $0x6, %ebx
cmpl $-0x9, %edx
jbe 0x2c8b
jmp 0x2c9b
movl $0xb, %ebx
cmpl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
jbe 0x2c8b
jmp 0x2c9b
leal -0x3(%rsi), %eax
cmpl $0xfc, %eax
ja 0x2c8b
leal -0x4(%rsi), %eax
cmpl $0xb, %eax
ja 0x2c5c
xorl %eax, %eax
cmpl $0x6, %esi
setge %al
leal 0x5(,%rax,2), %ecx
cmpl $0x9, %esi
leal 0x7(%rax,%rax), %eax
cmovll %ecx, %eax
leal 0x2(%rax), %ebx
cmpl $0xc, %esi
cmovll %eax, %ebx
jmp 0x2c6c
movl $0x9, %ebx
jmp 0x2c9b
cmpl $0x10, %esi
movl $0xd, %eax
movl $0x3, %ebx
cmovgel %eax, %ebx
cmpl $0xffffff00, %edx       # imm = 0xFFFFFF00
jb 0x2c79
addl $0x9, %ebx
jmp 0x2c9b
leal 0x1000(%rdx), %eax
cmpl $0xeff, %eax            # imm = 0xEFF
ja 0x2c8b
addl $0xd, %ebx
jmp 0x2c9b
leaq 0x3749(%rip), %rdi      # 0x63db
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1040
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mhmt/mhmt-main.c
// Function: main
int main( int argc, char* argv[] )
{
    int error=0;
    ULONG parse_result;
    init_globals();
    // printf short info
    printf("mhmt - MeHruMsT - MEgalz, HRUM and hruST (c) 2009 lvd^nedopc\n\n");
    // parse arguments
    parse_result = parse_args(argc, argv);

    if( parse_result&ARG_PARSER_SHOWHELP ) {
        if( parse_result&ARG_PARSER_ERROR )
            printf("\n");

        show_help();
    }

    if( parse_result&ARG_PARSER_ERROR ) {
        printf("There were errors in arguments.\n");
        error++;

    } else if( parse_result&ARG_PARSER_GO ) {
        if( do_files() ) {
            dump_config();

            if( wrk.mode ) {
                error += depack() ? 0 : 1;

            } else {
                error += pack() ? 0 : 1;
            }

        } else {
            error++;
        }
    }

    free_globals();
    return error;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x2700
leaq 0x3999(%rip), %rdi      # 0x6785
callq 0x1120
movl %ebp, %edi
movq %rbx, %rsi
callq 0x37b0
movl %eax, %ebx
testb $0x1, %bl
je 0x2e17
btl $0x8, %ebx
jae 0x2e12
movl $0xa, %edi
callq 0x10f0
callq 0x2e73
btl $0x8, %ebx
jb 0x2e26
testb $0x2, %bl
jne 0x2e36
xorl %eax, %eax
jmp 0x2e62
leaq 0x3996(%rip), %rdi      # 0x67c3
callq 0x1120
movb $0x1, %al
jmp 0x2e62
callq 0x2fab
testl %eax, %eax
je 0x2e32
callq 0x31ff
leaq 0x84d5(%rip), %rax      # 0xb320
cmpl $0x0, 0x8(%rax)
je 0x2e58
callq 0x4098
jmp 0x2e5d
callq 0x35d4
testl %eax, %eax
sete %al
movzbl %al, %ebx
callq 0x273f
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq