#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 */
double mysecond();
int checktick(void) {
  int i, minDelta, Delta;
  double t1, t2, timesfound[20];
  for (i = 0; i < 20; i++) {
    t1 = mysecond();
    while (((t2 = mysecond()) - t1) < 1.0E-6)
      ;
    timesfound[i] = t1 = t2;
  }
  minDelta = 1000000;
  for (i = 1; i < 20; i++) {
    Delta = (int)(1.0E6 * (timesfound[i] - timesfound[i - 1]));
    minDelta = ((minDelta) < (((Delta) > (0) ? (Delta) : (0)))
                    ? (minDelta)
                    : (((Delta) > (0) ? (Delta) : (0))));
  }
  return (minDelta);
}


x86 assembly (clang, -O0):
<checktick>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1188 <checktick+0x78>
mov    $0x0,%al
call   1030 <mysecond@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <mysecond@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x20(%rbp)
subsd  -0x18(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1163 <checktick+0x53>
jmp    1138 <checktick+0x28>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movslq -0x4(%rbp),%rax
movsd  %xmm0,-0xc0(%rbp,%rax,8)
ff ff
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <checktick+0x12>
movl   $0xf4240,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1269 <checktick+0x159>
movslq -0x4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm1
ff ff
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
subsd  -0xc0(%rbp,%rax,8),%xmm1
ff ff
movsd  0xe3a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc4(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11f2 <checktick+0xe2>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc8(%rbp)
jmp    11ff <checktick+0xef>
xor    %eax,%eax
mov    %eax,-0xc8(%rbp)
jmp    11ff <checktick+0xef>
mov    -0xc4(%rbp),%eax
mov    -0xc8(%rbp),%ecx
cmp    %ecx,%eax
jge    1221 <checktick+0x111>
mov    -0x8(%rbp),%eax
mov    %eax,-0xcc(%rbp)
jmp    1252 <checktick+0x142>
cmpl   $0x0,-0xc(%rbp)
jle    1239 <checktick+0x129>
mov    -0xc(%rbp),%eax
mov    %eax,-0xd0(%rbp)
jmp    1246 <checktick+0x136>
xor    %eax,%eax
mov    %eax,-0xd0(%rbp)
jmp    1246 <checktick+0x136>
mov    -0xd0(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xcc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <checktick+0x86>
mov    -0x8(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checktick>:
push   %rbx
sub    $0xb0,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mysecond@plt>
movsd  %xmm0,0x8(%rsp)
nopl   (%rax)
xor    %eax,%eax
call   1030 <mysecond@plt>
movapd %xmm0,%xmm1
subsd  0x8(%rsp),%xmm1
movsd  0xeb7(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1130 <checktick+0x20>
movsd  %xmm0,0x10(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    $0x14,%rbx
jne    1120 <checktick+0x10>
movupd 0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
unpcklpd %xmm2,%xmm0
movapd %xmm2,%xmm1
subpd  %xmm0,%xmm1
movapd 0xe91(%rip),%xmm0
mulpd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm3
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm4
pcmpgtd %xmm1,%xmm4
pand   %xmm3,%xmm4
movdqa 0xe81(%rip),%xmm3
movdqa %xmm3,%xmm5
pcmpgtd %xmm4,%xmm5
pand   %xmm5,%xmm4
pandn  %xmm3,%xmm5
por    %xmm4,%xmm5
movupd 0x28(%rsp),%xmm3
shufpd $0x1,%xmm3,%xmm2
movapd %xmm3,%xmm4
subpd  %xmm2,%xmm4
mulpd  %xmm0,%xmm4
cvttpd2dq %xmm4,%xmm2
movapd %xmm2,%xmm4
pcmpgtd %xmm1,%xmm4
pand   %xmm2,%xmm4
movdqa %xmm4,%xmm2
pcmpgtd %xmm5,%xmm2
pand   %xmm2,%xmm5
pandn  %xmm4,%xmm2
por    %xmm5,%xmm2
movupd 0x38(%rsp),%xmm4
shufpd $0x1,%xmm4,%xmm3
movapd %xmm4,%xmm5
subpd  %xmm3,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm3
movapd %xmm3,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm3,%xmm5
movdqa %xmm5,%xmm3
pcmpgtd %xmm2,%xmm3
pand   %xmm3,%xmm2
pandn  %xmm5,%xmm3
por    %xmm2,%xmm3
movupd 0x48(%rsp),%xmm2
shufpd $0x1,%xmm2,%xmm4
movapd %xmm2,%xmm5
subpd  %xmm4,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm4
movapd %xmm4,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm4,%xmm5
movdqa %xmm5,%xmm4
pcmpgtd %xmm3,%xmm4
pand   %xmm4,%xmm3
pandn  %xmm5,%xmm4
por    %xmm3,%xmm4
movupd 0x58(%rsp),%xmm3
shufpd $0x1,%xmm3,%xmm2
movapd %xmm3,%xmm5
subpd  %xmm2,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm2
movapd %xmm2,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm2,%xmm5
movdqa %xmm5,%xmm2
pcmpgtd %xmm4,%xmm2
pand   %xmm2,%xmm4
pandn  %xmm5,%xmm2
por    %xmm4,%xmm2
movupd 0x68(%rsp),%xmm4
shufpd $0x1,%xmm4,%xmm3
movapd %xmm4,%xmm5
subpd  %xmm3,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm3
movapd %xmm3,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm3,%xmm5
movdqa %xmm5,%xmm3
pcmpgtd %xmm2,%xmm3
pand   %xmm3,%xmm2
pandn  %xmm5,%xmm3
por    %xmm2,%xmm3
movupd 0x78(%rsp),%xmm2
shufpd $0x1,%xmm2,%xmm4
movapd %xmm2,%xmm5
subpd  %xmm4,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm4
movapd %xmm4,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm4,%xmm5
movdqa %xmm5,%xmm4
pcmpgtd %xmm3,%xmm4
pand   %xmm4,%xmm3
pandn  %xmm5,%xmm4
por    %xmm3,%xmm4
movupd 0x88(%rsp),%xmm3
shufpd $0x1,%xmm3,%xmm2
movapd %xmm3,%xmm5
subpd  %xmm2,%xmm5
mulpd  %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm2
movapd %xmm2,%xmm5
pcmpgtd %xmm1,%xmm5
pand   %xmm2,%xmm5
movdqa %xmm5,%xmm6
pcmpgtd %xmm4,%xmm6
pand   %xmm6,%xmm4
pandn  %xmm5,%xmm6
por    %xmm4,%xmm6
movupd 0x98(%rsp),%xmm2
shufpd $0x1,%xmm2,%xmm3
movapd %xmm2,%xmm4
subpd  %xmm3,%xmm4
mulpd  %xmm0,%xmm4
cvttpd2dq %xmm4,%xmm0
movapd %xmm0,%xmm3
pcmpgtd %xmm1,%xmm3
pand   %xmm0,%xmm3
movdqa %xmm3,%xmm0
pcmpgtd %xmm6,%xmm0
pand   %xmm0,%xmm6
pandn  %xmm3,%xmm0
por    %xmm6,%xmm0
pshufd $0x55,%xmm0,%xmm1
movdqa %xmm1,%xmm3
pcmpgtd %xmm0,%xmm3
pand   %xmm3,%xmm0
pandn  %xmm1,%xmm3
por    %xmm0,%xmm3
unpckhpd %xmm2,%xmm2
movsd  0xa8(%rsp),%xmm0
subsd  %xmm2,%xmm0
mulsd  0xc45(%rip),%xmm0
cvttsd2si %xmm0,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
movd   %xmm3,%ecx
cmp    %eax,%ecx
cmovl  %ecx,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @checktick() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca [20 x double]
store i32 0, i32* %1
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 20
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = call double (...) @mysecond()
store double %11, double* %4
br label %12
12: ; preds = %17, %10
%13 = call double (...) @mysecond()
store double %13, double* %5
%14 = load double, double* %4
%15 = fsub double %13, %14
%16 = fcmp olt double %15, 0x3EB0C6F7A0B5ED8D
br i1 %16, label %17, label %18
17: ; preds = %12
br label %12
18: ; preds = %12
%19 = load double, double* %5
store double %19, double* %4
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [20 x double], [20 x double]* %6, i64 0, i64 %21
store double %19, double* %22
br label %23
23: ; preds = %18
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %7
26: ; preds = %7
store i32 1000000, i32* %2
store i32 1, i32* %1
br label %27
27: ; preds = %64, %26
%28 = load i32, i32* %1
%29 = icmp slt i32 %28, 20
br i1 %29, label %30, label %67
30: ; preds = %27
%31 = load i32, i32* %1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [20 x double], [20 x double]* %6, i64 0, i64 %32
%34 = load double, double* %33
%35 = load i32, i32* %1
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x double], [20 x double]* %6, i64 0, i64 %37
%39 = load double, double* %38
%40 = fsub double %34, %39
%41 = fmul double 1.000000e+06, %40
%42 = fptosi double %41 to i32
store i32 %42, i32* %3
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %30
%47 = load i32, i32* %3
br label %49
48: ; preds = %30
br label %49
49: ; preds = %48, %46
%50 = phi i32 [ %47, %46 ], [ 0, %48 ]
%51 = icmp slt i32 %43, %50
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = load i32, i32* %2
br label %62
54: ; preds = %49
%55 = load i32, i32* %3
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = load i32, i32* %3
br label %60
59: ; preds = %54
br label %60
60: ; preds = %59, %57
%61 = phi i32 [ %58, %57 ], [ 0, %59 ]
br label %62
62: ; preds = %60, %52
%63 = phi i32 [ %53, %52 ], [ %61, %60 ]
store i32 %63, i32* %2
br label %64
64: ; preds = %62
%65 = load i32, i32* %1
%66 = add nsw i32 %65, 1
store i32 %66, i32* %1
br label %27
67: ; preds = %27
%68 = load i32, i32* %2
ret i32 %68
}

LLVM IR (-O2):
define i32 @checktick() {
%1 = alloca [20 x double]
%2 = bitcast [20 x double]* %1 to i8*
br label %3
3: ; preds = %0, %10
%4 = phi i64 [ 0, %0 ], [ %12, %10 ]
%5 = tail call double (...) @mysecond()
br label %6
6: ; preds = %6, %3
%7 = tail call double (...) @mysecond()
%8 = fsub double %7, %5
%9 = fcmp olt double %8, 0x3EB0C6F7A0B5ED8D
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 %4
store double %7, double* %11
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 20
br i1 %13, label %14, label %3
14: ; preds = %10
%15 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 0
%16 = load double, double* %15
%17 = insertelement <2 x double> poison, double %16, i64 1
%18 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 1
%19 = bitcast double* %18 to <2 x double>*
%20 = load <2 x double>, <2 x double>* %19
%21 = shufflevector <2 x double> %17, <2 x double> %20, <2 x i32> <i32 1, i32 2>
%22 = fsub <2 x double> %20, %21
%23 = fmul <2 x double> %22, <double 1.000000e+06, double 1.000000e+06>
%24 = fptosi <2 x double> %23 to <2 x i32>
%25 = icmp sgt <2 x i32> %24, zeroinitializer
%26 = select <2 x i1> %25, <2 x i32> %24, <2 x i32> zeroinitializer
%27 = icmp slt <2 x i32> %26, <i32 1000000, i32 1000000>
%28 = select <2 x i1> %27, <2 x i32> %26, <2 x i32> <i32 1000000, i32 1000000>
%29 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 3
%30 = bitcast double* %29 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = shufflevector <2 x double> %20, <2 x double> %31, <2 x i32> <i32 1, i32 2>
%33 = fsub <2 x double> %31, %32
%34 = fmul <2 x double> %33, <double 1.000000e+06, double 1.000000e+06>
%35 = fptosi <2 x double> %34 to <2 x i32>
%36 = icmp sgt <2 x i32> %35, zeroinitializer
%37 = select <2 x i1> %36, <2 x i32> %35, <2 x i32> zeroinitializer
%38 = icmp slt <2 x i32> %28, %37
%39 = select <2 x i1> %38, <2 x i32> %28, <2 x i32> %37
%40 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 5
%41 = bitcast double* %40 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = shufflevector <2 x double> %31, <2 x double> %42, <2 x i32> <i32 1, i32 2>
%44 = fsub <2 x double> %42, %43
%45 = fmul <2 x double> %44, <double 1.000000e+06, double 1.000000e+06>
%46 = fptosi <2 x double> %45 to <2 x i32>
%47 = icmp sgt <2 x i32> %46, zeroinitializer
%48 = select <2 x i1> %47, <2 x i32> %46, <2 x i32> zeroinitializer
%49 = icmp slt <2 x i32> %39, %48
%50 = select <2 x i1> %49, <2 x i32> %39, <2 x i32> %48
%51 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 7
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = shufflevector <2 x double> %42, <2 x double> %53, <2 x i32> <i32 1, i32 2>
%55 = fsub <2 x double> %53, %54
%56 = fmul <2 x double> %55, <double 1.000000e+06, double 1.000000e+06>
%57 = fptosi <2 x double> %56 to <2 x i32>
%58 = icmp sgt <2 x i32> %57, zeroinitializer
%59 = select <2 x i1> %58, <2 x i32> %57, <2 x i32> zeroinitializer
%60 = icmp slt <2 x i32> %50, %59
%61 = select <2 x i1> %60, <2 x i32> %50, <2 x i32> %59
%62 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 9
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = shufflevector <2 x double> %53, <2 x double> %64, <2 x i32> <i32 1, i32 2>
%66 = fsub <2 x double> %64, %65
%67 = fmul <2 x double> %66, <double 1.000000e+06, double 1.000000e+06>
%68 = fptosi <2 x double> %67 to <2 x i32>
%69 = icmp sgt <2 x i32> %68, zeroinitializer
%70 = select <2 x i1> %69, <2 x i32> %68, <2 x i32> zeroinitializer
%71 = icmp slt <2 x i32> %61, %70
%72 = select <2 x i1> %71, <2 x i32> %61, <2 x i32> %70
%73 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 11
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = shufflevector <2 x double> %64, <2 x double> %75, <2 x i32> <i32 1, i32 2>
%77 = fsub <2 x double> %75, %76
%78 = fmul <2 x double> %77, <double 1.000000e+06, double 1.000000e+06>
%79 = fptosi <2 x double> %78 to <2 x i32>
%80 = icmp sgt <2 x i32> %79, zeroinitializer
%81 = select <2 x i1> %80, <2 x i32> %79, <2 x i32> zeroinitializer
%82 = icmp slt <2 x i32> %72, %81
%83 = select <2 x i1> %82, <2 x i32> %72, <2 x i32> %81
%84 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 13
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = shufflevector <2 x double> %75, <2 x double> %86, <2 x i32> <i32 1, i32 2>
%88 = fsub <2 x double> %86, %87
%89 = fmul <2 x double> %88, <double 1.000000e+06, double 1.000000e+06>
%90 = fptosi <2 x double> %89 to <2 x i32>
%91 = icmp sgt <2 x i32> %90, zeroinitializer
%92 = select <2 x i1> %91, <2 x i32> %90, <2 x i32> zeroinitializer
%93 = icmp slt <2 x i32> %83, %92
%94 = select <2 x i1> %93, <2 x i32> %83, <2 x i32> %92
%95 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 15
%96 = bitcast double* %95 to <2 x double>*
%97 = load <2 x double>, <2 x double>* %96
%98 = shufflevector <2 x double> %86, <2 x double> %97, <2 x i32> <i32 1, i32 2>
%99 = fsub <2 x double> %97, %98
%100 = fmul <2 x double> %99, <double 1.000000e+06, double 1.000000e+06>
%101 = fptosi <2 x double> %100 to <2 x i32>
%102 = icmp sgt <2 x i32> %101, zeroinitializer
%103 = select <2 x i1> %102, <2 x i32> %101, <2 x i32> zeroinitializer
%104 = icmp slt <2 x i32> %94, %103
%105 = select <2 x i1> %104, <2 x i32> %94, <2 x i32> %103
%106 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 17
%107 = bitcast double* %106 to <2 x double>*
%108 = load <2 x double>, <2 x double>* %107
%109 = shufflevector <2 x double> %97, <2 x double> %108, <2 x i32> <i32 1, i32 2>
%110 = fsub <2 x double> %108, %109
%111 = fmul <2 x double> %110, <double 1.000000e+06, double 1.000000e+06>
%112 = fptosi <2 x double> %111 to <2 x i32>
%113 = icmp sgt <2 x i32> %112, zeroinitializer
%114 = select <2 x i1> %113, <2 x i32> %112, <2 x i32> zeroinitializer
%115 = icmp slt <2 x i32> %105, %114
%116 = select <2 x i1> %115, <2 x i32> %105, <2 x i32> %114
%117 = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> %116)
%118 = extractelement <2 x double> %108, i64 1
%119 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 19
%120 = load double, double* %119
%121 = fsub double %120, %118
%122 = fmul double %121, 1.000000e+06
%123 = fptosi double %122 to i32
%124 = icmp sgt i32 %123, 0
%125 = select i1 %124, i32 %123, i32 0
%126 = icmp slt i32 %117, %125
%127 = select i1 %126, i32 %117, i32 %125
ret i32 %127
}