// File: /workspace/github_c_makefile_star2_O0/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskDelayUntil
void vTaskDelayUntil( portTickType * const pxPreviousWakeTime, portTickType xTimeIncrement )
	{
	portTickType xTimeToWake;
	portBASE_TYPE xAlreadyYielded, xShouldDelay = pdFALSE;

		vTaskSuspendAll();
		{
			/* Generate the tick time at which the task wants to wake. */
			xTimeToWake = *pxPreviousWakeTime + xTimeIncrement;

			if( xTickCount < *pxPreviousWakeTime )
			{
				/* The tick count has overflowed since this function was
				lasted called.  In this case the only time we should ever
				actually delay is if the wake time has also	overflowed,
				and the wake time is greater than the tick time.  When this
				is the case it is as if neither time had overflowed. */
				if( ( xTimeToWake < *pxPreviousWakeTime ) && ( xTimeToWake > xTickCount ) )
				{
					xShouldDelay = pdTRUE;
				}
			}
			else
			{
				/* The tick time has not overflowed.  In this case we will
				delay if either the wake time has overflowed, and/or the
				tick time is less than the wake time. */
				if( ( xTimeToWake < *pxPreviousWakeTime ) || ( xTimeToWake > xTickCount ) )
				{
					xShouldDelay = pdTRUE;
				}
			}

			/* Update the wake time ready for the next call. */
			*pxPreviousWakeTime = xTimeToWake;

			if( xShouldDelay )
			{
				traceTASK_DELAY_UNTIL();

				/* 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 * ) &( pxCurrentTCB->xGenericListItem ) );

				/* The list item will be inserted in wake time order. */
				listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );

				if( xTimeToWake < xTickCount )
				{
					/* Wake time has overflowed.  Place this item in the
					overflow list. */
					vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
				}
				else
				{
					/* The wake time has not overflowed, so we can use the
					current block list. */
					vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
				}
			}
		}
		xAlreadyYielded = xTaskResumeAll();

		/* Force a reschedule if xTaskResumeAll has not already done so, we may
		have put ourselves to sleep. */
		if( !xAlreadyYielded )
		{
			portYIELD_WITHIN_API();
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x20(%rbp)
callq 0x4650
movq -0x8(%rbp), %rax
movl (%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movq 0x77c1(%rip), %rax      # 0xdee0
movl (%rax), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x674e
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x674c
movl -0x10(%rbp), %eax
movq 0x77a2(%rip), %rcx      # 0xdee0
movl (%rcx), %ecx
cmpl %ecx, %eax
jbe 0x674c
movq $0x1, -0x20(%rbp)
jmp 0x6773
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x6769
movl -0x10(%rbp), %eax
movq 0x777d(%rip), %rcx      # 0xdee0
movl (%rcx), %ecx
cmpl %ecx, %eax
jbe 0x6771
movq $0x1, -0x20(%rbp)
jmp 0x6773
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x67f4
movq 0x7826(%rip), %rax      # 0xdfb0
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x4040
movl -0x10(%rbp), %ecx
movq 0x7810(%rip), %rax      # 0xdfb0
movq (%rax), %rax
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %eax
movq 0x7730(%rip), %rcx      # 0xdee0
movl (%rcx), %ecx
cmpl %ecx, %eax
jae 0x67d5
movq 0x77a3(%rip), %rax      # 0xdf60
movq (%rax), %rdi
movq 0x77e9(%rip), %rax      # 0xdfb0
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x4090
jmp 0x67f2
movq 0x77e4(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
movq 0x77ca(%rip), %rax      # 0xdfb0
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x4090
jmp 0x67f4
callq 0x4080
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6809
callq 0x4560
addq $0x20, %rsp
popq %rbp
retq
nop