#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int Create(char *, int);
int /*<<< orphan*/ Delay(int);
int /*<<< orphan*/ Exit();
int /*<<< orphan*/ console_clear();
int /*<<< orphan*/ console_xy(int, int);
int /*<<< orphan*/ cprintf(char *, ...);
main() {
  int i;
  int tid;
  int numTask;
  int NumMatrix;
  int runningTime;
  char inputChar;
  console_clear();
  numTask = 3;
  numTask++;
  tid = Create("Stat", 63 - 1);
  numTask++;
  tid = Create("NameServer", 2);
  Delay(20 * 6);
  console_xy(45, 0);
  cprintf("[ F E M O S ] Fast EMbedded Operating System.    ");
  console_xy(0, 2);
  cprintf("-----------------------------------------------------------------"
          "-----------------------------------------------------------------");
  console_xy(90, 4);
  cprintf("CPU Usage:     %");
  numTask++;
  tid = Create("CommandSrv", 15);
  numTask++;
  tid = Create("SensorSrv", 20);
  numTask++;
  tid = Create("SensorSched", 14);
  numTask++;
  tid = Create("CentralControlMain", 36);
  numTask++;
  tid = Create("PathFind", 38);
  numTask++;
  tid = Create("OneStep", 37);
  numTask++;
  tid = Create("Schedular", 39);
  numTask++;
  tid = Create("Tokenizer", 41);
  numTask++;
  tid = Create("BlackBoardMain", 35);
  console_xy(90, 3);
  cprintf("#Tasks   :  %d s  * Uptime: ", numTask);
  console_xy(0, 5);
  cprintf("-----------------------------------------------------------------"
          "-----------------------------------------------------------------");
  Exit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <console_clear@plt>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x3e,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe62(%rip),%rdi
mov    $0x2,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    $0x78,%edi
call   1030 <Delay@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1070 <console_xy@plt>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1060 <cprintf@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1070 <console_xy@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1060 <cprintf@plt>
mov    $0x5a,%edi
mov    $0x4,%esi
call   1070 <console_xy@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1060 <cprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xebb(%rip),%rdi
mov    $0xf,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x14,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe96(%rip),%rdi
mov    $0xe,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe85(%rip),%rdi
mov    $0x24,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe7b(%rip),%rdi
mov    $0x26,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe67(%rip),%rdi
mov    $0x25,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe52(%rip),%rdi
mov    $0x27,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe3f(%rip),%rdi
mov    $0x29,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe2c(%rip),%rdi
mov    $0x23,%esi
call   1040 <Create@plt>
mov    %eax,-0x8(%rbp)
mov    $0x5a,%edi
mov    $0x3,%esi
call   1070 <console_xy@plt>
mov    -0xc(%rbp),%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1060 <cprintf@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1070 <console_xy@plt>
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1060 <cprintf@plt>
mov    $0x0,%al
call   1080 <Exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <console_clear@plt>
lea    0xe91(%rip),%rdi
mov    $0x3e,%esi
call   1040 <Create@plt>
lea    0xe85(%rip),%rdi
mov    $0x2,%esi
call   1040 <Create@plt>
mov    $0x78,%edi
call   1030 <Delay@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1070 <console_xy@plt>
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1060 <cprintf@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1070 <console_xy@plt>
lea    0xe81(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <cprintf@plt>
mov    $0x5a,%edi
mov    $0x4,%esi
call   1070 <console_xy@plt>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1060 <cprintf@plt>
lea    0xee7(%rip),%rdi
mov    $0xf,%esi
call   1040 <Create@plt>
lea    0xee1(%rip),%rdi
mov    $0x14,%esi
call   1040 <Create@plt>
lea    0xeda(%rip),%rdi
mov    $0xe,%esi
call   1040 <Create@plt>
lea    0xed5(%rip),%rdi
mov    $0x24,%esi
call   1040 <Create@plt>
lea    0xed7(%rip),%rdi
mov    $0x26,%esi
call   1040 <Create@plt>
lea    0xecf(%rip),%rdi
mov    $0x25,%esi
call   1040 <Create@plt>
lea    0xec6(%rip),%rdi
mov    $0x27,%esi
call   1040 <Create@plt>
lea    0xebf(%rip),%rdi
mov    $0x29,%esi
call   1040 <Create@plt>
lea    0xeb8(%rip),%rdi
mov    $0x23,%esi
call   1040 <Create@plt>
mov    $0x5a,%edi
mov    $0x3,%esi
call   1070 <console_xy@plt>
lea    0xea7(%rip),%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1060 <cprintf@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1070 <console_xy@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <cprintf@plt>
xor    %eax,%eax
call   1080 <Exit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Stat\00"
@.str.1 = [11 x i8] c"NameServer\00"
@.str.2 = [50 x i8] c"[ F E M O S ] Fast EMbedded Operating System. \00"
@.str.3 = [131 x i8] c"----------------------------------------------------------------------------------------------------------------------------------\00"
@.str.4 = [17 x i8] c"CPU Usage: %\00"
@.str.5 = [11 x i8] c"CommandSrv\00"
@.str.6 = [10 x i8] c"SensorSrv\00"
@.str.7 = [12 x i8] c"SensorSched\00"
@.str.8 = [19 x i8] c"CentralControlMain\00"
@.str.9 = [9 x i8] c"PathFind\00"
@.str.10 = [8 x i8] c"OneStep\00"
@.str.11 = [10 x i8] c"Schedular\00"
@.str.12 = [10 x i8] c"Tokenizer\00"
@.str.13 = [15 x i8] c"BlackBoardMain\00"
@.str.14 = [29 x i8] c"#Tasks : %d s * Uptime: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = call i32 (...) @console_clear()
store i32 3, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = call i32 @Create(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 62)
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = call i32 @Create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i32 %13, i32* %2
%14 = call i32 @Delay(i32 120)
%15 = call i32 @console_xy(i32 45, i32 0)
%16 = call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @console_xy(i32 0, i32 2)
%18 = call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @console_xy(i32 90, i32 4)
%20 = call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
%23 = call i32 @Create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 15)
store i32 %23, i32* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
%26 = call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 20)
store i32 %26, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
%29 = call i32 @Create(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 14)
store i32 %29, i32* %2
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
%32 = call i32 @Create(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 36)
store i32 %32, i32* %2
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
%35 = call i32 @Create(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 38)
store i32 %35, i32* %2
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
%38 = call i32 @Create(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 37)
store i32 %38, i32* %2
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
%41 = call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 39)
store i32 %41, i32* %2
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
%44 = call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 41)
store i32 %44, i32* %2
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
%47 = call i32 @Create(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 35)
store i32 %47, i32* %2
%48 = call i32 @console_xy(i32 90, i32 3)
%49 = load i32, i32* %3
%50 = call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i32 %49)
%51 = call i32 @console_xy(i32 0, i32 5)
%52 = call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0))
%53 = call i32 (...) @Exit()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Stat\00"
@.str.1 = [11 x i8] c"NameServer\00"
@.str.2 = [50 x i8] c"[ F E M O S ] Fast EMbedded Operating System. \00"
@.str.3 = [131 x i8] c"----------------------------------------------------------------------------------------------------------------------------------\00"
@.str.4 = [17 x i8] c"CPU Usage: %\00"
@.str.5 = [11 x i8] c"CommandSrv\00"
@.str.6 = [10 x i8] c"SensorSrv\00"
@.str.7 = [12 x i8] c"SensorSched\00"
@.str.8 = [19 x i8] c"CentralControlMain\00"
@.str.9 = [9 x i8] c"PathFind\00"
@.str.10 = [8 x i8] c"OneStep\00"
@.str.11 = [10 x i8] c"Schedular\00"
@.str.12 = [10 x i8] c"Tokenizer\00"
@.str.13 = [15 x i8] c"BlackBoardMain\00"
@.str.14 = [29 x i8] c"#Tasks : %d s * Uptime: \00"
define i32 @main() {
%1 = tail call i32 (...) @console_clear()
%2 = tail call i32 @Create(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 62)
%3 = tail call i32 @Create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 @Delay(i32 120)
%5 = tail call i32 @console_xy(i32 45, i32 0)
%6 = tail call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @console_xy(i32 0, i32 2)
%8 = tail call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @console_xy(i32 90, i32 4)
%10 = tail call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @Create(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 15)
%12 = tail call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 20)
%13 = tail call i32 @Create(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 14)
%14 = tail call i32 @Create(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 36)
%15 = tail call i32 @Create(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 38)
%16 = tail call i32 @Create(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 37)
%17 = tail call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 39)
%18 = tail call i32 @Create(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 41)
%19 = tail call i32 @Create(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 35)
%20 = tail call i32 @console_xy(i32 90, i32 3)
%21 = tail call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.14, i64 0, i64 0), i32 14)
%22 = tail call i32 @console_xy(i32 0, i32 5)
%23 = tail call i32 (i8*, ...) @cprintf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.3, i64 0, i64 0))
%24 = tail call i32 (...) @Exit()
ret i32 0
}