// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq $0x0, -0x10(%rbp)
callq 0x4330
movq 0x771c(%rip), %rax      # 0xdf68
movq (%rax), %rcx
addq $-0x1, %rcx
movq 0x770e(%rip), %rax      # 0xdf68
movq %rcx, (%rax)
movq 0x7704(%rip), %rax      # 0xdf68
movq (%rax), %rax
cmpq $0x0, %rax
jne 0x69d3
movq 0x76c8(%rip), %rax      # 0xdf40
movq (%rax), %rax
cmpq $0x0, %rax
jbe 0x69d1
movq $0x0, -0x18(%rbp)
movq 0x7704(%rip), %rax      # 0xdf98
movq (%rax), %rax
cmpq $0x0, %rax
je 0x68b2
movq 0x76f4(%rip), %rax      # 0xdf98
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x68ba
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x68ba
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x6954
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
callq 0x4040
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x4040
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x75d3(%rip), %rcx      # 0xdec8
movq (%rcx), %rcx
cmpq %rcx, %rax
jbe 0x690f
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
movq 0x75bc(%rip), %rax      # 0xdec8
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x75f6(%rip), %rdi      # 0xdf10
imulq $0x28, 0x58(%rax), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
callq 0x4760
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x7672(%rip), %rcx      # 0xdfb0
movq (%rcx), %rcx
cmpq 0x58(%rcx), %rax
jb 0x694f
movq $0x1, -0x18(%rbp)
jmp 0x688d
movq 0x7625(%rip), %rax      # 0xdf80
movq (%rax), %rax
cmpq $0x0, %rax
jbe 0x699d
jmp 0x6966
movq 0x7613(%rip), %rax      # 0xdf80
movq (%rax), %rax
cmpq $0x0, %rax
jbe 0x6995
callq 0x43f0
movq 0x75fe(%rip), %rax      # 0xdf80
movq (%rax), %rcx
addq $-0x1, %rcx
movq 0x75f0(%rip), %rax      # 0xdf80
movq %rcx, (%rax)
jmp 0x6966
movq $0x1, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
je 0x69b4
movq 0x752d(%rip), %rax      # 0xded8
movq (%rax), %rax
cmpq $0x1, %rax
jne 0x69cf
movq $0x1, -0x10(%rbp)
movq 0x7515(%rip), %rax      # 0xded8
movq $0x0, (%rax)
callq 0x4560
jmp 0x69d1
jmp 0x69d3
callq 0x44a0
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)