#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(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
int /*<<< orphan*/ printf(char *, ...);
void init_trail(double x[], double y[]) {
  int i = 0;
  int debug = 1;
  FILE *fp;
  fp = fopen("TrailData.in", "r");
  if (fp == NULL) {
    printf("Error reading file: traildata.in\n");
    exit(0);
  }
  for (i = 0; i < 12; i++) {
    fscanf(fp, "%lf", &x[i]);
    fscanf(fp, "%lf", &y[i]);
  }
  if (debug == 1) {
    printf("\ttrailX\ttrailY\n");
    printf("\t======\t======\n");
    for (i = 0; i < 12; i++) {
      printf("\t%.2lf\t%.2lf\n", x[i], y[i]);
    }
  }
  fclose(fp);
  return;
}


x86 assembly (clang, -O0):
<init_trail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xe8b(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11a5 <init_trail+0x55>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    1202 <init_trail+0xb2>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe61(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe42(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ac <init_trail+0x5c>
cmpl   $0x1,-0x18(%rbp)
jne    1274 <init_trail+0x124>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    126f <init_trail+0x11f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xdfb(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122f <init_trail+0xdf>
jmp    1274 <init_trail+0x124>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_trail>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xe8b(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1432 <init_trail+0x2d2>
mov    %rax,%rbx
lea    0xe7b(%rip),%r12
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
lea    0x8(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x8(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x10(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x10(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x18(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x18(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x20(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x20(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x28(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x28(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x30(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x30(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x38(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x38(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x40(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x40(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x48(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x48(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x50(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x50(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x58(%r15),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0x58(%r14),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fscanf@plt>
lea    0xd20(%rip),%rdi
call   1030 <puts@plt>
lea    0xd23(%rip),%rdi
call   1030 <puts@plt>
movsd  (%r15),%xmm0
movsd  (%r14),%xmm1
lea    0xcf0(%rip),%r12
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x8(%r15),%xmm0
movsd  0x8(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x10(%r15),%xmm0
movsd  0x10(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x18(%r15),%xmm0
movsd  0x18(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x20(%r15),%xmm0
movsd  0x20(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x28(%r15),%xmm0
movsd  0x28(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x30(%r15),%xmm0
movsd  0x30(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x38(%r15),%xmm0
movsd  0x38(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x40(%r15),%xmm0
movsd  0x40(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x48(%r15),%xmm0
movsd  0x48(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x50(%r15),%xmm0
movsd  0x50(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movsd  0x58(%r15),%xmm0
movsd  0x58(%r14),%xmm1
mov    %r12,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fclose@plt>
lea    0xc06(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"TrailData.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [34 x i8] c"Error reading file: traildata.in\0A\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [16 x i8] c"\09trailX\09trailY\0A\00"
@.str.5 = [16 x i8] c"\09======\09======\0A\00"
@.str.6 = [14 x i8] c"\09%.2lf\09%.2lf\0A\00"
define void @init_trail(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %5
store i32 1, i32* %6
%8 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %2
store i32 0, i32* %5
br label %15
15: ; preds = %31, %14
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 12
br i1 %17, label %18, label %34
18: ; preds = %15
%19 = load i32*, i32** %7
%20 = load double*, double** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = call i32 @fscanf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %23)
%25 = load i32*, i32** %7
%26 = load double*, double** %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = call i32 @fscanf(i32* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %29)
br label %31
31: ; preds = %18
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %15
34: ; preds = %15
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %59
37: ; preds = %34
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %5
br label %40
40: ; preds = %55, %37
%41 = load i32, i32* %5
%42 = icmp slt i32 %41, 12
br i1 %42, label %43, label %58
43: ; preds = %40
%44 = load double*, double** %3
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = load double*, double** %4
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %48, double %53)
br label %55
55: ; preds = %43
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %40
58: ; preds = %40
br label %59
59: ; preds = %58, %34
%60 = load i32*, i32** %7
%61 = call i32 @fclose(i32* %60)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"TrailData.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.6 = [14 x i8] c"\09%.2lf\09%.2lf\0A\00"
@str = [15 x i8] c"\09trailX\09trailY\00"
@str.7 = [15 x i8] c"\09======\09======\00"
@str.8 = [33 x i8] c"Error reading file: traildata.in\00"
define void @init_trail(double* %0, double* %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %91, label %5
5: ; preds = %2
%6 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %0)
%7 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %1)
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %8)
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %10)
%12 = getelementptr inbounds double, double* %0, i64 2
%13 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %12)
%14 = getelementptr inbounds double, double* %1, i64 2
%15 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %14)
%16 = getelementptr inbounds double, double* %0, i64 3
%17 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %16)
%18 = getelementptr inbounds double, double* %1, i64 3
%19 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %18)
%20 = getelementptr inbounds double, double* %0, i64 4
%21 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %20)
%22 = getelementptr inbounds double, double* %1, i64 4
%23 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %22)
%24 = getelementptr inbounds double, double* %0, i64 5
%25 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %24)
%26 = getelementptr inbounds double, double* %1, i64 5
%27 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %26)
%28 = getelementptr inbounds double, double* %0, i64 6
%29 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %28)
%30 = getelementptr inbounds double, double* %1, i64 6
%31 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %30)
%32 = getelementptr inbounds double, double* %0, i64 7
%33 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %32)
%34 = getelementptr inbounds double, double* %1, i64 7
%35 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %34)
%36 = getelementptr inbounds double, double* %0, i64 8
%37 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %36)
%38 = getelementptr inbounds double, double* %1, i64 8
%39 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %38)
%40 = getelementptr inbounds double, double* %0, i64 9
%41 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %40)
%42 = getelementptr inbounds double, double* %1, i64 9
%43 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %42)
%44 = getelementptr inbounds double, double* %0, i64 10
%45 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %44)
%46 = getelementptr inbounds double, double* %1, i64 10
%47 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %46)
%48 = getelementptr inbounds double, double* %0, i64 11
%49 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %48)
%50 = getelementptr inbounds double, double* %1, i64 11
%51 = tail call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %50)
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.7, i64 0, i64 0))
%54 = load double, double* %0
%55 = load double, double* %1
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %54, double %55)
%57 = load double, double* %8
%58 = load double, double* %10
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %57, double %58)
%60 = load double, double* %12
%61 = load double, double* %14
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %60, double %61)
%63 = load double, double* %16
%64 = load double, double* %18
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %63, double %64)
%66 = load double, double* %20
%67 = load double, double* %22
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %66, double %67)
%69 = load double, double* %24
%70 = load double, double* %26
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %69, double %70)
%72 = load double, double* %28
%73 = load double, double* %30
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %72, double %73)
%75 = load double, double* %32
%76 = load double, double* %34
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %75, double %76)
%78 = load double, double* %36
%79 = load double, double* %38
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %78, double %79)
%81 = load double, double* %40
%82 = load double, double* %42
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %81, double %82)
%84 = load double, double* %44
%85 = load double, double* %46
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %84, double %85)
%87 = load double, double* %48
%88 = load double, double* %50
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %87, double %88)
%90 = tail call i32 @fclose(i32* %3)
ret void
91: ; preds = %2
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
%93 = tail call i32 @exit(i32 0)
unreachable
}