#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 */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ isnan(double);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stat(char *, struct stat *);
int main(int argc, char *argv[]) {
  char *first, *second;
  int i, ended, flag;
  FILE *fp1, *fp2;
  struct stat stat1, stat2;
  double *df, *ds;
  int dsize;
  double double_min;
  double_min = (1e-10);
  if (argc < 3 || argc > 4) {
    printf("usage:  comparedouble file1 file2 [precision]\n");
  }
  if ((fp1 = fopen(argv[1], "r")) == NULL) {
    printf("file not found\n");
    exit(1);
  }
  if ((fp2 = fopen(argv[2], "r")) == NULL) {
    printf("file not found\n");
    exit(1);
  }
  if (argc == 4) {
    double_min = atof(argv[3]);
  }
  stat(argv[1], &stat1);
  stat(argv[2], &stat2);
  if (stat1.st_size != stat2.st_size) {
    printf("wrong file size\n");
    exit(1);
  }
  first = (char *)malloc(stat1.st_size);
  second = (char *)malloc(stat2.st_size);
  ended = 0;
  while (1) {
    ended += fread(first + ended, 1, stat1.st_size - ended, fp1);
    if (ended >= stat1.st_size)
      break;
  }
  fclose(fp1);
  ended = 0;
  while (1) {
    ended += fread(second + ended, 1, stat2.st_size - ended, fp2);
    if (ended >= stat2.st_size)
      break;
  }
  fclose(fp2);
  dsize = stat1.st_size / (sizeof(double) / sizeof(char));
  df = (double *)first;
  ds = (double *)second;
  flag = 0;
  for (i = 0; i < dsize; i++) {
    if (isnan(df[i]) || isnan(ds[i]) || (df[i] - ds[i]) / df[i] > double_min) {
      printf("error a[%d]=%.20e\n      b[%d]=%.20e\n", i, df[i], i, ds[i]);
      flag++;
    }
  }
  if (flag == 0)
    printf("no error. same data.(different less than %1.20f)\n", double_min);
  else
    printf("%d errors in %d. different data. \n", flag, i);
  free(first);
  free(second);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe42(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11d7 <main+0x37>
cmpl   $0x4,-0x8(%rbp)
jle    11e5 <main+0x45>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe43(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    121f <main+0x7f>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe09(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1259 <main+0xb9>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jne    1275 <main+0xd5>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x48(%rbp),%rsi
call   1080 <stat@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x50(%rbp),%rsi
call   1080 <stat@plt>
mov    -0x48(%rbp),%eax
cmp    -0x50(%rbp),%eax
je     12bb <main+0x11b>
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x48(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x50(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x48(%rbp),%edx
sub    -0x28(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,%rcx
movslq -0x28(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x48(%rbp),%eax
jl     1317 <main+0x177>
jmp    131c <main+0x17c>
jmp    12da <main+0x13a>
mov    -0x38(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
mov    -0x50(%rbp),%edx
sub    -0x28(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,%rcx
movslq -0x28(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x50(%rbp),%eax
jl     1369 <main+0x1c9>
jmp    136e <main+0x1ce>
jmp    132c <main+0x18c>
mov    -0x40(%rbp),%rdi
call   1060 <fclose@plt>
movslq -0x48(%rbp),%rax
shr    $0x3,%rax
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1460 <main+0x2c0>
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <isnan@plt>
cmp    $0x0,%rax
jne    1416 <main+0x276>
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   10a0 <isnan@plt>
cmp    $0x0,%rax
jne    1416 <main+0x276>
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    144d <main+0x2ad>
mov    -0x24(%rbp),%esi
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x24(%rbp),%edx
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xc1d(%rip),%rdi
mov    $0x2,%al
call   1070 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1452 <main+0x2b2>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13a0 <main+0x200>
cmpl   $0x0,-0x2c(%rbp)
jne    1482 <main+0x2e2>
movsd  -0x70(%rbp),%xmm0
lea    0xc09(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    1496 <main+0x2f6>
mov    -0x2c(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    -0x5(%rbp),%eax
cmp    $0xfffffffd,%eax
ja     11d7 <main+0x27>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rdi
lea    0xe26(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1395 <main+0x1e5>
mov    %rax,%r13
mov    0x10(%rbx),%rdi
lea    0xe0a(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1395 <main+0x1e5>
mov    %rax,%r12
cmp    $0x4,%ebp
jne    121f <main+0x6f>
mov    0x18(%rbx),%rdi
call   1060 <atof@plt>
jmp    1227 <main+0x77>
movsd  0xdd9(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    0x8(%rbx),%rdi
lea    0x10(%rsp),%rsi
call   1090 <stat@plt>
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1090 <stat@plt>
mov    0x10(%rsp),%ebx
cmp    0x8(%rsp),%ebx
jne    139e <main+0x1ee>
mov    %ebx,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   10a0 <malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
nopl   0x0(%rax)
movslq %eax,%rbp
lea    (%r15,%rbp,1),%rdi
mov    %ebx,%edx
sub    %ebp,%edx
mov    $0x1,%esi
mov    %r13,%rcx
call   1050 <fread@plt>
add    %ebp,%eax
cmp    %ebx,%eax
jl     1270 <main+0xc0>
mov    %r13,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movslq %eax,%rbp
lea    (%r14,%rbp,1),%rdi
mov    %ebx,%edx
sub    %ebp,%edx
mov    $0x1,%esi
mov    %r12,%rcx
call   1050 <fread@plt>
add    %ebp,%eax
cmp    %ebx,%eax
jl     12a0 <main+0xf0>
mov    %r12,%rdi
call   1070 <fclose@plt>
cmp    $0x8,%ebx
jl     1361 <main+0x1b1>
shr    $0x3,%rbx
xor    %ebp,%ebp
lea    0xd2e(%rip),%r13
xor    %r12d,%r12d
nop
movsd  (%r15,%rbp,8),%xmm0
call   10b0 <isnan@plt>
test   %rax,%rax
jne    1320 <main+0x170>
movsd  (%r14,%rbp,8),%xmm0
call   10b0 <isnan@plt>
test   %rax,%rax
jne    1320 <main+0x170>
movsd  (%r15,%rbp,8),%xmm0
movapd %xmm0,%xmm1
subsd  (%r14,%rbp,8),%xmm1
divsd  %xmm0,%xmm1
ucomisd (%rsp),%xmm1
jbe    133e <main+0x18e>
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbp,8),%xmm0
movsd  (%r14,%rbp,8),%xmm1
mov    %r13,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x2,%al
call   1080 <printf@plt>
add    $0x1,%r12d
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    12e0 <main+0x130>
test   %r12d,%r12d
je     1361 <main+0x1b1>
lea    0xd0e(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1374 <main+0x1c4>
lea    0xcc7(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf8(%rip),%rdi
jmp    13a5 <main+0x1f5>
lea    0xcdf(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [47 x i8] c"usage: comparedouble file1 file2 [precision]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"file not found\0A\00"
@.str.3 = [17 x i8] c"wrong file size\0A\00"
@.str.4 = [37 x i8] c"error a[%d]=%.20e\0A b[%d]=%.20e\0A\00"
@.str.5 = [50 x i8] c"no error. same data.(different less than %1.20f)\0A\00"
@.str.6 = [35 x i8] c"%d errors in %d. different data. \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca %struct.stat
%14 = alloca %struct.stat
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e-10, double* %18
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 3
br i1 %20, label %24, label %21
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 4
br i1 %23, label %24, label %26
24: ; preds = %21, %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %30, i32** %11
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %26
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %26
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %39, i32** %12
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %35
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %35
%45 = load i32, i32* %4
%46 = icmp eq i32 %45, 4
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = call double @atof(i8* %50)
store double %51, double* %18
br label %52
52: ; preds = %47, %44
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i32 @stat(i8* %55, %struct.stat* %13)
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32 @stat(i8* %59, %struct.stat* %14)
%61 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%62 = load i32, i32* %61
%63 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%64 = load i32, i32* %63
%65 = icmp ne i32 %62, %64
br i1 %65, label %66, label %69
66: ; preds = %52
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %52
%70 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%71 = load i32, i32* %70
%72 = call i64 @malloc(i32 %71)
%73 = inttoptr i64 %72 to i8*
store i8* %73, i8** %6
%74 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%75 = load i32, i32* %74
%76 = call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i8*
store i8* %77, i8** %7
store i32 0, i32* %9
br label %78
78: ; preds = %69, %98
%79 = load i8*, i8** %6
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
%83 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%84 = load i32, i32* %83
%85 = load i32, i32* %9
%86 = sub nsw i32 %84, %85
%87 = load i32*, i32** %11
%88 = call i64 @fread(i8* %82, i32 1, i32 %86, i32* %87)
%89 = load i32, i32* %9
%90 = sext i32 %89 to i64
%91 = add nsw i64 %90, %88
%92 = trunc i64 %91 to i32
store i32 %92, i32* %9
%93 = load i32, i32* %9
%94 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%95 = load i32, i32* %94
%96 = icmp sge i32 %93, %95
br i1 %96, label %97, label %98
97: ; preds = %78
br label %99
98: ; preds = %78
br label %78
99: ; preds = %97
%100 = load i32*, i32** %11
%101 = call i32 @fclose(i32* %100)
store i32 0, i32* %9
br label %102
102: ; preds = %99, %122
%103 = load i8*, i8** %7
%104 = load i32, i32* %9
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%108 = load i32, i32* %107
%109 = load i32, i32* %9
%110 = sub nsw i32 %108, %109
%111 = load i32*, i32** %12
%112 = call i64 @fread(i8* %106, i32 1, i32 %110, i32* %111)
%113 = load i32, i32* %9
%114 = sext i32 %113 to i64
%115 = add nsw i64 %114, %112
%116 = trunc i64 %115 to i32
store i32 %116, i32* %9
%117 = load i32, i32* %9
%118 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%119 = load i32, i32* %118
%120 = icmp sge i32 %117, %119
br i1 %120, label %121, label %122
121: ; preds = %102
br label %123
122: ; preds = %102
br label %102
123: ; preds = %121
%124 = load i32*, i32** %12
%125 = call i32 @fclose(i32* %124)
%126 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%127 = load i32, i32* %126
%128 = sext i32 %127 to i64
%129 = udiv i64 %128, 8
%130 = trunc i64 %129 to i32
store i32 %130, i32* %17
%131 = load i8*, i8** %6
%132 = bitcast i8* %131 to double*
store double* %132, double** %15
%133 = load i8*, i8** %7
%134 = bitcast i8* %133 to double*
store double* %134, double** %16
store i32 0, i32* %10
store i32 0, i32* %8
br label %135
135: ; preds = %192, %123
%136 = load i32, i32* %8
%137 = load i32, i32* %17
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %195
139: ; preds = %135
%140 = load double*, double** %15
%141 = load i32, i32* %8
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = call i64 @isnan(double %144)
%146 = icmp ne i64 %145, 0
br i1 %146, label %175, label %147
147: ; preds = %139
%148 = load double*, double** %16
%149 = load i32, i32* %8
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds double, double* %148, i64 %150
%152 = load double, double* %151
%153 = call i64 @isnan(double %152)
%154 = icmp ne i64 %153, 0
br i1 %154, label %175, label %155
155: ; preds = %147
%156 = load double*, double** %15
%157 = load i32, i32* %8
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = load double*, double** %16
%162 = load i32, i32* %8
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
%165 = load double, double* %164
%166 = fsub double %160, %165
%167 = load double*, double** %15
%168 = load i32, i32* %8
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = fdiv double %166, %171
%173 = load double, double* %18
%174 = fcmp ogt double %172, %173
br i1 %174, label %175, label %191
175: ; preds = %155, %147, %139
%176 = load i32, i32* %8
%177 = load double*, double** %15
%178 = load i32, i32* %8
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
%181 = load double, double* %180
%182 = load i32, i32* %8
%183 = load double*, double** %16
%184 = load i32, i32* %8
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %183, i64 %185
%187 = load double, double* %186
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %176, double %181, i32 %182, double %187)
%189 = load i32, i32* %10
%190 = add nsw i32 %189, 1
store i32 %190, i32* %10
br label %191
191: ; preds = %175, %155
br label %192
192: ; preds = %191
%193 = load i32, i32* %8
%194 = add nsw i32 %193, 1
store i32 %194, i32* %8
br label %135
195: ; preds = %135
%196 = load i32, i32* %10
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %201
198: ; preds = %195
%199 = load double, double* %18
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), double %199)
br label %205
201: ; preds = %195
%202 = load i32, i32* %10
%203 = load i32, i32* %8
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %202, i32 %203)
br label %205
205: ; preds = %201, %198
%206 = load i8*, i8** %6
%207 = call i32 @free(i8* %206)
%208 = load i8*, i8** %7
%209 = call i32 @free(i8* %208)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str.1 = [2 x i8] c"r\00"
@.str.4 = [37 x i8] c"error a[%d]=%.20e\0A b[%d]=%.20e\0A\00"
@.str.5 = [50 x i8] c"no error. same data.(different less than %1.20f)\0A\00"
@.str.6 = [35 x i8] c"%d errors in %d. different data. \0A\00"
@str = [16 x i8] c"wrong file size\00"
@str.8 = [15 x i8] c"file not found\00"
@str.9 = [46 x i8] c"usage: comparedouble file1 file2 [precision]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
%7 = add i32 %0, -5
%8 = icmp ult i32 %7, -2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.9, i64 0, i64 0))
br label %11
11: ; preds = %2, %9
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %11
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %19
%28 = icmp eq i32 %0, 4
br i1 %28, label %29, label %33
29: ; preds = %27
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = tail call double @atof(i8* %31)
br label %33
33: ; preds = %29, %27
%34 = phi double [ %32, %29 ], [ 1.000000e-10, %27 ]
%35 = load i8*, i8** %12
%36 = call i32 @stat(i8* %35, %struct.stat* %3)
%37 = load i8*, i8** %20
%38 = call i32 @stat(i8* %37, %struct.stat* %4)
%39 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%40 = load i32, i32* %39
%41 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%42 = load i32, i32* %41
%43 = icmp eq i32 %40, %42
br i1 %43, label %47, label %44
44: ; preds = %33
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%46 = tail call i32 @exit(i32 1)
unreachable
47: ; preds = %33
%48 = tail call i64 @malloc(i32 %40)
%49 = inttoptr i64 %48 to i8*
%50 = tail call i64 @malloc(i32 %40)
br label %51
51: ; preds = %51, %47
%52 = phi i32 [ 0, %47 ], [ %58, %51 ]
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %49, i64 %53
%55 = sub nsw i32 %40, %52
%56 = tail call i64 @fread(i8* %54, i32 1, i32 %55, i32* %14)
%57 = trunc i64 %56 to i32
%58 = add i32 %52, %57
%59 = icmp slt i32 %58, %40
br i1 %59, label %51, label %60
60: ; preds = %51
%61 = inttoptr i64 %50 to i8*
%62 = tail call i32 @fclose(i32* %14)
br label %63
63: ; preds = %63, %60
%64 = phi i32 [ 0, %60 ], [ %70, %63 ]
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %61, i64 %65
%67 = sub nsw i32 %40, %64
%68 = tail call i64 @fread(i8* %66, i32 1, i32 %67, i32* %22)
%69 = trunc i64 %68 to i32
%70 = add i32 %64, %69
%71 = icmp slt i32 %70, %40
br i1 %71, label %63, label %72
72: ; preds = %63
%73 = tail call i32 @fclose(i32* %22)
%74 = inttoptr i64 %48 to double*
%75 = inttoptr i64 %50 to double*
%76 = icmp sgt i32 %40, 7
br i1 %76, label %77, label %111
77: ; preds = %72
%78 = lshr i32 %40, 3
%79 = zext i32 %78 to i64
br label %80
80: ; preds = %77, %105
%81 = phi i64 [ 0, %77 ], [ %107, %105 ]
%82 = phi i32 [ 0, %77 ], [ %106, %105 ]
%83 = getelementptr inbounds double, double* %74, i64 %81
%84 = load double, double* %83
%85 = tail call i64 @isnan(double %84)
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %98
87: ; preds = %80
%88 = getelementptr inbounds double, double* %75, i64 %81
%89 = load double, double* %88
%90 = tail call i64 @isnan(double %89)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %98
92: ; preds = %87
%93 = load double, double* %83
%94 = load double, double* %88
%95 = fsub double %93, %94
%96 = fdiv double %95, %93
%97 = fcmp ogt double %96, %34
br i1 %97, label %98, label %105
98: ; preds = %92, %87, %80
%99 = load double, double* %83
%100 = getelementptr inbounds double, double* %75, i64 %81
%101 = load double, double* %100
%102 = trunc i64 %81 to i32
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %102, double %99, i32 %102, double %101)
%104 = add nsw i32 %82, 1
br label %105
105: ; preds = %92, %98
%106 = phi i32 [ %104, %98 ], [ %82, %92 ]
%107 = add nuw nsw i64 %81, 1
%108 = icmp eq i64 %107, %79
br i1 %108, label %109, label %80
109: ; preds = %105
%110 = icmp eq i32 %106, 0
br i1 %110, label %111, label %113
111: ; preds = %72, %109
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), double %34)
br label %115
113: ; preds = %109
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %106, i32 %78)
br label %115
115: ; preds = %113, %111
%116 = tail call i32 @free(i8* %49)
%117 = tail call i32 @free(i8* %61)
ret i32 0
}