// File: /workspace/github_c_makefile_star2_O1/weaslepalace[P]FreeRTOS_Posix_Sim/FreeRTOS_Kernel/tasks.c
// Function: vTaskGetRunTimeStats
void vTaskGetRunTimeStats( signed char *pcWriteBuffer )
	{
	unsigned portBASE_TYPE uxQueue;
	unsigned long ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();

		/* This is a VERY costly function that should be used for debug only.
		It leaves interrupts disabled for a LONG time. */

		vTaskSuspendAll();
		{
			/* Run through all the lists that could potentially contain a TCB,
			generating a table of run timer percentages in the provided
			buffer. */

			pcWriteBuffer[ 0 ] = ( signed char ) 0x00;
			strcat( ( char * ) pcWriteBuffer, ( const char * ) "\r\n" );

			uxQueue = uxTopUsedPriority + 1;

			do
			{
				uxQueue--;

				if( !listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxQueue ] ) ) )
				{
					prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), ulTotalRunTime );
				}
			}while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );

			if( !listLIST_IS_EMPTY( pxDelayedTaskList ) )
			{
				prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) pxDelayedTaskList, ulTotalRunTime );
			}

			if( !listLIST_IS_EMPTY( pxOverflowDelayedTaskList ) )
			{
				prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) pxOverflowDelayedTaskList, ulTotalRunTime );
			}

			#if ( INCLUDE_vTaskDelete == 1 )
			{
				if( !listLIST_IS_EMPTY( &xTasksWaitingTermination ) )
				{
					prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &xTasksWaitingTermination, ulTotalRunTime );
				}
			}
			#endif

			#if ( INCLUDE_vTaskSuspend == 1 )
			{
				if( !listLIST_IS_EMPTY( &xSuspendedTaskList ) )
				{
					prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) &xSuspendedTaskList, ulTotalRunTime );
				}
			}
			#endif
		}
		xTaskResumeAll();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x4470
movq 0x5b1a(%rip), %rcx      # 0xbf68
incq (%rcx)
movq %rax, %r14
xorl %r15d, %r15d
movb %r15b, (%rbx)
movq %rbx, %rdi
callq 0x4160
movb %r15b, 0x2(%rbx,%rax)
movw $0xa0d, (%rbx,%rax)     # imm = 0xA0D
movq 0x5b44(%rip), %rax      # 0xbfb8
movq (%rax), %r12
leaq (%r12,%r12,4), %r15
incq %r12
shlq $0x3, %r15
addq 0x5a87(%rip), %r15      # 0xbf10
cmpq $0x0, (%r15)
je 0x649d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4560
decq %r12
addq $-0x28, %r15
testq %r12, %r12
jne 0x6489
movq 0x5b10(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x64c7
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x5a92(%rip), %rax      # 0xbf60
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x64e5
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x5a9c(%rip), %rax      # 0xbf88
cmpq $0x0, (%rax)
je 0x6504
movq 0x5a8f(%rip), %rsi      # 0xbf88
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x59fd(%rip), %rax      # 0xbf08
cmpq $0x0, (%rax)
je 0x6523
movq 0x59f0(%rip), %rsi      # 0xbf08
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4080