// File: /workspace/github_c_makefile_star2_O3/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 0x4320
movq 0x6364(%rip), %rax      # 0xbf68
decq (%rax)
cmpq $0x0, (%rax)
je 0x5c14
xorl %ebx, %ebx
jmp 0x5d09
movq 0x6325(%rip), %rax      # 0xbf40
cmpq $0x0, (%rax)
je 0x5c0d
movq 0x6370(%rip), %r15      # 0xbf98
cmpq $0x0, (%r15)
je 0x5cb9
xorl %r14d, %r14d
movq 0x628c(%rip), %r12      # 0xbec8
movq 0x18(%r15), %rax
movq 0x18(%rax), %r13
testq %r13, %r13
je 0x5ca4
leaq 0x30(%r13), %rdi
callq 0x4040
leaq 0x8(%r13), %rbx
movq %rbx, %rdi
callq 0x4040
movq 0x58(%r13), %rax
cmpq (%r12), %rax
jbe 0x5c6c
movq %rax, (%r12)
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x6295(%rip), %rdi      # 0xbf10
movq %rbx, %rsi
callq 0x4730
movq 0x58(%r13), %rax
movq 0x6322(%rip), %rcx      # 0xbfb0
movq (%rcx), %rcx
cmpq 0x58(%rcx), %rax
movl $0x1, %eax
cmovaeq %rax, %r14
cmpq $0x0, (%r15)
jne 0x5c3c
movq 0x62d5(%rip), %rax      # 0xbf80
cmpq $0x0, (%rax)
jne 0x5cc6
cmpq $0x1, %r14
jne 0x5cdd
jmp 0x5cf1
movq 0x62c0(%rip), %rax      # 0xbf80
cmpq $0x0, (%rax)
je 0x5cdd
movq 0x62b3(%rip), %rbx      # 0xbf80
cmpq $0x0, (%rbx)
je 0x5cf1
callq 0x43d0
decq (%rbx)
jmp 0x5ccd
movq 0x61f4(%rip), %rax      # 0xbed8
movq (%rax), %rax
cmpq $0x1, %rax
jne 0x5c0d
movq 0x61e0(%rip), %rax      # 0xbed8
movq $0x0, (%rax)
callq 0x4540
movl $0x1, %ebx
callq 0x4480
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq