// File: /workspace/github_c_makefile_star2_O2/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: xTaskResumeAll
signed portBASE_TYPE xTaskResumeAll( void )
{
register tskTCB *pxTCB;
signed portBASE_TYPE xAlreadyYielded = pdFALSE;

	/* It is possible that an ISR caused a task to be removed from an event
	list while the scheduler was suspended.  If this was the case then the
	removed task will have been added to the xPendingReadyList.  Once the
	scheduler has been resumed it is safe to move all the pending ready
	tasks from this list into their appropriate ready list. */
	portENTER_CRITICAL();
	{
		--uxSchedulerSuspended;

		if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
		{
			if( uxCurrentNumberOfTasks > ( unsigned portBASE_TYPE ) 0 )
			{
				portBASE_TYPE xYieldRequired = pdFALSE;

				/* Move any readied tasks from the pending list into the
				appropriate ready list. */
				while( ( pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY(  ( ( xList * ) &xPendingReadyList ) ) ) != NULL )
				{
					vListRemove( &( pxTCB->xEventListItem ) );
					vListRemove( &( pxTCB->xGenericListItem ) );
					prvAddTaskToReadyQueue( pxTCB );

					/* If we have moved a task that has a priority higher than
					the current task then we should yield. */
					if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
					{
						xYieldRequired = pdTRUE;
					}
				}

				/* If any ticks occurred while the scheduler was suspended then
				they should be processed now.  This ensures the tick count does not
				slip, and that any delayed tasks are resumed at the correct time. */
				if( uxMissedTicks > ( unsigned portBASE_TYPE ) 0 )
				{
					while( uxMissedTicks > ( unsigned portBASE_TYPE ) 0 )
					{
						vTaskIncrementTick();
						--uxMissedTicks;
					}

					/* As we have processed some ticks it is appropriate to yield
					to ensure the highest priority task that is ready to run is
					the task actually running. */
					#if configUSE_PREEMPTION == 1
					{
						xYieldRequired = pdTRUE;
					}
					#endif
				}

				if( ( xYieldRequired == pdTRUE ) || ( xMissedYield == pdTRUE ) )
				{
					xAlreadyYielded = pdTRUE;
					xMissedYield = pdFALSE;
					portYIELD_WITHIN_API();
				}
			}
		}
	}
	portEXIT_CRITICAL();

	return xAlreadyYielded;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4340
movq 0x53cb(%rip), %rax      # 0xaf68
decq (%rax)
cmpq $0x0, (%rax)
je 0x5bad
xorl %ebx, %ebx
jmp 0x5c80
movq 0x538c(%rip), %rax      # 0xaf40
cmpq $0x0, (%rax)
je 0x5ba6
xorl %r15d, %r15d
movq 0x53d4(%rip), %r12      # 0xaf98
pushq $0x1
popq %rbx
cmpq $0x0, (%r12)
je 0x5c36
movq 0x18(%r12), %rax
movq 0x18(%rax), %r13
testq %r13, %r13
je 0x5c36
leaq 0x30(%r13), %rdi
callq 0x4040
leaq 0x8(%r13), %r14
movq %r14, %rdi
callq 0x4040
movq 0x58(%r13), %rax
movq 0x52cc(%rip), %rcx      # 0xaec8
cmpq (%rcx), %rax
jbe 0x5c0b
movq 0x52c0(%rip), %rcx      # 0xaec8
movq %rax, (%rcx)
imulq $0x28, %rax, %rdi
addq 0x52fa(%rip), %rdi      # 0xaf10
movq %r14, %rsi
callq 0x4760
movq 0x58(%r13), %rax
movq 0x5387(%rip), %rcx      # 0xafb0
movq (%rcx), %rcx
cmpq 0x58(%rcx), %rax
cmovaeq %rbx, %r15
jmp 0x5bc7
movq 0x5343(%rip), %r14      # 0xaf80
cmpq $0x0, (%r14)
jne 0x5c67
cmpq $0x1, %r15
je 0x5c6d
movq 0x5288(%rip), %rax      # 0xaed8
movq (%rax), %rax
cmpq $0x1, %rax
jne 0x5ba6
jmp 0x5c6d
callq 0x4400
decq (%r14)
cmpq $0x0, (%r14)
jne 0x5c5f
movq 0x5264(%rip), %rax      # 0xaed8
movq $0x0, (%rax)
callq 0x4570
callq 0x44b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq