#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*/ freexyz(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 readxyz_ex(char *filename, double **x, double **y, double **z, 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 = "readxyz";
  (*x) = NULL;
  (*y) = NULL;
  (*z) = NULL;
  (*n) = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    if (output != NULL)
      fprintf(output, "Cannot open file %s for reading array triplets.\n",
              filename);
    return (-2);
  }
  while (1) {
    void *ptr;
    double v[3];
    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, 3) == 3)
      (*n)++;
  }
  fclose(f);
  if ((*n) == 0) {
    if (output != NULL)
      fprintf(output, "There are no array triplets in file %s.\n", filename);
    return (0);
  }
  memsize = (long)sizeof(double) * (*n) * 3L;
  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)];
  (*z) = &(*y)[(*n)];
  i = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    freexyz(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  while (1) {
    double v[3];
    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, 3) == 3) {
      if (i >= (*n)) {
        fclose(f);
        freexyz(x);
        if (output != NULL)
          fprintf(output, internal, filename);
        return (-3);
      }
      (*x)[i] = v[0];
      (*y)[i] = v[1];
      (*z)[i] = v[2];
      i++;
    }
  }
  fclose(f);
  if (i != (*n)) {
    freexyz(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  return (0);
}


x86 assembly (clang, -O0):
<readxyz_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    122b <readxyz_ex+0x9b>
cmpq   $0x0,-0x38(%rbp)
je     121f <readxyz_ex+0x8f>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe44(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
jmp    1230 <readxyz_ex+0xa0>
cmpl   $0x0,0x10(%rbp)
je     125b <readxyz_ex+0xcb>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   10b0 <get_line_cf@plt>
mov    %rax,-0x130(%rbp)
jmp    1277 <readxyz_ex+0xe7>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   1060 <fgets@plt>
mov    %rax,-0x130(%rbp)
cmpq   $0x0,-0x130(%rbp)
jne    128a <readxyz_ex+0xfa>
jmp    12c7 <readxyz_ex+0x137>
lea    -0x110(%rbp),%rdi
call   1090 <clean_line@plt>
lea    -0x110(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0x3,%edx
call   1080 <string_read_doubles@plt>
cmp    $0x3,%eax
jne    12c2 <readxyz_ex+0x132>
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1230 <readxyz_ex+0xa0>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1308 <readxyz_ex+0x178>
cmpq   $0x0,-0x38(%rbp)
je     12fc <readxyz_ex+0x16c>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd98(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
mov    -0x30(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
imul   $0x3,%rax,%rax
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x118(%rbp),%rax
cmp    -0x128(%rbp),%rax
je     136b <readxyz_ex+0x1db>
cmpq   $0x0,-0x38(%rbp)
je     135f <readxyz_ex+0x1cf>
mov    -0x38(%rbp),%rdi
mov    0x2d12(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
mov    -0x18(%rbp),%rdi
mov    -0x128(%rbp),%rsi
mov    0x2cfb(%rip),%rdx
call   1040 <willus_mem_alloc@plt>
cmp    $0x0,%eax
jne    13b6 <readxyz_ex+0x226>
cmpq   $0x0,-0x38(%rbp)
je     13aa <readxyz_ex+0x21a>
mov    -0x38(%rbp),%rdi
mov    0x2cc7(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x30(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x30(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x11c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xc59(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    144b <readxyz_ex+0x2bb>
mov    -0x18(%rbp),%rdi
call   1030 <freexyz@plt>
cmpq   $0x0,-0x38(%rbp)
je     143f <readxyz_ex+0x2af>
mov    -0x38(%rbp),%rdi
mov    0x2c3a(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
jmp    1450 <readxyz_ex+0x2c0>
cmpl   $0x0,0x10(%rbp)
je     147b <readxyz_ex+0x2eb>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   10b0 <get_line_cf@plt>
mov    %rax,-0x178(%rbp)
jmp    1497 <readxyz_ex+0x307>
lea    -0x110(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xc7,%esi
call   1060 <fgets@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
jne    14aa <readxyz_ex+0x31a>
jmp    158b <readxyz_ex+0x3fb>
lea    -0x110(%rbp),%rdi
call   1090 <clean_line@plt>
lea    -0x110(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    $0x3,%edx
call   1080 <string_read_doubles@plt>
cmp    $0x3,%eax
jne    1586 <readxyz_ex+0x3f6>
mov    -0x11c(%rbp),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
jl     1526 <readxyz_ex+0x396>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <freexyz@plt>
cmpq   $0x0,-0x38(%rbp)
je     151a <readxyz_ex+0x38a>
mov    -0x38(%rbp),%rdi
mov    0x2b5f(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
movsd  -0x170(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x11c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x168(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x11c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x160(%rbp),%xmm0
ff
mov    -0x28(%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    1450 <readxyz_ex+0x2c0>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x11c(%rbp),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
je     15da <readxyz_ex+0x44a>
mov    -0x18(%rbp),%rdi
call   1030 <freexyz@plt>
cmpq   $0x0,-0x38(%rbp)
je     15ce <readxyz_ex+0x43e>
mov    -0x38(%rbp),%rdi
mov    0x2aab(%rip),%rsi
mov    -0x10(%rbp),%rdx
call   1070 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    15e1 <readxyz_ex+0x451>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readxyz_ex>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r9,%rbx
mov    %r8,%r13
mov    %rdi,%r15
mov    %rsi,0x18(%rsp)
movq   $0x0,(%rsi)
mov    %rdx,0x20(%rsp)
movq   $0x0,(%rdx)
mov    %rcx,0x28(%rsp)
movq   $0x0,(%rcx)
movl   $0x0,(%r8)
lea    0xe80(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1387 <readxyz_ex+0x1f7>
mov    %rax,%rbp
mov    %rbx,0x8(%rsp)
mov    0x150(%rsp),%r12d
lea    0x50(%rsp),%rbx
lea    0x30(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0xc7,%esi
mov    %rbp,%rdx
test   %r12d,%r12d
je     1230 <readxyz_ex+0xa0>
call   10b0 <get_line_cf@plt>
test   %rax,%rax
jne    123a <readxyz_ex+0xaa>
jmp    125e <readxyz_ex+0xce>
nopl   0x0(%rax)
call   1060 <fgets@plt>
test   %rax,%rax
je     125e <readxyz_ex+0xce>
mov    %rbx,%rdi
call   1090 <clean_line@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1080 <string_read_doubles@plt>
cmp    $0x3,%eax
jne    1210 <readxyz_ex+0x80>
addl   $0x1,0x0(%r13)
jmp    1210 <readxyz_ex+0x80>
mov    %rbp,%rdi
call   1050 <fclose@plt>
movslq 0x0(%r13),%rax
test   %rax,%rax
je     13a4 <readxyz_ex+0x214>
shl    $0x3,%rax
lea    (%rax,%rax,2),%rsi
lea    0xdd2(%rip),%rdx
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <willus_mem_alloc@plt>
test   %eax,%eax
je     13b9 <readxyz_ex+0x229>
movslq 0x0(%r13),%rax
lea    0x0(,%rax,8),%rcx
add    0x0(%rbp),%rcx
mov    0x20(%rsp),%rdx
mov    %rcx,(%rdx)
lea    (%rcx,%rax,8),%rax
mov    0x28(%rsp),%rcx
mov    %rax,(%rcx)
lea    0xd9a(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1408 <readxyz_ex+0x278>
mov    %rax,%r14
mov    %r15,0x10(%rsp)
xor    %ebx,%ebx
lea    0x50(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0xc7,%esi
mov    %r14,%rdx
test   %r12d,%r12d
je     1310 <readxyz_ex+0x180>
call   10b0 <get_line_cf@plt>
test   %rax,%rax
jne    131e <readxyz_ex+0x18e>
jmp    13d1 <readxyz_ex+0x241>
nop
call   1060 <fgets@plt>
test   %rax,%rax
je     13d1 <readxyz_ex+0x241>
mov    %r15,%rdi
call   1090 <clean_line@plt>
mov    %r15,%rdi
lea    0x30(%rsp),%rsi
mov    $0x3,%edx
call   1080 <string_read_doubles@plt>
cmp    $0x3,%eax
jne    12f0 <readxyz_ex+0x160>
cmp    0x0(%r13),%ebx
jge    1442 <readxyz_ex+0x2b2>
movsd  0x30(%rsp),%xmm0
mov    0x0(%rbp),%rax
movslq %ebx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x38(%rsp),%xmm0
mov    0x20(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x40(%rsp),%xmm0
mov    0x28(%rsp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%ebx
jmp    12f0 <readxyz_ex+0x160>
mov    $0xfffffffe,%ebp
test   %rbx,%rbx
je     142e <readxyz_ex+0x29e>
lea    0xcc2(%rip),%rsi
mov    %rbx,%rdi
jmp    1426 <readxyz_ex+0x296>
xor    %ebp,%ebp
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     142e <readxyz_ex+0x29e>
lea    0xcd8(%rip),%rsi
jmp    1426 <readxyz_ex+0x296>
mov    $0xffffffff,%ebp
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     142e <readxyz_ex+0x29e>
lea    0xc31(%rip),%rsi
jmp    1426 <readxyz_ex+0x296>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %ebp,%ebp
cmp    0x0(%r13),%ebx
je     142e <readxyz_ex+0x29e>
mov    0x18(%rsp),%rdi
call   1030 <freexyz@plt>
mov    $0xfffffffd,%ebp
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     142e <readxyz_ex+0x29e>
lea    0xc2f(%rip),%rsi
mov    0x10(%rsp),%rdx
jmp    1429 <readxyz_ex+0x299>
mov    %rbp,%rdi
call   1030 <freexyz@plt>
mov    $0xfffffffd,%ebp
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     142e <readxyz_ex+0x29e>
lea    0xc0a(%rip),%rsi
mov    %r15,%rdx
call   1070 <fprintf@plt>
mov    %ebp,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1030 <freexyz@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     146d <readxyz_ex+0x2dd>
lea    0xbcd(%rip),%rsi
mov    0x10(%rsp),%rdx
call   1070 <fprintf@plt>
mov    $0xfffffffd,%ebp
jmp    142e <readxyz_ex+0x29e>

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

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