#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 tms {
  scalar_t__ tms_cstime;
  scalar_t__ tms_cutime;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ _SC_CLK_TCK;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ execv(char *, char **const);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, int *, int);
int sysconf(int /*<<< orphan*/);
scalar_t__ times(struct tms *);
int wait(int *);
int /*<<< orphan*/ write(int, int *, int);
int main(int argc, char **argv) {
  int i, pid, status, pd[2], ticks_per_second;
  struct timeval startwtime, endwtime;
  double seq_time, usec, ssec;
  struct tms buf;
  char **const params = (char **)malloc((argc - 1) * sizeof(char *));
  for (i = 1; i < argc; i++) {
    params[i - 1] = argv[i];
  }
  if (pipe(pd) < 0) {
    printf("\n Can't open pipe! \n");
    exit(-1);
  }
  printf("\n\n");
  pid = fork();
  if (pid >= 0) {
    if (pid == 0) {
      gettimeofday(&startwtime, NULL);
      close(pd[0]);
      write(pd[1], &startwtime.tv_sec, 4);
      write(pd[1], &startwtime.tv_usec, 4);
      close(pd[1]);
      execv(argv[1], params);
      exit(EXIT_FAILURE);
    } else {
      if (wait(&status) == -1) {
        printf(" Wait failed! \n");
        exit(-6);
      }
      int sec, usec;
      close(pd[1]);
      read(pd[0], &sec, 4);
      read(pd[0], &usec, 4);
      close(pd[0]);
      gettimeofday(&endwtime, NULL);
      seq_time =
          (double)((endwtime.tv_usec - usec) / 1.0e6 + endwtime.tv_sec - sec);
      if (times(&buf) < 0) {
        printf("Times error\n");
        exit(-5);
      }
      ticks_per_second = sysconf(_SC_CLK_TCK);
      printf("\n Command to be executed: ");
      for (i = 0; i < (argc - 1); i++)
        printf("%s ", params[i]);
      printf("\n Complete time ( real time ) = %fs\n", seq_time);
      printf(" CPU time ( user time ) = %fs\n",
             (double)buf.tms_cutime / (double)ticks_per_second);
      printf(" CPU time ( system time ) = %fs\n\n",
             (double)buf.tms_cstime / (double)ticks_per_second);
    }
  } else {
    printf("\n Fork failed! \n");
    exit(-3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x68(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123b <main+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x68(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0x34>
lea    -0x24(%rbp),%rdi
call   1070 <pipe@plt>
cmp    $0x0,%rax
jge    1266 <main+0x96>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1466 <main+0x296>
cmpl   $0x0,-0x18(%rbp)
jne    12f4 <main+0x124>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x20(%rbp),%edi
lea    -0x30(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x68(%rbp),%rsi
call   10e0 <execv@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    -0x1c(%rbp),%rdi
call   10d0 <wait@plt>
cmp    $0xffffffff,%eax
jne    131e <main+0x14e>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    -0x24(%rbp),%edi
lea    -0x6c(%rbp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
mov    -0x24(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x4,%edx
call   1080 <read@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <gettimeofday@plt>
mov    -0x34(%rbp),%eax
sub    -0x70(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xc91(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x60(%rbp),%rdi
call   10a0 <times@plt>
cmp    $0x0,%rax
jge    13b5 <main+0x1e5>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xfffffffb,%edi
call   10c0 <exit@plt>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
call   10b0 <sysconf@plt>
mov    %eax,-0x28(%rbp)
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1414 <main+0x244>
mov    -0x68(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13db <main+0x20b>
movsd  -0x40(%rbp),%xmm0
lea    0xc39(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cvtsi2sdq -0x58(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xc41(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cvtsi2sdq -0x60(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xc43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    147e <main+0x2ae>
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xfffffffd,%edi
call   10c0 <exit@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %edi,%r13d
lea    -0x8(,%r13,8),%edi
ff
call   10a0 <malloc@plt>
mov    %rax,%r15
cmp    $0x2,%r13d
jl     137f <main+0x19f>
mov    %r13d,%eax
lea    -0x1(%rax),%rdx
mov    $0x1,%ecx
cmp    $0x4,%rdx
jb     1313 <main+0x133>
lea    (%rbx,%rax,8),%rsi
cmp    %rsi,%r15
jae    1242 <main+0x62>
lea    (%r15,%rax,8),%rsi
add    $0xfffffffffffffff8,%rsi
lea    0x8(%rbx),%rdi
cmp    %rsi,%rdi
jb     1313 <main+0x133>
mov    %rdx,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%ebp
and    $0x3,%ebp
cmp    $0xc,%rdi
jae    1267 <main+0x87>
xor    %edi,%edi
jmp    12d1 <main+0xf1>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nopl   (%rax)
movups 0x8(%rbx,%rdi,8),%xmm0
movups 0x18(%rbx,%rdi,8),%xmm1
movups %xmm0,(%r15,%rdi,8)
movups %xmm1,0x10(%r15,%rdi,8)
movups 0x28(%rbx,%rdi,8),%xmm0
movups 0x38(%rbx,%rdi,8),%xmm1
movups %xmm0,0x20(%r15,%rdi,8)
movups %xmm1,0x30(%r15,%rdi,8)
movups 0x48(%rbx,%rdi,8),%xmm0
movups 0x58(%rbx,%rdi,8),%xmm1
movups %xmm0,0x40(%r15,%rdi,8)
movups %xmm1,0x50(%r15,%rdi,8)
movups 0x68(%rbx,%rdi,8),%xmm0
movups 0x78(%rbx,%rdi,8),%xmm1
movups %xmm0,0x60(%r15,%rdi,8)
movups %xmm1,0x70(%r15,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1270 <main+0x90>
test   %rbp,%rbp
je     130a <main+0x12a>
cs nopw 0x0(%rax,%rax,1)
lea    0x0(,%rdi,8),%rsi
or     $0x8,%rsi
movups (%rbx,%rsi,1),%xmm0
movups 0x10(%rbx,%rsi,1),%xmm1
movups %xmm0,(%r15,%rdi,8)
movups %xmm1,0x10(%r15,%rdi,8)
add    $0x4,%rdi
add    $0xffffffffffffffff,%rbp
jne    12e0 <main+0x100>
cmp    %rcx,%rdx
je     137f <main+0x19f>
or     $0x1,%rcx
mov    %eax,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
and    $0x3,%rsi
je     1343 <main+0x163>
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%rcx,8),%rdi
mov    %rdi,-0x8(%r15,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1330 <main+0x150>
cmp    $0x3,%rdx
jb     137f <main+0x19f>
nopl   0x0(%rax)
mov    (%rbx,%rcx,8),%rdx
mov    %rdx,-0x8(%r15,%rcx,8)
mov    0x8(%rbx,%rcx,8),%rdx
mov    %rdx,(%r15,%rcx,8)
mov    0x10(%rbx,%rcx,8),%rdx
mov    %rdx,0x8(%r15,%rcx,8)
mov    0x18(%rbx,%rcx,8),%rdx
mov    %rdx,0x10(%r15,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1350 <main+0x170>
lea    0x8(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
js     151c <main+0x33c>
lea    -0x1(%r13),%ebp
lea    0xcee(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1100 <fork@plt>
test   %eax,%eax
js     1532 <main+0x352>
je     1548 <main+0x368>
lea    0x44(%rsp),%rdi
call   10e0 <wait@plt>
cmp    $0xffffffff,%eax
je     15a7 <main+0x3c7>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%edi
lea    0x24(%rsp),%rsi
mov    $0x4,%edx
call   1090 <read@plt>
mov    0x8(%rsp),%edi
lea    0x20(%rsp),%rsi
mov    $0x4,%edx
call   1090 <read@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x28(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x2c(%rsp),%r14d
mov    0x20(%rsp),%r12d
mov    0x24(%rsp),%eax
mov    %eax,0x1c(%rsp)
lea    0x30(%rsp),%rdi
call   10b0 <times@plt>
test   %rax,%rax
js     15bd <main+0x3dd>
mov    0x2b9e(%rip),%rax
mov    (%rax),%edi
call   10c0 <sysconf@plt>
mov    %eax,0x18(%rsp)
lea    0xbb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2,%r13d
jl     1487 <main+0x2a7>
mov    %ebp,%r13d
lea    0xbb8(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    (%r15,%rbp,8),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1470 <main+0x290>
sub    %r12d,%r14d
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
divsd  0xb66(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x1c(%rsp),%xmm1
subsd  %xmm1,%xmm0
lea    0xb6c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x38(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x18(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
divsd  %xmm1,%xmm0
lea    0xb66(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x30(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
lea    0xb67(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb95(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
lea    0xb54(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffd,%edi
call   10d0 <exit@plt>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
mov    $0x4,%edx
call   1040 <write@plt>
mov    0xc(%rsp),%edi
lea    0x34(%rsp),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rbx),%rdi
mov    %r15,%rsi
call   10f0 <execv@plt>
mov    0x2a38(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    0xafb(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffa,%edi
call   10d0 <exit@plt>
lea    0xad9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffb,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.tms = type { i64, i64 }
@.str = [21 x i8] c"\0A Can't open pipe! \0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [16 x i8] c" Wait failed! \0A\00"
@.str.3 = [13 x i8] c"Times error\0A\00"
@_SC_CLK_TCK = global i32 0
@.str.4 = [27 x i8] c"\0A Command to be executed: \00"
@.str.5 = [4 x i8] c"%s \00"
@.str.6 = [37 x i8] c"\0A Complete time ( real time ) = %fs\0A\00"
@.str.7 = [31 x i8] c" CPU time ( user time ) = %fs\0A\00"
@.str.8 = [34 x i8] c" CPU time ( system time ) = %fs\0A\0A\00"
@.str.9 = [17 x i8] c"\0A Fork failed! \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i32]
%10 = alloca i32
%11 = alloca %struct.timeval
%12 = alloca %struct.timeval
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca %struct.tms
%17 = alloca i8**
%18 = alloca i32
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to i8**
store i8** %26, i8*** %17
store i32 1, i32* %6
br label %27
27: ; preds = %42, %2
%28 = load i32, i32* %6
%29 = load i32, i32* %4
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %45
31: ; preds = %27
%32 = load i8**, i8*** %5
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %17
%38 = load i32, i32* %6
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %37, i64 %40
store i8* %36, i8** %41
br label %42
42: ; preds = %31
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %27
45: ; preds = %27
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%47 = call i64 @pipe(i32* %46)
%48 = icmp slt i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @exit(i32 -1)
unreachable
52: ; preds = %45
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%54 = call i32 (...) @fork()
store i32 %54, i32* %7
%55 = load i32, i32* %7
%56 = icmp sge i32 %55, 0
br i1 %56, label %57, label %158
57: ; preds = %52
%58 = load i32, i32* %7
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %83
60: ; preds = %57
%61 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%63 = load i32, i32* %62
%64 = call i32 @close(i32 %63)
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%66 = load i32, i32* %65
%67 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
%68 = call i32 @write(i32 %66, i32* %67, i32 4)
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%70 = load i32, i32* %69
%71 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
%72 = call i32 @write(i32 %70, i32* %71, i32 4)
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%74 = load i32, i32* %73
%75 = call i32 @close(i32 %74)
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 1
%78 = load i8*, i8** %77
%79 = load i8**, i8*** %17
%80 = call i32 @execv(i8* %78, i8** %79)
%81 = load i32, i32* @EXIT_FAILURE
%82 = call i32 @exit(i32 %81)
unreachable
83: ; preds = %57
%84 = call i32 @wait(i32* %8)
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %89
86: ; preds = %83
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%88 = call i32 @exit(i32 -6)
unreachable
89: ; preds = %83
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%91 = load i32, i32* %90
%92 = call i32 @close(i32 %91)
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%94 = load i32, i32* %93
%95 = call i32 @read(i32 %94, i32* %18, i32 4)
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%97 = load i32, i32* %96
%98 = call i32 @read(i32 %97, i32* %19, i32 4)
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%100 = load i32, i32* %99
%101 = call i32 @close(i32 %100)
%102 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%103 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%104 = load i32, i32* %103
%105 = load i32, i32* %19
%106 = sub nsw i32 %104, %105
%107 = sitofp i32 %106 to double
%108 = fdiv double %107, 1.000000e+06
%109 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%110 = load i32, i32* %109
%111 = sitofp i32 %110 to double
%112 = fadd double %108, %111
%113 = load i32, i32* %18
%114 = sitofp i32 %113 to double
%115 = fsub double %112, %114
store double %115, double* %13
%116 = call i64 @times(%struct.tms* %16)
%117 = icmp slt i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %89
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%120 = call i32 @exit(i32 -5)
unreachable
121: ; preds = %89
%122 = load i32, i32* @_SC_CLK_TCK
%123 = call i32 @sysconf(i32 %122)
store i32 %123, i32* %10
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %125
125: ; preds = %137, %121
%126 = load i32, i32* %6
%127 = load i32, i32* %4
%128 = sub nsw i32 %127, 1
%129 = icmp slt i32 %126, %128
br i1 %129, label %130, label %140
130: ; preds = %125
%131 = load i8**, i8*** %17
%132 = load i32, i32* %6
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %135)
br label %137
137: ; preds = %130
%138 = load i32, i32* %6
%139 = add nsw i32 %138, 1
store i32 %139, i32* %6
br label %125
140: ; preds = %125
%141 = load double, double* %13
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), double %141)
%143 = getelementptr inbounds %struct.tms, %struct.tms* %16, i32 0, i32 1
%144 = load i64, i64* %143
%145 = sitofp i64 %144 to double
%146 = load i32, i32* %10
%147 = sitofp i32 %146 to double
%148 = fdiv double %145, %147
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), double %148)
%150 = getelementptr inbounds %struct.tms, %struct.tms* %16, i32 0, i32 0
%151 = load i64, i64* %150
%152 = sitofp i64 %151 to double
%153 = load i32, i32* %10
%154 = sitofp i32 %153 to double
%155 = fdiv double %152, %154
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), double %155)
br label %157
157: ; preds = %140
br label %161
158: ; preds = %52
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%160 = call i32 @exit(i32 -3)
unreachable
161: ; preds = %157
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.tms = type { i64, i64 }
@EXIT_FAILURE = global i32 0
@_SC_CLK_TCK = global i32 0
@.str.4 = [27 x i8] c"\0A Command to be executed: \00"
@.str.5 = [4 x i8] c"%s \00"
@.str.6 = [37 x i8] c"\0A Complete time ( real time ) = %fs\0A\00"
@.str.7 = [31 x i8] c" CPU time ( user time ) = %fs\0A\00"
@.str.8 = [34 x i8] c" CPU time ( system time ) = %fs\0A\0A\00"
@str = [2 x i8] c"\0A\00"
@str.10 = [16 x i8] c"\0A Fork failed! \00"
@str.11 = [12 x i8] c"Times error\00"
@str.12 = [15 x i8] c" Wait failed! \00"
@str.13 = [20 x i8] c"\0A Can't open pipe! \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca %struct.tms
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %3 to i8*
%11 = bitcast [2 x i32]* %4 to i8*
%12 = bitcast %struct.timeval* %5 to i8*
%13 = bitcast %struct.timeval* %6 to i8*
%14 = bitcast %struct.tms* %7 to i8*
%15 = add nsw i32 %0, -1
%16 = shl i32 %15, 3
%17 = tail call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i8**
%19 = inttoptr i64 %17 to i8*
%20 = icmp sgt i32 %0, 1
br i1 %20, label %21, label %159
21: ; preds = %2
%22 = zext i32 %0 to i64
%23 = add nsw i64 %22, -1
%24 = icmp ult i64 %23, 4
br i1 %24, label %119, label %25
25: ; preds = %21
%26 = add nsw i64 %22, -1
%27 = getelementptr i8*, i8** %18, i64 %26
%28 = getelementptr i8*, i8** %1, i64 1
%29 = getelementptr i8*, i8** %1, i64 %22
%30 = bitcast i8** %29 to i8*
%31 = icmp ult i8* %19, %30
%32 = icmp ult i8** %28, %27
%33 = and i1 %31, %32
br i1 %33, label %119, label %34
34: ; preds = %25
%35 = and i64 %23, -4
%36 = or i64 %35, 1
%37 = add nsw i64 %35, -4
%38 = lshr exact i64 %37, 2
%39 = add nuw nsw i64 %38, 1
%40 = and i64 %39, 3
%41 = icmp ult i64 %37, 12
br i1 %41, label %97, label %42
42: ; preds = %34
%43 = and i64 %39, 9223372036854775804
br label %44
44: ; preds = %44, %42
%45 = phi i64 [ 0, %42 ], [ %94, %44 ]
%46 = phi i64 [ 0, %42 ], [ %95, %44 ]
%47 = or i64 %45, 1
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = bitcast i8** %48 to <2 x i8*>*
%50 = load <2 x i8*>, <2 x i8*>* %49
%51 = getelementptr inbounds i8*, i8** %48, i64 2
%52 = bitcast i8** %51 to <2 x i8*>*
%53 = load <2 x i8*>, <2 x i8*>* %52
%54 = getelementptr inbounds i8*, i8** %18, i64 %45
%55 = bitcast i8** %54 to <2 x i8*>*
store <2 x i8*> %50, <2 x i8*>* %55
%56 = getelementptr inbounds i8*, i8** %54, i64 2
%57 = bitcast i8** %56 to <2 x i8*>*
store <2 x i8*> %53, <2 x i8*>* %57
%58 = or i64 %45, 4
%59 = or i64 %45, 5
%60 = getelementptr inbounds i8*, i8** %1, i64 %59
%61 = bitcast i8** %60 to <2 x i8*>*
%62 = load <2 x i8*>, <2 x i8*>* %61
%63 = getelementptr inbounds i8*, i8** %60, i64 2
%64 = bitcast i8** %63 to <2 x i8*>*
%65 = load <2 x i8*>, <2 x i8*>* %64
%66 = getelementptr inbounds i8*, i8** %18, i64 %58
%67 = bitcast i8** %66 to <2 x i8*>*
store <2 x i8*> %62, <2 x i8*>* %67
%68 = getelementptr inbounds i8*, i8** %66, i64 2
%69 = bitcast i8** %68 to <2 x i8*>*
store <2 x i8*> %65, <2 x i8*>* %69
%70 = or i64 %45, 8
%71 = or i64 %45, 9
%72 = getelementptr inbounds i8*, i8** %1, i64 %71
%73 = bitcast i8** %72 to <2 x i8*>*
%74 = load <2 x i8*>, <2 x i8*>* %73
%75 = getelementptr inbounds i8*, i8** %72, i64 2
%76 = bitcast i8** %75 to <2 x i8*>*
%77 = load <2 x i8*>, <2 x i8*>* %76
%78 = getelementptr inbounds i8*, i8** %18, i64 %70
%79 = bitcast i8** %78 to <2 x i8*>*
store <2 x i8*> %74, <2 x i8*>* %79
%80 = getelementptr inbounds i8*, i8** %78, i64 2
%81 = bitcast i8** %80 to <2 x i8*>*
store <2 x i8*> %77, <2 x i8*>* %81
%82 = or i64 %45, 12
%83 = or i64 %45, 13
%84 = getelementptr inbounds i8*, i8** %1, i64 %83
%85 = bitcast i8** %84 to <2 x i8*>*
%86 = load <2 x i8*>, <2 x i8*>* %85
%87 = getelementptr inbounds i8*, i8** %84, i64 2
%88 = bitcast i8** %87 to <2 x i8*>*
%89 = load <2 x i8*>, <2 x i8*>* %88
%90 = getelementptr inbounds i8*, i8** %18, i64 %82
%91 = bitcast i8** %90 to <2 x i8*>*
store <2 x i8*> %86, <2 x i8*>* %91
%92 = getelementptr inbounds i8*, i8** %90, i64 2
%93 = bitcast i8** %92 to <2 x i8*>*
store <2 x i8*> %89, <2 x i8*>* %93
%94 = add nuw i64 %45, 16
%95 = add nuw i64 %46, 4
%96 = icmp eq i64 %95, %43
br i1 %96, label %97, label %44
97: ; preds = %44, %34
%98 = phi i64 [ 0, %34 ], [ %94, %44 ]
%99 = icmp eq i64 %40, 0
br i1 %99, label %117, label %100
100: ; preds = %97, %100
%101 = phi i64 [ %114, %100 ], [ %98, %97 ]
%102 = phi i64 [ %115, %100 ], [ 0, %97 ]
%103 = or i64 %101, 1
%104 = getelementptr inbounds i8*, i8** %1, i64 %103
%105 = bitcast i8** %104 to <2 x i8*>*
%106 = load <2 x i8*>, <2 x i8*>* %105
%107 = getelementptr inbounds i8*, i8** %104, i64 2
%108 = bitcast i8** %107 to <2 x i8*>*
%109 = load <2 x i8*>, <2 x i8*>* %108
%110 = getelementptr inbounds i8*, i8** %18, i64 %101
%111 = bitcast i8** %110 to <2 x i8*>*
store <2 x i8*> %106, <2 x i8*>* %111
%112 = getelementptr inbounds i8*, i8** %110, i64 2
%113 = bitcast i8** %112 to <2 x i8*>*
store <2 x i8*> %109, <2 x i8*>* %113
%114 = add nuw i64 %101, 4
%115 = add i64 %102, 1
%116 = icmp eq i64 %115, %40
br i1 %116, label %117, label %100
117: ; preds = %100, %97
%118 = icmp eq i64 %23, %35
br i1 %118, label %159, label %119
119: ; preds = %25, %21, %117
%120 = phi i64 [ 1, %25 ], [ 1, %21 ], [ %36, %117 ]
%121 = sub nsw i64 %22, %120
%122 = xor i64 %120, -1
%123 = add nsw i64 %122, %22
%124 = and i64 %121, 3
%125 = icmp eq i64 %124, 0
br i1 %125, label %136, label %126
126: ; preds = %119, %126
%127 = phi i64 [ %133, %126 ], [ %120, %119 ]
%128 = phi i64 [ %134, %126 ], [ 0, %119 ]
%129 = getelementptr inbounds i8*, i8** %1, i64 %127
%130 = load i8*, i8** %129
%131 = add nsw i64 %127, -1
%132 = getelementptr inbounds i8*, i8** %18, i64 %131
store i8* %130, i8** %132
%133 = add nuw nsw i64 %127, 1
%134 = add i64 %128, 1
%135 = icmp eq i64 %134, %124
br i1 %135, label %136, label %126
136: ; preds = %126, %119
%137 = phi i64 [ %120, %119 ], [ %133, %126 ]
%138 = icmp ult i64 %123, 3
br i1 %138, label %159, label %139
139: ; preds = %136, %139
%140 = phi i64 [ %157, %139 ], [ %137, %136 ]
%141 = getelementptr inbounds i8*, i8** %1, i64 %140
%142 = load i8*, i8** %141
%143 = add nsw i64 %140, -1
%144 = getelementptr inbounds i8*, i8** %18, i64 %143
store i8* %142, i8** %144
%145 = add nuw nsw i64 %140, 1
%146 = getelementptr inbounds i8*, i8** %1, i64 %145
%147 = load i8*, i8** %146
%148 = getelementptr inbounds i8*, i8** %18, i64 %140
store i8* %147, i8** %148
%149 = add nuw nsw i64 %140, 2
%150 = getelementptr inbounds i8*, i8** %1, i64 %149
%151 = load i8*, i8** %150
%152 = getelementptr inbounds i8*, i8** %18, i64 %145
store i8* %151, i8** %152
%153 = add nuw nsw i64 %140, 3
%154 = getelementptr inbounds i8*, i8** %1, i64 %153
%155 = load i8*, i8** %154
%156 = getelementptr inbounds i8*, i8** %18, i64 %149
store i8* %155, i8** %156
%157 = add nuw nsw i64 %140, 4
%158 = icmp eq i64 %157, %22
br i1 %158, label %159, label %139
159: ; preds = %136, %139, %117, %2
%160 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%161 = call i64 @pipe(i32* %160)
%162 = icmp slt i64 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %159
%164 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
%165 = call i32 @exit(i32 -1)
unreachable
166: ; preds = %159
%167 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%168 = call i32 (...) @fork()
%169 = icmp sgt i32 %168, -1
br i1 %169, label %170, label %253
170: ; preds = %166
%171 = icmp eq i32 %168, 0
br i1 %171, label %172, label %190
172: ; preds = %170
%173 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%174 = load i32, i32* %160
%175 = call i32 @close(i32 %174)
%176 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%177 = load i32, i32* %176
%178 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%179 = call i32 @write(i32 %177, i32* %178, i32 4)
%180 = load i32, i32* %176
%181 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%182 = call i32 @write(i32 %180, i32* %181, i32 4)
%183 = load i32, i32* %176
%184 = call i32 @close(i32 %183)
%185 = getelementptr inbounds i8*, i8** %1, i64 1
%186 = load i8*, i8** %185
%187 = call i32 @execv(i8* %186, i8** %18)
%188 = load i32, i32* @EXIT_FAILURE
%189 = call i32 @exit(i32 %188)
unreachable
190: ; preds = %170
%191 = call i32 @wait(i32* %3)
%192 = icmp eq i32 %191, -1
br i1 %192, label %193, label %196
193: ; preds = %190
%194 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%195 = call i32 @exit(i32 -6)
unreachable
196: ; preds = %190
%197 = bitcast i32* %8 to i8*
%198 = bitcast i32* %9 to i8*
%199 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%200 = load i32, i32* %199
%201 = call i32 @close(i32 %200)
%202 = load i32, i32* %160
%203 = call i32 @read(i32 %202, i32* %8, i32 4)
%204 = load i32, i32* %160
%205 = call i32 @read(i32 %204, i32* %9, i32 4)
%206 = load i32, i32* %160
%207 = call i32 @close(i32 %206)
%208 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%209 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%210 = load i32, i32* %209
%211 = load i32, i32* %9
%212 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%213 = load i32, i32* %212
%214 = load i32, i32* %8
%215 = call i64 @times(%struct.tms* %7)
%216 = icmp slt i64 %215, 0
br i1 %216, label %217, label %220
217: ; preds = %196
%218 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.11, i64 0, i64 0))
%219 = call i32 @exit(i32 -5)
unreachable
220: ; preds = %196
%221 = load i32, i32* @_SC_CLK_TCK
%222 = call i32 @sysconf(i32 %221)
%223 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br i1 %20, label %224, label %233
224: ; preds = %220
%225 = zext i32 %15 to i64
br label %226
226: ; preds = %224, %226
%227 = phi i64 [ 0, %224 ], [ %231, %226 ]
%228 = getelementptr inbounds i8*, i8** %18, i64 %227
%229 = load i8*, i8** %228
%230 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %229)
%231 = add nuw nsw i64 %227, 1
%232 = icmp eq i64 %231, %225
br i1 %232, label %233, label %226
233: ; preds = %226, %220
%234 = sub nsw i32 %210, %211
%235 = sitofp i32 %234 to double
%236 = fdiv double %235, 1.000000e+06
%237 = sitofp i32 %213 to double
%238 = fadd double %236, %237
%239 = sitofp i32 %214 to double
%240 = fsub double %238, %239
%241 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), double %240)
%242 = getelementptr inbounds %struct.tms, %struct.tms* %7, i64 0, i32 1
%243 = load i64, i64* %242
%244 = sitofp i64 %243 to double
%245 = sitofp i32 %222 to double
%246 = fdiv double %244, %245
%247 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), double %246)
%248 = getelementptr inbounds %struct.tms, %struct.tms* %7, i64 0, i32 0
%249 = load i64, i64* %248
%250 = sitofp i64 %249 to double
%251 = fdiv double %250, %245
%252 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), double %251)
ret i32 0
253: ; preds = %166
%254 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.10, i64 0, i64 0))
%255 = call i32 @exit(i32 -3)
unreachable
}