#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 */
double *dvector(long, long);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/ *);
scalar_t__ isDataLine(char *);
int /*<<< orphan*/ sscanf(char *, char *, double *, double *, double *);
void GetDat(char *InFile, double **x, double **y, double **dy, int *n) {
  FILE *path;
  int i;
  char aLine[256];
  double xx, yy, esd;
  *n = 0;
  path = fopen(InFile, "r");
  if (!path)
    return;
  i = 0;
  while (!feof(path)) {
    fgets(aLine, 256, path);
    if (isDataLine(aLine))
      i++;
  }
  *n = i - 1;
  *x = dvector((long)1, (long)*n);
  *y = dvector((long)1, (long)*n);
  *dy = dvector((long)1, (long)*n);
  freopen(InFile, "r", path);
  i = 0;
  while (!feof(path) && (i < *n)) {
    fgets(aLine, 256, path);
    if (isDataLine(aLine)) {
      i++;
      sscanf(aLine, "%le%le%le", &xx, &yy, &esd);
      (*x)[i] = xx;
      (*y)[i] = yy;
      (*dy)[i] = esd;
    }
  }
  fclose(path);
}


x86 assembly (clang, -O0):
<GetDat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11cd <GetDat+0x4d>
jmp    1396 <GetDat+0x216>
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11f2 <GetDat+0x72>
jmp    122b <GetDat+0xab>
lea    -0x140(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
lea    -0x140(%rbp),%rdi
call   1060 <isDataLine@plt>
cmp    $0x0,%rax
je     1226 <GetDat+0xa6>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d4 <GetDat+0x54>
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xd69(%rip),%rsi
call   1040 <freopen@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x159(%rbp)
jne    12d1 <GetDat+0x151>
mov    -0x34(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
mov    %al,-0x159(%rbp)
mov    -0x159(%rbp),%al
test   $0x1,%al
jne    12e4 <GetDat+0x164>
jmp    138d <GetDat+0x20d>
lea    -0x140(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
lea    -0x140(%rbp),%rdi
call   1060 <isDataLine@plt>
cmp    $0x0,%rax
je     1388 <GetDat+0x208>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
lea    -0x140(%rbp),%rdi
lea    0xcdc(%rip),%rsi
lea    -0x148(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    -0x158(%rbp),%r8
call   1080 <sscanf@plt>
movsd  -0x148(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x150(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x158(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12a3 <GetDat+0x123>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %r8,%r13
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,%r12
mov    %rdi,%rbp
movl   $0x0,(%r8)
lea    0xe4e(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1277 <GetDat+0xf7>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <feof@plt>
mov    $0xffffffff,%r15d
test   %eax,%eax
jne    1210 <GetDat+0x90>
xor    %r15d,%r15d
lea    0x30(%rsp),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1060 <isDataLine@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%r15d
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     11e0 <GetDat+0x60>
add    $0xffffffff,%r15d
mov    %r15d,0x0(%r13)
movslq %r15d,%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    %rax,(%r12)
movslq 0x0(%r13),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx)
movslq 0x0(%r13),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    0x10(%rsp),%rcx
mov    %rax,(%rcx)
lea    0xda8(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1040 <freopen@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     1289 <GetDat+0x109>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
lea    0x30(%rsp),%r14
jmp    12ac <GetDat+0x12c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    126f <GetDat+0xef>
cmp    0x0(%r13),%ebp
jge    126f <GetDat+0xef>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1060 <isDataLine@plt>
test   %rax,%rax
je     12a0 <GetDat+0x120>
lea    0x1(%rbp),%r15d
mov    %r14,%rdi
lea    0xd25(%rip),%rsi
lea    0x28(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x18(%rsp),%r8
call   1080 <sscanf@plt>
movsd  0x28(%rsp),%xmm0
mov    (%r12),%rax
movslq %ebp,%rcx
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  0x20(%rsp),%xmm0
mov    0x8(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  0x18(%rsp),%xmm0
mov    0x10(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax,%rcx,8)
mov    %r15d,%ebp
jmp    12a0 <GetDat+0x120>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"%le%le%le\00"
define void @GetDat(i8* %0, double** %1, double** %2, double** %3, i32* %4) {
%6 = alloca i8*
%7 = alloca double**
%8 = alloca double**
%9 = alloca double**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca double
%15 = alloca double
%16 = alloca double
store i8* %0, i8** %6
store double** %1, double*** %7
store double** %2, double*** %8
store double** %3, double*** %9
store i32* %4, i32** %10
%17 = load i32*, i32** %10
store i32 0, i32* %17
%18 = load i8*, i8** %6
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %11
%20 = load i32*, i32** %11
%21 = icmp ne i32* %20, null
br i1 %21, label %23, label %22
22: ; preds = %5
br label %107
23: ; preds = %5
store i32 0, i32* %12
br label %24
24: ; preds = %39, %23
%25 = load i32*, i32** %11
%26 = call i32 @feof(i32* %25)
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
br i1 %28, label %29, label %40
29: ; preds = %24
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%31 = load i32*, i32** %11
%32 = call i32 @fgets(i8* %30, i32 256, i32* %31)
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%34 = call i64 @isDataLine(i8* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = load i32, i32* %12
%38 = add nsw i32 %37, 1
store i32 %38, i32* %12
br label %39
39: ; preds = %36, %29
br label %24
40: ; preds = %24
%41 = load i32, i32* %12
%42 = sub nsw i32 %41, 1
%43 = load i32*, i32** %10
store i32 %42, i32* %43
%44 = load i32*, i32** %10
%45 = load i32, i32* %44
%46 = sext i32 %45 to i64
%47 = call double* @dvector(i64 1, i64 %46)
%48 = load double**, double*** %7
store double* %47, double** %48
%49 = load i32*, i32** %10
%50 = load i32, i32* %49
%51 = sext i32 %50 to i64
%52 = call double* @dvector(i64 1, i64 %51)
%53 = load double**, double*** %8
store double* %52, double** %53
%54 = load i32*, i32** %10
%55 = load i32, i32* %54
%56 = sext i32 %55 to i64
%57 = call double* @dvector(i64 1, i64 %56)
%58 = load double**, double*** %9
store double* %57, double** %58
%59 = load i8*, i8** %6
%60 = load i32*, i32** %11
%61 = call i32 @freopen(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %60)
store i32 0, i32* %12
br label %62
62: ; preds = %103, %40
%63 = load i32*, i32** %11
%64 = call i32 @feof(i32* %63)
%65 = icmp ne i32 %64, 0
br i1 %65, label %71, label %66
66: ; preds = %62
%67 = load i32, i32* %12
%68 = load i32*, i32** %10
%69 = load i32, i32* %68
%70 = icmp slt i32 %67, %69
br label %71
71: ; preds = %66, %62
%72 = phi i1 [ false, %62 ], [ %70, %66 ]
br i1 %72, label %73, label %104
73: ; preds = %71
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%75 = load i32*, i32** %11
%76 = call i32 @fgets(i8* %74, i32 256, i32* %75)
%77 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%78 = call i64 @isDataLine(i8* %77)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %103
80: ; preds = %73
%81 = load i32, i32* %12
%82 = add nsw i32 %81, 1
store i32 %82, i32* %12
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%84 = call i32 @sscanf(i8* %83, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %14, double* %15, double* %16)
%85 = load double, double* %14
%86 = load double**, double*** %7
%87 = load double*, double** %86
%88 = load i32, i32* %12
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
store double %85, double* %90
%91 = load double, double* %15
%92 = load double**, double*** %8
%93 = load double*, double** %92
%94 = load i32, i32* %12
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
store double %91, double* %96
%97 = load double, double* %16
%98 = load double**, double*** %9
%99 = load double*, double** %98
%100 = load i32, i32* %12
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double %97, double* %102
br label %103
103: ; preds = %80, %73
br label %62
104: ; preds = %71
%105 = load i32*, i32** %11
%106 = call i32 @fclose(i32* %105)
br label %107
107: ; preds = %104, %22
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c"%le%le%le\00"
define void @GetDat(i8* %0, double** nocapture %1, double** nocapture %2, double** nocapture %3, i32* nocapture %4) {
%6 = alloca [256 x i8]
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
%13 = bitcast double* %9 to i8*
store i32 0, i32* %4
%14 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %70, label %16
16: ; preds = %5
%17 = call i32 @feof(i32* %14)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %16, %19
%20 = phi i32 [ %25, %19 ], [ 0, %16 ]
%21 = call i32 @fgets(i8* %10, i32 256, i32* %14)
%22 = call i64 @isDataLine(i8* %10)
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i32
%25 = add nuw nsw i32 %20, %24
%26 = call i32 @feof(i32* %14)
%27 = icmp eq i32 %26, 0
br i1 %27, label %19, label %28
28: ; preds = %19
%29 = add nsw i32 %25, -1
br label %30
30: ; preds = %28, %16
%31 = phi i32 [ -1, %16 ], [ %29, %28 ]
store i32 %31, i32* %4
%32 = sext i32 %31 to i64
%33 = call double* @dvector(i64 1, i64 %32)
store double* %33, double** %1
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = call double* @dvector(i64 1, i64 %35)
store double* %36, double** %2
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = call double* @dvector(i64 1, i64 %38)
store double* %39, double** %3
%40 = call i32 @freopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %14)
%41 = call i32 @feof(i32* %14)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %68
43: ; preds = %30, %64
%44 = phi i32 [ %65, %64 ], [ 0, %30 ]
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %68
47: ; preds = %43
%48 = call i32 @fgets(i8* %10, i32 256, i32* %14)
%49 = call i64 @isDataLine(i8* %10)
%50 = icmp eq i64 %49, 0
br i1 %50, label %64, label %51
51: ; preds = %47
%52 = add nsw i32 %44, 1
%53 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %7, double* %8, double* %9)
%54 = load double, double* %7
%55 = load double*, double** %1
%56 = sext i32 %52 to i64
%57 = getelementptr inbounds double, double* %55, i64 %56
store double %54, double* %57
%58 = load double, double* %8
%59 = load double*, double** %2
%60 = getelementptr inbounds double, double* %59, i64 %56
store double %58, double* %60
%61 = load double, double* %9
%62 = load double*, double** %3
%63 = getelementptr inbounds double, double* %62, i64 %56
store double %61, double* %63
br label %64
64: ; preds = %51, %47
%65 = phi i32 [ %52, %51 ], [ %44, %47 ]
%66 = call i32 @feof(i32* %14)
%67 = icmp eq i32 %66, 0
br i1 %67, label %43, label %68
68: ; preds = %43, %64, %30
%69 = call i32 @fclose(i32* %14)
br label %70
70: ; preds = %5, %68
ret void
}