LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: prvGenerateRunTimeStatsForTasksInList
static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTime )
	{
	volatile tskTCB *pxNextTCB, *pxFirstTCB;
	unsigned long ulStatsAsPercentage;

		/* Write the run time stats of all the TCB's in pxList into the buffer. */
		listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );
		do
		{
			/* Get next TCB in from the list. */
			listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );

			/* Divide by zero check. */
			if( ulTotalRunTime > 0UL )
			{
				/* Has the task run at all? */
				if( pxNextTCB->ulRunTimeCounter == 0 )
				{
					/* The task has used no CPU time at all. */
					sprintf( pcStatsString, ( char * ) "%s\t\t0\t\t0%%\r\n", pxNextTCB->pcTaskName );
				}
				else
				{
					/* What percentage of the total run time as the task used?
					This will always be rounded down to the nearest integer. */
					ulStatsAsPercentage = ( 100UL * pxNextTCB->ulRunTimeCounter ) / ulTotalRunTime;

					if( ulStatsAsPercentage > 0UL )
					{
						sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
					}
					else
					{
						/* If the percentage is zero here then the task has
						consumed less than 1% of the total run time. */
						sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );
					}
				}

				strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatsString );
			}

		} while( pxNextTCB != pxFirstTCB );
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
movq 0x8(%rsi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsi)
leaq 0x10(%rsi), %rcx
movq %rcx, -0x38(%rbp)
cmpq %rcx, %rax
jne 0x656c
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movq 0x18(%rax), %r15
movq 0x591d(%rip), %r13      # 0xbe98
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq -0x38(%rbp), %rax
jne 0x6595
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movq 0x18(%rax), %r12
testq %rbx, %rbx
je 0x6629
cmpq $0x0, 0x90(%r12)
je 0x65df
imulq $0x64, 0x90(%r12), %rax
cmpq %rbx, %rax
jae 0x65f7
leaq 0x68(%r12), %rdx
movq 0x90(%r12), %rcx
movq %r13, %rdi
leaq 0x2a5d(%rip), %rsi      # 0x9033
xorl %eax, %eax
callq 0x4680
jmp 0x661d
leaq 0x68(%r12), %rdx
movq %r13, %rdi
leaq 0x2a29(%rip), %rsi      # 0x9017
xorl %eax, %eax
callq 0x4680
jmp 0x661d
xorl %edx, %edx
divq %rbx
leaq 0x68(%r12), %rdx
movq 0x90(%r12), %rcx
movq %r13, %rdi
leaq 0x2a11(%rip), %rsi      # 0x9024
movl %eax, %r8d
xorl %eax, %eax
callq 0x4680
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x4650
cmpq %r15, %r12
jne 0x657b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskStartTrace
void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )
	{
		portENTER_CRITICAL();
		{
			pcTraceBuffer = ( signed char * )pcBuffer;
			pcTraceBufferStart = pcBuffer;
			pcTraceBufferEnd = pcBuffer + ( ulBufferSize - tskSIZE_OF_EACH_TRACE_LINE );
			xTracing = pdTRUE;
		}
		portEXIT_CRITICAL();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4320
movq 0x58a6(%rip), %rax      # 0xbf00
movq %r14, (%rax)
movq 0x5974(%rip), %rax      # 0xbfd8
movq %r14, (%rax)
leaq -0x10(%r14,%rbx), %rax
movq 0x5885(%rip), %rcx      # 0xbef8
movq %rax, (%rcx)
movq 0x58db(%rip), %rax      # 0xbf58
movq $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x4480
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: ulTaskEndTrace
unsigned long ulTaskEndTrace( void )
	{
	unsigned long ulBufferLength;

		portENTER_CRITICAL();
			xTracing = pdFALSE;
		portEXIT_CRITICAL();

		ulBufferLength = ( unsigned long ) ( pcTraceBuffer - pcTraceBufferStart );

		return ulBufferLength;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x4320
movq 0x58bb(%rip), %rax      # 0xbf58
movq $0x0, (%rax)
callq 0x4480
movq 0x5850(%rip), %rax      # 0xbf00
movq (%rax), %rax
movq 0x591e(%rip), %rcx      # 0xbfd8
subq (%rcx), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskSwitchContext
void vTaskSwitchContext( void )
{
	if( uxSchedulerSuspended != ( unsigned portBASE_TYPE ) pdFALSE )
	{
		/* The scheduler is currently suspended - do not allow a context
		switch. */
		xMissedYield = pdTRUE;
		return;
	}

	traceTASK_SWITCHED_OUT();

	#if ( configGENERATE_RUN_TIME_STATS == 1 )
	{
		unsigned long ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();

			/* Add the amount of time the task has been running to the accumulated
			time so far.  The time the task started running was stored in
			ulTaskSwitchedInTime.  Note that there is no overflow protection here
			so count values are only valid until the timer overflows.  Generally
			this will be about 1 hour assuming a 1uS timer increment. */
			pxCurrentTCB->ulRunTimeCounter += ( ulTempCounter - ulTaskSwitchedInTime );
			ulTaskSwitchedInTime = ulTempCounter;
	}
	#endif

	taskFIRST_CHECK_FOR_STACK_OVERFLOW();
	taskSECOND_CHECK_FOR_STACK_OVERFLOW();

	/* Find the highest priority queue that contains ready tasks. */
	while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopReadyPriority ] ) ) )
	{
		--uxTopReadyPriority;
	}

	/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the tasks of the
	same priority get an equal share of the processor time. */
	listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopReadyPriority ] ) );

	traceTASK_SWITCHED_IN();
	vWriteTraceToBuffer();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x5663(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x691b
movq 0x55c6(%rip), %rax      # 0xbed8
movq $0x1, (%rax)
popq %rbp
retq
callq 0x4470
movq 0x5611(%rip), %rdx      # 0xbf38
movq %rax, %rsi
subq (%rdx), %rsi
movq 0x567c(%rip), %rcx      # 0xbfb0
movq (%rcx), %rdi
addq %rsi, 0x90(%rdi)
movq %rax, (%rdx)
movq 0x5580(%rip), %rdx      # 0xbec8
movq (%rdx), %rax
leaq (%rax,%rax,4), %rsi
movq 0x55ba(%rip), %rax      # 0xbf10
cmpq $0x0, (%rax,%rsi,8)
jne 0x6969
decq (%rdx)
movq (%rdx), %rsi
leaq (%rsi,%rsi,4), %rsi
jmp 0x6956
movq (%rdx), %rdx
leaq (%rdx,%rdx,4), %rdi
leaq (%rax,%rdi,8), %rdx
movq 0x8(%rdx), %rsi
movq 0x8(%rsi), %rsi
movq %rsi, 0x8(%rdx)
leaq (%rax,%rdi,8), %rax
addq $0x10, %rax
cmpq %rax, %rsi
jne 0x6995
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdx)
movq 0x8(%rdx), %rax
movq 0x18(%rax), %rax
movq %rax, (%rcx)
movq 0x55b1(%rip), %rdx      # 0xbf58
cmpq $0x0, (%rdx)
je 0x6919
movq 0x5570(%rip), %rax      # 0xbf28
movq (%rax), %rsi
movq (%rcx), %rdi
cmpq 0x78(%rdi), %rsi
je 0x6919
movq 0x5531(%rip), %rsi      # 0xbf00
movq (%rsi), %rdi
addq $0x10, %rdi
movq 0x551b(%rip), %r8       # 0xbef8
cmpq (%r8), %rdi
jae 0x6a11
movq (%rcx), %rcx
movq 0x78(%rcx), %rcx
movq %rcx, (%rax)
movq 0x54ed(%rip), %rcx      # 0xbee0
movl (%rcx), %ecx
movq (%rsi), %rdx
movq %rcx, (%rdx)
addq $0x8, (%rsi)
movq (%rax), %rax
movq (%rsi), %rcx
movq %rax, (%rcx)
addq $0x8, (%rsi)
jmp 0x6919
movq $0x0, (%rdx)
jmp 0x6919
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: xTaskCheckForTimeOut
portBASE_TYPE xTaskCheckForTimeOut( xTimeOutType * const pxTimeOut, portTickType * const pxTicksToWait )
{
portBASE_TYPE xReturn;

	portENTER_CRITICAL();
	{
		#if ( INCLUDE_vTaskSuspend == 1 )
			/* If INCLUDE_vTaskSuspend is set to 1 and the block time specified is
			the maximum block time then the task should block indefinitely, and
			therefore never time out. */
			if( *pxTicksToWait == portMAX_DELAY )
			{
				xReturn = pdFALSE;
			}
			else /* We are not blocking indefinitely, perform the checks below. */
		#endif

		if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( ( portTickType ) xTickCount >= ( portTickType ) pxTimeOut->xTimeOnEntering ) )
		{
			/* The tick count is greater than the time at which vTaskSetTimeout()
			was called, but has also overflowed since vTaskSetTimeOut() was called.
			It must have wrapped all the way around and gone past us again. This
			passed since vTaskSetTimeout() was called. */
			xReturn = pdTRUE;
		}
		else if( ( ( portTickType ) ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) ) < ( portTickType ) *pxTicksToWait )
		{
			/* Not a genuine timeout. Adjust parameters for time remaining. */
			*pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );
			vTaskSetTimeOutState( pxTimeOut );
			xReturn = pdFALSE;
		}
		else
		{
			xReturn = pdTRUE;
		}
	}
	portEXIT_CRITICAL();

	return xReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4320
movl (%r14), %eax
cmpl $-0x1, %eax
je 0x6bb2
movq 0x547c(%rip), %rcx      # 0xbfe8
movq (%rcx), %rdx
cmpq (%rbx), %rdx
je 0x6b88
movq 0x5365(%rip), %rdx      # 0xbee0
movl (%rdx), %edx
movl $0x1, %r15d
cmpl 0x8(%rbx), %edx
jae 0x6bb5
movq 0x5351(%rip), %rdx      # 0xbee0
movl (%rdx), %edi
movl 0x8(%rbx), %esi
subl %esi, %edi
movl $0x1, %r15d
cmpl %eax, %edi
jae 0x6bb5
addl %eax, %esi
subl (%rdx), %esi
movl %esi, (%r14)
movq (%rcx), %rax
movq %rax, (%rbx)
movl (%rdx), %eax
movl %eax, 0x8(%rbx)
xorl %r15d, %r15d
callq 0x4480
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: prvCheckTasksWaitingTermination
static void prvCheckTasksWaitingTermination( void )
{
	#if ( INCLUDE_vTaskDelete == 1 )
	{
		portBASE_TYPE xListIsEmpty;

		/* ucTasksDeleted is used to prevent vTaskSuspendAll() being called
		too often in the idle task. */
		if( uxTasksDeleted > ( unsigned portBASE_TYPE ) 0 )
		{
			vTaskSuspendAll();
				xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );
			xTaskResumeAll();

			if( !xListIsEmpty )
			{
				tskTCB *pxTCB;

				portENTER_CRITICAL();
				{
					pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xTasksWaitingTermination ) );
					vListRemove( &( pxTCB->xGenericListItem ) );
					--uxCurrentNumberOfTasks;
					--uxTasksDeleted;
				}
				portEXIT_CRITICAL();

				prvDeleteTCB( pxTCB );
			}
		}
	}
	#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x52a3(%rip), %r14      # 0xbe90
cmpq $0x0, (%r14)
je 0x6c57
movq 0x536e(%rip), %rax      # 0xbf68
incq (%rax)
movq 0x5384(%rip), %rbx      # 0xbf88
movq (%rbx), %r15
callq 0x4080
testq %r15, %r15
je 0x6c57
callq 0x4320
movq (%rbx), %rax
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x530f(%rip), %rax      # 0xbf40
decq (%rax)
decq (%r14)
callq 0x4480
movq 0x60(%rbx), %rdi
callq 0x4190
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4190
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: usTaskCheckFreeStackSpace
static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )
	{
	register unsigned short usCount = 0;

		while( *pucStackByte == tskSTACK_FILL_BYTE )
		{
			pucStackByte -= portSTACK_GROWTH;
			usCount++;
		}

		usCount /= sizeof( portSTACK_TYPE );

		return usCount;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $-0x5b, (%rdi)
jne 0x6c80
xorl %eax, %eax
cmpb $-0x5b, 0x1(%rdi,%rax)
leaq 0x1(%rax), %rax
je 0x6c6d
movzwl %ax, %eax
shrl $0x3, %eax
jmp 0x6c82
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskPriorityInherit
void vTaskPriorityInherit( xTaskHandle * const pxMutexHolder )
	{
	tskTCB * const pxTCB = ( tskTCB * ) pxMutexHolder;

		if( pxTCB->uxPriority < pxCurrentTCB->uxPriority )
		{
			/* Adjust the mutex holder state to account for its new priority. */
			listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) pxCurrentTCB->uxPriority );

			/* If the task being modified is in the ready state it will need to
			be moved in to a new list. */
			if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xGenericListItem ) ) )
			{
				vListRemove( &( pxTCB->xGenericListItem ) );

				/* Inherit the priority before being moved into the new list. */
				pxTCB->uxPriority = pxCurrentTCB->uxPriority;
				prvAddTaskToReadyQueue( pxTCB );
			}
			else
			{
				/* Just inherit the priority. */
				pxTCB->uxPriority = pxCurrentTCB->uxPriority;
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x58(%rdi), %rax
movq 0x52d9(%rip), %r15      # 0xbfb0
movq (%r15), %rcx
cmpq 0x58(%rcx), %rax
jae 0x6d11
movq %rdi, %rbx
movq (%r15), %rcx
movl $0xa, %edx
subl 0x58(%rcx), %edx
movl %edx, 0x30(%rdi)
leaq (%rax,%rax,4), %rax
shlq $0x3, %rax
addq 0x5210(%rip), %rax      # 0xbf10
cmpq %rax, 0x28(%rdi)
je 0x6d1c
movq (%r15), %rax
movq 0x58(%rax), %rax
movq %rax, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
movq (%r15), %rax
movq 0x58(%rax), %rax
movq %rax, 0x58(%rbx)
movq 0x518e(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x6d42
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x51bf(%rip), %rdi      # 0xbf10
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4730
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskPriorityDisinherit
void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder )
	{
	tskTCB * const pxTCB = ( tskTCB * ) pxMutexHolder;

		if( pxMutexHolder != NULL )
		{
			if( pxTCB->uxPriority != pxTCB->uxBasePriority )
			{
				/* We must be the running task to be able to give the mutex back.
				Remove ourselves from the ready list we currently appear in. */
				vListRemove( &( pxTCB->xGenericListItem ) );

				/* Disinherit the priority before adding ourselves into the new
				ready list. */
				pxTCB->uxPriority = pxTCB->uxBasePriority;
				listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) pxTCB->uxPriority );
				prvAddTaskToReadyQueue( pxTCB );
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x6d7f
movq %rdi, %r14
movq 0x58(%rdi), %rax
cmpq 0x80(%rdi), %rax
jne 0x6d84
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8(%r14), %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x80(%r14), %rax
movq %rax, 0x58(%r14)
movl $0xa, %ecx
subl %eax, %ecx
movl %ecx, 0x30(%r14)
movq 0x511b(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x6db5
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x514c(%rip), %rdi      # 0xbf10
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x4730
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/MemMang/heap_3.c
// Function: vPortFree
void vPortFree( void *pv )
{
	if( pv )
	{
		vTaskSuspendAll();
		{
			free( pv );
		}
		xTaskResumeAll();
	}
}

// Assembly:
testq %rdi, %rdi
je 0x6e1e
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4620
movq %rbx, %rdi
callq 0x4060
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4080
retq
nop
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: pxPortInitialiseStack
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
/* Should actually keep this struct on the stack. */
xParams *pxThisThreadParams = pvPortMalloc( sizeof( xParams ) );

	(void)pthread_once( &hSigSetupThread, prvSetupSignalsAndSchedulerPolicy );

	if ( (pthread_t)NULL == hMainThread )
	{
		hMainThread = pthread_self();
	}

	/* No need to join the threads. */
	pthread_attr_init( &xThreadAttributes );
	pthread_attr_setdetachstate( &xThreadAttributes, PTHREAD_CREATE_DETACHED );

	/* Add the task parameters. */
	pxThisThreadParams->pxCode = pxCode;
	pxThisThreadParams->pvParams = pvParameters;

	vPortEnterCritical();

	lIndexOfLastAddedTask = prvGetFreeThreadState();

	/* Create the new pThread. */
	if ( 0 == pthread_mutex_lock( &xSingleThreadMutex ) )
	{
		xSentinel = 0;
		if ( 0 != pthread_create( &( pxThreads[ lIndexOfLastAddedTask ].hThread ), &xThreadAttributes, prvWaitForStart, (void *)pxThisThreadParams ) )
		{
			/* Thread create failed, signal the failure */
			pxTopOfStack = 0;
		}

		/* Wait until the task suspends. */
		(void)pthread_mutex_unlock( &xSingleThreadMutex );
		while ( xSentinel == 0 );
		vPortExitCritical();
	}

	return pxTopOfStack;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x10, %edi
callq 0x42e0
movq %rax, %r14
leaq 0x5a1d(%rip), %rdi      # 0xc868
leaq 0x10f(%rip), %rsi       # 0x6f61
callq 0x4750
cmpq $0x0, 0x5a11(%rip)      # 0xc870
jne 0x6e6d
callq 0x4550
movq %rax, 0x5a03(%rip)      # 0xc870
leaq 0x5a04(%rip), %r13      # 0xc878
movq %r13, %rdi
callq 0x42b0
movq %r13, %rdi
movl $0x1, %esi
callq 0x43b0
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movq $0x0, 0x5545(%rip) # 0xc3e0
incq 0x5a4e(%rip)            # 0xc8f0
xorl %eax, %eax
movq 0x5a3d(%rip), %rcx      # 0xc8e8
cmpq $0x0, (%rcx)
je 0x6ec3
incq %rax
addq $0x18, %rcx
cmpq $0x40, %rax
jne 0x6eab
movl $0x40, %eax
cmpl $0x40, %eax
jne 0x6edb
leaq 0x224f(%rip), %rdi      # 0x911e
callq 0x40c0
callq 0x44a0
xorl %eax, %eax
movl %eax, 0x59cf(%rip)      # 0xc8b0
leaq 0x59d0(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
jne 0x6f4f
movq $0x0, 0x59e4(%rip) # 0xc8e0
movslq 0x59ad(%rip), %rax      # 0xc8b0
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0x59d6(%rip), %rdi      # 0xc8e8
leaq 0x595f(%rip), %rsi      # 0xc878
leaq 0x166(%rip), %rdx       # 0x7086
movq %r14, %rcx
callq 0x4530
movl %eax, %r14d
leaq 0x5986(%rip), %rdi      # 0xc8b8
callq 0x43e0
cmpq $0x0, 0x59a1(%rip)      # 0xc8e0
je 0x6f37
xorl %eax, %eax
testl %r14d, %r14d
cmovneq %rax, %rbx
callq 0x4480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvSetupSignalsAndSchedulerPolicy
void prvSetupSignalsAndSchedulerPolicy( void )
{
/* The following code would allow for configuring the scheduling of this task as a Real-time task.
 * The process would then need to be run with higher privileges for it to take affect.
int iPolicy;
int iResult;
int iSchedulerPriority;
	iResult = pthread_getschedparam( pthread_self(), &iPolicy, &iSchedulerPriority );
	iResult = pthread_attr_setschedpolicy( &xThreadAttributes, SCHED_FIFO );
	iPolicy = SCHED_FIFO;
	iResult = pthread_setschedparam( pthread_self(), iPolicy, &iSchedulerPriority );		*/

struct sigaction sigsuspendself, sigresume, sigtick;
portLONG lIndex;

	pxThreads = ( xThreadState *)pvPortMalloc( sizeof( xThreadState ) * MAX_NUMBER_OF_TASKS );
	for ( lIndex = 0; lIndex < MAX_NUMBER_OF_TASKS; lIndex++ )
	{
		pxThreads[ lIndex ].hThread = ( pthread_t )NULL;
		pxThreads[ lIndex ].hTask = ( xTaskHandle )NULL;
		pxThreads[ lIndex ].uxCriticalNesting = 0;
	}

	sigsuspendself.sa_flags = 0;
	sigsuspendself.sa_handler = prvSuspendSignalHandler;
	sigfillset( &sigsuspendself.sa_mask );

	sigresume.sa_flags = 0;
	sigresume.sa_handler = prvResumeSignalHandler;
	sigfillset( &sigresume.sa_mask );

	sigtick.sa_flags = 0;
	sigtick.sa_handler = vPortSystemTickHandler;
	sigfillset( &sigtick.sa_mask );

	if ( 0 != sigaction( SIG_SUSPEND, &sigsuspendself, NULL ) )
	{
		printf( "Problem installing SIG_SUSPEND_SELF\n" );
	}
	if ( 0 != sigaction( SIG_RESUME, &sigresume, NULL ) )
	{
		printf( "Problem installing SIG_RESUME\n" );
	}
	if ( 0 != sigaction( SIG_TICK, &sigtick, NULL ) )
	{
		printf( "Problem installing SIG_TICK\n" );
	}
	printf( "Running as PID: %d\n", getpid() );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl $0x600, %edi            # imm = 0x600
callq 0x42e0
movq %rax, 0x596a(%rip)      # 0xc8e8
xorl %ebx, %ebx
movl $0x600, %edx            # imm = 0x600
movq %rax, %rdi
xorl %esi, %esi
callq 0x41e0
leaq -0x1c8(%rbp), %rdi
movl %ebx, 0x80(%rdi)
leaq 0x8c7(%rip), %rax       # 0x786a
movq %rax, -0x8(%rdi)
callq 0x4340
leaq -0x130(%rbp), %rdi
movl %ebx, 0x80(%rdi)
leaq 0x93f(%rip), %rax       # 0x78ff
movq %rax, -0x8(%rdi)
callq 0x4340
leaq -0x98(%rbp), %rdi
movl %ebx, 0x80(%rdi)
movq 0x4f13(%rip), %rax      # 0xbef0
movq %rax, -0x8(%rdi)
callq 0x4340
leaq -0x1d0(%rbp), %rsi
movl $0xa, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x7009
leaq 0x20bc(%rip), %rdi      # 0x90c0
callq 0x40c0
leaq -0x138(%rbp), %rsi
movl $0xc, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x702c
leaq 0x20bd(%rip), %rdi      # 0x90e4
callq 0x40c0
leaq -0xa0(%rbp), %rsi
movl $0xe, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x704f
leaq 0x20b8(%rip), %rdi      # 0x9102
callq 0x40c0
callq 0x4120
leaq 0x2045(%rip), %rdi      # 0x90a0
movl %eax, %esi
xorl %eax, %eax
callq 0x4170
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvWaitForStart
void *prvWaitForStart( void * pvParams )
{
xParams * pxParams = ( xParams * )pvParams;
pdTASK_CODE pvCode = pxParams->pxCode;
void * pParams = pxParams->pvParams;
	vPortFree( pvParams );

	pthread_cleanup_push( prvDeleteThread, (void *)pthread_self() );

	if ( 0 == pthread_mutex_lock( &xSingleThreadMutex ) )
	{
		prvSuspendThread( pthread_self() );
	}

	pvCode( pParams );

	pthread_cleanup_pop( 1 );
	return (void *)NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq (%rdi), %r15
movq 0x8(%rdi), %r14
callq 0x4190
callq 0x4550
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x4710
testl %eax, %eax
jne 0x70fb
leaq -0x80(%rbp), %rdi
callq 0x46a0
leaq 0x57f2(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
jne 0x70d7
movq %rbx, %rdi
callq 0x74a0
movq %r14, %rdi
callq *%r15
leaq -0x80(%rbp), %rdi
callq 0x41c0
movq %rbx, %rdi
callq 0x7816
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x7816
leaq -0x80(%rbp), %rdi
callq 0x44c0
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortStartFirstTask
void vPortStartFirstTask( void )
{
	/* Initialise the critical nesting count ready for the first task. */
	uxCriticalNesting = 0;

	/* Start the first task. */
	vPortEnableInterrupts();

	/* Start the first task. */
	prvResumeThread( prvGetThreadHandle( xTaskGetCurrentTaskHandle() ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq $0x0, 0x578b(%rip) # 0xc8f0
movq $0x1, 0x5270(%rip) # 0xc3e0
callq 0x40d0
movl $0x8, %ecx
movq 0x5767(%rip), %rdx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rdx,%rcx)
je 0x7198
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x7183
jmp 0x719d
movq -0x8(%rdx,%rcx), %rdi
popq %rbp
jmp 0x71b1
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: prvResumeThread
void prvResumeThread( pthread_t xThreadId )
{
portBASE_TYPE xResult;
	if ( 0 == pthread_mutex_lock( &xSuspendResumeThreadMutex ) )
	{
		if ( pthread_self() != xThreadId )
		{
			xResult = pthread_kill( xThreadId, SIG_RESUME );
		}
		xResult = pthread_mutex_unlock( &xSuspendResumeThreadMutex );
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x573f(%rip), %rdi      # 0xc900
callq 0x4770
testl %eax, %eax
je 0x71d1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x4550
cmpq %rbx, %rax
je 0x71e8
movq %rbx, %rdi
movl $0xc, %esi
callq 0x42d0
leaq 0x5711(%rip), %rdi      # 0xc900
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x43e0
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: xPortStartScheduler
portBASE_TYPE xPortStartScheduler( void )
{
portBASE_TYPE xResult;
int iSignal;
sigset_t xSignals;
sigset_t xSignalToBlock;
sigset_t xSignalsBlocked;
portLONG lIndex;

	/* Establish the signals to block before they are needed. */
	sigfillset( &xSignalToBlock );

	/* Block until the end */
	(void)pthread_sigmask( SIG_SETMASK, &xSignalToBlock, &xSignalsBlocked );

	for ( lIndex = 0; lIndex < MAX_NUMBER_OF_TASKS; lIndex++ )
	{
		pxThreads[ lIndex ].uxCriticalNesting = 0;
	}

	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();

	/* Start the first task. Will not return unless all threads are killed. */
	vPortStartFirstTask();

	/* This is the end signal we are looking for. */
	sigemptyset( &xSignals );
	sigaddset( &xSignals, SIG_RESUME );

	while ( pdTRUE != xSchedulerEnd )
	{
		if ( 0 != sigwait( &xSignals, &iSignal ) )
		{
			printf( "Main thread spurious signal: %d\n", iSignal );
		}
	}

	printf( "Cleaning Up, Exiting.\n" );
	/* Cleanup the mutexes */
	xResult = pthread_mutex_destroy( &xSuspendResumeThreadMutex );
	xResult = pthread_mutex_destroy( &xSingleThreadMutex );
	vPortFree( (void *)pxThreads );

	/* Should not get here! */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
leaq -0x1b8(%rbp), %rbx
movq %rbx, %rdi
callq 0x4340
leaq -0x138(%rbp), %rdx
movl $0x2, %edi
movq %rbx, %rsi
callq 0x44b0
movl $0x10, %eax
movq 0x56af(%rip), %rcx      # 0xc8e8
movq $0x0, (%rcx,%rax)
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7239
leaq -0xb8(%rbp), %rsi
xorl %edi, %edi
callq 0x4600
testl %eax, %eax
je 0x7268
leaq 0x1f01(%rip), %rdi      # 0x9167
jmp 0x729b
xorl %eax, %eax
leaq -0xb8(%rbp), %rsi
movq %rax, (%rsi)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rcx, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
leaq -0x38(%rbp), %rdx
xorl %edi, %edi
callq 0x44e0
testl %eax, %eax
je 0x72a0
leaq 0x1edf(%rip), %rdi      # 0x917a
callq 0x40c0
callq 0x4460
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x42f0
movq %rbx, %rdi
movl $0xc, %esi
callq 0x4760
movq 0x5630(%rip), %rax      # 0xc8f8
cmpq $0x1, %rax
je 0x7302
leaq -0x38(%rbp), %r14
leaq 0x1d69(%rip), %r15      # 0x9042
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4630
testl %eax, %eax
je 0x72f5
movl -0x38(%rbp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x4170
movq 0x55fc(%rip), %rax      # 0xc8f8
cmpq $0x1, %rax
jne 0x72d9
leaq 0x1e48(%rip), %rdi      # 0x9151
callq 0x40c0
leaq 0x55eb(%rip), %rdi      # 0xc900
callq 0x41a0
leaq 0x5597(%rip), %rdi      # 0xc8b8
callq 0x41a0
movq 0x55bb(%rip), %rdi      # 0xc8e8
callq 0x4190
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortEndScheduler
void vPortEndScheduler( void )
{
portBASE_TYPE xNumberOfThreads;
portBASE_TYPE xResult;
	for ( xNumberOfThreads = 0; xNumberOfThreads < MAX_NUMBER_OF_TASKS; xNumberOfThreads++ )
	{
		if ( ( pthread_t )NULL != pxThreads[ xNumberOfThreads ].hThread )
		{
			/* Kill all of the threads, they are in the detached state. */
			xResult = pthread_cancel( pxThreads[ xNumberOfThreads ].hThread );
		}
	}

	/* Signal the scheduler to exit its loop. */
	xSchedulerEnd = pdTRUE;
	(void)pthread_kill( hMainThread, SIG_RESUME );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movq 0x5597(%rip), %rax      # 0xc8e8
movq (%rax,%rbx), %rdi
testq %rdi, %rdi
je 0x735f
callq 0x4720
addq $0x18, %rbx
cmpq $0x600, %rbx            # imm = 0x600
jne 0x734a
movq $0x1, 0x5581(%rip) # 0xc8f8
movq 0x54f2(%rip), %rdi      # 0xc870
movl $0xc, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x42d0
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/portable/GCC/Posix/port.c
// Function: vPortYield
void vPortYield( void )
{
pthread_t xTaskToSuspend;
pthread_t xTaskToResume;

	if ( 0 == pthread_mutex_lock( &xSingleThreadMutex ) )
	{
		xTaskToSuspend = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );

		vTaskSwitchContext();

		xTaskToResume = prvGetThreadHandle( xTaskGetCurrentTaskHandle() );
		if ( xTaskToSuspend != xTaskToResume )
		{
			/* Remember and switch the critical nesting. */
			prvSetTaskCriticalNesting( xTaskToSuspend, uxCriticalNesting );
			uxCriticalNesting = prvGetTaskCriticalNesting( xTaskToResume );
			/* Switch tasks. */
			prvResumeThread( xTaskToResume );
			prvSuspendThread( xTaskToSuspend );
		}
		else
		{
			/* Yielding to self */
			(void)pthread_mutex_unlock( &xSingleThreadMutex );
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x54fb(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
je 0x73cd
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x40d0
movl $0x8, %ecx
movq 0x550a(%rip), %rdx      # 0xc8e8
xorl %ebx, %ebx
cmpq %rax, (%rdx,%rcx)
je 0x73f5
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x73e0
jmp 0x73fa
movq -0x8(%rdx,%rcx), %rbx
callq 0x46e0
callq 0x40d0
movl $0x8, %edx
movq 0x54d8(%rip), %rcx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rcx,%rdx)
je 0x7427
addq $0x18, %rdx
cmpq $0x608, %rdx            # imm = 0x608
jne 0x7412
jmp 0x742c
movq -0x8(%rcx,%rdx), %rdi
cmpq %rdi, %rbx
jne 0x7443
leaq 0x5480(%rip), %rdi      # 0xc8b8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x43e0
movl $0x10, %eax
movq 0x54a1(%rip), %rdx      # 0xc8f0
cmpq %rbx, -0x10(%rcx,%rax)
je 0x7464
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x744f
jmp 0x7468
movq %rdx, (%rcx,%rax)
movl $0x10, %edx
xorl %eax, %eax
cmpq %rdi, -0x10(%rcx,%rdx)
je 0x7485
addq $0x18, %rdx
cmpq $0x610, %rdx            # imm = 0x610
jne 0x746f
jmp 0x7489
movq (%rcx,%rdx), %rax
movq %rax, 0x5460(%rip)      # 0xc8f0
callq 0x71b1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x74a0
// File: /workspace/github_c_makefile_star2_O1/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 0x5450(%rip), %rdi      # 0xc900
callq 0x4770
testl %eax, %eax
je 0x74c0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq $0x0, 0x5415(%rip) # 0xc8e0
leaq 0x542e(%rip), %rdi      # 0xc900
callq 0x43e0
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
cmpq $0x0, 0x53f4(%rip)      # 0xc8e0
jne 0x74b9
movq 0x543b(%rip), %rax      # 0xc930
cmpq $0x1, %rax
je 0x74b9
callq 0x4280
jmp 0x74e4
// File: /workspace/github_c_makefile_star2_O1/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 0x4eb2(%rip), %rax      # 0xc3e0
cmpq $0x1, %rax
jne 0x7541
movq 0x53f5(%rip), %rax      # 0xc930
cmpq $0x1, %rax
jne 0x754d
movq $0x1, 0x53dc(%rip) # 0xc928
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x535e(%rip), %rdi      # 0xc8b8
callq 0x4260
testl %eax, %eax
je 0x7573
movq $0x1, 0x53ba(%rip) # 0xc928
jmp 0x765a
movq $0x1, 0x53b2(%rip) # 0xc930
callq 0x40d0
movl $0x8, %ecx
movq 0x5359(%rip), %rdx      # 0xc8e8
xorl %ebx, %ebx
cmpq %rax, (%rdx,%rcx)
je 0x75a6
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x7591
jmp 0x75ab
movq -0x8(%rdx,%rcx), %rbx
callq 0x43d0
callq 0x46e0
callq 0x40d0
movl $0x8, %edx
movq 0x5322(%rip), %rcx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rcx,%rdx)
je 0x75dd
addq $0x18, %rdx
cmpq $0x608, %rdx            # imm = 0x608
jne 0x75c8
jmp 0x75e2
movq -0x8(%rcx,%rdx), %rdi
cmpq %rdi, %rbx
jne 0x75f5
leaq 0x52ca(%rip), %rdi      # 0xc8b8
callq 0x43e0
jmp 0x764f
movl $0x10, %eax
movq 0x52ef(%rip), %rdx      # 0xc8f0
cmpq %rbx, -0x10(%rcx,%rax)
je 0x7616
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7601
jmp 0x761a
movq %rdx, (%rcx,%rax)
movl $0x10, %edx
xorl %eax, %eax
cmpq %rdi, -0x10(%rcx,%rdx)
je 0x7637
addq $0x18, %rdx
cmpq $0x610, %rdx            # imm = 0x610
jne 0x7621
jmp 0x763b
movq (%rcx,%rdx), %rax
movq %rax, 0x52ae(%rip)      # 0xc8f0
callq 0x71b1
movq %rbx, %rdi
callq 0x74a0
movq $0x0, 0x52d6(%rip) # 0xc930
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5246(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
je 0x7680
popq %rbx
popq %r14
popq %rbp
retq
movl $0x8, %eax
movq 0x525c(%rip), %rcx      # 0xc8e8
xorl %ebx, %ebx
cmpq %r14, (%rcx,%rax)
je 0x76a2
addq $0x18, %rax
cmpq $0x608, %rax            # imm = 0x608
jne 0x768e
jmp 0x76a7
movq -0x8(%rcx,%rax), %rbx
callq 0x40d0
movl $0x8, %ecx
movq 0x5230(%rip), %rdx      # 0xc8e8
xorl %r14d, %r14d
cmpq %rax, (%rdx,%rcx)
je 0x76d0
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x76bb
jmp 0x76d5
movq -0x8(%rdx,%rcx), %r14
cmpq %rbx, %r14
jne 0x770d
callq 0x46e0
callq 0x40d0
movl $0x8, %ecx
movq 0x51f8(%rip), %rdx      # 0xc8e8
xorl %r14d, %r14d
cmpq %rax, (%rdx,%rcx)
je 0x7708
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x76f3
jmp 0x770d
movq -0x8(%rdx,%rcx), %r14
callq 0x4550
cmpq %rbx, %rax
je 0x7739
testq %rbx, %rbx
je 0x7729
callq 0x4330
movq %rbx, %rdi
callq 0x4720
leaq 0x5188(%rip), %rdi      # 0xc8b8
popq %rbx
popq %r14
popq %rbp
jmp 0x43e0
movq %r14, %rdi
callq 0x71b1
movq $0x0, 0x51a4(%rip) # 0xc8f0
movq $0x1, 0x4c89(%rip) # 0xc3e0
leaq 0x515a(%rip), %rdi      # 0xc8b8
callq 0x43e0
movl $0x1, %edi
callq 0x43f0
// File: /workspace/github_c_makefile_star2_O1/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 0x5170(%rip), %rax      # 0xc8e8
movslq 0x5131(%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 0x5118(%rip), %rsi      # 0xc8b0
leaq (%rsi,%rsi,2), %rsi
cmpq (%rax,%rsi,8), %rdx
jne 0x77c8
movq 0x8(%rax,%rcx), %rdx
movslq 0x5102(%rip), %rsi      # 0xc8b0
leaq (%rsi,%rsi,2), %rsi
cmpq 0x8(%rax,%rsi,8), %rdx
je 0x77c8
leaq (%rax,%rcx), %rdx
movups %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
addq $0x18, %rcx
cmpq $0x600, %rcx            # imm = 0x600
jne 0x778d
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x50c2(%rip), %rcx      # 0xc8e8
cmpq %rdi, -0x10(%rcx,%rax)
je 0x783b
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7826
jmp 0x7868
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%rcx,%rax)
cmpq $0x0, (%rcx,%rax)
je 0x7860
movq $0x0, 0x509b(%rip) # 0xc8f0
movq $0x1, 0x4b80(%rip) # 0xc3e0
movq $0x0, (%rcx,%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x5040(%rip) # 0xc8e0
leaq 0x5011(%rip), %rdi      # 0xc8b8
callq 0x43e0
testl %eax, %eax
je 0x78bc
leaq 0x18d6(%rip), %rdi      # 0x918d
callq 0x40c0
leaq -0x90(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x4630
testl %eax, %eax
je 0x78e1
movl -0xc(%rbp), %esi
leaq 0x17da(%rip), %rdi      # 0x90b4
xorl %eax, %eax
callq 0x4170
xorl %eax, %eax
cmpq $0x0, 0x5005(%rip)      # 0xc8f0
sete %al
movq %rax, 0x4aeb(%rip)      # 0xc3e0
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1873(%rip), %rdi      # 0x91ac
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4170
movq 0x4576(%rip), %rax      # 0xbec0
movq (%rax), %rdi
callq 0x4410
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O1/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 0x183c(%rip), %rdi      # 0x91af
leaq 0x185d(%rip), %rsi      # 0x91d7
callq 0x45d0
testq %rax, %rax
je 0x79c3
movq %rax, %rbx
movq %r14, %rdi
callq 0x4160
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x4690
leaq 0x1812(%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_O1/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 0x17f1(%rip), %rdi      # 0x91d9
leaq 0x17f4(%rip), %rsi      # 0x91e3
callq 0x45d0
testq %rax, %rax
je 0x7a17
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_O1/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 0x7a76
movq %rdx, %r15
movl %edi, %r14d
leaq 0x4ef0(%rip), %rax      # 0xc938
movq %rax, %r12
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0x7a48
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_O1/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 0x4ebb(%rip), %eax      # 0xc958
cmpl $0x1, %eax
je 0x7b10
movq 0x44ff(%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 0x7b06
leaq 0x170d(%rip), %rdi      # 0x920c
callq 0x40c0
jmp 0x7b10
movl $0x1, 0x4e48(%rip)      # 0xc958
callq 0x4120
movl %ebx, %edi
movl $0x8, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4110
testl %eax, %eax
je 0x7b3e
callq 0x40a0
movl (%rax), %esi
leaq 0x16af(%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 0x7b6a
callq 0x40a0
movl (%rax), %esi
leaq 0x1696(%rip), %rdi      # 0x91f9
xorl %eax, %eax
callq 0x4170
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq