#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*/ clean_line(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ freexy(double **);
void *get_line_cf(char *, int, int /*<<< orphan*/ *);
int string_read_doubles(char *, double *, int);
int /*<<< orphan*/ willus_mem_alloc(double **, size_t, char *);
int readxy_ex(char *filename, double **x, double **y, int *n, FILE *output,
              int ignore_after_semicolon) {
  FILE *f;
  static char *notenough = "There is not enough memory to read in file %s.\n";
  static char *internal = "Internal error re-reading file %s.\n";
  char buf[200];
  long memsize;
  int i;
  size_t memsizest;
  static char *funcname = "readxy";
  (*x) = NULL;
  (*y) = NULL;
  (*n) = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    if (output != NULL)
      fprintf(output, "Cannot open file %s for reading array pairs.\n",
              filename);
    return (-2);
  }
  while (1) {
    double v[2];
    void *ptr;
    if (ignore_after_semicolon)
      ptr = get_line_cf(buf, 199, f);
    else
      ptr = fgets(buf, 199, f);
    if (ptr == NULL)
      break;
    clean_line(buf);
    if (string_read_doubles(buf, v, 2) == 2)
      (*n)++;
  }
  fclose(f);
  if ((*n) == 0) {
    if (output != NULL)
      fprintf(output, "There are no array pairs in file %s.\n", filename);
    return (0);
  }
  memsize = (long)sizeof(double) * (*n) * 2L;
  memsizest = (size_t)memsize;
  if (memsize != memsizest) {
    if (output != NULL)
      fprintf(output, notenough, filename);
    return (-1);
  }
  if (!willus_mem_alloc(x, memsizest, funcname)) {
    if (output != NULL)
      fprintf(output, notenough, filename);
    return (-1);
  }
  (*y) = &(*x)[(*n)];
  i = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    freexy(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  while (1) {
    double v[2];
    void *ptr;
    if (ignore_after_semicolon)
      ptr = get_line_cf(buf, 199, f);
    else
      ptr = fgets(buf, 199, f);
    if (ptr == NULL)
      break;
    clean_line(buf);
    if (string_read_doubles(buf, v, 2) == 2) {
      if (i >= (*n)) {
        fclose(f);
        freexy(x);
        if (output != NULL)
          fprintf(output, internal, filename);
        return (-3);
      }
      (*x)[i] = v[0];
      (*y)[i] = v[1];
      i++;
    }
  }
  fclose(f);
  if (i != (*n)) {
    freexy(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  return (0);
}


x86 assembly (clang, -O0):
<readxy_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    121d <readxy_ex+0x8d>
cmpq   $0x0,-0x30(%rbp)
je     1211 <readxy_ex+0x81>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe51(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
jmp    1222 <readxy_ex+0x92>
cmpl   $0x0,-0x34(%rbp)
je     124d <readxy_ex+0xbd>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   10b0 <get_line_cf@plt>
mov    %rax,-0x148(%rbp)
jmp    1269 <readxy_ex+0xd9>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   1050 <fgets@plt>
mov    %rax,-0x148(%rbp)
cmpq   $0x0,-0x148(%rbp)
jne    127c <readxy_ex+0xec>
jmp    12b9 <readxy_ex+0x129>
lea    -0x110(%rbp),%rdi
call   1090 <clean_line@plt>
lea    -0x110(%rbp),%rdi
lea    -0x140(%rbp),%rsi
mov    $0x2,%edx
call   1070 <string_read_doubles@plt>
cmp    $0x2,%eax
jne    12b4 <readxy_ex+0x124>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1222 <readxy_ex+0x92>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    12fa <readxy_ex+0x16a>
cmpq   $0x0,-0x30(%rbp)
je     12ee <readxy_ex+0x15e>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xda2(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
shl    $0x1,%rax
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x118(%rbp),%rax
cmp    -0x128(%rbp),%rax
je     135d <readxy_ex+0x1cd>
cmpq   $0x0,-0x30(%rbp)
je     1351 <readxy_ex+0x1c1>
mov    -0x30(%rbp),%rdi
mov    0x2d20(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
mov    -0x18(%rbp),%rdi
mov    -0x128(%rbp),%rsi
mov    0x2d09(%rip),%rdx
call   1030 <willus_mem_alloc@plt>
cmp    $0x0,%eax
jne    13a8 <readxy_ex+0x218>
cmpq   $0x0,-0x30(%rbp)
je     139c <readxy_ex+0x20c>
mov    -0x30(%rbp),%rdi
mov    0x2cd5(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x11c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1421 <readxy_ex+0x291>
mov    -0x18(%rbp),%rdi
call   1080 <freexy@plt>
cmpq   $0x0,-0x30(%rbp)
je     1415 <readxy_ex+0x285>
mov    -0x30(%rbp),%rdi
mov    0x2c64(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
jmp    1426 <readxy_ex+0x296>
cmpl   $0x0,-0x34(%rbp)
je     1451 <readxy_ex+0x2c1>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   10b0 <get_line_cf@plt>
mov    %rax,-0x168(%rbp)
jmp    146d <readxy_ex+0x2dd>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   1050 <fgets@plt>
mov    %rax,-0x168(%rbp)
cmpq   $0x0,-0x168(%rbp)
jne    1480 <readxy_ex+0x2f0>
jmp    1546 <readxy_ex+0x3b6>
lea    -0x110(%rbp),%rdi
call   1090 <clean_line@plt>
lea    -0x110(%rbp),%rdi
lea    -0x160(%rbp),%rsi
mov    $0x2,%edx
call   1070 <string_read_doubles@plt>
cmp    $0x2,%eax
jne    1541 <readxy_ex+0x3b1>
mov    -0x11c(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jl     14fc <readxy_ex+0x36c>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1080 <freexy@plt>
cmpq   $0x0,-0x30(%rbp)
je     14f0 <readxy_ex+0x360>
mov    -0x30(%rbp),%rdi
mov    0x2b89(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
movsd  -0x160(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x11c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x158(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x11c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1426 <readxy_ex+0x296>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x11c(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
je     1595 <readxy_ex+0x405>
mov    -0x18(%rbp),%rdi
call   1080 <freexy@plt>
cmpq   $0x0,-0x30(%rbp)
je     1589 <readxy_ex+0x3f9>
mov    -0x30(%rbp),%rdi
mov    0x2af0(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    159c <readxy_ex+0x40c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readxy_ex>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %r9d,%r12d
mov    %r8,%rbp
mov    %rcx,%r13
mov    %rdi,%r15
mov    %rsi,0x38(%rsp)
movq   $0x0,(%rsi)
mov    %rdx,0x18(%rsp)
movq   $0x0,(%rdx)
movl   $0x0,(%rcx)
lea    0xe89(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1344 <readxy_ex+0x1b4>
mov    %rax,%rbx
mov    %rbp,0x8(%rsp)
lea    0x40(%rsp),%rbp
lea    0x20(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    $0xc7,%esi
mov    %rbx,%rdx
test   %r12d,%r12d
je     1220 <readxy_ex+0x90>
call   10b0 <get_line_cf@plt>
test   %rax,%rax
jne    122a <readxy_ex+0x9a>
jmp    124e <readxy_ex+0xbe>
nopl   0x0(%rax)
call   1050 <fgets@plt>
test   %rax,%rax
je     124e <readxy_ex+0xbe>
mov    %rbp,%rdi
call   1090 <clean_line@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1070 <string_read_doubles@plt>
cmp    $0x2,%eax
jne    1200 <readxy_ex+0x70>
addl   $0x1,0x0(%r13)
jmp    1200 <readxy_ex+0x70>
mov    %rbx,%rdi
call   1040 <fclose@plt>
movslq 0x0(%r13),%rsi
test   %rsi,%rsi
je     1362 <readxy_ex+0x1d2>
shl    $0x4,%rsi
lea    0xde6(%rip),%rdx
mov    0x38(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <willus_mem_alloc@plt>
test   %eax,%eax
je     137c <readxy_ex+0x1ec>
movslq 0x0(%r13),%rax
shl    $0x3,%rax
add    0x0(%rbp),%rax
mov    0x18(%rsp),%rcx
mov    %rax,(%rcx)
lea    0xdbd(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13cc <readxy_ex+0x23c>
mov    %rax,%r14
mov    %r15,0x10(%rsp)
xor    %ebx,%ebx
lea    0x40(%rsp),%r15
xchg   %ax,%ax
mov    %r15,%rdi
mov    $0xc7,%esi
mov    %r14,%rdx
test   %r12d,%r12d
je     12e0 <readxy_ex+0x150>
call   10b0 <get_line_cf@plt>
test   %rax,%rax
jne    12ee <readxy_ex+0x15e>
jmp    1395 <readxy_ex+0x205>
nop
call   1050 <fgets@plt>
test   %rax,%rax
je     1395 <readxy_ex+0x205>
mov    %r15,%rdi
call   1090 <clean_line@plt>
mov    %r15,%rdi
lea    0x20(%rsp),%rsi
mov    $0x2,%edx
call   1070 <string_read_doubles@plt>
cmp    $0x2,%eax
jne    12c0 <readxy_ex+0x130>
cmp    0x0(%r13),%ebx
jge    1408 <readxy_ex+0x278>
movsd  0x20(%rsp),%xmm0
mov    0x0(%rbp),%rax
movslq %ebx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x28(%rsp),%xmm0
mov    0x18(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%ebx
jmp    12c0 <readxy_ex+0x130>
mov    $0xfffffffe,%r14d
test   %rbp,%rbp
je     13f3 <readxy_ex+0x263>
lea    0xd03(%rip),%rsi
mov    %rbp,%rdi
jmp    13eb <readxy_ex+0x25b>
xor    %r14d,%r14d
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13f3 <readxy_ex+0x263>
lea    0xd11(%rip),%rsi
jmp    13eb <readxy_ex+0x25b>
mov    $0xffffffff,%r14d
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13f3 <readxy_ex+0x263>
lea    0xc6d(%rip),%rsi
jmp    13eb <readxy_ex+0x25b>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %r14d,%r14d
cmp    0x0(%r13),%ebx
je     13f3 <readxy_ex+0x263>
mov    %rbp,%rdi
call   1080 <freexy@plt>
mov    $0xfffffffd,%r14d
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13f3 <readxy_ex+0x263>
lea    0xc6b(%rip),%rsi
mov    0x10(%rsp),%rdx
jmp    13ee <readxy_ex+0x25e>
mov    %rbp,%rdi
call   1080 <freexy@plt>
mov    $0xfffffffd,%r14d
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13f3 <readxy_ex+0x263>
lea    0xc45(%rip),%rsi
mov    %r15,%rdx
call   1060 <fprintf@plt>
mov    %r14d,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbp,%rdi
call   1080 <freexy@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1433 <readxy_ex+0x2a3>
lea    0xc07(%rip),%rsi
mov    0x10(%rsp),%rdx
call   1060 <fprintf@plt>
mov    $0xfffffffd,%r14d
jmp    13f3 <readxy_ex+0x263>

LLVM IR (-O0):
@readxy_ex.notenough = internal global i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i32 0, i32 0)
@.str = [48 x i8] c"There is not enough memory to read in file %s.\0A\00"
@readxy_ex.internal = internal global i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [36 x i8] c"Internal error re-reading file %s.\0A\00"
@readxy_ex.funcname = internal global i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0)
@.str.2 = [7 x i8] c"readxy\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [46 x i8] c"Cannot open file %s for reading array pairs.\0A\00"
@.str.5 = [38 x i8] c"There are no array pairs in file %s.\0A\00"
define i32 @readxy_ex(i8* %0, double** %1, double** %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca double**
%10 = alloca double**
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca [200 x i8]
%16 = alloca i64
%17 = alloca i32
%18 = alloca i64
%19 = alloca [2 x double]
%20 = alloca i8*
%21 = alloca [2 x double]
%22 = alloca i8*
store i8* %0, i8** %8
store double** %1, double*** %9
store double** %2, double*** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32 %5, i32* %13
%23 = load double**, double*** %9
store double* null, double** %23
%24 = load double**, double*** %10
store double* null, double** %24
%25 = load i32*, i32** %11
store i32 0, i32* %25
%26 = load i8*, i8** %8
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %27, i32** %14
%28 = load i32*, i32** %14
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %38
30: ; preds = %6
%31 = load i32*, i32** %12
%32 = icmp ne i32* %31, null
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load i32*, i32** %12
%35 = load i8*, i8** %8
%36 = call i32 @fprintf(i32* %34, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %33, %30
store i32 -2, i32* %7
br label %215
38: ; preds = %6
br label %39
39: ; preds = %38, %65
%40 = load i32, i32* %13
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%44 = load i32*, i32** %14
%45 = call i8* @get_line_cf(i8* %43, i32 199, i32* %44)
store i8* %45, i8** %20
br label %50
46: ; preds = %39
%47 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%48 = load i32*, i32** %14
%49 = call i8* @fgets(i8* %47, i32 199, i32* %48)
store i8* %49, i8** %20
br label %50
50: ; preds = %46, %42
%51 = load i8*, i8** %20
%52 = icmp eq i8* %51, null
br i1 %52, label %53, label %54
53: ; preds = %50
br label %66
54: ; preds = %50
%55 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%56 = call i32 @clean_line(i8* %55)
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%58 = getelementptr inbounds [2 x double], [2 x double]* %19, i64 0, i64 0
%59 = call i32 @string_read_doubles(i8* %57, double* %58, i32 2)
%60 = icmp eq i32 %59, 2
br i1 %60, label %61, label %65
61: ; preds = %54
%62 = load i32*, i32** %11
%63 = load i32, i32* %62
%64 = add nsw i32 %63, 1
store i32 %64, i32* %62
br label %65
65: ; preds = %61, %54
br label %39
66: ; preds = %53
%67 = load i32*, i32** %14
%68 = call i32 @fclose(i32* %67)
%69 = load i32*, i32** %11
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %80
72: ; preds = %66
%73 = load i32*, i32** %12
%74 = icmp ne i32* %73, null
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = load i32*, i32** %12
%77 = load i8*, i8** %8
%78 = call i32 @fprintf(i32* %76, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %75, %72
store i32 0, i32* %7
br label %215
80: ; preds = %66
%81 = load i32*, i32** %11
%82 = load i32, i32* %81
%83 = sext i32 %82 to i64
%84 = mul nsw i64 8, %83
%85 = mul nsw i64 %84, 2
store i64 %85, i64* %16
%86 = load i64, i64* %16
store i64 %86, i64* %18
%87 = load i64, i64* %16
%88 = load i64, i64* %18
%89 = icmp ne i64 %87, %88
br i1 %89, label %90, label %99
90: ; preds = %80
%91 = load i32*, i32** %12
%92 = icmp ne i32* %91, null
br i1 %92, label %93, label %98
93: ; preds = %90
%94 = load i32*, i32** %12
%95 = load i8*, i8** @readxy_ex.notenough
%96 = load i8*, i8** %8
%97 = call i32 @fprintf(i32* %94, i8* %95, i8* %96)
br label %98
98: ; preds = %93, %90
store i32 -1, i32* %7
br label %215
99: ; preds = %80
%100 = load double**, double*** %9
%101 = load i64, i64* %18
%102 = load i8*, i8** @readxy_ex.funcname
%103 = call i32 @willus_mem_alloc(double** %100, i64 %101, i8* %102)
%104 = icmp ne i32 %103, 0
br i1 %104, label %114, label %105
105: ; preds = %99
%106 = load i32*, i32** %12
%107 = icmp ne i32* %106, null
br i1 %107, label %108, label %113
108: ; preds = %105
%109 = load i32*, i32** %12
%110 = load i8*, i8** @readxy_ex.notenough
%111 = load i8*, i8** %8
%112 = call i32 @fprintf(i32* %109, i8* %110, i8* %111)
br label %113
113: ; preds = %108, %105
store i32 -1, i32* %7
br label %215
114: ; preds = %99
%115 = load double**, double*** %9
%116 = load double*, double** %115
%117 = load i32*, i32** %11
%118 = load i32, i32* %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %116, i64 %119
%121 = load double**, double*** %10
store double* %120, double** %121
store i32 0, i32* %17
%122 = load i8*, i8** %8
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %123, i32** %14
%124 = load i32*, i32** %14
%125 = icmp eq i32* %124, null
br i1 %125, label %126, label %137
126: ; preds = %114
%127 = load double**, double*** %9
%128 = call i32 @freexy(double** %127)
%129 = load i32*, i32** %12
%130 = icmp ne i32* %129, null
br i1 %130, label %131, label %136
131: ; preds = %126
%132 = load i32*, i32** %12
%133 = load i8*, i8** @readxy_ex.internal
%134 = load i8*, i8** %8
%135 = call i32 @fprintf(i32* %132, i8* %133, i8* %134)
br label %136
136: ; preds = %131, %126
store i32 -3, i32* %7
br label %215
137: ; preds = %114
br label %138
138: ; preds = %137, %195
%139 = load i32, i32* %13
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %145
141: ; preds = %138
%142 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%143 = load i32*, i32** %14
%144 = call i8* @get_line_cf(i8* %142, i32 199, i32* %143)
store i8* %144, i8** %22
br label %149
145: ; preds = %138
%146 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%147 = load i32*, i32** %14
%148 = call i8* @fgets(i8* %146, i32 199, i32* %147)
store i8* %148, i8** %22
br label %149
149: ; preds = %145, %141
%150 = load i8*, i8** %22
%151 = icmp eq i8* %150, null
br i1 %151, label %152, label %153
152: ; preds = %149
br label %196
153: ; preds = %149
%154 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%155 = call i32 @clean_line(i8* %154)
%156 = getelementptr inbounds [200 x i8], [200 x i8]* %15, i64 0, i64 0
%157 = getelementptr inbounds [2 x double], [2 x double]* %21, i64 0, i64 0
%158 = call i32 @string_read_doubles(i8* %156, double* %157, i32 2)
%159 = icmp eq i32 %158, 2
br i1 %159, label %160, label %195
160: ; preds = %153
%161 = load i32, i32* %17
%162 = load i32*, i32** %11
%163 = load i32, i32* %162
%164 = icmp sge i32 %161, %163
br i1 %164, label %165, label %178
165: ; preds = %160
%166 = load i32*, i32** %14
%167 = call i32 @fclose(i32* %166)
%168 = load double**, double*** %9
%169 = call i32 @freexy(double** %168)
%170 = load i32*, i32** %12
%171 = icmp ne i32* %170, null
br i1 %171, label %172, label %177
172: ; preds = %165
%173 = load i32*, i32** %12
%174 = load i8*, i8** @readxy_ex.internal
%175 = load i8*, i8** %8
%176 = call i32 @fprintf(i32* %173, i8* %174, i8* %175)
br label %177
177: ; preds = %172, %165
store i32 -3, i32* %7
br label %215
178: ; preds = %160
%179 = getelementptr inbounds [2 x double], [2 x double]* %21, i64 0, i64 0
%180 = load double, double* %179
%181 = load double**, double*** %9
%182 = load double*, double** %181
%183 = load i32, i32* %17
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %180, double* %185
%186 = getelementptr inbounds [2 x double], [2 x double]* %21, i64 0, i64 1
%187 = load double, double* %186
%188 = load double**, double*** %10
%189 = load double*, double** %188
%190 = load i32, i32* %17
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %189, i64 %191
store double %187, double* %192
%193 = load i32, i32* %17
%194 = add nsw i32 %193, 1
store i32 %194, i32* %17
br label %195
195: ; preds = %178, %153
br label %138
196: ; preds = %152
%197 = load i32*, i32** %14
%198 = call i32 @fclose(i32* %197)
%199 = load i32, i32* %17
%200 = load i32*, i32** %11
%201 = load i32, i32* %200
%202 = icmp ne i32 %199, %201
br i1 %202, label %203, label %214
203: ; preds = %196
%204 = load double**, double*** %9
%205 = call i32 @freexy(double** %204)
%206 = load i32*, i32** %12
%207 = icmp ne i32* %206, null
br i1 %207, label %208, label %213
208: ; preds = %203
%209 = load i32*, i32** %12
%210 = load i8*, i8** @readxy_ex.internal
%211 = load i8*, i8** %8
%212 = call i32 @fprintf(i32* %209, i8* %210, i8* %211)
br label %213
213: ; preds = %208, %203
store i32 -3, i32* %7
br label %215
214: ; preds = %196
store i32 0, i32* %7
br label %215
215: ; preds = %214, %213, %177, %136, %113, %98, %79, %37
%216 = load i32, i32* %7
ret i32 %216
}

LLVM IR (-O2):
@.str = [48 x i8] c"There is not enough memory to read in file %s.\0A\00"
@.str.1 = [36 x i8] c"Internal error re-reading file %s.\0A\00"
@.str.2 = [7 x i8] c"readxy\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [46 x i8] c"Cannot open file %s for reading array pairs.\0A\00"
@.str.5 = [38 x i8] c"There are no array pairs in file %s.\0A\00"
define i32 @readxy_ex(i8* %0, double** %1, double** nocapture %2, i32* nocapture %3, i32* %4, i32 %5) {
%7 = alloca [200 x i8]
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
store double* null, double** %1
store double* null, double** %2
store i32 0, i32* %3
%11 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %6
%14 = bitcast [2 x double]* %8 to i8*
%15 = icmp eq i32 %5, 0
%16 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
br label %21
17: ; preds = %6
%18 = icmp eq i32* %4, null
br i1 %18, label %113, label %19
19: ; preds = %17
%20 = tail call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %0)
br label %113
21: ; preds = %13, %36
br i1 %15, label %24, label %22
22: ; preds = %21
%23 = call i8* @get_line_cf(i8* %10, i32 199, i32* %11)
br label %26
24: ; preds = %21
%25 = call i8* @fgets(i8* %10, i32 199, i32* %11)
br label %26
26: ; preds = %24, %22
%27 = phi i8* [ %23, %22 ], [ %25, %24 ]
%28 = icmp eq i8* %27, null
br i1 %28, label %37, label %29
29: ; preds = %26
%30 = call i32 @clean_line(i8* %10)
%31 = call i32 @string_read_doubles(i8* %10, double* %16, i32 2)
%32 = icmp eq i32 %31, 2
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %36
36: ; preds = %29, %33
br label %21
37: ; preds = %26
%38 = call i32 @fclose(i32* %11)
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = icmp eq i32* %4, null
br i1 %42, label %113, label %43
43: ; preds = %41
%44 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i8* %0)
br label %113
45: ; preds = %37
%46 = sext i32 %39 to i64
%47 = shl nsw i64 %46, 4
%48 = call i32 @willus_mem_alloc(double** %1, i64 %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %45
%51 = icmp eq i32* %4, null
br i1 %51, label %113, label %52
52: ; preds = %50
%53 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %113
54: ; preds = %45
%55 = load double*, double** %1
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
store double* %58, double** %2
%59 = call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %65, label %61
61: ; preds = %54
%62 = bitcast [2 x double]* %9 to i8*
%63 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%64 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
br label %70
65: ; preds = %54
%66 = call i32 @freexy(double** %1)
%67 = icmp eq i32* %4, null
br i1 %67, label %113, label %68
68: ; preds = %65
%69 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %113
70: ; preds = %61, %102
%71 = phi i32 [ %103, %102 ], [ 0, %61 ]
br i1 %15, label %74, label %72
72: ; preds = %70
%73 = call i8* @get_line_cf(i8* %10, i32 199, i32* %59)
br label %76
74: ; preds = %70
%75 = call i8* @fgets(i8* %10, i32 199, i32* %59)
br label %76
76: ; preds = %74, %72
%77 = phi i8* [ %73, %72 ], [ %75, %74 ]
%78 = icmp eq i8* %77, null
br i1 %78, label %104, label %79
79: ; preds = %76
%80 = call i32 @clean_line(i8* %10)
%81 = call i32 @string_read_doubles(i8* %10, double* %63, i32 2)
%82 = icmp eq i32 %81, 2
br i1 %82, label %83, label %102
83: ; preds = %79
%84 = load i32, i32* %3
%85 = icmp slt i32 %71, %84
br i1 %85, label %92, label %86
86: ; preds = %83
%87 = call i32 @fclose(i32* %59)
%88 = call i32 @freexy(double** %1)
%89 = icmp eq i32* %4, null
br i1 %89, label %101, label %90
90: ; preds = %86
%91 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %101
92: ; preds = %83
%93 = load double, double* %63
%94 = load double*, double** %1
%95 = sext i32 %71 to i64
%96 = getelementptr inbounds double, double* %94, i64 %95
store double %93, double* %96
%97 = load double, double* %64
%98 = load double*, double** %2
%99 = getelementptr inbounds double, double* %98, i64 %95
store double %97, double* %99
%100 = add nsw i32 %71, 1
br label %102
101: ; preds = %90, %86
br label %113
102: ; preds = %79, %92
%103 = phi i32 [ %100, %92 ], [ %71, %79 ]
br label %70
104: ; preds = %76
%105 = call i32 @fclose(i32* %59)
%106 = load i32, i32* %3
%107 = icmp eq i32 %71, %106
br i1 %107, label %113, label %108
108: ; preds = %104
%109 = call i32 @freexy(double** %1)
%110 = icmp eq i32* %4, null
br i1 %110, label %113, label %111
111: ; preds = %108
%112 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %113
113: ; preds = %101, %104, %108, %111, %65, %68, %50, %52, %41, %43, %17, %19
%114 = phi i32 [ -2, %19 ], [ -2, %17 ], [ 0, %43 ], [ 0, %41 ], [ -1, %52 ], [ -1, %50 ], [ -3, %68 ], [ -3, %65 ], [ -3, %111 ], [ -3, %108 ], [ 0, %104 ], [ -3, %101 ]
ret i32 %114
}