LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskDelete
void vTaskDelete( xTaskHandle pxTaskToDelete )
	{
	tskTCB *pxTCB;

		portENTER_CRITICAL();
		{
			/* Ensure a yield is performed if the current task is being
			deleted. */
			if( pxTaskToDelete == pxCurrentTCB )
			{
				pxTaskToDelete = NULL;
			}

			/* If null is passed in here then we are deleting ourselves. */
			pxTCB = prvGetTCBFromHandle( pxTaskToDelete );

			/* Remove task from the ready list and place in the	termination list.
			This will stop the task from be scheduled.  The idle task will check
			the termination list and free up any memory allocated by the
			scheduler for the TCB and stack. */
			vListRemove( &( pxTCB->xGenericListItem ) );

			/* Is the task waiting on an event also? */
			if( pxTCB->xEventListItem.pvContainer )
			{
				vListRemove( &( pxTCB->xEventListItem ) );
			}

			vListInsertEnd( ( xList * ) &xTasksWaitingTermination, &( pxTCB->xGenericListItem ) );

			/* Increment the ucTasksDeleted variable so the idle task knows
			there is a task that has been deleted and that it should therefore
			check the xTasksWaitingTermination list. */
			++uxTasksDeleted;

			/* Increment the uxTaskNumberVariable also so kernel aware debuggers
			can detect that the task lists need re-generating. */
			uxTaskNumber++;

			traceTASK_DELETE( pxTCB );
		}
		portEXIT_CRITICAL();

		/* Force a reschedule if we have just deleted the current task. */
		if( xSchedulerRunning != pdFALSE )
		{
			if( ( void * ) pxTaskToDelete == NULL )
			{
				portYIELD_WITHIN_API();
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4320
movq 0x650c(%rip), %rax      # 0xbfb0
movq (%rax), %rcx
cmpq %rbx, %rcx
sete %cl
testq %rbx, %rbx
sete %r15b
orb %cl, %r15b
cmpb $0x1, %r15b
jne 0x5ac0
movq (%rax), %rbx
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
cmpq $0x0, 0x50(%rbx)
je 0x5adc
leaq 0x30(%rbx), %rdi
callq 0x4040
movq 0x64a5(%rip), %rdi      # 0xbf88
movq %r14, %rsi
callq 0x4730
movq 0x639e(%rip), %rax      # 0xbe90
incq (%rax)
movq 0x6434(%rip), %rax      # 0xbf30
incq (%rax)
movq %rbx, %rdi
callq 0x45a0
callq 0x4480
movq 0x643d(%rip), %rax      # 0xbf50
cmpq $0x0, (%rax)
sete %al
xorb $0x1, %r15b
addq $0x8, %rsp
orb %al, %r15b
jne 0x5b32
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4540
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: uxTaskPriorityGet
unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask )
	{
	tskTCB *pxTCB;
	unsigned portBASE_TYPE uxReturn;

		portENTER_CRITICAL();
		{
			/* If null is passed in here then we are changing the
			priority of the calling function. */
			pxTCB = prvGetTCBFromHandle( pxTask );
			uxReturn = pxTCB->uxPriority;
		}
		portEXIT_CRITICAL();

		return uxReturn;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4320
testq %rbx, %rbx
jne 0x5dbc
movq 0x61f7(%rip), %rax      # 0xbfb0
movq (%rax), %rbx
movq 0x58(%rbx), %rbx
callq 0x4480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskSuspend
void vTaskSuspend( xTaskHandle pxTaskToSuspend )
	{
	tskTCB *pxTCB;

		portENTER_CRITICAL();
		{
			/* Ensure a yield is performed if the current task is being
			suspended. */
			if( pxTaskToSuspend == pxCurrentTCB )
			{
				pxTaskToSuspend = NULL;
			}

			/* If null is passed in here then we are suspending ourselves. */
			pxTCB = prvGetTCBFromHandle( pxTaskToSuspend );

			traceTASK_SUSPEND( pxTCB );

			/* Remove task from the ready/delayed list and place in the	suspended list. */
			vListRemove( &( pxTCB->xGenericListItem ) );

			/* Is the task waiting on an event also? */
			if( pxTCB->xEventListItem.pvContainer )
			{
				vListRemove( &( pxTCB->xEventListItem ) );
			}

			vListInsertEnd( ( xList * ) &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );
		}
		portEXIT_CRITICAL();

		/* We may have just suspended the current task. */
		if( ( void * ) pxTaskToSuspend == NULL )
		{
			portYIELD_WITHIN_API();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4320
movq 0x60f3(%rip), %rax      # 0xbfb0
movq (%rax), %rcx
cmpq %rbx, %rcx
sete %cl
testq %rbx, %rbx
sete %r15b
orb %cl, %r15b
cmpb $0x1, %r15b
jne 0x5ed9
movq (%rax), %rbx
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
cmpq $0x0, 0x50(%rbx)
je 0x5ef8
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x6009(%rip), %rdi      # 0xbf08
movq %r14, %rsi
callq 0x4730
callq 0x4480
addq $0x8, %rsp
testb %r15b, %r15b
je 0x5f20
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4540
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskResume
void vTaskResume( xTaskHandle pxTaskToResume )
	{
	tskTCB *pxTCB;

		/* Remove the task from whichever list it is currently in, and place
		it in the ready list. */
		pxTCB = ( tskTCB * ) pxTaskToResume;

		/* The parameter cannot be NULL as it is impossible to resume the
		currently executing task. */
		if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) )
		{
			portENTER_CRITICAL();
			{
				if( xTaskIsTaskSuspended( pxTCB ) == pdTRUE )
				{
					traceTASK_RESUME( pxTCB );

					/* As we are in a critical section we can access the ready
					lists even if the scheduler is suspended. */
					vListRemove(  &( pxTCB->xGenericListItem ) );
					prvAddTaskToReadyQueue( pxTCB );

					/* We may have just resumed a higher priority task. */
					if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
					{
						/* This yield may not cause the task just resumed to run, but
						will leave the lists in the correct state for the next yield. */
						portYIELD_WITHIN_API();
					}
				}
			}
			portEXIT_CRITICAL();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5fdd
movq %rdi, %rbx
movq 0x604b(%rip), %r15      # 0xbfb0
movq (%r15), %rax
cmpq %rdi, %rax
je 0x5fdd
callq 0x4320
movq 0x28(%rbx), %rax
cmpq 0x5f8b(%rip), %rax      # 0xbf08
jne 0x5fce
cmpq $0x0, 0x50(%rbx)
jne 0x5fce
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
movq 0x58(%rbx), %rax
movq 0x5f2b(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x5fa5
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5f5c(%rip), %rdi      # 0xbf10
movq %r14, %rsi
callq 0x4730
movq 0x58(%rbx), %rax
movq (%r15), %rcx
cmpq 0x58(%rcx), %rax
jb 0x5fce
callq 0x4540
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4480
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: xTaskResumeFromISR
portBASE_TYPE xTaskResumeFromISR( xTaskHandle pxTaskToResume )
	{
	portBASE_TYPE xYieldRequired = pdFALSE;
	tskTCB *pxTCB;

		pxTCB = ( tskTCB * ) pxTaskToResume;

		if( xTaskIsTaskSuspended( pxTCB ) == pdTRUE )
		{
			traceTASK_RESUME_FROM_ISR( pxTCB );

			if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
			{
				xYieldRequired = ( pxTCB->uxPriority >= pxCurrentTCB->uxPriority );
				vListRemove(  &( pxTCB->xGenericListItem ) );
				prvAddTaskToReadyQueue( pxTCB );
			}
			else
			{
				/* We cannot access the delayed or ready lists, so will hold this
				task pending until the scheduler is resumed, at which point a
				yield will be performed if necessary. */
				vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxTCB->xEventListItem ) );
			}
		}

		return xYieldRequired;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rax
cmpq 0x5f0b(%rip), %rax      # 0xbf08
jne 0x6029
movq %rdi, %r14
cmpq $0x0, 0x50(%rdi)
jne 0x6029
movq 0x5f58(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x6039
addq $0x30, %r14
movq 0x5f77(%rip), %rdi      # 0xbf98
movq %r14, %rsi
callq 0x4730
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x58(%r14), %rax
movq 0x5f6c(%rip), %rcx      # 0xbfb0
movq (%rcx), %rcx
xorl %ebx, %ebx
cmpq 0x58(%rcx), %rax
setae %bl
leaq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x4040
movq 0x58(%r14), %rax
movq 0x5e61(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x606f
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5e92(%rip), %rdi      # 0xbf10
movq %r15, %rsi
callq 0x4730
jmp 0x602b
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskIncrementTick
void vTaskIncrementTick( void )
{
	/* Called by the portable layer each time a tick interrupt occurs.
	Increments the tick then checks to see if the new tick value will cause any
	tasks to be unblocked. */
	if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
	{
		++xTickCount;
		if( xTickCount == ( portTickType ) 0 )
		{
			xList *pxTemp;

			/* Tick count has overflowed so we need to swap the delay lists.
			If there are any items in pxDelayedTaskList here then there is
			an error! */
			pxTemp = pxDelayedTaskList;
			pxDelayedTaskList = pxOverflowDelayedTaskList;
			pxOverflowDelayedTaskList = pxTemp;
			xNumOfOverflows++;
		}

		/* See if this tick has made a timeout expire. */
		prvCheckDelayedTasks();
	}
	else
	{
		++uxMissedTicks;

		/* The tick hook gets called at regular intervals, even if the
		scheduler is locked. */
		#if ( configUSE_TICK_HOOK == 1 )
		{
			extern void vApplicationTickHook( void );

			vApplicationTickHook();
		}
		#endif
	}

	#if ( configUSE_TICK_HOOK == 1 )
	{
		extern void vApplicationTickHook( void );

		/* Guard against the tick hook being called when the missed tick
		count is being unwound (when the scheduler is being unlocked. */
		if( uxMissedTicks == 0 )
		{
			vApplicationTickHook();
		}
	}
	#endif

	traceTASK_INCREMENT_TICK( xTickCount );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x5e22(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x6165
movq 0x5e2d(%rip), %rax      # 0xbf80
incq (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5d74(%rip), %r14      # 0xbee0
incl (%r14)
cmpl $0x0, (%r14)
jne 0x6199
movq 0x5e44(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq 0x5dda(%rip), %rdx      # 0xbf60
movq (%rdx), %rsi
movq %rsi, (%rax)
movq %rcx, (%rdx)
movq 0x5e52(%rip), %rax      # 0xbfe8
incq (%rax)
movq 0x5e20(%rip), %r15      # 0xbfc0
movq (%r15), %rax
cmpq $0x0, (%rax)
je 0x6156
movq 0x5d18(%rip), %r12      # 0xbec8
movq (%r15), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r13
testq %r13, %r13
je 0x6156
movl (%r14), %eax
cmpl 0x8(%r13), %eax
jb 0x6156
leaq 0x8(%r13), %rbx
movq %rbx, %rdi
callq 0x4040
cmpq $0x0, 0x50(%r13)
je 0x61e5
leaq 0x30(%r13), %rdi
callq 0x4040
movq 0x58(%r13), %rax
cmpq (%r12), %rax
jbe 0x61f3
movq %rax, (%r12)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5d0e(%rip), %rdi      # 0xbf10
movq %rbx, %rsi
callq 0x4730
movq (%r15), %rax
cmpq $0x0, (%rax)
jne 0x61b0
jmp 0x6156
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: xTaskGetTickCount
portTickType xTaskGetTickCount( void )
{
portTickType xTicks;

	/* Critical section required if running on a 16 bit processor. */
	portENTER_CRITICAL();
	{
		xTicks = xTickCount;
	}
	portEXIT_CRITICAL();

	return xTicks;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x4320
movq 0x5cb6(%rip), %rax      # 0xbee0
movl (%rax), %ebx
callq 0x4480
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskList
void vTaskList( signed char *pcWriteBuffer )
	{
	unsigned portBASE_TYPE uxQueue;

		/* This is a VERY costly function that should be used for debug only.
		It leaves interrupts disabled for a LONG time. */

		vTaskSuspendAll();
		{
			/* Run through all the lists that could potentially contain a TCB and
			report the task name, state and stack high water mark. */

			pcWriteBuffer[ 0 ] = ( signed char ) 0x00;
			strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );

			uxQueue = uxTopUsedPriority + 1;

			do
			{
				uxQueue--;

				if( !listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxQueue ] ) ) )
				{
					prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tskREADY_CHAR );
				}
			}while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );

			if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )
			{
				prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) pxDelayedTaskList, tskBLOCKED_CHAR );
			}

			if( !listLIST_IS_EMPTY( pxOverflowDelayedTaskList ) )
			{
				prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) pxOverflowDelayedTaskList, tskBLOCKED_CHAR );
			}

			#if( INCLUDE_vTaskDelete == 1 )
			{
				if( !listLIST_IS_EMPTY( &xTasksWaitingTermination ) )
				{
					prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &xTasksWaitingTermination, tskDELETED_CHAR );
				}
			}
			#endif

			#if ( INCLUDE_vTaskSuspend == 1 )
			{
				if( !listLIST_IS_EMPTY( &xSuspendedTaskList ) )
				{
					prvListTaskWithinSingleList( pcWriteBuffer, ( xList * ) &xSuspendedTaskList, tskSUSPENDED_CHAR );
				}
			}
			#endif
		}
		xTaskResumeAll();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x5d0d(%rip), %rax      # 0xbf68
incq (%rax)
movq %rdi, %rbx
xorl %r14d, %r14d
movb %r14b, (%rdi)
callq 0x4160
movb %r14b, 0x2(%rbx,%rax)
movw $0xa0d, (%rbx,%rax)     # imm = 0xA0D
movq 0x5d3a(%rip), %rax      # 0xbfb8
movq (%rax), %r15
leaq (%r15,%r15,4), %r14
incq %r15
shlq $0x3, %r14
addq 0x5c7d(%rip), %r14      # 0xbf10
cmpq $0x0, (%r14)
je 0x62a9
movq %rbx, %rdi
movq %r14, %rsi
movl $0x52, %edx
callq 0x46b0
decq %r15
addq $-0x28, %r14
testq %r15, %r15
jne 0x6293
movq 0x5d04(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x62d5
movq (%rax), %rsi
movq %rbx, %rdi
movl $0x42, %edx
callq 0x46b0
movq 0x5c84(%rip), %rax      # 0xbf60
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x62f5
movq (%rax), %rsi
movq %rbx, %rdi
movl $0x42, %edx
callq 0x46b0
movq 0x5c8c(%rip), %rax      # 0xbf88
cmpq $0x0, (%rax)
je 0x6316
movq 0x5c7f(%rip), %rsi      # 0xbf88
movq %rbx, %rdi
movl $0x44, %edx
callq 0x46b0
movq 0x5beb(%rip), %rax      # 0xbf08
cmpq $0x0, (%rax)
je 0x6337
movq 0x5bde(%rip), %rsi      # 0xbf08
movq %rbx, %rdi
movl $0x53, %edx
callq 0x46b0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O3/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: prvListTaskWithinSingleList
static void prvListTaskWithinSingleList( const signed char *pcWriteBuffer, xList *pxList, signed char cStatus )
	{
	volatile tskTCB *pxNextTCB, *pxFirstTCB;
	unsigned short usStackRemaining;

		/* Write the details of all the TCB's in pxList into the buffer. */
		listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );
		do
		{
			listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );
			#if ( portSTACK_GROWTH > 0 )
			{
				usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxEndOfStack );
			}
			#else
			{
				usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );
			}
			#endif			
			
			sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
			strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );

		} while( pxNextTCB != pxFirstTCB );
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
movq 0x8(%rsi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsi)
leaq 0x10(%rsi), %rcx
movq %rcx, -0x30(%rbp)
cmpq %rcx, %rax
jne 0x637f
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%rax), %r14
movsbl %dl, %r15d
movq 0x5c62(%rip), %r12      # 0xbff0
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
cmpq -0x30(%rbp), %rax
jne 0x63a8
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%rax), %r13
movq 0x60(%r13), %rax
xorl %r9d, %r9d
cmpb $-0x5b, (%rax)
jne 0x63cd
xorl %ecx, %ecx
cmpb $-0x5b, 0x1(%rax,%rcx)
leaq 0x1(%rcx), %rcx
je 0x63ba
movzwl %cx, %r9d
shrl $0x3, %r9d
leaq 0x68(%r13), %rdx
movq 0x58(%r13), %r8
movq 0x78(%r13), %rax
movl %eax, (%rsp)
movq %r12, %rdi
leaq 0x2c1f(%rip), %rsi      # 0x9005
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4680
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x4650
cmpq %r14, %r13
jne 0x638e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6548
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq 0x18(%rax), %r15
movq 0x5945(%rip), %r13      # 0xbe98
movq 0x8(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
cmpq -0x38(%rbp), %rax
jne 0x656d
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq 0x18(%rax), %r12
testq %rbx, %rbx
je 0x65fd
cmpq $0x0, 0x90(%r12)
je 0x65b3
imulq $0x64, 0x90(%r12), %rax
cmpq %rbx, %rax
jae 0x65cb
leaq 0x68(%r12), %rdx
movq 0x90(%r12), %rcx
movq %r13, %rdi
leaq 0x2a89(%rip), %rsi      # 0x9033
xorl %eax, %eax
callq 0x4680
jmp 0x65f1
leaq 0x68(%r12), %rdx
movq %r13, %rdi
leaq 0x2a55(%rip), %rsi      # 0x9017
xorl %eax, %eax
callq 0x4680
jmp 0x65f1
xorl %edx, %edx
divq %rbx
leaq 0x68(%r12), %rdx
movq 0x90(%r12), %rcx
movq %r13, %rdi
leaq 0x2a3d(%rip), %rsi      # 0x9024
movl %eax, %r8d
xorl %eax, %eax
callq 0x4680
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x4650
cmpq %r15, %r12
jne 0x6553
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x58d2(%rip), %rax      # 0xbf00
movq %r14, (%rax)
movq 0x59a0(%rip), %rax      # 0xbfd8
movq %r14, (%rax)
leaq -0x10(%r14,%rbx), %rax
movq 0x58b1(%rip), %rcx      # 0xbef8
movq %rax, (%rcx)
movq 0x5907(%rip), %rax      # 0xbf58
movq $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x4480
// File: /workspace/github_c_makefile_star2_O3/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 0x58e7(%rip), %rax      # 0xbf58
movq $0x0, (%rax)
callq 0x4480
movq 0x587c(%rip), %rax      # 0xbf00
movq (%rax), %rax
movq 0x594a(%rip), %rcx      # 0xbfd8
subq (%rcx), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x56a0(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x68de
movq 0x5603(%rip), %rax      # 0xbed8
movq $0x1, (%rax)
popq %rbp
retq
callq 0x4470
movq 0x564e(%rip), %rdx      # 0xbf38
movq %rax, %rsi
subq (%rdx), %rsi
movq 0x56b9(%rip), %rcx      # 0xbfb0
movq (%rcx), %rdi
addq %rsi, 0x90(%rdi)
movq %rax, (%rdx)
movq 0x55bd(%rip), %rdx      # 0xbec8
movq (%rdx), %rax
leaq (%rax,%rax,4), %rsi
movq 0x55f7(%rip), %rax      # 0xbf10
cmpq $0x0, (%rax,%rsi,8)
jne 0x692c
decq (%rdx)
movq (%rdx), %rsi
leaq (%rsi,%rsi,4), %rsi
jmp 0x6919
movq (%rdx), %rdx
leaq (%rdx,%rdx,4), %rsi
leaq (%rax,%rsi,8), %rdi
addq $0x10, %rdi
movq -0x8(%rdi), %rdx
movq 0x8(%rdx), %rdx
movq %rdx, -0x8(%rdi)
cmpq %rdi, %rdx
jne 0x6958
leaq (%rax,%rsi,8), %rax
movq 0x8(%rdx), %rdx
movq %rdx, 0x8(%rax)
movq 0x18(%rdx), %rax
movq %rax, (%rcx)
movq 0x55f2(%rip), %rdx      # 0xbf58
cmpq $0x0, (%rdx)
je 0x68dc
movq 0x55b1(%rip), %rax      # 0xbf28
movq (%rax), %rsi
movq (%rcx), %rdi
cmpq 0x78(%rdi), %rsi
je 0x68dc
movq 0x5572(%rip), %rsi      # 0xbf00
movq (%rsi), %rdi
addq $0x10, %rdi
movq 0x555c(%rip), %r8       # 0xbef8
cmpq (%r8), %rdi
jae 0x69d0
movq (%rcx), %rcx
movq 0x78(%rcx), %rcx
movq %rcx, (%rax)
movq 0x552e(%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 0x68dc
movq $0x0, (%rdx)
jmp 0x68dc
// File: /workspace/github_c_makefile_star2_O3/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 0x6b71
movq 0x54c1(%rip), %rcx      # 0xbfe8
movq (%rcx), %rdx
cmpq (%rbx), %rdx
jne 0x6b34
movl 0x8(%rbx), %edx
jmp 0x6b4a
movq 0x53a5(%rip), %rdx      # 0xbee0
movl (%rdx), %esi
movl 0x8(%rbx), %edx
movl $0x1, %r15d
cmpl %edx, %esi
jae 0x6b74
movq 0x538f(%rip), %rsi      # 0xbee0
movl (%rsi), %edi
subl %edx, %edi
movl $0x1, %r15d
cmpl %eax, %edi
jae 0x6b74
addl %eax, %edx
subl (%rsi), %edx
movl %edx, (%r14)
movq (%rcx), %rax
movq %rax, (%rbx)
movl (%rsi), %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_O3/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 0x52e4(%rip), %r14      # 0xbe90
cmpq $0x0, (%r14)
je 0x6c16
movq 0x53af(%rip), %rax      # 0xbf68
incq (%rax)
movq 0x53c5(%rip), %rbx      # 0xbf88
movq (%rbx), %r15
callq 0x4080
testq %r15, %r15
je 0x6c16
callq 0x4320
movq (%rbx), %rax
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%rbx), %rdi
callq 0x4040
movq 0x5350(%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_O3/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 0x6c3f
xorl %eax, %eax
cmpb $-0x5b, 0x1(%rdi,%rax)
leaq 0x1(%rax), %rax
je 0x6c2c
movzwl %ax, %eax
shrl $0x3, %eax
jmp 0x6c41
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x531a(%rip), %r15      # 0xbfb0
movq (%r15), %rcx
cmpq 0x58(%rcx), %rax
jae 0x6cd0
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 0x5251(%rip), %rax      # 0xbf10
cmpq %rax, 0x28(%rdi)
je 0x6cdb
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 0x51cf(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x6d01
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5200(%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_O3/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 0x6d3e
movq %rdi, %r14
movq 0x58(%rdi), %rax
cmpq 0x80(%rdi), %rax
jne 0x6d43
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 0x515c(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x6d74
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x518d(%rip), %rdi      # 0xbf10
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x4730
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x6dde
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_O3/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 0x5a5d(%rip), %rdi      # 0xc868
leaq 0x105(%rip), %rsi       # 0x6f17
callq 0x4750
cmpq $0x0, 0x5a51(%rip)      # 0xc870
jne 0x6e2d
callq 0x4550
movq %rax, 0x5a43(%rip)      # 0xc870
leaq 0x5a44(%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, 0x5585(%rip) # 0xc3e0
incq 0x5a8e(%rip)            # 0xc8f0
xorl %eax, %eax
movq 0x5a7d(%rip), %rcx      # 0xc8e8
cmpq $0x0, (%rcx)
je 0x6e91
incq %rax
addq $0x18, %rcx
cmpq $0x40, %rax
jne 0x6e6b
leaq 0x2299(%rip), %rdi      # 0x911e
callq 0x40c0
callq 0x44a0
xorl %eax, %eax
movl %eax, 0x5a19(%rip)      # 0xc8b0
leaq 0x5a1a(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
jne 0x6f05
movq $0x0, 0x5a2e(%rip) # 0xc8e0
movslq 0x59f7(%rip), %rax      # 0xc8b0
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0x5a20(%rip), %rdi      # 0xc8e8
leaq 0x59a9(%rip), %rsi      # 0xc878
leaq 0x166(%rip), %rdx       # 0x703c
movq %r14, %rcx
callq 0x4530
movl %eax, %r14d
leaq 0x59d0(%rip), %rdi      # 0xc8b8
callq 0x43e0
cmpq $0x0, 0x59eb(%rip)      # 0xc8e0
je 0x6eed
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_O3/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, 0x59b4(%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 0x938(%rip), %rax       # 0x7891
movq %rax, -0x8(%rdi)
callq 0x4340
leaq -0x130(%rbp), %rdi
movl %ebx, 0x80(%rdi)
leaq 0x9b0(%rip), %rax       # 0x7926
movq %rax, -0x8(%rdi)
callq 0x4340
leaq -0x98(%rbp), %rdi
movl %ebx, 0x80(%rdi)
movq 0x4f5d(%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 0x6fbf
leaq 0x2106(%rip), %rdi      # 0x90c0
callq 0x40c0
leaq -0x138(%rbp), %rsi
movl $0xc, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x6fe2
leaq 0x2107(%rip), %rdi      # 0x90e4
callq 0x40c0
leaq -0xa0(%rbp), %rsi
movl $0xe, %edi
xorl %edx, %edx
callq 0x40f0
testl %eax, %eax
je 0x7005
leaq 0x2102(%rip), %rdi      # 0x9102
callq 0x40c0
callq 0x4120
leaq 0x208f(%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_O3/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 %r12
pushq %rbx
subq $0x70, %rsp
movq (%rdi), %r12
movq 0x8(%rdi), %r14
callq 0x4190
callq 0x4550
movq %rax, %rbx
movq %rax, %r15
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
callq 0x4710
testl %eax, %eax
jne 0x7115
leaq -0x90(%rbp), %rdi
callq 0x46a0
leaq 0x582d(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
jne 0x709c
movq %r15, %rdi
callq 0x74c4
movq %r14, %rdi
callq *%r12
leaq -0x90(%rbp), %rdi
callq 0x41c0
movl $0x10, %edx
movq 0x582e(%rip), %rax      # 0xc8e8
cmpq %rbx, -0x10(%rax,%rdx)
je 0x70d6
movq %rdx, %rcx
addq $0x18, %rcx
movq %rcx, %rdx
cmpq $0x610, %rcx            # imm = 0x610
jne 0x70ba
jmp 0x7106
leaq (%rax,%rdx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%rax,%rdx)
cmpq $0x0, (%rax,%rdx)
je 0x70ff
movq $0x0, 0x57fc(%rip) # 0xc8f0
movq $0x1, 0x52e1(%rip) # 0xc3e0
movq $0x0, (%rcx)
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x783a
leaq -0x90(%rbp), %rdi
callq 0x44c0
// File: /workspace/github_c_makefile_star2_O3/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, 0x576e(%rip) # 0xc8f0
movq $0x1, 0x5253(%rip) # 0xc3e0
callq 0x40d0
movl $0x8, %ecx
movq 0x574a(%rip), %rdx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rdx,%rcx)
je 0x71b5
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x71a0
jmp 0x71ba
movq -0x8(%rdx,%rcx), %rdi
popq %rbp
jmp 0x71ce
// File: /workspace/github_c_makefile_star2_O3/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 0x5722(%rip), %rdi      # 0xc900
callq 0x4770
testl %eax, %eax
je 0x71ee
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x4550
cmpq %rbx, %rax
je 0x7205
movq %rbx, %rdi
movl $0xc, %esi
callq 0x42d0
leaq 0x56f4(%rip), %rdi      # 0xc900
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x43e0
// File: /workspace/github_c_makefile_star2_O3/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 0x5692(%rip), %rcx      # 0xc8e8
movq $0x0, (%rcx,%rax)
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7256
leaq -0xb8(%rbp), %rsi
xorl %edi, %edi
callq 0x4600
testl %eax, %eax
je 0x7285
leaq 0x1ee4(%rip), %rdi      # 0x9167
jmp 0x72b8
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 0x72bd
leaq 0x1ec2(%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 0x5613(%rip), %rax      # 0xc8f8
cmpq $0x1, %rax
je 0x731f
leaq -0x38(%rbp), %r14
leaq 0x1d4c(%rip), %r15      # 0x9042
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4630
testl %eax, %eax
je 0x7312
movl -0x38(%rbp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x4170
movq 0x55df(%rip), %rax      # 0xc8f8
cmpq $0x1, %rax
jne 0x72f6
leaq 0x1e2b(%rip), %rdi      # 0x9151
callq 0x40c0
leaq 0x55ce(%rip), %rdi      # 0xc900
callq 0x41a0
leaq 0x557a(%rip), %rdi      # 0xc8b8
callq 0x41a0
movq 0x559e(%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_O3/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
movq 0x557c(%rip), %rax      # 0xc8e8
xorl %ebx, %ebx
movq (%rax,%rbx), %rdi
testq %rdi, %rdi
je 0x7383
callq 0x4720
movq 0x5565(%rip), %rax      # 0xc8e8
addq $0x18, %rbx
cmpq $0x600, %rbx            # imm = 0x600
jne 0x736e
movq $0x1, 0x555d(%rip) # 0xc8f8
movq 0x54ce(%rip), %rdi      # 0xc870
movl $0xc, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x42d0
// File: /workspace/github_c_makefile_star2_O3/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 0x54d7(%rip), %rdi      # 0xc8b8
callq 0x4770
testl %eax, %eax
je 0x73f1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x40d0
movl $0x8, %ecx
movq 0x54e6(%rip), %rdx      # 0xc8e8
xorl %ebx, %ebx
cmpq %rax, (%rdx,%rcx)
je 0x7419
addq $0x18, %rcx
cmpq $0x608, %rcx            # imm = 0x608
jne 0x7404
jmp 0x741e
movq -0x8(%rdx,%rcx), %rbx
callq 0x46e0
callq 0x40d0
movl $0x8, %edx
movq 0x54b4(%rip), %rcx      # 0xc8e8
xorl %edi, %edi
cmpq %rax, (%rcx,%rdx)
je 0x744b
addq $0x18, %rdx
cmpq $0x608, %rdx            # imm = 0x608
jne 0x7436
jmp 0x7450
movq -0x8(%rcx,%rdx), %rdi
cmpq %rdi, %rbx
jne 0x7467
leaq 0x545c(%rip), %rdi      # 0xc8b8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x43e0
movl $0x10, %eax
movq 0x547d(%rip), %rdx      # 0xc8f0
cmpq %rbx, -0x10(%rcx,%rax)
je 0x7488
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x7473
jmp 0x748c
movq %rdx, (%rcx,%rax)
movl $0x10, %edx
xorl %eax, %eax
cmpq %rdi, -0x10(%rcx,%rdx)
je 0x74a9
addq $0x18, %rdx
cmpq $0x610, %rdx            # imm = 0x610
jne 0x7493
jmp 0x74ad
movq (%rcx,%rdx), %rax
movq %rax, 0x543c(%rip)      # 0xc8f0
callq 0x71ce
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x74c4