#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*/ *fopen(char *, char *);
int fread(float *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int sqrt(double);
int main(int argc, char **argv) {
  FILE *f1;
  FILE *f2;
  float buf1[512];
  float buf2[512];
  int i, j;
  int total = 0;
  double max = 0, err = 0, square = 0;
  if (argc != 3)
    return 1;
  f1 = fopen(argv[1], "rb");
  f2 = fopen(argv[2], "rb");
  if ((f1 == NULL) || (f2 == NULL)) {
    printf("cannot open file %s\n", (f1 == NULL) ? argv[1] : argv[2]);
    return 1;
  }
  while (1) {
    i = fread(buf1, sizeof(float), 512, f1);
    j = fread(buf2, sizeof(float), 512, f2);
    if ((i < 512) || (j < 512))
      break;
    for (i = 0; i < 512; i++) {
      double delta;
      delta = buf2[i] - buf1[i];
      err += delta;
      square += delta * delta;
      if (delta > max)
        max = delta;
      if (-delta > max)
        max = -delta;
    }
    total += 512;
  }
  if (i == j) {
    err /= total;
    square = (square / total) - (err * err);
    if (square > 0)
      square = 32768 * sqrt(square);
    err *= 32768;
    max *= 32768;
    printf("max error %f mean error %f standard deviation %f\n", max, err,
           square);
    return ((max > 0.01) || (err > 0.001) || (square > 0.001));
  }
  if (i < j)
    printf("%s is too short\n", argv[1]);
  else
    printf("%s is too short\n", argv[2]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x102c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1038(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1040(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1048(%rbp)
ff
cmpl   $0x3,-0x8(%rbp)
je     119a <main+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1586 <main+0x446>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6f(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe57(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11e0 <main+0xa0>
cmpq   $0x0,-0x20(%rbp)
jne    122f <main+0xef>
cmpq   $0x0,-0x18(%rbp)
jne    11ff <main+0xbf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1058(%rbp)
jmp    120e <main+0xce>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x1058(%rbp)
mov    -0x1058(%rbp),%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1586 <main+0x446>
jmp    1234 <main+0xf4>
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
mov    %eax,-0x1024(%rbp)
lea    -0x1020(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
mov    $0x200,%edx
call   1030 <fread@plt>
mov    %eax,-0x1028(%rbp)
cmpl   $0x200,-0x1024(%rbp)
jl     1294 <main+0x154>
cmpl   $0x200,-0x1028(%rbp)
jge    1299 <main+0x159>
jmp    13c8 <main+0x288>
movl   $0x0,-0x1024(%rbp)
cmpl   $0x200,-0x1024(%rbp)
jge    13b2 <main+0x272>
movslq -0x1024(%rbp),%rax
movss  -0x1020(%rbp,%rax,4),%xmm0
ff ff
movslq -0x1024(%rbp),%rax
subss  -0x820(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x1050(%rbp)
ff
movsd  -0x1050(%rbp),%xmm0
ff
addsd  -0x1040(%rbp),%xmm0
ff
movsd  %xmm0,-0x1040(%rbp)
ff
movsd  -0x1050(%rbp),%xmm0
ff
movsd  -0x1050(%rbp),%xmm2
ff
movsd  -0x1048(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1048(%rbp)
ff
movsd  -0x1050(%rbp),%xmm0
ff
ucomisd -0x1038(%rbp),%xmm0
ff
jbe    1345 <main+0x205>
movsd  -0x1050(%rbp),%xmm0
ff
movsd  %xmm0,-0x1038(%rbp)
ff
movsd  -0x1050(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd -0x1038(%rbp),%xmm0
ff
jbe    1399 <main+0x259>
movsd  -0x1050(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x1038(%rbp)
ff
jmp    139e <main+0x25e>
mov    -0x1024(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1024(%rbp)
jmp    12a3 <main+0x163>
mov    -0x102c(%rbp),%eax
add    $0x200,%eax
mov    %eax,-0x102c(%rbp)
jmp    1234 <main+0xf4>
mov    -0x1024(%rbp),%eax
cmp    -0x1028(%rbp),%eax
jne    153c <main+0x3fc>
cvtsi2sdl -0x102c(%rbp),%xmm1
ff
movsd  -0x1040(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1040(%rbp)
ff
movsd  -0x1048(%rbp),%xmm1
ff
cvtsi2sdl -0x102c(%rbp),%xmm0
ff
divsd  %xmm0,%xmm1
movsd  -0x1040(%rbp),%xmm0
ff
movsd  -0x1040(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1048(%rbp)
ff
movsd  -0x1048(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1472 <main+0x332>
movsd  -0x1048(%rbp),%xmm0
ff
call   1060 <sqrt@plt>
shl    $0xf,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x1048(%rbp)
ff
movsd  0xb8e(%rip),%xmm0
mulsd  -0x1040(%rbp),%xmm0
ff
movsd  %xmm0,-0x1040(%rbp)
ff
movsd  0xb76(%rip),%xmm0
mulsd  -0x1038(%rbp),%xmm0
ff
movsd  %xmm0,-0x1038(%rbp)
ff
movsd  -0x1038(%rbp),%xmm0
ff
movsd  -0x1040(%rbp),%xmm1
ff
movsd  -0x1048(%rbp),%xmm2
ff
lea    0xb6f(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movsd  -0x1038(%rbp),%xmm0
ff
mov    $0x1,%al
movsd  0xb26(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1059(%rbp)
ja     1529 <main+0x3e9>
movsd  -0x1040(%rbp),%xmm0
ff
mov    $0x1,%al
movsd  0xb14(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1059(%rbp)
ja     1529 <main+0x3e9>
movsd  -0x1048(%rbp),%xmm0
ff
movsd  0xaf4(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x1059(%rbp)
mov    -0x1059(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1586 <main+0x446>
mov    -0x1024(%rbp),%eax
cmp    -0x1028(%rbp),%eax
jge    1569 <main+0x429>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xb05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    157f <main+0x43f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xaea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1048,%rsp
mov    $0x1,%r12d
cmp    $0x3,%edi
jne    1414 <main+0x2d4>
mov    %rsi,%r15
lea    0x8(%rsi),%r13
mov    0x8(%rsi),%rdi
lea    0xeb6(%rip),%rbx
mov    %rbx,%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    0x10(%r15),%rdi
add    $0x10,%r15
mov    %rbx,%rsi
call   1050 <fopen@plt>
test   %rbp,%rbp
je     13e8 <main+0x2a8>
mov    %rax,%rbx
test   %rax,%rax
je     13e8 <main+0x2a8>
lea    0x840(%rsp),%rdi
mov    $0x4,%esi
mov    $0x200,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
mov    %eax,%r14d
lea    0x40(%rsp),%rdi
mov    $0x4,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
xorpd  %xmm0,%xmm0
xorpd  %xmm6,%xmm6
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmp    $0x200,%r14d
jl     1337 <main+0x1f7>
cmp    $0x200,%eax
jl     1337 <main+0x1f7>
mov    %r13,0x38(%rsp)
xor    %r12d,%r12d
xorpd  %xmm2,%xmm2
movapd 0xdee(%rip),%xmm7
lea    0x40(%rsp),%r13
xorpd  %xmm1,%xmm1
xorpd  %xmm6,%xmm6
nop
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0x40(%rsp,%rax,4),%xmm0
movss  0x44(%rsp,%rax,4),%xmm4
subss  0x840(%rsp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm2,%xmm5
movapd %xmm0,%xmm3
maxsd  %xmm6,%xmm3
xorpd  %xmm7,%xmm0
maxsd  %xmm3,%xmm0
subss  0x844(%rsp,%rax,4),%xmm4
xorps  %xmm6,%xmm6
cvtss2sd %xmm4,%xmm6
addsd  %xmm6,%xmm1
movapd %xmm6,%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm5,%xmm2
movapd %xmm6,%xmm3
maxsd  %xmm0,%xmm3
xorpd  %xmm7,%xmm6
maxsd  %xmm3,%xmm6
add    $0x2,%rax
cmp    $0x200,%rax
jne    1230 <main+0xf0>
add    $0x200,%r12d
lea    0x840(%rsp),%rdi
mov    $0x4,%esi
mov    $0x200,%edx
mov    %rbp,%rcx
movapd %xmm1,(%rsp)
movapd %xmm2,0x20(%rsp)
movapd %xmm6,0x10(%rsp)
call   1030 <fread@plt>
mov    %eax,%r14d
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x200,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movapd 0xd09(%rip),%xmm7
movapd 0x10(%rsp),%xmm6
movapd 0x20(%rsp),%xmm2
movapd (%rsp),%xmm1
cmp    $0x200,%r14d
jl     131c <main+0x1dc>
cmp    $0x1ff,%eax
jg     1220 <main+0xe0>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xce4(%rip),%xmm6
mov    $0x1,%r12d
mov    0x38(%rsp),%r13
cmp    %eax,%r14d
jne    13fb <main+0x2bb>
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd %xmm6,0x10(%rsp)
jbe    1387 <main+0x247>
movapd %xmm2,%xmm0
movapd %xmm1,(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm6
movapd (%rsp),%xmm1
shl    $0xf,%eax
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movapd %xmm2,0x20(%rsp)
mulsd  0xc7b(%rip),%xmm1
movapd %xmm1,(%rsp)
lea    0xc9f(%rip),%rdi
movapd %xmm6,%xmm0
mov    $0x3,%al
call   1040 <printf@plt>
movapd 0x10(%rsp),%xmm0
ucomisd 0xc5e(%rip),%xmm0
seta   %al
movsd  0xc5b(%rip),%xmm0
movapd (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
or     %al,%cl
movapd 0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
or     %cl,%al
movzbl %al,%r12d
jmp    1414 <main+0x2d4>
test   %rbp,%rbp
cmove  %r13,%r15
mov    (%r15),%rsi
lea    0xc32(%rip),%rdi
jmp    140d <main+0x2cd>
jge    1403 <main+0x2c3>
mov    0x0(%r13),%rsi
jmp    1406 <main+0x2c6>
mov    (%r15),%rsi
lea    0xc65(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12d,%eax
add    $0x1048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [21 x i8] c"cannot open file %s\0A\00"
@.str.2 = [50 x i8] c"max error %f mean error %f standard deviation %f\0A\00"
@.str.3 = [17 x i8] c"%s is too short\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 [512 x float]
%9 = alloca [512 x float]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %15
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 3
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %3
br label %163
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %24, i32** %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %28, i32** %7
%29 = load i32*, i32** %6
%30 = icmp eq i32* %29, null
br i1 %30, label %34, label %31
31: ; preds = %20
%32 = load i32*, i32** %7
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %48
34: ; preds = %31, %20
%35 = load i32*, i32** %6
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
br label %45
41: ; preds = %34
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
br label %45
45: ; preds = %41, %37
%46 = phi i8* [ %40, %37 ], [ %44, %41 ]
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %46)
store i32 1, i32* %3
br label %163
48: ; preds = %31
br label %49
49: ; preds = %48, %101
%50 = getelementptr inbounds [512 x float], [512 x float]* %8, i64 0, i64 0
%51 = load i32*, i32** %6
%52 = call i32 @fread(float* %50, i32 4, i32 512, i32* %51)
store i32 %52, i32* %10
%53 = getelementptr inbounds [512 x float], [512 x float]* %9, i64 0, i64 0
%54 = load i32*, i32** %7
%55 = call i32 @fread(float* %53, i32 4, i32 512, i32* %54)
store i32 %55, i32* %11
%56 = load i32, i32* %10
%57 = icmp slt i32 %56, 512
br i1 %57, label %61, label %58
58: ; preds = %49
%59 = load i32, i32* %11
%60 = icmp slt i32 %59, 512
br i1 %60, label %61, label %62
61: ; preds = %58, %49
br label %104
62: ; preds = %58
store i32 0, i32* %10
br label %63
63: ; preds = %98, %62
%64 = load i32, i32* %10
%65 = icmp slt i32 %64, 512
br i1 %65, label %66, label %101
66: ; preds = %63
%67 = load i32, i32* %10
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [512 x float], [512 x float]* %9, i64 0, i64 %68
%70 = load float, float* %69
%71 = load i32, i32* %10
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [512 x float], [512 x float]* %8, i64 0, i64 %72
%74 = load float, float* %73
%75 = fsub float %70, %74
%76 = fpext float %75 to double
store double %76, double* %16
%77 = load double, double* %16
%78 = load double, double* %14
%79 = fadd double %78, %77
store double %79, double* %14
%80 = load double, double* %16
%81 = load double, double* %16
%82 = load double, double* %15
%83 = call double @llvm.fmuladd.f64(double %80, double %81, double %82)
store double %83, double* %15
%84 = load double, double* %16
%85 = load double, double* %13
%86 = fcmp ogt double %84, %85
br i1 %86, label %87, label %89
87: ; preds = %66
%88 = load double, double* %16
store double %88, double* %13
br label %89
89: ; preds = %87, %66
%90 = load double, double* %16
%91 = fneg double %90
%92 = load double, double* %13
%93 = fcmp ogt double %91, %92
br i1 %93, label %94, label %97
94: ; preds = %89
%95 = load double, double* %16
%96 = fneg double %95
store double %96, double* %13
br label %97
97: ; preds = %94, %89
br label %98
98: ; preds = %97
%99 = load i32, i32* %10
%100 = add nsw i32 %99, 1
store i32 %100, i32* %10
br label %63
101: ; preds = %63
%102 = load i32, i32* %12
%103 = add nsw i32 %102, 512
store i32 %103, i32* %12
br label %49
104: ; preds = %61
%105 = load i32, i32* %10
%106 = load i32, i32* %11
%107 = icmp eq i32 %105, %106
br i1 %107, label %108, label %148
108: ; preds = %104
%109 = load i32, i32* %12
%110 = sitofp i32 %109 to double
%111 = load double, double* %14
%112 = fdiv double %111, %110
store double %112, double* %14
%113 = load double, double* %15
%114 = load i32, i32* %12
%115 = sitofp i32 %114 to double
%116 = fdiv double %113, %115
%117 = load double, double* %14
%118 = load double, double* %14
%119 = fneg double %117
%120 = call double @llvm.fmuladd.f64(double %119, double %118, double %116)
store double %120, double* %15
%121 = load double, double* %15
%122 = fcmp ogt double %121, 0.000000e+00
br i1 %122, label %123, label %128
123: ; preds = %108
%124 = load double, double* %15
%125 = call i32 @sqrt(double %124)
%126 = mul nsw i32 32768, %125
%127 = sitofp i32 %126 to double
store double %127, double* %15
br label %128
128: ; preds = %123, %108
%129 = load double, double* %14
%130 = fmul double %129, 3.276800e+04
store double %130, double* %14
%131 = load double, double* %13
%132 = fmul double %131, 3.276800e+04
store double %132, double* %13
%133 = load double, double* %13
%134 = load double, double* %14
%135 = load double, double* %15
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), double %133, double %134, double %135)
%137 = load double, double* %13
%138 = fcmp ogt double %137, 1.000000e-02
br i1 %138, label %145, label %139
139: ; preds = %128
%140 = load double, double* %14
%141 = fcmp ogt double %140, 1.000000e-03
br i1 %141, label %145, label %142
142: ; preds = %139
%143 = load double, double* %15
%144 = fcmp ogt double %143, 1.000000e-03
br label %145
145: ; preds = %142, %139, %128
%146 = phi i1 [ true, %139 ], [ true, %128 ], [ %144, %142 ]
%147 = zext i1 %146 to i32
store i32 %147, i32* %3
br label %163
148: ; preds = %104
%149 = load i32, i32* %10
%150 = load i32, i32* %11
%151 = icmp slt i32 %149, %150
br i1 %151, label %152, label %157
152: ; preds = %148
%153 = load i8**, i8*** %5
%154 = getelementptr inbounds i8*, i8** %153, i64 1
%155 = load i8*, i8** %154
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %155)
br label %162
157: ; preds = %148
%158 = load i8**, i8*** %5
%159 = getelementptr inbounds i8*, i8** %158, i64 2
%160 = load i8*, i8** %159
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %160)
br label %162
162: ; preds = %157, %152
store i32 1, i32* %3
br label %163
163: ; preds = %162, %145, %45, %19
%164 = load i32, i32* %3
ret i32 %164
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [21 x i8] c"cannot open file %s\0A\00"
@.str.2 = [50 x i8] c"max error %f mean error %f standard deviation %f\0A\00"
@.str.3 = [17 x i8] c"%s is too short\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x float]
%4 = alloca [512 x float]
%5 = bitcast [512 x float]* %3 to i8*
%6 = bitcast [512 x float]* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %8, label %115
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %11, null
%16 = icmp eq i32* %14, null
%17 = or i1 %15, %16
br i1 %17, label %26, label %18
18: ; preds = %8
%19 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 0
%20 = call i32 @fread(float* %19, i32 4, i32 512, i32* %11)
%21 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 0
%22 = call i32 @fread(float* %21, i32 4, i32 512, i32* %14)
%23 = icmp slt i32 %20, 512
%24 = icmp slt i32 %22, 512
%25 = or i1 %23, %24
br i1 %25, label %79, label %30
26: ; preds = %8
%27 = select i1 %15, i8** %9, i8** %12
%28 = load i8*, i8** %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %28)
br label %115
30: ; preds = %18, %69
%31 = phi double [ %61, %69 ], [ 0.000000e+00, %18 ]
%32 = phi double [ %60, %69 ], [ 0.000000e+00, %18 ]
%33 = phi double [ %66, %69 ], [ 0.000000e+00, %18 ]
%34 = phi i32 [ %70, %69 ], [ 0, %18 ]
br label %35
35: ; preds = %35, %30
%36 = phi i64 [ 0, %30 ], [ %67, %35 ]
%37 = phi double [ %31, %30 ], [ %61, %35 ]
%38 = phi double [ %32, %30 ], [ %60, %35 ]
%39 = phi double [ %33, %30 ], [ %66, %35 ]
%40 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 %36
%41 = load float, float* %40
%42 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %36
%43 = load float, float* %42
%44 = fsub float %41, %43
%45 = fpext float %44 to double
%46 = fadd double %38, %45
%47 = tail call double @llvm.fmuladd.f64(double %45, double %45, double %37)
%48 = fcmp olt double %39, %45
%49 = select i1 %48, double %45, double %39
%50 = fneg double %45
%51 = fcmp olt double %49, %50
%52 = select i1 %51, double %50, double %49
%53 = or i64 %36, 1
%54 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 %53
%55 = load float, float* %54
%56 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %53
%57 = load float, float* %56
%58 = fsub float %55, %57
%59 = fpext float %58 to double
%60 = fadd double %46, %59
%61 = tail call double @llvm.fmuladd.f64(double %59, double %59, double %47)
%62 = fcmp olt double %52, %59
%63 = select i1 %62, double %59, double %52
%64 = fneg double %59
%65 = fcmp olt double %63, %64
%66 = select i1 %65, double %64, double %63
%67 = add nuw nsw i64 %36, 2
%68 = icmp eq i64 %67, 512
br i1 %68, label %69, label %35
69: ; preds = %35
%70 = add nuw nsw i32 %34, 512
%71 = call i32 @fread(float* %19, i32 4, i32 512, i32* %11)
%72 = call i32 @fread(float* %21, i32 4, i32 512, i32* %14)
%73 = icmp slt i32 %71, 512
%74 = icmp slt i32 %72, 512
%75 = or i1 %73, %74
br i1 %75, label %76, label %30
76: ; preds = %69
%77 = sitofp i32 %70 to double
%78 = fmul double %66, 3.276800e+04
br label %79
79: ; preds = %76, %18
%80 = phi double [ 0.000000e+00, %18 ], [ %77, %76 ]
%81 = phi double [ 0.000000e+00, %18 ], [ %78, %76 ]
%82 = phi double [ 0.000000e+00, %18 ], [ %60, %76 ]
%83 = phi double [ 0.000000e+00, %18 ], [ %61, %76 ]
%84 = phi i32 [ %20, %18 ], [ %71, %76 ]
%85 = phi i32 [ %22, %18 ], [ %72, %76 ]
%86 = icmp eq i32 %84, %85
br i1 %86, label %87, label %107
87: ; preds = %79
%88 = fdiv double %82, %80
%89 = fdiv double %83, %80
%90 = fneg double %88
%91 = tail call double @llvm.fmuladd.f64(double %90, double %88, double %89)
%92 = fcmp ogt double %91, 0.000000e+00
br i1 %92, label %93, label %97
93: ; preds = %87
%94 = tail call i32 @sqrt(double %91)
%95 = shl nsw i32 %94, 15
%96 = sitofp i32 %95 to double
br label %97
97: ; preds = %93, %87
%98 = phi double [ %96, %93 ], [ %91, %87 ]
%99 = fmul double %88, 3.276800e+04
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), double %81, double %99, double %98)
%101 = fcmp ogt double %81, 1.000000e-02
%102 = fcmp ogt double %99, 1.000000e-03
%103 = or i1 %101, %102
%104 = fcmp ogt double %98, 1.000000e-03
%105 = or i1 %103, %104
%106 = zext i1 %105 to i32
br label %115
107: ; preds = %79
%108 = icmp slt i32 %84, %85
br i1 %108, label %109, label %112
109: ; preds = %107
%110 = load i8*, i8** %9
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %110)
br label %115
112: ; preds = %107
%113 = load i8*, i8** %12
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %109, %112, %2, %97, %26
%116 = phi i32 [ 1, %26 ], [ %106, %97 ], [ 1, %2 ], [ 1, %112 ], [ 1, %109 ]
ret i32 %116
}