// File: /workspace/github_c_makefile_star2_O3/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 0x5b3e(%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 0x5b68(%rip), %rax      # 0xbfb8
movq (%rax), %r12
leaq (%r12,%r12,4), %r15
incq %r12
shlq $0x3, %r15
addq 0x5aab(%rip), %r15      # 0xbf10
cmpq $0x0, (%r15)
je 0x6479
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4560
decq %r12
addq $-0x28, %r15
testq %r12, %r12
jne 0x6465
movq 0x5b34(%rip), %rax      # 0xbfc0
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x64a3
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x5ab6(%rip), %rax      # 0xbf60
movq (%rax), %rcx
cmpq $0x0, (%rcx)
je 0x64c1
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x5ac0(%rip), %rax      # 0xbf88
cmpq $0x0, (%rax)
je 0x64e0
movq 0x5ab3(%rip), %rsi      # 0xbf88
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
movq 0x5a21(%rip), %rax      # 0xbf08
cmpq $0x0, (%rax)
je 0x64ff
movq 0x5a14(%rip), %rsi      # 0xbf08
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4560
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4080