LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvSuspendThread
void prvSuspendThread( pthread_t xThreadId )
{
portBASE_TYPE xResult = pthread_mutex_lock( &xSuspendResumeThreadMutex );
	if ( 0 == xResult )
	{
		/* Set-up for the Suspend Signal handler? */
		xSentinel = 0;
		xResult = pthread_mutex_unlock( &xSuspendResumeThreadMutex );
		xResult = pthread_kill( xThreadId, SIG_SUSPEND );
		while ( ( xSentinel == 0 ) && ( pdTRUE != xServicingTick ) )
		{
			sched_yield();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x542c(%rip), %rdi      # 0xc900
callq 0x4770
testl %eax, %eax
je 0x74e4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq $0x0, 0x53f1(%rip) # 0xc8e0
leaq 0x540a(%rip), %rdi      # 0xc900
callq 0x43e0
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
cmpq $0x0, 0x53d0(%rip)      # 0xc8e0
jne 0x74dd
movq 0x5417(%rip), %rax      # 0xc930
cmpq $0x1, %rax
je 0x74dd
callq 0x4280
jmp 0x7508
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortSystemTickHandler
void vPortSystemTickHandler( int sig )
{
pthread_t xTaskToSuspend;
pthread_t xTaskToResume;

	if ( ( pdTRUE == xInterruptsEnabled ) && ( pdTRUE != xServicingTick ) )
	{
		if ( 0 == pthread_mutex_trylock( &xSingleThreadMutex ) )
		{
			xServicingTick = pdTRUE;

			xTaskToSuspend = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );
			/* Tick Increment. */
			vTaskIncrementTick();

			/* Select Next Task. */
#if ( configUSE_PREEMPTION == 1 )
			vTaskSwitchContext();
#endif
			xTaskToResume = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );

			/* The only thread that can process this tick is the running thread. */
			if ( xTaskToSuspend != xTaskToResume )
			{
				/* Remember and switch the critical nesting. */
				prvSetTaskCriticalNesting( xTaskToSuspend, uxCriticalNesting );
				uxCriticalNesting = prvGetTaskCriticalNesting( xTaskToResume );
				/* Resume next task. */
				prvResumeThread( xTaskToResume );
				/* Suspend the current task. */
				prvSuspendThread( xTaskToSuspend );
			}
			else
			{
				/* Release the lock as we are Resuming. */
				(void)pthread_mutex_unlock( &xSingleThreadMutex );
			}
			xServicingTick = pdFALSE;
		}
		else
		{
			xPendYield = pdTRUE;
		}
	}
	else
	{
		xPendYield = pdTRUE;
	}
}

// Assembly:
movq 0x4e8e(%rip), %rax      # 0xc3e0
cmpq $0x1, %rax
jne 0x7565
movq 0x53d1(%rip), %rax      # 0xc930
cmpq $0x1, %rax
jne 0x7571
movq $0x1, 0x53b8(%rip) # 0xc928
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x533a(%rip), %rdi      # 0xc8b8
callq 0x4260
testl %eax, %eax
je 0x7597
movq $0x1, 0x5396(%rip) # 0xc928
jmp 0x767e
movq $0x1, 0x538e(%rip) # 0xc930
callq 0x40d0
movl $0x8, %ecx
movq 0x5335(%rip), %rdx      # 0xc8e8
xorl %ebx, %ebx
cmpq %rax, (%rdx,%rcx)
je 0x75ca
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x75b5
jmp 0x75cf
movq -0x8(%rdx,%rcx), %rbx
callq 0x43d0
callq 0x46e0
callq 0x40d0
movl $0x8, %edx
movq 0x52fe(%rip), %rcx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rcx,%rdx)
je 0x7601
addq $0x18, %rdx
cmpq $0x608, %rdx            # imm = 0x608
jne 0x75ec
jmp 0x7606
movq -0x8(%rcx,%rdx), %rdi
cmpq %rdi, %rbx
jne 0x7619
leaq 0x52a6(%rip), %rdi      # 0xc8b8
callq 0x43e0
jmp 0x7673
movl $0x10, %eax
movq 0x52cb(%rip), %rdx      # 0xc8f0
cmpq %rbx, -0x10(%rcx,%rax)
je 0x763a
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7625
jmp 0x763e
movq %rdx, (%rcx,%rax)
movl $0x10, %edx
xorl %eax, %eax
cmpq %rdi, -0x10(%rcx,%rdx)
je 0x765b
addq $0x18, %rdx
cmpq $0x610, %rdx            # imm = 0x610
jne 0x7645
jmp 0x765f
movq (%rcx,%rdx), %rax
movq %rax, 0x528a(%rip)      # 0xc8f0
callq 0x71ce
movq %rbx, %rdi
callq 0x74c4
movq $0x0, 0x52b2(%rip) # 0xc930
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortForciblyEndThread
void vPortForciblyEndThread( void *pxTaskToDelete )
{
xTaskHandle hTaskToDelete = ( xTaskHandle )pxTaskToDelete;
pthread_t xTaskToDelete;
pthread_t xTaskToResume;
portBASE_TYPE xResult;

	if ( 0 == pthread_mutex_lock( &xSingleThreadMutex ) )
	{
		xTaskToDelete = prvGetThreadHandle( hTaskToDelete );
		xTaskToResume = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );

		if ( xTaskToResume == xTaskToDelete )
		{
			/* This is a suicidal thread, need to select a different task to run. */
			vTaskSwitchContext();
			xTaskToResume = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );
		}

		if ( pthread_self() != xTaskToDelete )
		{
			/* Cancelling a thread that is not me. */
			if ( xTaskToDelete != ( pthread_t )NULL )
			{
				/* Send a signal to wake the task so that it definitely cancels. */
				pthread_testcancel();
				xResult = pthread_cancel( xTaskToDelete );
				/* Pthread Clean-up function will note the cancellation. */
			}
			(void)pthread_mutex_unlock( &xSingleThreadMutex );
		}
		else
		{
			/* Resume the other thread. */
			prvResumeThread( xTaskToResume );
			/* Pthread Clean-up function will note the cancellation. */
			/* Release the execution. */
			uxCriticalNesting = 0;
			vPortEnableInterrupts();
			(void)pthread_mutex_unlock( &xSingleThreadMutex );
			/* Commit suicide */
			pthread_exit( (void *)1 );
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x5222(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
je 0x76a4
popq %rbx
popq %r14
popq %rbp
retq
movl $0x8, %eax
movq 0x5238(%rip), %rcx      # 0xc8e8
xorl %ebx, %ebx
cmpq %r14, (%rcx,%rax)
je 0x76c6
addq $0x18, %rax
cmpq $0x608, %rax            # imm = 0x608
jne 0x76b2
jmp 0x76cb
movq -0x8(%rcx,%rax), %rbx
callq 0x40d0
movl $0x8, %ecx
movq 0x520c(%rip), %rdx      # 0xc8e8
xorl %r14d, %r14d
cmpq %rax, (%rdx,%rcx)
je 0x76f4
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x76df
jmp 0x76f9
movq -0x8(%rdx,%rcx), %r14
cmpq %rbx, %r14
jne 0x7731
callq 0x46e0
callq 0x40d0
movl $0x8, %ecx
movq 0x51d4(%rip), %rdx      # 0xc8e8
xorl %r14d, %r14d
cmpq %rax, (%rdx,%rcx)
je 0x772c
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x7717
jmp 0x7731
movq -0x8(%rdx,%rcx), %r14
callq 0x4550
cmpq %rbx, %rax
je 0x775d
testq %rbx, %rbx
je 0x774d
callq 0x4330
movq %rbx, %rdi
callq 0x4720
leaq 0x5164(%rip), %rdi      # 0xc8b8
popq %rbx
popq %r14
popq %rbp
jmp 0x43e0
movq %r14, %rdi
callq 0x71ce
movq $0x0, 0x5180(%rip) # 0xc8f0
movq $0x1, 0x4c65(%rip) # 0xc3e0
leaq 0x5136(%rip), %rdi      # 0xc8b8
callq 0x43e0
movl $0x1, %edi
callq 0x43f0
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortAddTaskHandle
void vPortAddTaskHandle( void *pxTaskHandle )
{
portLONG lIndex;

	pxThreads[ lIndexOfLastAddedTask ].hTask = ( xTaskHandle )pxTaskHandle;
	for ( lIndex = 0; lIndex < MAX_NUMBER_OF_TASKS; lIndex++ )
	{
		if ( pxThreads[ lIndex ].hThread == pxThreads[ lIndexOfLastAddedTask ].hThread )
		{
			if ( pxThreads[ lIndex ].hTask != pxThreads[ lIndexOfLastAddedTask ].hTask )
			{
				pxThreads[ lIndex ].hThread = ( pthread_t )NULL;
				pxThreads[ lIndex ].hTask = NULL;
				pxThreads[ lIndex ].uxCriticalNesting = 0;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x514c(%rip), %rax      # 0xc8e8
movslq 0x510d(%rip), %rcx      # 0xc8b0
leaq (%rcx,%rcx,2), %rcx
movq %rdi, 0x8(%rax,%rcx,8)
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movq (%rax,%rcx), %rdx
movslq 0x50f4(%rip), %rsi      # 0xc8b0
leaq (%rsi,%rsi,2), %rsi
cmpq (%rax,%rsi,8), %rdx
jne 0x77ec
movq 0x8(%rax,%rcx), %rdx
movslq 0x50de(%rip), %rsi      # 0xc8b0
leaq (%rsi,%rsi,2), %rsi
cmpq 0x8(%rax,%rsi,8), %rdx
je 0x77ec
leaq (%rax,%rcx), %rdx
movups %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
addq $0x18, %rcx
cmpq $0x600, %rcx            # imm = 0x600
jne 0x77b1
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvDeleteThread
void prvDeleteThread( void *xThreadId )
{
portLONG lIndex;
	for ( lIndex = 0; lIndex < MAX_NUMBER_OF_TASKS; lIndex++ )
	{
		if ( pxThreads[ lIndex ].hThread == ( pthread_t )xThreadId )
		{
			pxThreads[ lIndex ].hThread = (pthread_t)NULL;
			pxThreads[ lIndex ].hTask = (xTaskHandle)NULL;
			if ( pxThreads[ lIndex ].uxCriticalNesting > 0 )
			{
				uxCriticalNesting = 0;
				vPortEnableInterrupts();
			}
			pxThreads[ lIndex ].uxCriticalNesting = 0;
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x10, %eax
movq 0x509e(%rip), %rcx      # 0xc8e8
cmpq %rdi, -0x10(%rcx,%rax)
je 0x785f
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x784a
jmp 0x788f
leaq (%rcx,%rax), %rdx
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%rcx,%rax)
cmpq $0x0, (%rcx,%rax)
je 0x7888
movq $0x0, 0x5073(%rip) # 0xc8f0
movq $0x1, 0x4b58(%rip) # 0xc3e0
movq $0x0, (%rdx)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvSuspendSignalHandler
void prvSuspendSignalHandler(int sig)
{
sigset_t xSignals;

	/* Only interested in the resume signal. */
	sigemptyset( &xSignals );
	sigaddset( &xSignals, SIG_RESUME );
	xSentinel = 1;

	/* Unlock the Single thread mutex to allow the resumed task to continue. */
	if ( 0 != pthread_mutex_unlock( &xSingleThreadMutex ) )
	{
		printf( "Releasing someone else's lock.\n" );
	}

	/* Wait on the resume signal. */
	if ( 0 != sigwait( &xSignals, &sig ) )
	{
		printf( "SSH: Sw %d\n", sig );
	}

	/* Will resume here when the SIG_RESUME signal is received. */
	/* Need to set the interrupts based on the task's critical nesting. */
	if ( uxCriticalNesting == 0 )
	{
		vPortEnableInterrupts();
	}
	else
	{
		vPortDisableInterrupts();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
movl %edi, -0xc(%rbp)
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
callq 0x42f0
movq %rbx, %rdi
movl $0xc, %esi
callq 0x4760
movq $0x1, 0x5019(%rip) # 0xc8e0
leaq 0x4fea(%rip), %rdi      # 0xc8b8
callq 0x43e0
testl %eax, %eax
je 0x78e3
leaq 0x18af(%rip), %rdi      # 0x918d
callq 0x40c0
leaq -0x90(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x4630
testl %eax, %eax
je 0x7908
movl -0xc(%rbp), %esi
leaq 0x17b3(%rip), %rdi      # 0x90b4
xorl %eax, %eax
callq 0x4170
xorl %eax, %eax
cmpq $0x0, 0x4fde(%rip)      # 0xc8f0
sete %al
movq %rax, 0x4ac4(%rip)      # 0xc3e0
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FileIO/fileIO.c
// Function: vDisplayMessage
void vDisplayMessage( const char * const pcMessageToPrint )
{
	vTaskSuspendAll();
	{
		printf( "%s", pcMessageToPrint );
		fflush( stdout );
	}
	xTaskResumeAll();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4620
leaq 0x184b(%rip), %rdi      # 0x91ac
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4170
movq 0x454e(%rip), %rax      # 0xbec0
movq (%rax), %rdi
callq 0x4410
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FileIO/fileIO.c
// Function: vWriteMessageToDisk
void vWriteMessageToDisk( const char * const pcMessage )
{
const portCHAR * const pcFileName = "RTOSlog.txt";
const portCHAR * const pcSeparator = "\r\n-----------------------\r\n";
FILE *pf;

	vTaskSuspendAll();
	{
		pf = fopen( pcFileName, "a" );
		if( pf != NULL )
		{
			fwrite( pcMessage, strlen( pcMessage ), ( unsigned portSHORT ) 1, pf );
			fwrite( pcSeparator, strlen( pcSeparator ), ( unsigned portSHORT ) 1, pf );
			fclose( pf );
		}
	}
	xTaskResumeAll();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x4620
leaq 0x1814(%rip), %rdi      # 0x91af
leaq 0x1835(%rip), %rsi      # 0x91d7
callq 0x45d0
testq %rax, %rax
je 0x79eb
movq %rax, %rbx
movq %r14, %rdi
callq 0x4160
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x4690
leaq 0x17ea(%rip), %rdi      # 0x91bb
movl $0x1b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x4690
movq %rbx, %rdi
callq 0x4140
popq %rbx
popq %r14
popq %rbp
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FileIO/fileIO.c
// Function: vWriteBufferToDisk
void vWriteBufferToDisk( const char * const pcBuffer, unsigned long ulBufferLength )
{
const portCHAR * const pcFileName = "trace.bin";
FILE *pf;

	vTaskSuspendAll();
	{
		pf = fopen( pcFileName, "wb" );
		if( pf )
		{
			fwrite( pcBuffer, ( size_t ) ulBufferLength, ( unsigned portSHORT ) 1, pf );
			fclose( pf );
		}
	}
	xTaskResumeAll();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4620
leaq 0x17c9(%rip), %rdi      # 0x91d9
leaq 0x17cc(%rip), %rsi      # 0x91e3
callq 0x45d0
testq %rax, %rax
je 0x7a3f
movq %rax, %r15
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rcx
callq 0x4690
movq %r15, %rdi
callq 0x4140
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4080
nop
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIO.c
// Function: lAsyncIORegisterCallback
long lAsyncIORegisterCallback( int iFileDescriptor, void (*pvFunction)(int,void*), void *pvContext )
{
xAsyncIOCallback *pxIterator;
	if ( NULL != pvFunction )
	{
		/* Record the socket against its call back. */
		for ( pxIterator = &xHead; pxIterator->pxNext != NULL; pxIterator = pxIterator->pxNext );
		pxIterator->pxNext = ( xAsyncIOCallback * )malloc( sizeof( xAsyncIOCallback ) );
		pxIterator->pxNext->iFileHandle = iFileDescriptor;
		pxIterator->pxNext->pvFunction = pvFunction;
		pxIterator->pxNext->pvContext = pvContext;

		/* Set the socket as requiring a signal when messages are received. */
		prvRegisterSignalHandler( iFileDescriptor );
	}
	return ( NULL != pvFunction );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
testq %rsi, %rsi
je 0x7a9e
movq %rdx, %r15
movl %edi, %r14d
leaq 0x4ec8(%rip), %rax      # 0xc938
movq %rax, %r12
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0x7a70
movl $0x20, %edi
callq 0x4400
movq %rax, 0x18(%r12)
movl %r14d, (%rax)
movq %rbx, 0x8(%rax)
movq %r15, 0x10(%rax)
movl %r14d, %edi
callq 0x4780
xorl %eax, %eax
testq %rbx, %rbx
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIO.c
// Function: prvRegisterSignalHandler
void prvRegisterSignalHandler( int iSocket )
{
struct sigaction xAction;

	if ( 1 != iAlreadyRegisteredHandler )
	{
		/* Initialise the sigaction struct for the signal handler. */
		xAction.sa_sigaction = prvSignalHandler;
		xAction.sa_flags = SA_SIGINFO;	/* Using this option, the signal handler knows which socket caused the signal. */
		sigfillset( &xAction.sa_mask );
		sigdelset( &xAction.sa_mask, SIG_MSG_RX );
		sigdelset( &xAction.sa_mask, SIG_TICK );

		/* Register the signal handler. */
		if ( 0 != sigaction( SIG_MSG_RX, &xAction, NULL ) )	/* Register the Signal Handler. */
		{
			printf( "Problem installing SIG_MSG_RX\n" );
		}
		else
		{
			iAlreadyRegisteredHandler = 1;
		}
	}

	/* Request that the socket generates a signal. */
	if ( SIG_MSG_RX == SIGIO )
	{
		if ( 0 != fcntl( iSocket, F_SETOWN, getpid() ) )
		{
			printf( "fnctl: Failed: %d\n", errno );
		}
	}
	else
	{
		/* Use real-time signals instead of SIGIO */
		if ( 0 != fcntl( iSocket, F_SETSIG, SIG_MSG_RX ) )
		{
			printf( "fnctl: Failed: %d\n", errno );
		}
	}

	/* Indicate that the socket is Asynchronous. */
	if ( 0 != fcntl( iSocket, F_SETFL, O_ASYNC ) )
	{
		printf( "fcntl: Failed: %d\n", errno );
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movl %edi, %ebx
movl 0x4e93(%rip), %eax      # 0xc958
cmpl $0x1, %eax
je 0x7b38
movq 0x44d7(%rip), %rax      # 0xbfa8
leaq -0xa0(%rbp), %r14
movq %rax, -0x8(%r14)
movl $0x4, 0x80(%r14)
movq %r14, %rdi
callq 0x4340
movq %r14, %rdi
movl $0x1d, %esi
callq 0x45e0
movq %r14, %rdi
movl $0xe, %esi
callq 0x45e0
leaq -0xa8(%rbp), %rsi
movl $0x1d, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x7b2e
leaq 0x16e5(%rip), %rdi      # 0x920c
callq 0x40c0
jmp 0x7b38
movl $0x1, 0x4e20(%rip)      # 0xc958
callq 0x4120
movl %ebx, %edi
movl $0x8, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4110
testl %eax, %eax
je 0x7b66
callq 0x40a0
movl (%rax), %esi
leaq 0x1687(%rip), %rdi      # 0x91e6
xorl %eax, %eax
callq 0x4170
movl %ebx, %edi
movl $0x4, %esi
movl $0x2000, %edx           # imm = 0x2000
xorl %eax, %eax
callq 0x4110
testl %eax, %eax
je 0x7b92
callq 0x40a0
movl (%rax), %esi
leaq 0x166e(%rip), %rdi      # 0x91f9
xorl %eax, %eax
callq 0x4170
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIO.c
// Function: prvSignalHandler
void prvSignalHandler( int signal, siginfo_t * data, void * pvParam )
{
int iSocket = 0, iReturn;
xAsyncIOCallback *pxIterator;
struct pollfd xFileDescriptorPollEvents;
	if ( SIG_MSG_RX == signal )	/* Are we in the correct signal handler. */
	{
		if ( data->si_code == SI_SIGIO )	/* Do we know which socket caused the signal? */
		{
			iSocket = data->si_fd;	/* Yes we do. Find the owner. */

			for ( pxIterator = &xHead; ( pxIterator->pxNext != NULL ) && ( pxIterator->iFileHandle != iSocket ); pxIterator = pxIterator->pxNext );

			if ( pxIterator->iFileHandle == iSocket )
			{
				( pxIterator->pvFunction )( iSocket, pxIterator->pvContext );
			}
			else
			{
				printf( "No socket owner.\n" );
			}
		}
		else
		{
			/* We don't know which socket cause the signal. Use poll to find the socket. */
			for ( pxIterator = &xHead; pxIterator != NULL; pxIterator = pxIterator->pxNext )
			{
				xFileDescriptorPollEvents.fd = pxIterator->iFileHandle;
				xFileDescriptorPollEvents.events = POLLIN;
				xFileDescriptorPollEvents.revents = 0;
				if ( xFileDescriptorPollEvents.fd != 0 )
				{
					iReturn = poll( &xFileDescriptorPollEvents, 1, 0 );	/* Need to kick off the signal handling. */

					if ( ( 1 == iReturn ) && ( POLLIN == xFileDescriptorPollEvents.revents ) )
					{
						if ( pxIterator->pvFunction != NULL )
						{
							( pxIterator->pvFunction )( xFileDescriptorPollEvents.fd, pxIterator->pvContext );
						}
					}
				}
			}
			/* Note that poll should really be passed all of the sockets in one go and then iterate over the results. */
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x1d, %edi
jne 0x7c69
cmpl $-0x5, 0x8(%rsi)
jne 0x7c17
movl 0x18(%rsi), %edi
leaq 0x4d49(%rip), %rcx      # 0xc938
movq %rcx, %rax
movq 0x18(%rcx), %rcx
movl (%rax), %edx
testq %rcx, %rcx
je 0x7c01
cmpl %edi, %edx
jne 0x7bef
cmpl %edi, %edx
jne 0x7c72
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmpq *%rcx
leaq 0x4d1a(%rip), %r14      # 0xc938
leaq -0x18(%rbp), %rbx
movl (%r14), %eax
movl %eax, -0x18(%rbp)
movl $0x1, -0x14(%rbp)
testl %eax, %eax
je 0x7c60
movl $0x1, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4510
cmpl $0x1, %eax
jne 0x7c60
cmpw $0x1, -0x12(%rbp)
jne 0x7c60
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x7c60
movl -0x18(%rbp), %edi
movq 0x10(%r14), %rsi
callq *%rax
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x7c22
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x15b1(%rip), %rdi      # 0x922a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x40c0
nop
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSerial.c
// Function: vAsyncSerialIODataAvailableISR
void vAsyncSerialIODataAvailableISR( int iFileDescriptor, void *pContext )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
ssize_t iReadResult = -1;
unsigned char ucRx;

	/* This handler only processes a single byte/character at a time. */
	iReadResult = read( iFileDescriptor, &ucRx, 1 );
	if ( 1 == iReadResult )
	{
		if ( NULL != pContext )
		{
			/* Send the received byte to the queue. */
			if ( pdTRUE != xQueueSendFromISR( (xQueueHandle)pContext, &ucRx, &xHigherPriorityTaskWoken ) )
			{
				/* the queue is full. */
			}
		}
	}
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq $0x0, -0x20(%rbp)
leaq -0x11(%rbp), %rsi
movl $0x1, %edx
callq 0x4290
testq %rbx, %rbx
je 0x7d51
cmpq $0x1, %rax
jne 0x7d51
leaq -0x11(%rbp), %rsi
leaq -0x20(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x4100
cmpq $0x0, (%r14)
je 0x7d51
callq 0x4440
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSocket.c
// Function: iSocketOpenUDP
int iSocketOpenUDP( void (*vSocketCallback)( int, void * ), void *pvContext, struct sockaddr_in *pxBindAddress )
{
int iSocket = 0;

	taskENTER_CRITICAL();
	{
		/* Open a new socket. */
		iSocket = socket( PF_INET, SOCK_DGRAM, IPPROTO_UDP );
		if ( 0 != iSocket )
		{
			/* Have we been passed a call back function that will deal with received messages? */
			if ( pdTRUE == lAsyncIORegisterCallback( iSocket, vSocketCallback, pvContext ) )
			{
				/* This is UDP so bind it passed listen address. */
				if ( NULL != pxBindAddress )
				{
					if ( 0 != bind( iSocket, ( struct sockaddr *)pxBindAddress, sizeof( struct sockaddr_in ) ) )
					{
						printf("Bind error: %d\n", errno );
					}
				}
			}
			else
			{
				/* Socket is being used as polled IO or for sending data. */
			}
		}
		else
		{
			printf( "Failed to open socket: %d.\n", errno );
		}
	}
	taskEXIT_CRITICAL();
	return iSocket;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x4320
movl $0x2, %edi
movl $0x2, %esi
movl $0x11, %edx
callq 0x4790
movl %eax, %ebx
testl %eax, %eax
je 0x7dc3
movl %ebx, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4420
testq %r14, %r14
je 0x7ddb
cmpq $0x1, %rax
jne 0x7ddb
movl %ebx, %edi
movq %r14, %rsi
movl $0x10, %edx
callq 0x4520
testl %eax, %eax
je 0x7ddb
leaq 0x147a(%rip), %r14      # 0x923b
jmp 0x7dca
leaq 0x1481(%rip), %r14      # 0x924b
callq 0x40a0
movl (%rax), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x4170
callq 0x4480
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSocket.c
// Function: iSocketUDPSendTo
int iSocketUDPSendTo( int iSocket, xUDPPacket *pxPacket, struct sockaddr_in *pxSendAddress )
{
int iBytesSent = 0;
	if ( ( 0 != iSocket ) && ( NULL != pxPacket ) )
	{
		taskENTER_CRITICAL();
			iBytesSent = sendto( iSocket, pxPacket, sizeof( xUDPPacket ), 0, ( struct sockaddr *)pxSendAddress, sizeof( struct sockaddr_in ) );
		taskEXIT_CRITICAL();
	}
	return iBytesSent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edi, %edi
sete %al
testq %rsi, %rsi
sete %cl
xorl %r12d, %r12d
orb %al, %cl
jne 0x7e53
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
callq 0x4320
movl $0x400, %edx            # imm = 0x400
movl %r15d, %edi
movq %r14, %rsi
xorl %ecx, %ecx
movq %rbx, %r8
movl $0x10, %r9d
callq 0x4200
movq %rax, %r12
callq 0x4480
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSocket.c
// Function: iSocketUDPReceiveISR
int iSocketUDPReceiveISR( int iSocket, xUDPPacket *pxPacket, struct sockaddr_in *pxReceiveAddress )
{
int iBytesReceived = 0;
socklen_t xSocketLength = sizeof( struct sockaddr_in );

	if ( 0 != iSocket )
	{
		iBytesReceived = recvfrom( iSocket, pxPacket, sizeof( xUDPPacket ), 0, ( struct sockaddr *)pxReceiveAddress, &xSocketLength );
		pxPacket->ucNull = 0;
	}
	return iBytesReceived;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x10, -0xc(%rbp)
testl %edi, %edi
je 0x7e8f
movq %rdx, %r8
movq %rsi, %rbx
leaq -0xc(%rbp), %r9
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0x4450
movb $0x0, 0x3ff(%rbx)
jmp 0x7e91
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSocket.c
// Function: iSocketUDPReceiveFrom
int iSocketUDPReceiveFrom( int iSocket, xUDPPacket *pxPacket, struct sockaddr_in *pxReceiveAddress )
{
int iBytesReceived = 0;
socklen_t xSocketLength = sizeof( struct sockaddr_in );

	if ( 0 != iSocket )
	{
		taskENTER_CRITICAL();
			iBytesReceived = recvfrom( iSocket, pxPacket, sizeof( xUDPPacket ), 0, ( struct sockaddr *)pxReceiveAddress, &xSocketLength );
			pxPacket->ucNull = 0;
		taskEXIT_CRITICAL();
	}
	return iBytesReceived;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x10, -0x1c(%rbp)
testl %edi, %edi
je 0x7ee5
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %r15d
callq 0x4320
leaq -0x1c(%rbp), %r9
movl $0x400, %edx            # imm = 0x400
movl %r15d, %edi
movq %rbx, %rsi
xorl %ecx, %ecx
movq %r14, %r8
callq 0x4450
movq %rax, %r14
movb $0x0, 0x3ff(%rbx)
callq 0x4480
jmp 0x7ee8
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/AsyncIOSocket.c
// Function: vUDPReceiveAndDeliverCallback
void vUDPReceiveAndDeliverCallback( int iSocket, void *pvContext )
{
portBASE_TYPE xHigherTaskWoken = pdFALSE;
static xUDPPacket xPacket;
struct sockaddr_in xReceiveAddress;

	if ( sizeof( xUDPPacket ) == iSocketUDPReceiveISR( iSocket, &xPacket, &xReceiveAddress ) )
	{
		if ( pdPASS != xQueueSendFromISR( (xQueueHandle)pvContext, &xPacket, &xHigherTaskWoken ) )
		{
			printf( "UDP Rx failed\n" );
		}
	}
	else
	{
		printf( "UDP Rx failed: %d\n", errno );
	}
	portEND_SWITCHING_ISR( xHigherTaskWoken );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq $0x0, -0x18(%rbp)
movl $0x10, -0xc(%rbp)
testl %edi, %edi
je 0x7f67
movq %rsi, %rbx
leaq 0x4a40(%rip), %rsi      # 0xc95c
leaq -0x28(%rbp), %r8
leaq -0xc(%rbp), %r9
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0x4450
movb $0x0, 0x4e24(%rip)      # 0xcd5b
cmpl $0x400, %eax            # imm = 0x400
jne 0x7f67
leaq 0x4a17(%rip), %rsi      # 0xc95c
leaq -0x18(%rbp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x4100
cmpq $0x1, %rax
je 0x7f7c
leaq 0x131a(%rip), %rdi      # 0x927a
callq 0x40c0
jmp 0x7f7c
callq 0x40a0
movl (%rax), %esi
leaq 0x12f2(%rip), %rdi      # 0x9267
xorl %eax, %eax
callq 0x4170
cmpq $0x0, -0x18(%rbp)
je 0x7f88
callq 0x4440
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/PosixMessageQueueIPC.c
// Function: prvPosixIPCInterruptHandler
void prvPosixIPCInterruptHandler( int signal, siginfo_t * data, void * pvParam )
{
union sigval xParameters = data->si_value;
xPipeAndFunction *pxPipes = ( xPipeAndFunction *)xParameters.sival_ptr;
mqd_t hPipeHandle = 0;
void (*vMessageInterruptHandler)(xMessageObject,void*) = NULL;
xMessageObject xRxMessage;
portLONG lMessagesReceived = 0;

	if ( NULL != pxPipes )
	{
		hPipeHandle = pxPipes->hPipe;
		vMessageInterruptHandler = pxPipes->pvFunction;

		memset( &xRxMessage, 0, sizeof( xMessageObject ) );

		if ( NULL != vMessageInterruptHandler )
		{
			while ( ( pdTRUE == lPosixIPCReceiveMessage( hPipeHandle, &xRxMessage ) ) && ( lMessagesReceived++ < MAX_NUMBER_OF_MESSAGES ) )
			{
				vMessageInterruptHandler( xRxMessage, pxPipes->pvContext );
			}
		}

		/* Re-register the notification. */
		if ( 0 != mq_notify( hPipeHandle, &xMessageEvent ) )
		{
			printf( "Failed to install Rx interrupt handler: %d.\n", errno );
		}
	}
	else
	{
		printf( "NULL parameter: Failed to install Rx interrupt handler: %d.\n", errno );
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x18(%rsi), %r12
testq %r12, %r12
je 0x81a7
movl (%r12), %ebx
movq 0x8(%r12), %r13
testq %r13, %r13
je 0x816e
leaq 0x4ca8(%rip), %rsi      # 0xcdc0
leaq -0x2c(%rbp), %rcx
movl $0x2000, %edx           # imm = 0x2000
movl %ebx, %edi
callq 0x4590
testl %eax, %eax
jle 0x816e
movl $0xb, %r15d
leaq 0x4c87(%rip), %r14      # 0xcdc0
decl %r15d
je 0x816e
movq 0x10(%r12), %rax
movl $0x40, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq *%r13
movl $0x2000, %edx           # imm = 0x2000
movl %ebx, %edi
movq %r14, %rsi
leaq -0x2c(%rbp), %rcx
callq 0x4590
testl %eax, %eax
jg 0x8139
leaq 0x4c03(%rip), %rsi      # 0xcd78
movl %ebx, %edi
callq 0x4610
testl %eax, %eax
je 0x8195
callq 0x40a0
movl (%rax), %esi
leaq 0x1119(%rip), %rdi      # 0x92a7
xorl %eax, %eax
callq 0x4170
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40a0
movl (%rax), %esi
leaq 0x10e2(%rip), %rdi      # 0x9297
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4170
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/PosixMessageQueueIPC.c
// Function: lPosixIPCSendMessage
portLONG lPosixIPCSendMessage( mqd_t hPipeHandle, xMessageObject xMessage )
{
portLONG lReturn = pdFALSE;

	if ( 0 != hPipeHandle )
	{
		if ( 0 == mq_send( hPipeHandle, (const char *)&xMessage, sizeof( xMessageObject ), 1 ) )
		{
			lReturn = pdTRUE;
		}
		else
		{
			printf( "Message Sending error.\n" );
		}
	}
	return lReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testl %edi, %edi
je 0x822b
leaq 0x10(%rbp), %rsi
movl $0x1, %ebx
movl $0x200, %edx            # imm = 0x200
movl $0x1, %ecx
callq 0x4240
testl %eax, %eax
je 0x822b
leaq 0x10ec(%rip), %rdi      # 0x9310
callq 0x40c0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/AsyncIO/PosixMessageQueueIPC.c
// Function: lPosixIPCReceiveMessage
portLONG lPosixIPCReceiveMessage( mqd_t hPipeHandle, xMessageObject *pxMessage )
{
static char pcBuffer[ MAX_MESSAGE_SIZE ];
unsigned int uiPriority;
portLONG lBytesReceived = 0;
portLONG lBytesToProcess;
portLONG lReturn = pdFALSE;

	lBytesReceived = mq_receive( hPipeHandle, pcBuffer, MAX_MESSAGE_SIZE, &uiPriority );
	for ( lBytesToProcess = 0; lBytesToProcess < lBytesReceived; lBytesToProcess += sizeof( xMessageObject ) )
	{
		memcpy( pxMessage, pcBuffer, sizeof( xMessageObject ) );
		lReturn = pdTRUE;

		/* Only receiving one message at the moment. */
		break;
	}
	return lReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4b7c(%rip), %rsi      # 0xcdc0
leaq -0xc(%rbp), %rcx
movl $0x2000, %edx           # imm = 0x2000
callq 0x4590
testl %eax, %eax
jle 0x8271
leaq 0x4b63(%rip), %rsi      # 0xcdc0
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
callq 0x4350
movl $0x1, %eax
jmp 0x8273
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: common_usage
void common_usage()
{
  int i;

  fprintf(stderr,
          "Usage: dosfs --<subcmd> <options> <..args..>\n"
          "Usage: dos<subcmd> <options> <..args..>\n"
          "Valid subcommands are:");
  for (i=0; commands[i].cmd; i++)
    fprintf(stderr, " %s", commands[i].cmd);
  fprintf(stderr, "\n");
  fprintf(stderr,
          "Common options:\n");
  common_options();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xe79f(%rip), %r14      # 0x10ff8
movq (%r14), %rcx
leaq 0xa99f(%rip), %rdi      # 0xd202
pushq $0x6b
popq %rsi
pushq $0x1
popq %rdx
callq 0x2230
movq 0xe8db(%rip), %rdx      # 0x11150
testq %rdx, %rdx
je 0x28a1
leaq 0xe8e7(%rip), %r15      # 0x11168
leaq 0xa9e6(%rip), %rbx      # 0xd26e
movq (%r14), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2180
movq (%r15), %rdx
addq $0x18, %r15
testq %rdx, %rdx
jne 0x2888
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x2130
movq (%r14), %rcx
leaq 0xa9bc(%rip), %rdi      # 0xd272
pushq $0x10
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2230
movq (%r14), %rcx
leaq 0x9887(%rip), %rdi      # 0xc155
movl $0x92, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: fatal
void fatal(const char *fmt, ...)
{
  va_list ap;
  va_start(ap, fmt);
  fprintf(stderr,"dosfs: ");
  vfprintf(stderr, fmt, ap);
  va_end(ap);
  exit(EXIT_FAILURE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2b8f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0xe442(%rip), %r15      # 0x10ff8
movq (%r15), %rcx
leaq 0x94a8(%rip), %rdi      # 0xc068
movl $0x7, %esi
movl $0x1, %edx
callq 0x2230
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2200
movl $0x1, %edi
callq 0x2220
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: fatal_code
void fatal_code(FRESULT code)
{
  switch(code)
    {
    case FR_OK: break;
    case FR_NO_FILESYSTEM: fatal("Cannot find fat or exfat filesystem\n");
    case FR_DISK_ERR: fatal("I/O error\n");
    case FR_NO_FILE: fatal("File not found\n");
    case FR_NO_PATH: fatal("Path not found\n");
    case FR_INVALID_NAME: fatal("Invalid file name\n");
    case FR_DENIED: fatal("Permission denied\n");
    case FR_WRITE_PROTECTED: fatal("Write protected\n");
    case FR_INVALID_PARAMETER: fatal("Invalid parameter\n");
    case FR_EXIST: fatal("File already exists\n");
    case FR_MKFS_ABORTED: fatal("Formatting failed\n");
    default: fatal("Internal error %d\n", (int)code);
    }
  exit(EXIT_FAILURE);
}

// Assembly:
pushq %rax
movl %edi, %esi
cmpl $0x13, %edi
ja 0x2c6a
movl %esi, %eax
leaq 0x940c(%rip), %rcx      # 0xc004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
callq 0x2220
leaq 0x94f5(%rip), %rdi      # 0xc107
jmp 0x2c63
leaq 0x94b5(%rip), %rdi      # 0xc0d0
jmp 0x2c63
leaq 0x94bf(%rip), %rdi      # 0xc0e3
jmp 0x2c63
leaq 0x9493(%rip), %rdi      # 0xc0c0
jmp 0x2c63
leaq 0x947a(%rip), %rdi      # 0xc0b0
jmp 0x2c63
leaq 0x9466(%rip), %rdi      # 0xc0a5
jmp 0x2c63
leaq 0x94d2(%rip), %rdi      # 0xc11a
jmp 0x2c63
leaq 0x94a5(%rip), %rdi      # 0xc0f6
jmp 0x2c63
leaq 0x94d5(%rip), %rdi      # 0xc12f
jmp 0x2c63
leaq 0x941d(%rip), %rdi      # 0xc080
xorl %eax, %eax
callq 0x2b2c
leaq 0x94d1(%rip), %rdi      # 0xc142
xorl %eax, %eax
callq 0x2b2c
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: disk_initialize
DSTATUS disk_initialize (BYTE pdrv)
{
  if ((fd = open(fn, O_RDWR)) < 0) {
    wp = 1;
    if ((fd = open(fn, O_RDONLY)) < 0) {
      fatal("Cannot open file \"%s\"\n", fn);
      return STA_NOINIT;
    }
  }
  return disk_status(pdrv);
}

// Assembly:
pushq %rax
movq 0xe590(%rip), %rdi      # 0x11230
movl $0x2, %esi
xorl %eax, %eax
callq 0x21f0
movl %eax, 0xe48e(%rip)      # 0x11140
testl %eax, %eax
jns 0x2cda
movl $0x1, 0xe580(%rip)      # 0x11240
movq 0xe569(%rip), %rdi      # 0x11230
xorl %esi, %esi
xorl %eax, %eax
callq 0x21f0
movl %eax, 0xe46a(%rip)      # 0x11140
testl %eax, %eax
js 0x2ce9
cmpl $0x0, 0xe55f(%rip)      # 0x11240
setne %al
shlb $0x2, %al
popq %rcx
retq
movq 0xe540(%rip), %rsi      # 0x11230
leaq 0x9505(%rip), %rdi      # 0xc1fc
xorl %eax, %eax
callq 0x2b2c
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: disk_read
DRESULT disk_read (BYTE pdrv, BYTE *buff, LBA_t sector,	UINT count)
{
  (void) pdrv;
  size_t sz = (size_t)count * 512;
  ssize_t rsz;

  if (! fd)
    return RES_NOTRDY;
  if (lseek(fd, (off_t)(sector * 512), SEEK_SET)  == (off_t)(-1))
    return RES_PARERR;
  while (sz > 0) {
    rsz = read(fd, buff, sz);
    if (rsz < 0)
      return RES_ERROR;
    if (rsz == 0)
      return RES_PARERR;
    sz -= rsz;
    buff += rsz;
  }
  return RES_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0xe435(%rip), %edi      # 0x11140
testl %edi, %edi
je 0x2d5c
movl %ecx, %ebp
movq %rsi, %r14
shlq $0x9, %rdx
movq %rdx, %rsi
xorl %edx, %edx
callq 0x2100
movl $0x4, %ebx
cmpq $-0x1, %rax
je 0x2d61
testl %ebp, %ebp
je 0x2d58
movl %ebp, %r15d
shlq $0x9, %r15
movl 0xe402(%rip), %edi      # 0x11140
movq %r14, %rsi
movq %r15, %rdx
callq 0x2140
testq %rax, %rax
js 0x2d6e
je 0x2d61
addq %rax, %r14
subq %rax, %r15
jne 0x2d38
xorl %ebx, %ebx
jmp 0x2d61
movl $0x3, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebx
jmp 0x2d61
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: disk_write
DRESULT disk_write (BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
{
  (void) pdrv;
  size_t sz = (size_t)count * 512;
  ssize_t rsz;

  if (! fd)
    return RES_NOTRDY;
  if (wp)
    return RES_WRPRT;
  if (lseek(fd, (off_t)(sector * 512), SEEK_SET) == (off_t)(-1))
    return RES_PARERR;
  while (sz > 0) {
    rsz = write(fd, buff, sz);
    if (rsz < 0)
      return RES_ERROR;
    if (rsz == 0)
      return RES_PARERR;
    sz -= rsz;
    buff += rsz;
  }
  return RES_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0xe3be(%rip), %edi      # 0x11140
testl %edi, %edi
je 0x2de1
movl $0x2, %ebx
cmpl $0x0, 0xe4ae(%rip)      # 0x11240
jne 0x2de6
movl %ecx, %ebp
movq %rsi, %r14
shlq $0x9, %rdx
movq %rdx, %rsi
xorl %edx, %edx
callq 0x2100
movl $0x4, %ebx
cmpq $-0x1, %rax
je 0x2de6
testl %ebp, %ebp
je 0x2ddd
movl %ebp, %r15d
shlq $0x9, %r15
movl 0xe37d(%rip), %edi      # 0x11140
movq %r14, %rsi
movq %r15, %rdx
callq 0x20c0
testq %rax, %rax
js 0x2df3
je 0x2de6
addq %rax, %r14
subq %rax, %r15
jne 0x2dbd
xorl %ebx, %ebx
jmp 0x2de6
movl $0x3, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebx
jmp 0x2de6
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: disk_ioctl
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void *buff)
{
  (void) pdrv;
  switch(cmd)
    {
    case CTRL_TRIM:
    case CTRL_SYNC:
      {
        return RES_OK;
      }
    case GET_SECTOR_SIZE:
      {
        *(WORD*)buff = 512;
        return RES_OK;
      }
    case GET_SECTOR_COUNT:
      {
        off_t sz;
        if (fd < 0)
          return RES_NOTRDY;
        sz = lseek(fd, 0, SEEK_END);
        if (sz == (off_t)-1)
          return RES_ERROR;
        *(LBA_t*)buff = (LBA_t)sz / 512;
        return RES_OK;
      }
    default:
      {
        break;
      }
    }
  return RES_PARERR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x4, %esi
ja 0x2e49
movq %rdx, %r14
xorl %ebx, %ebx
movl %esi, %eax
leaq 0x9243(%rip), %rcx      # 0xc054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xe320(%rip), %edi      # 0x11140
testl %edi, %edi
js 0x2e50
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x2, %edx
callq 0x2100
cmpq $-0x1, %rax
je 0x2e57
shrq $0x9, %rax
movq %rax, (%r14)
jmp 0x2e5c
movw $0x200, (%r14)          # imm = 0x200
jmp 0x2e5c
movl $0x4, %ebx
jmp 0x2e5c
movl $0x3, %ebx
jmp 0x2e5c
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: strconcat
char *strconcat(const char *str1, ...)
{
  va_list ap;
  const char *s;
  char *res, *d;
  int l = strlen(str1);

  va_start(ap, str1);
  while ((s = va_arg(ap, const char*)))
    l += strlen(s);
  va_end(ap);
  if (! (res = malloc(l + 1)))
    fatal("out of memory\n");
  strcpy(res, str1);
  d = res + strlen(res);
  va_start(ap, str1);
  while ((s = va_arg(ap, const char*))) {
    strcpy(d, s);
    d += strlen(d);
  }
  va_end(ap);
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x2f2c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x20d0
movq %rax, %r14
movabsq $0x3000000008, %r12     # imm = 0x3000000008
movq %r12, (%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl $0x8, %ebp
cmpl $0x28, %ebp
ja 0x2f6e
movq %rax, %r13
movl %ebp, %eax
addq %r15, %rax
addl $0x8, %ebp
movl %ebp, (%rsp)
jmp 0x2f77
leaq 0x8(%rax), %r13
movq %r13, 0x8(%rsp)
movq (%rax), %rdi
shlq $0x20, %r14
testq %rdi, %rdi
je 0x2f94
callq 0x20d0
sarq $0x20, %r14
addq %rax, %r14
movq %r13, %rax
jmp 0x2f59
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r14
sarq $0x20, %r14
movq %r14, %rdi
callq 0x21a0
testq %rax, %rax
je 0x3040
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2080
movq %r14, %rdi
callq 0x20d0
movq %rax, %rbx
addq %r14, %rbx
movq %r12, (%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl $0x8, %ebp
cmpl $0x28, %ebp
ja 0x3002
movq %rax, %r12
movl %ebp, %eax
addq %r15, %rax
addl $0x8, %ebp
movl %ebp, (%rsp)
jmp 0x300b
leaq 0x8(%rax), %r12
movq %r12, 0x8(%rsp)
movq (%rax), %rsi
testq %rsi, %rsi
je 0x302b
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x20d0
addq %rax, %rbx
movq %r12, %rax
jmp 0x2fed
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x91cc(%rip), %rdi      # 0xc213
xorl %eax, %eax
callq 0x2b2c
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: fix_path
char *fix_path(const char *path)
{
  char *s, *np;

  while (*path == '/' || *path == '\\')
    path += 1;
  if (! (np = strdup(path)))
    fatal("out of memory\n");
  for (s = np; *s; s++)
    if (*s == '\\')
      *s = '/';
  while (s > np && s[-1] == '/')
    *--s = 0;
  return np;
}

// Assembly:
pushq %rax
movzbl (%rdi), %eax
cmpl $0x5c, %eax
je 0x305c
cmpl $0x2f, %eax
jne 0x3061
incq %rdi
jmp 0x304f
callq 0x2240
testq %rax, %rax
je 0x3097
movq %rax, %rcx
movzbl (%rcx), %edx
cmpl $0x5c, %edx
je 0x307c
testl %edx, %edx
jne 0x307f
jmp 0x3090
movb $0x2f, (%rcx)
incq %rcx
jmp 0x306e
cmpb $0x2f, -0x1(%rcx)
jne 0x3095
decq %rcx
movb $0x0, (%rcx)
cmpq %rax, %rcx
ja 0x3084
popq %rcx
retq
leaq 0x9175(%rip), %rdi      # 0xc213
xorl %eax, %eax
callq 0x2b2c
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: rmkdir
FRESULT rmkdir(char *path, int qflag)
{
  if (qflag) {
    char *s = strrchr(path,'/');
    if (dir_p(path))
      return FR_OK;
    if (s) {
      *s = 0;
      rmkdir(path, qflag);
      *s = '/';
    }
  }
  return f_mkdir(path);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x3179
movl %esi, %ebp
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x20f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x30e9
testl %eax, %eax
setne %cl
testq %r14, %r14
sete %dl
orb %cl, %dl
je 0x3167
testl %eax, %eax
je 0x3179
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movb $0x0, (%r14)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3128
movb $0x2f, (%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x81ef
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: format_time
const char *format_time(WORD time)
{
  static char buffer[12];
  int hour = (time >> 11) & 0x1f;
  const char *ampm = (hour >= 12) ? "PM" : "AM";

  if (hour >= 12)
    hour -= 12;
  if (hour == 0)
    hour = 12;
  sprintf(buffer, "%02d:%02d %2s",
          hour, (time >> 5) & 0x3f, ampm);
  return buffer;
}

// Assembly:
pushq %rbx
movl %edi, %ecx
movl %edi, %eax
shrl $0xb, %eax
leal -0xc(%rax), %esi
cmpl $0x6000, %edi           # imm = 0x6000
leaq 0x905f(%rip), %rdx      # 0xc234
leaq 0x905b(%rip), %r8       # 0xc237
cmovaeq %rdx, %r8
cmovbl %eax, %esi
testl %esi, %esi
movl $0xc, %edx
cmovnel %esi, %edx
shrl $0x5, %ecx
andl $0x3f, %ecx
leaq 0xe056(%rip), %rbx      # 0x11250
leaq 0x9039(%rip), %rsi      # 0xc23a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2210
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lb3361[P]dosfs/dosfs.c
// Function: print_filinfo
void print_filinfo(FILINFO *inf, int xflag)
{
  printf("%s %s %8s %8lld ",
         format_date(inf->fdate), format_time(inf->ftime),
         (inf->fattrib & AM_DIR) ? "<DIR>" : "",
         (long long)(inf->fsize) );
#if FF_USE_LFN
  if (xflag)
    printf("%-12s ",
           (inf->altname[0] && strcasecmp(inf->fname, inf->altname))
           ? inf->altname : "");
  printf("%s\n", inf->fname);
#else
  printf("%s\n", inf->fname);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movzwl 0x8(%rdi), %r8d
movl %r8d, %edx
shrl $0x5, %edx
andl $0xf, %edx
movl %r8d, %ecx
andl $0x1f, %ecx
shrl $0x9, %r8d
andl $0x3f, %r8d
addl $0x7bc, %r8d            # imm = 0x7BC
leaq 0xdffd(%rip), %r14      # 0x11244
leaq 0x8fd7(%rip), %rsi      # 0xc225
movq %r14, %rdi
xorl %eax, %eax
callq 0x2210
movzwl 0xa(%rbx), %ecx
movl %ecx, %eax
shrl $0xb, %eax
leal -0xc(%rax), %esi
cmpl $0x6000, %ecx           # imm = 0x6000
leaq 0x8fc3(%rip), %rdx      # 0xc234
leaq 0x8fbf(%rip), %r8       # 0xc237
cmovaeq %rdx, %r8
cmovbl %eax, %esi
testl %esi, %esi
movl $0xc, %edx
cmovnel %esi, %edx
shrl $0x5, %ecx
andl $0x3f, %ecx
leaq 0xdfba(%rip), %r12      # 0x11250
leaq 0x8f9d(%rip), %rsi      # 0xc23a
movq %r12, %rdi
xorl %eax, %eax
callq 0x2210
testb $0x10, 0xc(%rbx)
leaq 0x91ed(%rip), %r15      # 0xc49f
leaq 0x8fa0(%rip), %rcx      # 0xc259
cmoveq %r15, %rcx
movq (%rbx), %r8
leaq 0x8f81(%rip), %rdi      # 0xc248
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x20e0
testl %ebp, %ebp
je 0x330c
cmpb $0x0, 0xd(%rbx)
je 0x32fb
leaq 0xd(%rbx), %r14
leaq 0x1a(%rbx), %rdi
movq %r14, %rsi
callq 0x2050
testl %eax, %eax
leaq 0x91a8(%rip), %r15      # 0xc49f
cmovneq %r14, %r15
leaq 0x8f5d(%rip), %rdi      # 0xc25f
movq %r15, %rsi
xorl %eax, %eax
callq 0x20e0
addq $0x1a, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2090