#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 */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, scalar_t__);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ testCmd();
int /*<<< orphan*/ testGetRedirectionType();
int /*<<< orphan*/ testGetWorkingDirectory();
int /*<<< orphan*/ testRemoveCarriageReturn();
int /*<<< orphan*/ testWriteToFile();
int main(int argc, char *argv[]) {
  puts("Starting Unit Testing");
  struct timeval stop, start;
  gettimeofday(&start, NULL);
  testRemoveCarriageReturn();
  testWriteToFile();
  testGetRedirectionType();
  testGetWorkingDirectory();
  testCmd();
  gettimeofday(&stop, NULL);
  printf("Unitary test success : %lu ms\n", stop.tv_usec - start.tv_usec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    $0x0,%al
call   1050 <testRemoveCarriageReturn@plt>
mov    $0x0,%al
call   1080 <testWriteToFile@plt>
mov    $0x0,%al
call   10a0 <testGetRedirectionType@plt>
mov    $0x0,%al
call   1090 <testGetWorkingDirectory@plt>
mov    $0x0,%al
call   1070 <testCmd@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x18(%rbp),%rsi
sub    -0x20(%rbp),%rsi
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
xor    %eax,%eax
call   1050 <testRemoveCarriageReturn@plt>
xor    %eax,%eax
call   1080 <testWriteToFile@plt>
xor    %eax,%eax
call   10a0 <testGetRedirectionType@plt>
xor    %eax,%eax
call   1090 <testGetWorkingDirectory@plt>
xor    %eax,%eax
call   1070 <testCmd@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x10(%rsp),%rsi
sub    0x8(%rsp),%rsi
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
@.str = [22 x i8] c"Starting Unit Testing\00"
@.str.1 = [31 x i8] c"Unitary test success : %lu ms\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @gettimeofday(%struct.timeval* %7, i32* null)
%10 = call i32 (...) @testRemoveCarriageReturn()
%11 = call i32 (...) @testWriteToFile()
%12 = call i32 (...) @testGetRedirectionType()
%13 = call i32 (...) @testGetWorkingDirectory()
%14 = call i32 (...) @testCmd()
%15 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%17 = load i64, i64* %16
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sub nsw i64 %17, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %20)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
@.str = [22 x i8] c"Starting Unit Testing\00"
@.str.1 = [31 x i8] c"Unitary test success : %lu ms\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = bitcast %struct.timeval* %3 to i8*
%7 = bitcast %struct.timeval* %4 to i8*
%8 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%9 = tail call i32 (...) @testRemoveCarriageReturn()
%10 = tail call i32 (...) @testWriteToFile()
%11 = tail call i32 (...) @testGetRedirectionType()
%12 = tail call i32 (...) @testGetWorkingDirectory()
%13 = tail call i32 (...) @testCmd()
%14 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%16 = load i64, i64* %15
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%18 = load i64, i64* %17
%19 = sub nsw i64 %16, %18
%20 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i64 %19)
ret i32 0
}