#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 int /*<<< orphan*/ rev;
typedef int /*<<< orphan*/ lines;
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ revncpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, float, float);
scalar_t__ strncmp(char *, char *, int);
int main() {
  FILE *f = fopen("times.log", "rt");
  if (!f)
    return 1;
  char lines[0xffff][64] = {0};
  int n = 0;
  float mintime = 0.0f, maxtime = 0.0f;
  char rev[10] = {0};
  char line[128] = {0};
  while (fgets(line, sizeof(line), f) && n < (sizeof(lines) / sizeof(*lines))) {
    if (strncmp(line, "HEAD is now at ", 15) == 0) {
      if (rev[0])
        sprintf(lines[n++], "%s\t%.1f\t%.1f", rev, mintime, maxtime);
      revncpy(rev, line + 15, sizeof(rev) - 1);
      mintime = 0.0f;
      maxtime = 0.0f;
    }
    if (strncmp(line, "Overall time:", 13) == 0) {
      float time = atof(line + 14);
      if (mintime < 0.1f || time < mintime)
        mintime = time;
      if (time > maxtime)
        maxtime = time;
    }
  }
  while (n > 0)
    printf("%s\n", lines[--n]);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400080,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5b(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d0 <main+0x40>
movl   $0x1,-0x4(%rbp)
jmp    141a <main+0x28a>
lea    -0x3fffd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3fffc0,%edx
call   1070 <memset@plt>
movl   $0x0,-0x3fffd4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3fffd8(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3fffdc(%rbp)
ff
lea    -0x3fffe6(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <memset@plt>
lea    -0x400070(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x400070(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x80,%esi
call   1080 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x400075(%rbp)
je     1269 <main+0xd9>
movslq -0x3fffd4(%rbp),%rax
cmp    $0xffff,%rax
setb   %al
mov    %al,-0x400075(%rbp)
mov    -0x400075(%rbp),%al
test   $0x1,%al
jne    127c <main+0xec>
jmp    13c8 <main+0x238>
lea    -0x400070(%rbp),%rdi
lea    0xd87(%rip),%rsi
mov    $0xf,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1321 <main+0x191>
cmpb   $0x0,-0x3fffe6(%rbp)
je     12ef <main+0x15f>
mov    -0x3fffd4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x3fffd4(%rbp)
cltq
lea    -0x3fffd0(%rbp),%rdi
shl    $0x6,%rax
add    %rax,%rdi
lea    -0x3fffe6(%rbp),%rdx
movss  -0x3fffd8(%rbp),%xmm0
ff
movss  -0x3fffdc(%rbp),%xmm1
ff
lea    0xd37(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x3fffe6(%rbp),%rdi
lea    -0x400070(%rbp),%rsi
add    $0xf,%rsi
mov    $0x9,%edx
call   10a0 <revncpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3fffd8(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3fffdc(%rbp)
ff
lea    -0x400070(%rbp),%rdi
lea    0xcff(%rip),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13c3 <main+0x233>
lea    -0x400070(%rbp),%rdi
add    $0xe,%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x400074(%rbp)
ff
movss  0xc9d(%rip),%xmm0
ucomiss -0x3fffd8(%rbp),%xmm0
ja     1389 <main+0x1f9>
movss  -0x400074(%rbp),%xmm1
ff
movss  -0x3fffd8(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jbe    1399 <main+0x209>
movss  -0x400074(%rbp),%xmm0
ff
movss  %xmm0,-0x3fffd8(%rbp)
ff
movss  -0x400074(%rbp),%xmm0
ff
ucomiss -0x3fffdc(%rbp),%xmm0
jbe    13be <main+0x22e>
movss  -0x400074(%rbp),%xmm0
ff
movss  %xmm0,-0x3fffdc(%rbp)
ff
jmp    13c3 <main+0x233>
jmp    1229 <main+0x99>
jmp    13cd <main+0x23d>
cmpl   $0x0,-0x3fffd4(%rbp)
jle    140a <main+0x27a>
mov    -0x3fffd4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3fffd4(%rbp)
cltq
lea    -0x3fffd0(%rbp),%rsi
shl    $0x6,%rax
add    %rax,%rsi
lea    0xc3c(%rip),%rdi
call   1060 <printf@plt>
jmp    13cd <main+0x23d>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x400080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x400078,%rsp
lea    0xe5c(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1390 <main+0x200>
mov    %rax,%r13
lea    0xb0(%rsp),%rdi
xor    %r15d,%r15d
mov    $0x3fffc0,%edx
xor    %esi,%esi
call   1070 <memset@plt>
movw   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x80,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1384 <main+0x1f4>
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xdcb(%rip),%r12
lea    0x30(%rsp),%rbx
lea    0xddc(%rip),%r14
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xf,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    12d8 <main+0x148>
cmpb   $0x0,0x10(%rsp)
je     12b3 <main+0x123>
add    $0x1,%r15d
shl    $0x6,%rbp
lea    (%rsp,%rbp,1),%rdi
add    $0xb0,%rdi
lea    0xd8b(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdx
movaps 0x20(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   10b0 <sprintf@plt>
mov    %rbp,%rdi
jmp    12b8 <main+0x128>
lea    0x10(%rsp),%rdi
lea    0x3f(%rsp),%rsi
mov    $0x9,%edx
call   10a0 <revncpy@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1329 <main+0x199>
lea    0x3e(%rsp),%rdi
call   1040 <atof@plt>
movaps %xmm0,%xmm1
movaps 0x20(%rsp),%xmm3
minss  %xmm3,%xmm1
cmpltss 0xcf4(%rip),%xmm3
movaps %xmm3,%xmm2
andps  %xmm0,%xmm2
andnps %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,0x20(%rsp)
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r13,%rdx
call   1080 <fgets@plt>
mov    %r15d,%ebp
test   %rax,%rax
je     134e <main+0x1be>
cmp    $0xffff,%r15d
jb     1260 <main+0xd0>
test   %r15d,%r15d
je     1384 <main+0x1f4>
add    $0x1,%rbp
lea    0xcde(%rip),%rbx
xchg   %ax,%ax
lea    -0x2(%rbp),%eax
shl    $0x6,%rax
lea    (%rsp,%rax,1),%rsi
add    $0xb0,%rsi
mov    %rbx,%rdi
call   1060 <printf@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1360 <main+0x1d0>
mov    %r13,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    1395 <main+0x205>
mov    $0x1,%eax
add    $0x400078,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"times.log\00"
@.str.1 = [3 x i8] c"rt\00"
@.str.2 = [16 x i8] c"HEAD is now at \00"
@.str.3 = [13 x i8] c"%s\09%.1f\09%.1f\00"
@.str.4 = [14 x i8] c"Overall time:\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [65535 x [64 x i8]]
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca [10 x i8]
%8 = alloca [128 x i8]
%9 = alloca float
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = icmp ne i32* %11, null
br i1 %12, label %14, label %13
13: ; preds = %0
store i32 1, i32* %1
br label %90
14: ; preds = %0
%15 = bitcast [65535 x [64 x i8]]* %3 to i8*
store i32 0, i32* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%16 = bitcast [10 x i8]* %7 to i8*
%17 = bitcast [128 x i8]* %8 to i8*
br label %18
18: ; preds = %75, %14
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%20 = load i32*, i32** %2
%21 = call i64 @fgets(i8* %19, i32 128, i32* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = icmp ult i64 %25, 65535
br label %27
27: ; preds = %23, %18
%28 = phi i1 [ false, %18 ], [ %26, %23 ]
br i1 %28, label %29, label %76
29: ; preds = %27
%30 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%31 = call i64 @strncmp(i8* %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 15)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %52
33: ; preds = %29
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%35 = load i8, i8* %34
%36 = icmp ne i8 %35, 0
br i1 %36, label %37, label %47
37: ; preds = %33
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds [65535 x [64 x i8]], [65535 x [64 x i8]]* %3, i64 0, i64 %40
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %41, i64 0, i64 0
%43 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%44 = load float, float* %5
%45 = load float, float* %6
%46 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %43, float %44, float %45)
br label %47
47: ; preds = %37, %33
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%49 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%50 = getelementptr inbounds i8, i8* %49, i64 15
%51 = call i32 @revncpy(i8* %48, i8* %50, i32 9)
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
br label %52
52: ; preds = %47, %29
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%54 = call i64 @strncmp(i8* %53, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 13)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %75
56: ; preds = %52
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%58 = getelementptr inbounds i8, i8* %57, i64 14
%59 = call float @atof(i8* %58)
store float %59, float* %9
%60 = load float, float* %5
%61 = fcmp olt float %60, 0x3FB99999A0000000
br i1 %61, label %66, label %62
62: ; preds = %56
%63 = load float, float* %9
%64 = load float, float* %5
%65 = fcmp olt float %63, %64
br i1 %65, label %66, label %68
66: ; preds = %62, %56
%67 = load float, float* %9
store float %67, float* %5
br label %68
68: ; preds = %66, %62
%69 = load float, float* %9
%70 = load float, float* %6
%71 = fcmp ogt float %69, %70
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = load float, float* %9
store float %73, float* %6
br label %74
74: ; preds = %72, %68
br label %75
75: ; preds = %74, %52
br label %18
76: ; preds = %27
br label %77
77: ; preds = %80, %76
%78 = load i32, i32* %4
%79 = icmp sgt i32 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %77
%81 = load i32, i32* %4
%82 = add nsw i32 %81, -1
store i32 %82, i32* %4
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [65535 x [64 x i8]], [65535 x [64 x i8]]* %3, i64 0, i64 %83
%85 = getelementptr inbounds [64 x i8], [64 x i8]* %84, i64 0, i64 0
%86 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %85)
br label %77
87: ; preds = %77
%88 = load i32*, i32** %2
%89 = call i32 @fclose(i32* %88)
store i32 0, i32* %1
br label %90
90: ; preds = %87, %13
%91 = load i32, i32* %1
ret i32 %91
}

LLVM IR (-O2):
@.str = [10 x i8] c"times.log\00"
@.str.1 = [3 x i8] c"rt\00"
@.str.2 = [16 x i8] c"HEAD is now at \00"
@.str.3 = [13 x i8] c"%s\09%.1f\09%.1f\00"
@.str.4 = [14 x i8] c"Overall time:\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [65535 x [64 x i8]]
%2 = alloca [10 x i8]
%3 = alloca [128 x i8]
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %67, label %6
6: ; preds = %0
%7 = getelementptr inbounds [65535 x [64 x i8]], [65535 x [64 x i8]]* %1, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%10 = call i64 @fgets(i8* %9, i32 128, i32* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %65, label %12
12: ; preds = %6
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 15
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 14
br label %19
15: ; preds = %50
%16 = icmp eq i32 %37, 0
br i1 %16, label %65, label %17
17: ; preds = %15
%18 = zext i32 %37 to i64
br label %58
19: ; preds = %12, %50
%20 = phi i64 [ 0, %12 ], [ %55, %50 ]
%21 = phi float [ 0.000000e+00, %12 ], [ %52, %50 ]
%22 = phi float [ 0.000000e+00, %12 ], [ %51, %50 ]
%23 = phi i32 [ 0, %12 ], [ %37, %50 ]
%24 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 15)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %36
26: ; preds = %19
%27 = load i8, i8* %8
%28 = icmp eq i8 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %26
%30 = add nuw nsw i32 %23, 1
%31 = getelementptr inbounds [65535 x [64 x i8]], [65535 x [64 x i8]]* %1, i64 0, i64 %20, i64 0
%32 = call i32 @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %8, float %22, float %21)
br label %33
33: ; preds = %29, %26
%34 = phi i32 [ %30, %29 ], [ %23, %26 ]
%35 = call i32 @revncpy(i8* %8, i8* %13, i32 9)
br label %36
36: ; preds = %33, %19
%37 = phi i32 [ %34, %33 ], [ %23, %19 ]
%38 = phi float [ 0.000000e+00, %33 ], [ %22, %19 ]
%39 = phi float [ 0.000000e+00, %33 ], [ %21, %19 ]
%40 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 13)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %50
42: ; preds = %36
%43 = call float @atof(i8* %14)
%44 = fcmp olt float %38, 0x3FB99999A0000000
%45 = fcmp olt float %43, %38
%46 = select i1 %44, i1 true, i1 %45
%47 = select i1 %46, float %43, float %38
%48 = fcmp ogt float %43, %39
%49 = select i1 %48, float %43, float %39
br label %50
50: ; preds = %42, %36
%51 = phi float [ %47, %42 ], [ %38, %36 ]
%52 = phi float [ %49, %42 ], [ %39, %36 ]
%53 = call i64 @fgets(i8* %9, i32 128, i32* %4)
%54 = icmp ne i64 %53, 0
%55 = zext i32 %37 to i64
%56 = icmp ult i32 %37, 65535
%57 = select i1 %54, i1 %56, i1 false
br i1 %57, label %19, label %15
58: ; preds = %17, %58
%59 = phi i64 [ %18, %17 ], [ %60, %58 ]
%60 = add nsw i64 %59, -1
%61 = and i64 %60, 4294967295
%62 = getelementptr inbounds [65535 x [64 x i8]], [65535 x [64 x i8]]* %1, i64 0, i64 %61, i64 0
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %62)
%64 = icmp ugt i64 %59, 1
br i1 %64, label %58, label %65
65: ; preds = %58, %6, %15
%66 = call i32 @fclose(i32* %4)
br label %67
67: ; preds = %0, %65
%68 = phi i32 [ 0, %65 ], [ 1, %0 ]
ret i32 %68
}