#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ die(char *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double, double, double, double);
int fscanf(int /*<<< orphan*/ *, char *, double *, double *, double *,
           double *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, char *);
int main() {
  char inName[81];
  printf("input file name: ");
  scanf("%s", inName) == 1 || die("input failure");
  FILE *fin;
  fin = fopen(inName, "r");
  if (errno) {
    perror("opening input file");
    exit(EXIT_FAILURE);
  }
  char outName[81];
  printf("output file name: ");
  scanf("%s", outName) == 1 || die("input failure");
  FILE *fout;
  fout = fopen(outName, "w");
  if (errno) {
    perror("opening output file");
    exit(EXIT_FAILURE);
  }
  unsigned qs = 0;
  double a, b, c, d;
  for (a, b, c, d; fscanf(fin, "%lf%lf%lf%lf", &a, &b, &c, &d) == 4;) {
    qs++;
    double mn, av, mx;
    mn = a < b && a < c && a < d ? a : b < c && b < d ? b : c < d ? c : d;
    av = (a + b + c + d) / 4;
    mx = a > b && a > c && a > d ? a : b > c && b > d ? b : c > d ? c : d;
    fprintf(fout, "<%f, %f, %f>:  %f  %f  %f  %f\n", mn, av, mx, a, b, c, d);
  }
  printf("%u quartets processed\n", qs);
  fclose(fout);
  if (ferror(fout))
    die("problem writing/closing output file");
  fclose(fin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1080 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x109(%rbp)
je     11fc <main+0x5c>
lea    0xe33(%rip),%rdi
call   10a0 <die@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
lea    -0x60(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x68(%rbp)
mov    0x2dc3(%rip),%rax
cmpq   $0x0,(%rax)
je     1241 <main+0xa1>
lea    0xdff(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc0(%rbp),%rsi
lea    0xdbd(%rip),%rdi
call   1080 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x10a(%rbp)
je     128e <main+0xee>
lea    0xda1(%rip),%rdi
call   10a0 <die@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x10a(%rbp)
mov    -0x10a(%rbp),%al
lea    -0xc0(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xc8(%rbp)
mov    0x2d2b(%rip),%rax
cmpq   $0x0,(%rax)
je     12d9 <main+0x139>
lea    0xd8f(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movl   $0x0,-0xcc(%rbp)
mov    -0x68(%rbp),%rdi
lea    0xd7b(%rip),%rsi
lea    -0xd8(%rbp),%rdx
lea    -0xe0(%rbp),%rcx
lea    -0xe8(%rbp),%r8
lea    -0xf0(%rbp),%r9
call   1060 <fscanf@plt>
cmp    $0x4,%eax
jne    15c9 <main+0x429>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    138a <main+0x1ea>
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    138a <main+0x1ea>
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    138a <main+0x1ea>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    1432 <main+0x292>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    13d3 <main+0x233>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    13d3 <main+0x233>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
jmp    1422 <main+0x282>
movsd  -0xe8(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1402 <main+0x262>
movsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
jmp    1412 <main+0x272>
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
addsd  -0xe0(%rbp),%xmm0
ff
addsd  -0xe8(%rbp),%xmm0
ff
addsd  -0xf0(%rbp),%xmm0
ff
movsd  0xb96(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
ucomisd -0xe0(%rbp),%xmm0
ff
jbe    14cd <main+0x32d>
movsd  -0xd8(%rbp),%xmm0
ff
ucomisd -0xe8(%rbp),%xmm0
ff
jbe    14cd <main+0x32d>
movsd  -0xd8(%rbp),%xmm0
ff
ucomisd -0xf0(%rbp),%xmm0
ff
jbe    14cd <main+0x32d>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
jmp    1569 <main+0x3c9>
movsd  -0xe0(%rbp),%xmm0
ff
ucomisd -0xe8(%rbp),%xmm0
ff
jbe    150e <main+0x36e>
movsd  -0xe0(%rbp),%xmm0
ff
ucomisd -0xf0(%rbp),%xmm0
ff
jbe    150e <main+0x36e>
movsd  -0xe0(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
jmp    1559 <main+0x3b9>
movsd  -0xe8(%rbp),%xmm0
ff
ucomisd -0xf0(%rbp),%xmm0
ff
jbe    1539 <main+0x399>
movsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
jmp    1549 <main+0x3a9>
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0xc8(%rbp),%rdi
movsd  -0xf8(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm1
ff
movsd  -0x108(%rbp),%xmm2
ff
movsd  -0xd8(%rbp),%xmm3
ff
movsd  -0xe0(%rbp),%xmm4
ff
movsd  -0xe8(%rbp),%xmm5
ff
movsd  -0xf0(%rbp),%xmm6
ff
lea    0xab7(%rip),%rsi
call   1070 <fprintf@plt>
jmp    12e3 <main+0x143>
mov    -0xcc(%rbp),%esi
lea    0xabf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     160b <main+0x46b>
lea    0xaa6(%rip),%rdi
call   10a0 <die@plt>
mov    -0x68(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe54(%rip),%rdi
lea    0x80(%rsp),%rsi
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     11e4 <main+0x44>
lea    0xe3e(%rip),%rdi
call   10a0 <die@plt>
lea    0xe40(%rip),%rsi
lea    0x80(%rsp),%rdi
call   1090 <fopen@plt>
mov    0x2de1(%rip),%rbp
cmpq   $0x0,0x0(%rbp)
jne    13c1 <main+0x221>
mov    %rax,%r14
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdf8(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1080 <scanf@plt>
cmp    $0x1,%eax
je     123d <main+0x9d>
lea    0xde5(%rip),%rdi
call   10a0 <die@plt>
lea    0xe0f(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1090 <fopen@plt>
cmpq   $0x0,0x0(%rbp)
jne    13ca <main+0x22a>
mov    %rax,%rbx
lea    0xe06(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rsp,%r9
mov    %r14,%rdi
call   1060 <fscanf@plt>
xor    %ebp,%ebp
cmp    $0x4,%eax
jne    1374 <main+0x1d4>
xor    %ebp,%ebp
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%r13
jmp    12e0 <main+0x140>
nopl   0x0(%rax)
movapd %xmm5,%xmm2
maxsd  %xmm6,%xmm2
mov    %rbx,%rdi
lea    0xdc4(%rip),%rsi
call   1070 <fprintf@plt>
mov    %r14,%rdi
lea    0xda8(%rip),%rsi
lea    0x18(%rsp),%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    %r13,%r9
call   1060 <fscanf@plt>
add    $0x1,%ebp
cmp    $0x4,%eax
jne    1374 <main+0x1d4>
movsd  0x18(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
ucomisd %xmm3,%xmm4
movsd  0x8(%rsp),%xmm5
movsd  (%rsp),%xmm6
jbe    130d <main+0x16d>
ucomisd %xmm3,%xmm5
jbe    130d <main+0x16d>
ucomisd %xmm3,%xmm6
movapd %xmm3,%xmm0
ja     1325 <main+0x185>
ucomisd %xmm4,%xmm5
jbe    131d <main+0x17d>
ucomisd %xmm4,%xmm6
movapd %xmm4,%xmm0
ja     1325 <main+0x185>
movapd %xmm5,%xmm0
minsd  %xmm6,%xmm0
movapd %xmm3,%xmm1
addsd  %xmm4,%xmm1
addsd  %xmm5,%xmm1
addsd  %xmm6,%xmm1
mulsd  0xcc3(%rip),%xmm1
ucomisd %xmm4,%xmm3
jbe    1357 <main+0x1b7>
ucomisd %xmm5,%xmm3
jbe    1357 <main+0x1b7>
ucomisd %xmm6,%xmm3
movapd %xmm3,%xmm2
ja     12a8 <main+0x108>
ucomisd %xmm5,%xmm4
jbe    12a0 <main+0x100>
ucomisd %xmm6,%xmm4
movapd %xmm4,%xmm2
ja     12a8 <main+0x108>
jmp    12a0 <main+0x100>
lea    0xd1a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1030 <ferror@plt>
test   %rax,%rax
je     13a5 <main+0x205>
lea    0xd0c(%rip),%rdi
call   10a0 <die@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc65(%rip),%rdi
jmp    13d1 <main+0x231>
lea    0xc84(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2bfb(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"input file name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c"input failure\00"
@.str.3 = [2 x i8] c"r\00"
@errno = global i64 0
@.str.4 = [19 x i8] c"opening input file\00"
@EXIT_FAILURE = global i32 0
@.str.5 = [19 x i8] c"output file name: \00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [20 x i8] c"opening output file\00"
@.str.8 = [13 x i8] c"%lf%lf%lf%lf\00"
@.str.9 = [31 x i8] c"<%f, %f, %f>: %f %f %f %f\0A\00"
@.str.10 = [23 x i8] c"%u quartets processed\0A\00"
@.str.11 = [36 x i8] c"problem writing/closing output file\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca i32*
%4 = alloca [81 x i8]
%5 = alloca i32*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 0, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %0
%19 = call i64 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br label %21
21: ; preds = %18, %0
%22 = phi i1 [ true, %0 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
%24 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %25, i32** %3
%26 = load i64, i64* @errno
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %21
%29 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %21
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%34 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = icmp eq i32 %35, 1
br i1 %36, label %40, label %37
37: ; preds = %32
%38 = call i64 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br label %40
40: ; preds = %37, %32
%41 = phi i1 [ true, %32 ], [ %39, %37 ]
%42 = zext i1 %41 to i32
%43 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%44 = call i32* @fopen(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %44, i32** %5
%45 = load i64, i64* @errno
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %40
%48 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; preds = %40
store i32 0, i32* %6
%52 = load double, double* %7
%53 = load double, double* %8
%54 = load double, double* %9
%55 = load double, double* %10
br label %56
56: ; preds = %143, %51
%57 = load i32*, i32** %3
%58 = call i32 @fscanf(i32* %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double* %7, double* %8, double* %9, double* %10)
%59 = icmp eq i32 %58, 4
br i1 %59, label %60, label %154
60: ; preds = %56
%61 = load i32, i32* %6
%62 = add i32 %61, 1
store i32 %62, i32* %6
%63 = load double, double* %7
%64 = load double, double* %8
%65 = fcmp olt double %63, %64
br i1 %65, label %66, label %76
66: ; preds = %60
%67 = load double, double* %7
%68 = load double, double* %9
%69 = fcmp olt double %67, %68
br i1 %69, label %70, label %76
70: ; preds = %66
%71 = load double, double* %7
%72 = load double, double* %10
%73 = fcmp olt double %71, %72
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = load double, double* %7
br label %98
76: ; preds = %70, %66, %60
%77 = load double, double* %8
%78 = load double, double* %9
%79 = fcmp olt double %77, %78
br i1 %79, label %80, label %86
80: ; preds = %76
%81 = load double, double* %8
%82 = load double, double* %10
%83 = fcmp olt double %81, %82
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = load double, double* %8
br label %96
86: ; preds = %80, %76
%87 = load double, double* %9
%88 = load double, double* %10
%89 = fcmp olt double %87, %88
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = load double, double* %9
br label %94
92: ; preds = %86
%93 = load double, double* %10
br label %94
94: ; preds = %92, %90
%95 = phi double [ %91, %90 ], [ %93, %92 ]
br label %96
96: ; preds = %94, %84
%97 = phi double [ %85, %84 ], [ %95, %94 ]
br label %98
98: ; preds = %96, %74
%99 = phi double [ %75, %74 ], [ %97, %96 ]
store double %99, double* %11
%100 = load double, double* %7
%101 = load double, double* %8
%102 = fadd double %100, %101
%103 = load double, double* %9
%104 = fadd double %102, %103
%105 = load double, double* %10
%106 = fadd double %104, %105
%107 = fdiv double %106, 4.000000e+00
store double %107, double* %12
%108 = load double, double* %7
%109 = load double, double* %8
%110 = fcmp ogt double %108, %109
br i1 %110, label %111, label %121
111: ; preds = %98
%112 = load double, double* %7
%113 = load double, double* %9
%114 = fcmp ogt double %112, %113
br i1 %114, label %115, label %121
115: ; preds = %111
%116 = load double, double* %7
%117 = load double, double* %10
%118 = fcmp ogt double %116, %117
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = load double, double* %7
br label %143
121: ; preds = %115, %111, %98
%122 = load double, double* %8
%123 = load double, double* %9
%124 = fcmp ogt double %122, %123
br i1 %124, label %125, label %131
125: ; preds = %121
%126 = load double, double* %8
%127 = load double, double* %10
%128 = fcmp ogt double %126, %127
br i1 %128, label %129, label %131
129: ; preds = %125
%130 = load double, double* %8
br label %141
131: ; preds = %125, %121
%132 = load double, double* %9
%133 = load double, double* %10
%134 = fcmp ogt double %132, %133
br i1 %134, label %135, label %137
135: ; preds = %131
%136 = load double, double* %9
br label %139
137: ; preds = %131
%138 = load double, double* %10
br label %139
139: ; preds = %137, %135
%140 = phi double [ %136, %135 ], [ %138, %137 ]
br label %141
141: ; preds = %139, %129
%142 = phi double [ %130, %129 ], [ %140, %139 ]
br label %143
143: ; preds = %141, %119
%144 = phi double [ %120, %119 ], [ %142, %141 ]
store double %144, double* %13
%145 = load i32*, i32** %5
%146 = load double, double* %11
%147 = load double, double* %12
%148 = load double, double* %13
%149 = load double, double* %7
%150 = load double, double* %8
%151 = load double, double* %9
%152 = load double, double* %10
%153 = call i32 @fprintf(i32* %145, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %146, double %147, double %148, double %149, double %150, double %151, double %152)
br label %56
154: ; preds = %56
%155 = load i32, i32* %6
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %155)
%157 = load i32*, i32** %5
%158 = call i32 @fclose(i32* %157)
%159 = load i32*, i32** %5
%160 = call i64 @ferror(i32* %159)
%161 = icmp ne i64 %160, 0
br i1 %161, label %162, label %164
162: ; preds = %154
%163 = call i64 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
br label %164
164: ; preds = %162, %154
%165 = load i32*, i32** %3
%166 = call i32 @fclose(i32* %165)
%167 = load i32, i32* %1
ret i32 %167
}

LLVM IR (-O2):
@.str = [18 x i8] c"input file name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c"input failure\00"
@.str.3 = [2 x i8] c"r\00"
@errno = global i64 0
@.str.4 = [19 x i8] c"opening input file\00"
@EXIT_FAILURE = global i32 0
@.str.5 = [19 x i8] c"output file name: \00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [20 x i8] c"opening output file\00"
@.str.8 = [13 x i8] c"%lf%lf%lf%lf\00"
@.str.9 = [31 x i8] c"<%f, %f, %f>: %f %f %f %f\0A\00"
@.str.10 = [23 x i8] c"%u quartets processed\0A\00"
@.str.11 = [36 x i8] c"problem writing/closing output file\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%10 = icmp eq i32 %9, 1
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i64 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = load i64, i64* @errno
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %13
%22 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%25 = icmp eq i32 %24, 1
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = call i64 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %21
%29 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%30 = load i64, i64* @errno
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %28
%37 = bitcast double* %3 to i8*
%38 = bitcast double* %4 to i8*
%39 = bitcast double* %5 to i8*
%40 = bitcast double* %6 to i8*
%41 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double* %3, double* %4, double* %5, double* %6)
%42 = icmp eq i32 %41, 4
br i1 %42, label %43, label %85
43: ; preds = %36, %80
%44 = phi i32 [ %45, %80 ], [ 0, %36 ]
%45 = add i32 %44, 1
%46 = load double, double* %3
%47 = load double, double* %4
%48 = fcmp olt double %46, %47
%49 = load double, double* %5
%50 = fcmp olt double %46, %49
%51 = select i1 %48, i1 %50, i1 false
%52 = load double, double* %6
%53 = fcmp olt double %46, %52
%54 = select i1 %51, i1 %53, i1 false
br i1 %54, label %62, label %55
55: ; preds = %43
%56 = fcmp olt double %47, %49
%57 = fcmp olt double %47, %52
%58 = select i1 %56, i1 %57, i1 false
br i1 %58, label %62, label %59
59: ; preds = %55
%60 = fcmp olt double %49, %52
%61 = select i1 %60, double %49, double %52
br label %62
62: ; preds = %55, %43, %59
%63 = phi double [ %61, %59 ], [ %46, %43 ], [ %47, %55 ]
%64 = fadd double %46, %47
%65 = fadd double %64, %49
%66 = fadd double %65, %52
%67 = fmul double %66, 2.500000e-01
%68 = fcmp ogt double %46, %47
%69 = fcmp ogt double %46, %49
%70 = select i1 %68, i1 %69, i1 false
%71 = fcmp ogt double %46, %52
%72 = select i1 %70, i1 %71, i1 false
br i1 %72, label %80, label %73
73: ; preds = %62
%74 = fcmp ogt double %47, %49
%75 = fcmp ogt double %47, %52
%76 = select i1 %74, i1 %75, i1 false
br i1 %76, label %80, label %77
77: ; preds = %73
%78 = fcmp ogt double %49, %52
%79 = select i1 %78, double %49, double %52
br label %80
80: ; preds = %73, %62, %77
%81 = phi double [ %79, %77 ], [ %46, %62 ], [ %47, %73 ]
%82 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %63, double %67, double %81, double %46, double %47, double %49, double %52)
%83 = call i32 @fscanf(i32* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double* %3, double* %4, double* %5, double* %6)
%84 = icmp eq i32 %83, 4
br i1 %84, label %43, label %85
85: ; preds = %80, %36
%86 = phi i32 [ 0, %36 ], [ %45, %80 ]
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i32 %86)
%88 = call i32 @fclose(i32* %29)
%89 = call i64 @ferror(i32* %29)
%90 = icmp eq i64 %89, 0
br i1 %90, label %93, label %91
91: ; preds = %85
%92 = call i64 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
br label %93
93: ; preds = %91, %85
%94 = call i32 @fclose(i32* %14)
ret i32 0
}