LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: xCoRoutineCreate
signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )
{
signed portBASE_TYPE xReturn;
corCRCB *pxCoRoutine;

	/* Allocate the memory that will store the co-routine control block. */
	pxCoRoutine = ( corCRCB * ) pvPortMalloc( sizeof( corCRCB ) );
	if( pxCoRoutine )
	{
		/* If pxCurrentCoRoutine is NULL then this is the first co-routine to
		be created and the co-routine data structures need initialising. */
		if( pxCurrentCoRoutine == NULL )
		{
			pxCurrentCoRoutine = pxCoRoutine;
			prvInitialiseCoRoutineLists();
		}

		/* Check the priority is within limits. */
		if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
		{
			uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
		}

		/* Fill out the co-routine control block from the function parameters. */
		pxCoRoutine->uxState = corINITIAL_STATE;
		pxCoRoutine->uxPriority = uxPriority;
		pxCoRoutine->uxIndex = uxIndex;
		pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;

		/* Initialise all the other co-routine control block parameters. */
		vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
		vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );

		/* Set the co-routine control block as a link back from the xListItem.
		This is so we can get back to the containing CRCB from a generic item
		in a list. */
		listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
		listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
	
		/* Event lists are always in priority order. */
		listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) uxPriority );
		
		/* Now the co-routine has been initialised it can be added to the ready
		list at the correct priority. */
		prvAddCoRoutineToReadyQueue( pxCoRoutine );

		xReturn = pdPASS;
	}
	else
	{		
		xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
	}
	
	return xReturn;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movl $0x70, %edi
callq 0x42e0
testq %rax, %rax
je 0x4929
movq %rax, %rbx
movq 0x7730(%rip), %rax      # 0xbfd0
cmpq $0x0, (%rax)
jne 0x48ae
movq %rbx, (%rax)
callq 0x4490
xorl %r13d, %r13d
testq %r12, %r12
setne %r13b
movw $0x0, 0x68(%rbx)
movq %r13, 0x58(%rbx)
movq %r14, 0x60(%rbx)
movq %r15, (%rbx)
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4050
movq %rbx, %rdi
addq $0x30, %rdi
callq 0x4050
movq %rbx, 0x20(%rbx)
movq %rbx, 0x48(%rbx)
movl $0xa, %eax
subl %r13d, %eax
movl %eax, 0x30(%rbx)
movq 0x58(%rbx), %rax
movq 0x7679(%rip), %rcx      # 0xbf78
cmpq (%rcx), %rax
jbe 0x4907
movq %rax, (%rcx)
movq 0x58(%rbx), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x7586(%rip), %rdi      # 0xbea0
movq %r14, %rsi
callq 0x4730
movl $0x1, %eax
jmp 0x4930
movq $-0x1, %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/croutine.c
// Function: prvInitialiseCoRoutineLists
static void prvInitialiseCoRoutineLists( void )
{
unsigned portBASE_TYPE uxPriority;

	for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
	{
		vListInitialise( ( xList * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
	}

	vListInitialise( ( xList * ) &xDelayedCoRoutineList1 );
	vListInitialise( ( xList * ) &xDelayedCoRoutineList2 );
	vListInitialise( ( xList * ) &xPendingReadyCoRoutineList );

	/* Start with pxDelayedCoRoutineList using list1 and the
	pxOverflowDelayedCoRoutineList using list2. */
	pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
	pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x7551(%rip), %r14      # 0xbea0
leaq (%rbx,%r14), %rdi
callq 0x4390
addq $0x28, %rbx
cmpq $0x28, %rbx
je 0x494f
movq 0x7607(%rip), %rbx      # 0xbf70
movq %rbx, %rdi
callq 0x4390
movq 0x7538(%rip), %r14      # 0xbeb0
movq %r14, %rdi
callq 0x4390
movq 0x7591(%rip), %rdi      # 0xbf18
callq 0x4390
movq 0x7635(%rip), %rax      # 0xbfc8
movq %rbx, (%rax)
movq 0x74eb(%rip), %rax      # 0xbe88
movq %r14, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: vCoRoutineAddToDelayedList
void vCoRoutineAddToDelayedList( portTickType xTicksToDelay, xList *pxEventList )
{
portTickType xTimeToWake;

	/* Calculate the time to wake - this may overflow but this is
	not a problem. */
	xTimeToWake = xCoRoutineTickCount + xTicksToDelay;

	/* We must remove ourselves from the ready list before adding
	ourselves to the blocked list as the same list item is used for
	both lists. */
	vListRemove( ( xListItem * ) &( pxCurrentCoRoutine->xGenericListItem ) );

	/* The list item will be inserted in wake time order. */
	listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );

	if( xTimeToWake < xCoRoutineTickCount )
	{
		/* Wake time has overflowed.  Place this item in the
		overflow list. */
		vListInsert( ( xList * ) pxOverflowDelayedCoRoutineList, ( xListItem * ) &( pxCurrentCoRoutine->xGenericListItem ) );
	}
	else
	{
		/* The wake time has not overflowed, so we can use the
		current block list. */
		vListInsert( ( xList * ) pxDelayedCoRoutineList, ( xListItem * ) &( pxCurrentCoRoutine->xGenericListItem ) );
	}

	if( pxEventList )
	{
		/* Also add the co-routine to an event list.  If this is done then the
		function must be called with interrupts disabled. */
		vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %r14d
movq 0x75e6(%rip), %r12      # 0xbfa0
addl (%r12), %r14d
movq %rsi, %rbx
movq 0x7608(%rip), %r15      # 0xbfd0
movq (%r15), %rdi
addq $0x8, %rdi
callq 0x4040
movq (%r15), %rsi
movl %r14d, 0x8(%rsi)
addq $0x8, %rsi
cmpl (%r12), %r14d
jae 0x49ee
movq 0x749c(%rip), %rax      # 0xbe88
jmp 0x49f5
movq 0x75d3(%rip), %rax      # 0xbfc8
movq (%rax), %rdi
callq 0x4090
testq %rbx, %rbx
je 0x4a19
movq (%r15), %rsi
addq $0x30, %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4090
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: prvCheckPendingReadyList
static void prvCheckPendingReadyList( void )
{
	/* Are there any co-routines waiting to get moved to the ready list?  These
	are co-routines that have been readied by an ISR.  The ISR cannot access
	the	ready lists itself. */
	while( !listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) )
	{
		corCRCB *pxUnblockedCRCB;

		/* The pending ready list can be accessed by an ISR. */
		portDISABLE_INTERRUPTS();
		{	
			pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) );			
			vListRemove( &( pxUnblockedCRCB->xEventListItem ) );
		}
		portENABLE_INTERRUPTS();

		vListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
		prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );	
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x74e1(%rip), %r14      # 0xbf18
cmpq $0x0, (%r14)
je 0x4aa6
movq 0x7534(%rip), %r15      # 0xbf78
movq 0x7455(%rip), %r12      # 0xbea0
callq 0x4310
cmpq $0x0, (%r14)
je 0x4a60
movq 0x18(%r14), %rax
movq 0x18(%rax), %r13
jmp 0x4a63
xorl %r13d, %r13d
leaq 0x30(%r13), %rdi
callq 0x4040
callq 0x43c0
leaq 0x8(%r13), %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x58(%r13), %rax
cmpq (%r15), %rax
jbe 0x4a89
movq %rax, (%r15)
movq 0x58(%r13), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq %r12, %rdi
movq %rbx, %rsi
callq 0x4730
cmpq $0x0, (%r14)
jne 0x4a4b
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/croutine.c
// Function: vCoRoutineSchedule
void vCoRoutineSchedule( void )
{
	/* See if any co-routines readied by events need moving to the ready lists. */
	prvCheckPendingReadyList();

	/* See if any delayed co-routines have timed out. */
	prvCheckDelayedList();

	/* Find the highest priority queue that contains ready co-routines. */
	while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
	{
		if( uxTopCoRoutineReadyPriority == 0 )
		{
			/* No more co-routines to check. */
			return;
		}
		--uxTopCoRoutineReadyPriority;
	}

	/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
	 of the	same priority get an equal share of the processor time. */
	listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );

	/* Call the co-routine. */
	( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x41d0
callq 0x4370
movq 0x73a8(%rip), %rax      # 0xbf78
movq (%rax), %rcx
leaq (%rcx,%rcx,4), %rdx
movq 0x72c2(%rip), %rsi      # 0xbea0
cmpq $0x0, (%rsi,%rdx,8)
je 0x4beb
leaq (%rsi,%rdx,8), %rsi
jmp 0x4c13
decq %rcx
shlq $0x3, %rdx
addq 0x72a7(%rip), %rdx      # 0xbea0
cmpq $-0x1, %rcx
je 0x4c4c
movq %rcx, (%rax)
leaq -0x28(%rdx), %rsi
decq %rcx
cmpq $0x0, -0x28(%rdx)
movq %rsi, %rdx
je 0x4bf9
movq 0x8(%rsi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsi)
leaq 0x10(%rsi), %rcx
cmpq %rcx, %rax
jne 0x4c30
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsi)
movq 0x8(%rsi), %rax
movq 0x18(%rax), %rdi
movq 0x7391(%rip), %rax      # 0xbfd0
movq %rdi, (%rax)
movq (%rdi), %rax
movq 0x60(%rdi), %rsi
popq %rbp
jmpq *%rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: xCoRoutineRemoveFromEventList
signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )
{
corCRCB *pxUnblockedCRCB;
signed portBASE_TYPE xReturn;

	/* This function is called from within an interrupt.  It can only access
	event lists and the pending ready list. */
	pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
	vListRemove( &( pxUnblockedCRCB->xEventListItem ) );
	vListInsertEnd( ( xList * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );

	if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
	{
		xReturn = pdTRUE;
	}
	else
	{
		xReturn = pdFALSE;
	}

	return xReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpq $0x0, (%rdi)
je 0x4c65
movq 0x18(%rdi), %rax
movq 0x18(%rax), %r14
jmp 0x4c68
xorl %r14d, %r14d
leaq 0x30(%r14), %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x729d(%rip), %rdi      # 0xbf18
movq %rbx, %rsi
callq 0x4730
movq 0x58(%r14), %rcx
movq 0x7342(%rip), %rax      # 0xbfd0
movq (%rax), %rdx
xorl %eax, %eax
cmpq 0x58(%rdx), %rcx
setae %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueCreate
xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize )
{
xQUEUE *pxNewQueue;
size_t xQueueSizeInBytes;

	/* Allocate the new queue structure. */
	if( uxQueueLength > ( unsigned portBASE_TYPE ) 0 )
	{
		pxNewQueue = ( xQUEUE * ) pvPortMalloc( sizeof( xQUEUE ) );
		if( pxNewQueue != NULL )
		{
			/* Create the list of pointers to queue items.  The queue is one byte
			longer than asked for to make wrap checking easier/faster. */
			xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1;

			pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes );
			if( pxNewQueue->pcHead != NULL )
			{
				/* Initialise the queue members as described above where the
				queue type is defined. */
				pxNewQueue->pcTail = pxNewQueue->pcHead + ( uxQueueLength * uxItemSize );
				pxNewQueue->uxMessagesWaiting = 0;
				pxNewQueue->pcWriteTo = pxNewQueue->pcHead;
				pxNewQueue->pcReadFrom = pxNewQueue->pcHead + ( ( uxQueueLength - 1 ) * uxItemSize );
				pxNewQueue->uxLength = uxQueueLength;
				pxNewQueue->uxItemSize = uxItemSize;
				pxNewQueue->xRxLock = queueUNLOCKED;
				pxNewQueue->xTxLock = queueUNLOCKED;

				/* Likewise ensure the event queues start with the correct state. */
				vListInitialise( &( pxNewQueue->xTasksWaitingToSend ) );
				vListInitialise( &( pxNewQueue->xTasksWaitingToReceive ) );

				traceQUEUE_CREATE( pxNewQueue );
				return  pxNewQueue;
			}
			else
			{
				traceQUEUE_CREATE_FAILED();
				vPortFree( pxNewQueue );
			}
		}
	}

	/* Will only reach here if we could not allocate enough memory or no memory
	was required. */
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x4e25
movq %rsi, %r14
movq %rdi, %r15
movl $0x98, %edi
callq 0x42e0
testq %rax, %rax
je 0x4e25
movq %rax, %rbx
movq %r14, %r12
imulq %r15, %r12
leaq 0x1(%r12), %rdi
callq 0x42e0
movq %rax, (%rbx)
testq %rax, %rax
je 0x4e1d
addq %rax, %r12
movq %r12, 0x8(%rbx)
movq $0x0, 0x70(%rbx)
movq %rax, 0x10(%rbx)
leaq -0x1(%r15), %rcx
imulq %r14, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rbx)
movq %r15, 0x78(%rbx)
movq %r14, 0x80(%rbx)
leaq 0x20(%rbx), %rdi
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x88(%rbx)
callq 0x4390
movq %rbx, %rdi
addq $0x48, %rdi
callq 0x4390
jmp 0x4e27
movq %rbx, %rdi
callq 0x4190
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueTakeMutexRecursive
portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle pxMutex, portTickType xBlockTime )
	{
	portBASE_TYPE xReturn;

		/* Comments regarding mutual exclusion as per those within
		xQueueGiveMutexRecursive(). */

		traceTAKE_MUTEX_RECURSIVE( pxMutex );

		if( pxMutex->pxMutexHolder == xTaskGetCurrentTaskHandle() )
		{
			( pxMutex->uxRecursiveCallCount )++;
			xReturn = pdPASS;
		}
		else
		{
			xReturn = xQueueGenericReceive( pxMutex, NULL, xBlockTime, pdFALSE );

			/* pdPASS will only be returned if we successfully obtained the mutex,
			we may have blocked to reach here. */
			if( xReturn == pdPASS )
			{
				( pxMutex->uxRecursiveCallCount )++;
			}
		}

		return xReturn;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq 0x8(%rdi), %r14
callq 0x40d0
cmpq %rax, %r14
je 0x5066
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x4270
testq %rax, %rax
je 0x5070
incq 0x18(%rbx)
movl $0x1, %r14d
movq %r14, %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/queue.c
// Function: prvCopyDataToQueue
static void prvCopyDataToQueue( xQUEUE *pxQueue, const void *pvItemToQueue, portBASE_TYPE xPosition )
{
	if( pxQueue->uxItemSize == ( unsigned portBASE_TYPE ) 0 )
	{
		#if ( configUSE_MUTEXES == 1 )
		{
			if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )
			{
				/* The mutex is no longer being held. */
				vTaskPriorityDisinherit( ( void * ) pxQueue->pxMutexHolder );
				pxQueue->pxMutexHolder = NULL;
			}
		}
		#endif
	}
	else if( xPosition == queueSEND_TO_BACK )
	{
		memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( unsigned ) pxQueue->uxItemSize );
		pxQueue->pcWriteTo += pxQueue->uxItemSize;
		if( pxQueue->pcWriteTo >= pxQueue->pcTail )
		{
			pxQueue->pcWriteTo = pxQueue->pcHead;
		}
	}
	else
	{
		memcpy( ( void * ) pxQueue->pcReadFrom, pvItemToQueue, ( unsigned ) pxQueue->uxItemSize );
		pxQueue->pcReadFrom -= pxQueue->uxItemSize;
		if( pxQueue->pcReadFrom < pxQueue->pcHead )
		{
			pxQueue->pcReadFrom = ( pxQueue->pcTail - pxQueue->uxItemSize );
		}
	}

	++( pxQueue->uxMessagesWaiting );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x80(%rdi), %rcx
testq %rcx, %rcx
je 0x52c3
movq %rdx, %rax
movl %ecx, %edx
testq %rax, %rax
je 0x52dc
movq 0x18(%rbx), %rdi
callq 0x4350
movq 0x18(%rbx), %rcx
movq 0x80(%rbx), %rax
subq %rax, %rcx
movq %rcx, 0x18(%rbx)
cmpq (%rbx), %rcx
jae 0x5301
negq %rax
addq 0x8(%rbx), %rax
movq %rax, 0x18(%rbx)
jmp 0x5301
cmpq $0x0, (%rbx)
jne 0x5301
movq 0x8(%rbx), %rdi
callq 0x43a0
movq $0x0, 0x8(%rbx)
jmp 0x5301
movq 0x10(%rbx), %rdi
callq 0x4350
movq 0x10(%rbx), %rax
addq 0x80(%rbx), %rax
movq %rax, 0x10(%rbx)
cmpq 0x8(%rbx), %rax
jb 0x5301
movq (%rbx), %rax
movq %rax, 0x10(%rbx)
incq 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueGenericSendFromISR
signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition )
{
signed portBASE_TYPE xReturn;
unsigned portBASE_TYPE uxSavedInterruptStatus;

	/* Similar to xQueueGenericSend, except we don't block if there is no room
	in the queue.  Also we don't directly wake a task that was blocked on a
	queue read, instead we return a flag to say whether a context switch is
	required or not (i.e. has a task with a higher priority than us been woken
	by this	post). */
	uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
		{
			traceQUEUE_SEND_FROM_ISR( pxQueue );

			prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );

			/* If the queue is locked we do not alter the event list.  This will
			be done when the queue is unlocked later. */
			if( pxQueue->xTxLock == queueUNLOCKED )
			{
				if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
				{
					if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
					{
						/* The task waiting has a higher priority so record that a
						context	switch is required. */
						*pxHigherPriorityTaskWoken = pdTRUE;
					}
				}
			}
			else
			{
				/* Increment the lock count so the task that unlocks the queue
				knows that data was posted while it was locked. */
				++( pxQueue->xTxLock );
			}

			xReturn = pdPASS;
		}
		else
		{
			traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue );
			xReturn = errQUEUE_FULL;
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );

	return xReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
callq 0x41b0
movq %rax, %rbx
movq 0x70(%r12), %rax
cmpq 0x78(%r12), %rax
jae 0x541d
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x5277
movq 0x90(%r12), %rax
cmpq $-0x1, %rax
je 0x543a
incq %rax
movq %rax, 0x90(%r12)
movl $0x1, %r15d
jmp 0x5420
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x4700
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r15d
cmpq $0x0, 0x48(%r12)
je 0x5420
addq $0x48, %r12
movq %r12, %rdi
callq 0x4210
testq %rax, %rax
je 0x5420
movq $0x1, (%r14)
jmp 0x5420
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueReceiveFromISR
signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxTaskWoken )
{
signed portBASE_TYPE xReturn;
unsigned portBASE_TYPE uxSavedInterruptStatus;

	uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		/* We cannot block from an ISR, so check there is data available. */
		if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
		{
			traceQUEUE_RECEIVE_FROM_ISR( pxQueue );

			prvCopyDataFromQueue( pxQueue, pvBuffer );
			--( pxQueue->uxMessagesWaiting );

			/* If the queue is locked we will not modify the event list.  Instead
			we update the lock count so the task that unlocks the queue will know
			that an ISR has removed data while the queue was locked. */
			if( pxQueue->xRxLock == queueUNLOCKED )
			{
				if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) )
				{
					if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )
					{
						/* The task waiting has a higher priority than us so
						force a context switch. */
						*pxTaskWoken = pdTRUE;
					}
				}
			}
			else
			{
				/* Increment the lock count so the task that unlocks the queue
				knows that data was removed while it was locked. */
				++( pxQueue->xRxLock );
			}

			xReturn = pdPASS;
		}
		else
		{
			xReturn = pdFAIL;
			traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue );
		}
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );

	return xReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
callq 0x41b0
movq %rax, %rbx
cmpq $0x0, 0x70(%r15)
je 0x54d4
movq (%r15), %rsi
testq %rsi, %rsi
je 0x54b1
movq 0x80(%r15), %rax
movq 0x18(%r15), %rcx
addq %rax, %rcx
cmpq 0x8(%r15), %rcx
cmovbq %rcx, %rsi
movq %rsi, 0x18(%r15)
movl %eax, %edx
movq %r12, %rdi
callq 0x4350
decq 0x70(%r15)
movq 0x88(%r15), %rax
cmpq $-0x1, %rax
je 0x54eb
incq %rax
movq %rax, 0x88(%r15)
movl $0x1, %r12d
jmp 0x54d7
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x4700
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r12d
cmpq $0x0, 0x20(%r15)
je 0x54d7
addq $0x20, %r15
movq %r15, %rdi
callq 0x4210
testq %rax, %rax
je 0x54d7
movq $0x1, (%r14)
jmp 0x54d7
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: uxQueueMessagesWaiting
unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue )
{
unsigned portBASE_TYPE uxReturn;

	taskENTER_CRITICAL();
		uxReturn = pxQueue->uxMessagesWaiting;
	taskEXIT_CRITICAL();

	return uxReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4320
movq 0x70(%rbx), %rbx
callq 0x4480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueCRSendFromISR
signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken )
{
	/* Cannot block within an ISR so if there is no space on the queue then
	exit without doing anything. */
	if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )
	{
		prvCopyDataToQueue( pxQueue, pvItemToQueue, queueSEND_TO_BACK );

		/* We only want to wake one co-routine per ISR, so check that a
		co-routine has not already been woken. */
		if( !xCoRoutinePreviouslyWoken )
		{
			if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
			{
				if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
				{
					return pdTRUE;
				}
			}
		}
	}

	return xCoRoutinePreviouslyWoken;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x70(%rdi), %rax
cmpq 0x78(%rdi), %rax
jae 0x571d
movq %rdi, %r14
xorl %edx, %edx
callq 0x5277
testq %rbx, %rbx
je 0x5725
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x0, 0x48(%r14)
je 0x571d
addq $0x48, %r14
movq %r14, %rdi
callq 0x4670
movq %rax, %rcx
movl $0x1, %eax
testq %rcx, %rcx
jne 0x5720
jmp 0x571d
// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/queue.c
// Function: xQueueCRReceiveFromISR
signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxCoRoutineWoken )
{
signed portBASE_TYPE xReturn;

	/* We cannot block from an ISR, so check there is data available. If
	not then just leave without doing anything. */
	if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
	{
		/* Copy the data from the queue. */
		pxQueue->pcReadFrom += pxQueue->uxItemSize;
		if( pxQueue->pcReadFrom >= pxQueue->pcTail )
		{
			pxQueue->pcReadFrom = pxQueue->pcHead;
		}
		--( pxQueue->uxMessagesWaiting );
		memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->pcReadFrom, ( unsigned ) pxQueue->uxItemSize );

		if( !( *pxCoRoutineWoken ) )
		{
			if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) )
			{
				if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )
				{
					*pxCoRoutineWoken = pdTRUE;
				}
			}
		}

		xReturn = pdPASS;
	}
	else
	{
		xReturn = pdFAIL;
	}

	return xReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x70(%rdi)
je 0x57bf
movq %rdx, %rbx
movq %rdi, %r14
movq 0x80(%rdi), %rcx
movq 0x18(%rdi), %rax
addq %rcx, %rax
movq %rax, 0x18(%rdi)
cmpq 0x8(%rdi), %rax
jb 0x577d
movq (%r14), %rax
movq %rax, 0x18(%r14)
decq 0x70(%r14)
movq 0x18(%r14), %rax
movl %ecx, %edx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x4350
movl $0x1, %r15d
cmpq $0x0, (%rbx)
jne 0x57c2
cmpq $0x0, 0x20(%r14)
je 0x57c2
addq $0x20, %r14
movq %r14, %rdi
callq 0x4670
testq %rax, %rax
je 0x57c2
movq $0x1, (%rbx)
jmp 0x57c2
xorl %r15d, %r15d
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: prvAllocateTCBAndStack
static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TYPE *puxStackBuffer )
{
tskTCB *pxNewTCB;

	/* Allocate space for the TCB.  Where the memory comes from depends on
	the implementation of the port malloc function. */
	pxNewTCB = ( tskTCB * ) pvPortMalloc( sizeof( tskTCB ) );

	if( pxNewTCB != NULL )
	{
		/* Allocate space for the stack used by the task being created.
		The base of the stack memory stored in the TCB so the task can
		be deleted later if required. */
		pxNewTCB->pxStack = ( portSTACK_TYPE * ) pvPortMallocAligned( ( ( ( size_t )usStackDepth ) * sizeof( portSTACK_TYPE ) ), puxStackBuffer );

		if( pxNewTCB->pxStack == NULL )
		{
			/* Could not allocate the stack.  Delete the allocated TCB. */
			vPortFree( pxNewTCB );
			pxNewTCB = NULL;
		}
		else
		{
			/* Just to help debugging. */
			memset( pxNewTCB->pxStack, tskSTACK_FILL_BYTE, usStackDepth * sizeof( portSTACK_TYPE ) );
		}
	}

	return pxNewTCB;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r15d
movl $0x98, %edi
callq 0x42e0
testq %rax, %rax
je 0x59a2
movq %rax, %rbx
movzwl %r15w, %r15d
testq %r14, %r14
jne 0x597b
leal (,%r15,8), %edi
callq 0x42e0
movq %rax, %r14
movq %r14, 0x60(%rbx)
testq %r14, %r14
je 0x599a
shll $0x3, %r15d
movq %r14, %rdi
movl $0xa5, %esi
movq %r15, %rdx
callq 0x41e0
jmp 0x59a4
movq %rbx, %rdi
callq 0x4190
xorl %ebx, %ebx
movq %rbx, %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: prvInitialiseTaskLists
static void prvInitialiseTaskLists( void )
{
unsigned portBASE_TYPE uxPriority;

	for( uxPriority = 0; uxPriority < configMAX_PRIORITIES; uxPriority++ )
	{
		vListInitialise( ( xList * ) &( pxReadyTasksLists[ uxPriority ] ) );
	}

	vListInitialise( ( xList * ) &xDelayedTaskList1 );
	vListInitialise( ( xList * ) &xDelayedTaskList2 );
	vListInitialise( ( xList * ) &xPendingReadyList );

	#if ( INCLUDE_vTaskDelete == 1 )
	{
		vListInitialise( ( xList * ) &xTasksWaitingTermination );
	}
	#endif

	#if ( INCLUDE_vTaskSuspend == 1 )
	{
		vListInitialise( ( xList * ) &xSuspendedTaskList );
	}
	#endif

	/* Start with pxDelayedTaskList using list1 and the pxOverflowDelayedTaskList
	using list2. */
	pxDelayedTaskList = &xDelayedTaskList1;
	pxOverflowDelayedTaskList = &xDelayedTaskList2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
movq 0x64d9(%rip), %r14      # 0xbf10
leaq (%rbx,%r14), %rdi
callq 0x4390
addq $0x28, %rbx
cmpq $0x190, %rbx            # imm = 0x190
jne 0x5a37
movq 0x64f4(%rip), %rbx      # 0xbf48
movq %rbx, %rdi
callq 0x4390
movq 0x6445(%rip), %r14      # 0xbea8
movq %r14, %rdi
callq 0x4390
movq 0x6526(%rip), %rdi      # 0xbf98
callq 0x4390
movq 0x650a(%rip), %rdi      # 0xbf88
callq 0x4390
movq 0x647e(%rip), %rdi      # 0xbf08
callq 0x4390
movq 0x652a(%rip), %rax      # 0xbfc0
movq %rbx, (%rax)
movq 0x64c0(%rip), %rax      # 0xbf60
movq %r14, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x64ef(%rip), %rax      # 0xbfb0
movq (%rax), %rcx
xorl %r15d, %r15d
cmpq %rbx, %rcx
cmovneq %rbx, %r15
movq %r15, %rbx
testq %r15, %r15
jne 0x5ad9
movq (%rax), %rbx
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
cmpq $0x0, 0x50(%rbx)
je 0x5af5
leaq 0x30(%rbx), %rdi
callq 0x4040
movq 0x648c(%rip), %rdi      # 0xbf88
movq %r14, %rsi
callq 0x4730
movq 0x6385(%rip), %rax      # 0xbe90
incq (%rax)
movq 0x641b(%rip), %rax      # 0xbf30
incq (%rax)
movq %rbx, %rdi
callq 0x45a0
callq 0x4480
movq 0x6424(%rip), %rax      # 0xbf50
movq (%rax), %rax
testq %r15, %r15
jne 0x5b48
testq %rax, %rax
je 0x5b48
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4540
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: 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 0x5dc7
movq 0x61ec(%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_O1/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 0x60db(%rip), %rax      # 0xbfb0
movq (%rax), %rcx
xorl %r15d, %r15d
cmpq %rbx, %rcx
cmovneq %rbx, %r15
movq %r15, %rbx
testq %r15, %r15
jne 0x5eed
movq (%rax), %rbx
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
cmpq $0x0, 0x50(%rbx)
je 0x5f0c
addq $0x30, %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x5ff5(%rip), %rdi      # 0xbf08
movq %r14, %rsi
callq 0x4730
callq 0x4480
addq $0x8, %rsp
testq %r15, %r15
je 0x5f30
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4540
// File: /workspace/github_c_makefile_star2_O1/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 0x5ff1
movq %rdi, %rbx
movq 0x6037(%rip), %r15      # 0xbfb0
movq (%r15), %rax
cmpq %rdi, %rax
je 0x5ff1
callq 0x4320
movq 0x28(%rbx), %rax
cmpq 0x5f77(%rip), %rax      # 0xbf08
jne 0x5fe2
cmpq $0x0, 0x50(%rbx)
jne 0x5fe2
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4040
movq 0x58(%rbx), %rax
movq 0x5f17(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x5fb9
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5f48(%rip), %rdi      # 0xbf10
movq %r14, %rsi
callq 0x4730
movq 0x58(%rbx), %rax
movq (%r15), %rcx
cmpq 0x58(%rcx), %rax
jb 0x5fe2
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_O1/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 0x5ef7(%rip), %rax      # 0xbf08
jne 0x603d
movq %rdi, %r14
cmpq $0x0, 0x50(%rdi)
jne 0x603d
movq 0x5f44(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x604d
addq $0x30, %r14
movq 0x5f63(%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 0x5f58(%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 0x5e4d(%rip), %rcx      # 0xbec8
cmpq (%rcx), %rax
jbe 0x6083
movq %rax, (%rcx)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x5e7e(%rip), %rdi      # 0xbf10
movq %r15, %rsi
callq 0x4730
jmp 0x603f
// File: /workspace/github_c_makefile_star2_O1/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 0x5e0e(%rip), %rax      # 0xbf68
cmpq $0x0, (%rax)
je 0x6179
movq 0x5e19(%rip), %rax      # 0xbf80
incq (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5d60(%rip), %rax      # 0xbee0
incl (%rax)
cmpl $0x0, (%rax)
jne 0x61ab
movq 0x5e32(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
movq 0x5dc8(%rip), %rdx      # 0xbf60
movq (%rdx), %rsi
movq %rsi, (%rax)
movq %rcx, (%rdx)
movq 0x5e40(%rip), %rax      # 0xbfe8
incq (%rax)
movq 0x5e0e(%rip), %r15      # 0xbfc0
movq 0x5d0f(%rip), %r12      # 0xbec8
movq 0x5d50(%rip), %r13      # 0xbf10
movq (%r15), %rax
cmpq $0x0, (%rax)
je 0x61d6
movq (%r15), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r14
jmp 0x61d9
xorl %r14d, %r14d
testq %r14, %r14
je 0x616a
movq 0x5cfb(%rip), %rax      # 0xbee0
movl (%rax), %eax
cmpl 0x8(%r14), %eax
jb 0x616a
leaq 0x8(%r14), %rbx
movq %rbx, %rdi
callq 0x4040
cmpq $0x0, 0x50(%r14)
je 0x620d
leaq 0x30(%r14), %rdi
callq 0x4040
movq 0x58(%r14), %rax
cmpq (%r12), %rax
jbe 0x621b
movq %rax, (%r12)
movq 0x58(%r14), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq %r13, %rdi
movq %rbx, %rsi
callq 0x4730
jmp 0x61c0
// File: /workspace/github_c_makefile_star2_O1/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 0x5c9a(%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_O1/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 0x5cf1(%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 0x5d1e(%rip), %rax      # 0xbfb8
movq (%rax), %r15
leaq (%r15,%r15,4), %r14
incq %r15
shlq $0x3, %r14
addq 0x5c61(%rip), %r14      # 0xbf10
cmpq $0x0, (%r14)
je 0x62c5
movq %rbx, %rdi
movq %r14, %rsi
movl $0x52, %edx
callq 0x46b0
decq %r15
addq $-0x28, %r14
testq %r15, %r15
jne 0x62af
movq 0x5ce8(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x62f1
movq (%rax), %rsi
movq %rbx, %rdi
movl $0x42, %edx
callq 0x46b0
movq 0x5c68(%rip), %rax      # 0xbf60
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x6311
movq (%rax), %rsi
movq %rbx, %rdi
movl $0x42, %edx
callq 0x46b0
movq 0x5c70(%rip), %rax      # 0xbf88
cmpq $0x0, (%rax)
je 0x6332
movq 0x5c63(%rip), %rsi      # 0xbf88
movq %rbx, %rdi
movl $0x44, %edx
callq 0x46b0
movq 0x5bcf(%rip), %rax      # 0xbf08
cmpq $0x0, (%rax)
je 0x6353
movq 0x5bc2(%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_O1/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 0x639b
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rax), %r14
movsbl %dl, %r15d
movq 0x5c42(%rip), %r12      # 0xbff0
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
cmpq -0x30(%rbp), %rax
jne 0x63c8
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rbx), %rax
movq 0x18(%rax), %r13
movq 0x60(%r13), %rax
xorl %r9d, %r9d
cmpb $-0x5b, (%rax)
jne 0x63f1
xorl %ecx, %ecx
cmpb $-0x5b, 0x1(%rax,%rcx)
leaq 0x1(%rcx), %rcx
je 0x63de
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 0x2bfb(%rip), %rsi      # 0x9005
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4680
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x4650
cmpq %r14, %r13
jne 0x63ae
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq