#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 */
typedef scalar_t__ clock_t;

/* Variables and functions */
float CLOCKS_PER_SEC;
scalar_t__ clock();
scalar_t__ comp(int, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i;
  argc--;
  clock_t timer;
  timer = clock();
  if (argc < 2) {
    printf("lack of file error\n");
    exit(1);
  }
  if (comp(argc, &argv[1])) {
    printf("comp error\n");
    exit(1);
  }
  printf("done %fs\n", (float)(clock() - timer) / CLOCKS_PER_SEC);
  exit(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)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    118c <main+0x4c>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <comp@plt>
cmp    $0x0,%rax
je     11be <main+0x7e>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <clock@plt>
sub    -0x20(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    0x2e13(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <clock@plt>
cmp    $0x2,%ebp
jg     116e <main+0x1e>
lea    0xea9(%rip),%rdi
jmp    11c1 <main+0x71>
mov    %rax,%r14
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <comp@plt>
test   %rax,%rax
jne    11ba <main+0x6a>
xor    %eax,%eax
call   1050 <clock@plt>
sub    %r14,%rax
cvtsi2ss %rax,%xmm0
mov    0x2e4b(%rip),%rax
divss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"lack of file error\0A\00"
@.str.1 = [12 x i8] c"comp error\0A\00"
@.str.2 = [10 x i8] c"done %fs\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = call i64 (...) @clock()
store i64 %10, i64* %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = call i64 @comp(i32 %17, i8** %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %16
%26 = call i64 (...) @clock()
%27 = load i64, i64* %7
%28 = sub nsw i64 %26, %27
%29 = sitofp i64 %28 to float
%30 = load float, float* @CLOCKS_PER_SEC
%31 = fdiv float %29, %30
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %32)
%34 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.2 = [10 x i8] c"done %fs\0A\00"
@CLOCKS_PER_SEC = global float 0.000000e+00
@str = [11 x i8] c"comp error\00"
@str.3 = [19 x i8] c"lack of file error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @clock()
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = tail call i64 @comp(i32 %9, i8** %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %8
%17 = tail call i64 (...) @clock()
%18 = sub nsw i64 %17, %3
%19 = sitofp i64 %18 to float
%20 = load float, float* @CLOCKS_PER_SEC
%21 = fdiv float %19, %20
%22 = fpext float %21 to double
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = tail call i32 @exit(i32 0)
unreachable
}