// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/croutine.c
// Function: prvCheckDelayedList
static void prvCheckDelayedList( void )
{
corCRCB *pxCRCB;

	xPassedTicks = xTaskGetTickCount() - xLastTickCount;
	while( xPassedTicks )
	{
		xCoRoutineTickCount++;
		xPassedTicks--;

		/* If the tick count has overflowed we need to swap the ready lists. */
		if( xCoRoutineTickCount == 0 )
		{
			xList * pxTemp;

			/* Tick count has overflowed so we need to swap the delay lists.  If there are
			any items in pxDelayedCoRoutineList here then there is an error! */
			pxTemp = pxDelayedCoRoutineList;
			pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
			pxOverflowDelayedCoRoutineList = pxTemp;
		}

		/* See if this tick has made a timeout expire. */
		while( ( pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ) ) != NULL )
		{	
			if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )				
			{			
				/* Timeout not yet expired. */																			
				break;																				
			}																						

			portDISABLE_INTERRUPTS();
			{
				/* The event could have occurred just before this critical
				section.  If this is the case then the generic list item will
				have been moved to the pending ready list and the following
				line is still valid.  Also the pvContainer parameter will have
				been set to NULL so the following lines are also valid. */
				vListRemove( &( pxCRCB->xGenericListItem ) );											

				/* Is the co-routine waiting on an event also? */												
				if( pxCRCB->xEventListItem.pvContainer )													
				{															
					vListRemove( &( pxCRCB->xEventListItem ) );											
				}
			}
			portENABLE_INTERRUPTS();

			prvAddCoRoutineToReadyQueue( pxCRCB );													
		}																									
	}

	xLastTickCount = xCoRoutineTickCount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4300
movq 0x7401(%rip), %rcx      # 0xbed0
movq 0x74ba(%rip), %rdx      # 0xbf90
subl (%rcx), %eax
movl %eax, (%rdx)
je 0x4b9a
movq 0x74b9(%rip), %r12      # 0xbfa0
movq 0x74da(%rip), %r13      # 0xbfc8
movq 0x7483(%rip), %r14      # 0xbf78
decl %eax
incl (%r12)
movl %eax, (%rdx)
jne 0x4b14
movq (%r13), %rax
movq 0x737e(%rip), %rdx      # 0xbe88
movq (%rdx), %rcx
movq %rcx, (%r13)
movq %rax, (%rdx)
movq (%r13), %rax
cmpq $0x0, (%rax)
je 0x4b28
movq 0x18(%rax), %rax
movq 0x18(%rax), %r15
jmp 0x4b2b
xorl %r15d, %r15d
testq %r15, %r15
je 0x4b89
movl (%r12), %eax
cmpl 0x8(%r15), %eax
jb 0x4b89
leaq 0x8(%r15), %rbx
callq 0x4310
movq %rbx, %rdi
callq 0x4040
cmpq $0x0, 0x50(%r15)
je 0x4b5b
leaq 0x30(%r15), %rdi
callq 0x4040
callq 0x43c0
movq 0x58(%r15), %rax
cmpq (%r14), %rax
jbe 0x4b6c
movq %rax, (%r14)
movq 0x58(%r15), %rax
leaq (%rax,%rax,4), %rdi
shlq $0x3, %rdi
addq 0x7321(%rip), %rdi      # 0xbea0
movq %rbx, %rsi
callq 0x4730
jmp 0x4b14
movq 0x7400(%rip), %rdx      # 0xbf90
movl (%rdx), %eax
testl %eax, %eax
jne 0x4af5
movq 0x73ff(%rip), %rax      # 0xbfa0
movl (%rax), %eax
movq 0x7326(%rip), %rcx      # 0xbed0
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq