#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*/ O_RDONLY;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
float atof(int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
scalar_t__ malloc(int);
int open(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ read(int, ...);
scalar_t__ realloc(char *, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ *strtok(char *, char *);
int read_n_objects(int isBinaryFile, char *filename, int numObjs, int numCoords,
                   float **objects) {
  int i, j, len;
  if (isBinaryFile) {
    int infile;
    if ((infile = open(filename, O_RDONLY, "0600")) == -1) {
      fprintf(stderr, "Error: open file %s (err=%s)\n", filename,
              strerror(errno));
      return 0;
    }
    read(infile, &i, sizeof(int));
    read(infile, &i, sizeof(int));
    read(infile, objects[0], numObjs * numCoords * sizeof(float));
    close(infile);
  } else {
    FILE *infile;
    char *line, *ret;
    int lineLen;
    if ((infile = fopen(filename, "r")) == NULL) {
      fprintf(stderr, "Error: open file %s (err=%s)\n", filename,
              strerror(errno));
      return 0;
    }
    lineLen = 128;
    line = (char *)malloc(lineLen);
    assert(line != NULL);
    while (fgets(line, lineLen, infile) != NULL) {
      while (strlen(line) == lineLen - 1) {
        len = strlen(line);
        fseek(infile, -len, SEEK_CUR);
        lineLen += 128;
        line = (char *)realloc(line, lineLen);
        assert(line != NULL);
        ret = fgets(line, lineLen, infile);
        assert(ret != NULL);
      }
    }
    rewind(infile);
    for (i = 0; i < numObjs; i++) {
      fgets(line, lineLen, infile);
      if (strtok(line, " \t\n") == NULL)
        continue;
      for (j = 0; j < numCoords; j++)
        objects[i][j] = atof(strtok(NULL, " ,\t\n"));
    }
    fclose(infile);
    free(line);
  }
  return 1;
}


x86 assembly (clang, -O0):
<read_n_objects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12ee <read_n_objects+0xde>
mov    -0x10(%rbp),%rdi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
lea    0xdb9(%rip),%rdx
call   1100 <open@plt>
mov    %eax,-0x30(%rbp)
cmp    $0xffffffff,%eax
jne    129c <read_n_objects+0x8c>
mov    0x2d71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
call   1130 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
lea    0xd7a(%rip),%rsi
call   10c0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f0 <read_n_objects+0x2e0>
mov    -0x30(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1090 <read@plt>
mov    -0x30(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1090 <read@plt>
mov    -0x30(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
movslq %eax,%rdx
shl    $0x2,%rdx
mov    $0x0,%al
call   1090 <read@plt>
mov    -0x30(%rbp),%edi
call   1080 <close@plt>
jmp    14e9 <read_n_objects+0x2d9>
mov    -0x10(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1350 <read_n_objects+0x140>
mov    0x2cbd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   1130 <strerror@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    %rax,%rcx
lea    0xcc6(%rip),%rsi
call   10c0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f0 <read_n_objects+0x2e0>
movl   $0x80,-0x4c(%rbp)
mov    -0x4c(%rbp),%edi
call   10d0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     142b <read_n_objects+0x21b>
jmp    1394 <read_n_objects+0x184>
mov    -0x40(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1426 <read_n_objects+0x216>
mov    -0x40(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
sub    -0x2c(%rbp),%esi
mov    0x2c21(%rip),%rax
mov    (%rax),%edx
call   10e0 <fseek@plt>
mov    -0x4c(%rbp),%eax
add    $0x80,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   10f0 <realloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   10a0 <fgets@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
jmp    1394 <read_n_objects+0x184>
jmp    1375 <read_n_objects+0x165>
mov    -0x38(%rbp),%rdi
call   1070 <rewind@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14d7 <read_n_objects+0x2c7>
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   10a0 <fgets@plt>
mov    -0x40(%rbp),%rdi
lea    0xbc3(%rip),%rsi
call   1120 <strtok@plt>
cmp    $0x0,%rax
jne    1476 <read_n_objects+0x266>
jmp    14c9 <read_n_objects+0x2b9>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14c4 <read_n_objects+0x2b4>
xor    %eax,%eax
mov    %eax,%edi
lea    0xb95(%rip),%rsi
call   1120 <strtok@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    147d <read_n_objects+0x26d>
jmp    14c9 <read_n_objects+0x2b9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    143b <read_n_objects+0x22b>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_n_objects>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r14
mov    %ecx,0xc(%rsp)
mov    %edx,%r15d
mov    %rsi,%rbx
test   %edi,%edi
je     12a0 <read_n_objects+0x90>
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
lea    0xdc1(%rip),%rdx
mov    %rbx,%rdi
call   1100 <open@plt>
cmp    $0xffffffff,%eax
je     13b1 <read_n_objects+0x1a1>
mov    %eax,%ebp
lea    0x34(%rsp),%rbx
mov    $0x4,%edx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <read@plt>
mov    $0x4,%edx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <read@plt>
mov    (%r14),%rsi
mov    0xc(%rsp),%eax
imul   %r15d,%eax
movslq %eax,%rdx
shl    $0x2,%rdx
mov    %ebp,%edi
xor    %eax,%eax
call   1090 <read@plt>
mov    %ebp,%edi
call   1080 <close@plt>
jmp    14a7 <read_n_objects+0x297>
lea    0xd7c(%rip),%rsi
mov    %rbx,%rdi
call   1110 <fopen@plt>
test   %rax,%rax
je     13b1 <read_n_objects+0x1a1>
mov    %rax,%r12
mov    %r14,0x28(%rsp)
mov    $0x80,%ebp
mov    $0x80,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10b0 <assert@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     13e3 <read_n_objects+0x1d3>
mov    $0x80,%ebp
mov    0x2ce3(%rip),%r14
jmp    1326 <read_n_objects+0x116>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     13e3 <read_n_objects+0x1d3>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    -0x1(%rbp),%r13d
cmp    %r13d,%eax
jne    1310 <read_n_objects+0x100>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <strlen@plt>
neg    %eax
mov    (%r14),%edx
mov    %r12,%rdi
mov    %eax,%esi
call   10e0 <fseek@plt>
lea    0x81(%r13),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   10f0 <realloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10b0 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10b0 <assert@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
sub    $0xffffff80,%r13d
cmp    %eax,%r13d
je     1340 <read_n_objects+0x130>
add    $0x1,%r13d
mov    %r13d,%ebp
jmp    1310 <read_n_objects+0x100>
mov    0x2c18(%rip),%rax
mov    (%rax),%ebp
mov    0x2c07(%rip),%rax
mov    (%rax),%edi
call   1130 <strerror@plt>
lea    0xc36(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   10c0 <fprintf@plt>
xor    %eax,%eax
jmp    14ac <read_n_objects+0x29c>
mov    %rbp,0x20(%rsp)
mov    %r12,%rdi
call   1070 <rewind@plt>
test   %r15d,%r15d
jle    1497 <read_n_objects+0x287>
mov    %r15d,%eax
mov    %rax,0x18(%rsp)
mov    0xc(%rsp),%r13d
xor    %ebp,%ebp
mov    %r12,0x10(%rsp)
mov    0x28(%rsp),%r14
jmp    1430 <read_n_objects+0x220>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
cmp    0x18(%rsp),%rbp
mov    0x10(%rsp),%r12
je     1497 <read_n_objects+0x287>
mov    %rbx,%rdi
mov    0x20(%rsp),%rsi
mov    %r12,%rdx
call   10a0 <fgets@plt>
mov    %rbx,%rdi
lea    0xbdb(%rip),%rsi
call   1120 <strtok@plt>
test   %rax,%rax
lea    0xbd0(%rip),%r12
je     1420 <read_n_objects+0x210>
cmpl   $0x0,0xc(%rsp)
jle    1420 <read_n_objects+0x210>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
mov    %r12,%rsi
call   1120 <strtok@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
mov    (%r14,%rbp,8),%rax
movss  %xmm0,(%rax,%r15,4)
add    $0x1,%r15
cmp    %r15,%r13
jne    1470 <read_n_objects+0x260>
jmp    1420 <read_n_objects+0x210>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"0600\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error: open file %s (err=%s)\0A\00"
@errno = global i32 0
@.str.2 = [2 x i8] c"r\00"
@SEEK_CUR = global i32 0
@.str.3 = [4 x i8] c" \09\0A\00"
@.str.4 = [5 x i8] c" ,\09\0A\00"
define i32 @read_n_objects(i32 %0, i8* %1, i32 %2, i32 %3, float** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca float**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store float** %4, float*** %11
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %50
22: ; preds = %5
%23 = load i8*, i8** %8
%24 = load i32, i32* @O_RDONLY
%25 = call i32 @open(i8* %23, i32 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %25, i32* %15
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %8
%30 = load i32, i32* @errno
%31 = call i8* @strerror(i32 %30)
%32 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %29, i8* %31)
store i32 0, i32* %6
br label %153
33: ; preds = %22
%34 = load i32, i32* %15
%35 = call i32 (i32, ...) @read(i32 %34, i32* %12, i64 4)
%36 = load i32, i32* %15
%37 = call i32 (i32, ...) @read(i32 %36, i32* %12, i64 4)
%38 = load i32, i32* %15
%39 = load float**, float*** %11
%40 = getelementptr inbounds float*, float** %39, i64 0
%41 = load float*, float** %40
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = mul nsw i32 %42, %43
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 4
%47 = call i32 (i32, ...) @read(i32 %38, float* %41, i64 %46)
%48 = load i32, i32* %15
%49 = call i32 @close(i32 %48)
br label %152
50: ; preds = %5
%51 = load i8*, i8** %8
%52 = call i32* @fopen(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %52, i32** %16
%53 = icmp eq i32* %52, null
br i1 %53, label %54, label %60
54: ; preds = %50
%55 = load i32, i32* @stderr
%56 = load i8*, i8** %8
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %56, i8* %58)
store i32 0, i32* %6
br label %153
60: ; preds = %50
store i32 128, i32* %19
%61 = load i32, i32* %19
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to i8*
store i8* %63, i8** %17
%64 = load i8*, i8** %17
%65 = icmp ne i8* %64, null
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
br label %68
68: ; preds = %107, %60
%69 = load i8*, i8** %17
%70 = load i32, i32* %19
%71 = load i32*, i32** %16
%72 = call i8* @fgets(i8* %69, i32 %70, i32* %71)
%73 = icmp ne i8* %72, null
br i1 %73, label %74, label %108
74: ; preds = %68
br label %75
75: ; preds = %81, %74
%76 = load i8*, i8** %17
%77 = call i32 @strlen(i8* %76)
%78 = load i32, i32* %19
%79 = sub nsw i32 %78, 1
%80 = icmp eq i32 %77, %79
br i1 %80, label %81, label %107
81: ; preds = %75
%82 = load i8*, i8** %17
%83 = call i32 @strlen(i8* %82)
store i32 %83, i32* %14
%84 = load i32*, i32** %16
%85 = load i32, i32* %14
%86 = sub nsw i32 0, %85
%87 = load i32, i32* @SEEK_CUR
%88 = call i32 @fseek(i32* %84, i32 %86, i32 %87)
%89 = load i32, i32* %19
%90 = add nsw i32 %89, 128
store i32 %90, i32* %19
%91 = load i8*, i8** %17
%92 = load i32, i32* %19
%93 = call i64 @realloc(i8* %91, i32 %92)
%94 = inttoptr i64 %93 to i8*
store i8* %94, i8** %17
%95 = load i8*, i8** %17
%96 = icmp ne i8* %95, null
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = load i8*, i8** %17
%100 = load i32, i32* %19
%101 = load i32*, i32** %16
%102 = call i8* @fgets(i8* %99, i32 %100, i32* %101)
store i8* %102, i8** %18
%103 = load i8*, i8** %18
%104 = icmp ne i8* %103, null
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
br label %75
107: ; preds = %75
br label %68
108: ; preds = %68
%109 = load i32*, i32** %16
%110 = call i32 @rewind(i32* %109)
store i32 0, i32* %12
br label %111
111: ; preds = %144, %108
%112 = load i32, i32* %12
%113 = load i32, i32* %9
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %147
115: ; preds = %111
%116 = load i8*, i8** %17
%117 = load i32, i32* %19
%118 = load i32*, i32** %16
%119 = call i8* @fgets(i8* %116, i32 %117, i32* %118)
%120 = load i8*, i8** %17
%121 = call i32* @strtok(i8* %120, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%122 = icmp eq i32* %121, null
br i1 %122, label %123, label %124
123: ; preds = %115
br label %144
124: ; preds = %115
store i32 0, i32* %13
br label %125
125: ; preds = %140, %124
%126 = load i32, i32* %13
%127 = load i32, i32* %10
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %143
129: ; preds = %125
%130 = call i32* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%131 = call float @atof(i32* %130)
%132 = load float**, float*** %11
%133 = load i32, i32* %12
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds float*, float** %132, i64 %134
%136 = load float*, float** %135
%137 = load i32, i32* %13
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %136, i64 %138
store float %131, float* %139
br label %140
140: ; preds = %129
%141 = load i32, i32* %13
%142 = add nsw i32 %141, 1
store i32 %142, i32* %13
br label %125
143: ; preds = %125
br label %144
144: ; preds = %143, %123
%145 = load i32, i32* %12
%146 = add nsw i32 %145, 1
store i32 %146, i32* %12
br label %111
147: ; preds = %111
%148 = load i32*, i32** %16
%149 = call i32 @fclose(i32* %148)
%150 = load i8*, i8** %17
%151 = call i32 @free(i8* %150)
br label %152
152: ; preds = %147, %33
store i32 1, i32* %6
br label %153
153: ; preds = %152, %54, %27
%154 = load i32, i32* %6
ret i32 %154
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [5 x i8] c"0600\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error: open file %s (err=%s)\0A\00"
@errno = global i32 0
@.str.2 = [2 x i8] c"r\00"
@SEEK_CUR = global i32 0
@.str.3 = [4 x i8] c" \09\0A\00"
@.str.4 = [5 x i8] c" ,\09\0A\00"
define i32 @read_n_objects(i32 %0, i8* %1, i32 %2, i32 %3, float** nocapture %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = icmp eq i32 %0, 0
br i1 %8, label %27, label %9
9: ; preds = %5
%10 = load i32, i32* @O_RDONLY
%11 = tail call i32 @open(i8* %1, i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* @stderr
%15 = load i32, i32* @errno
%16 = tail call i8* @strerror(i32 %15)
%17 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %16)
br label %107
18: ; preds = %9
%19 = call i32 (i32, ...) @read(i32 %11, i32* %6, i64 4)
%20 = call i32 (i32, ...) @read(i32 %11, i32* %6, i64 4)
%21 = load float*, float** %4
%22 = mul nsw i32 %3, %2
%23 = sext i32 %22 to i64
%24 = shl nsw i64 %23, 2
%25 = call i32 (i32, ...) @read(i32 %11, float* %21, i64 %24)
%26 = call i32 @close(i32 %11)
br label %107
27: ; preds = %5
%28 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = load i32, i32* @errno
%33 = tail call i8* @strerror(i32 %32)
%34 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %33)
br label %107
35: ; preds = %27
%36 = tail call i64 @malloc(i32 128)
%37 = inttoptr i64 %36 to i8*
%38 = icmp ne i64 %36, 0
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i8* @fgets(i8* %37, i32 128, i32* %28)
%42 = icmp eq i8* %41, null
br i1 %42, label %76, label %50
43: ; preds = %56
%44 = inttoptr i64 %64 to i8*
br label %45
45: ; preds = %43, %50
%46 = phi i8* [ %52, %50 ], [ %44, %43 ]
%47 = phi i32 [ %51, %50 ], [ %63, %43 ]
%48 = tail call i8* @fgets(i8* %46, i32 %47, i32* %28)
%49 = icmp eq i8* %48, null
br i1 %49, label %76, label %50
50: ; preds = %35, %45
%51 = phi i32 [ %47, %45 ], [ 128, %35 ]
%52 = phi i8* [ %46, %45 ], [ %37, %35 ]
%53 = tail call i32 @strlen(i8* %52)
%54 = add nsw i32 %51, -1
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %45
56: ; preds = %50, %56
%57 = phi i32 [ %63, %56 ], [ %51, %50 ]
%58 = phi i8* [ %65, %56 ], [ %52, %50 ]
%59 = tail call i32 @strlen(i8* %58)
%60 = sub nsw i32 0, %59
%61 = load i32, i32* @SEEK_CUR
%62 = tail call i32 @fseek(i32* %28, i32 %60, i32 %61)
%63 = add nsw i32 %57, 128
%64 = tail call i64 @realloc(i8* %58, i32 %63)
%65 = inttoptr i64 %64 to i8*
%66 = icmp ne i64 %64, 0
%67 = zext i1 %66 to i32
%68 = tail call i32 @assert(i32 %67)
%69 = tail call i8* @fgets(i8* %65, i32 %63, i32* %28)
%70 = icmp ne i8* %69, null
%71 = zext i1 %70 to i32
%72 = tail call i32 @assert(i32 %71)
%73 = tail call i32 @strlen(i8* %65)
%74 = add nsw i32 %57, 127
%75 = icmp eq i32 %73, %74
br i1 %75, label %56, label %43
76: ; preds = %45, %35
%77 = phi i8* [ %37, %35 ], [ %46, %45 ]
%78 = phi i32 [ 128, %35 ], [ %47, %45 ]
%79 = tail call i32 @rewind(i32* %28)
%80 = icmp sgt i32 %2, 0
br i1 %80, label %81, label %104
81: ; preds = %76
%82 = icmp slt i32 %3, 1
%83 = zext i32 %2 to i64
%84 = zext i32 %3 to i64
br label %85
85: ; preds = %81, %101
%86 = phi i64 [ 0, %81 ], [ %102, %101 ]
%87 = tail call i8* @fgets(i8* %77, i32 %78, i32* %28)
%88 = tail call i32* @strtok(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%89 = icmp eq i32* %88, null
%90 = or i1 %89, %82
br i1 %90, label %101, label %91
91: ; preds = %85
%92 = getelementptr inbounds float*, float** %4, i64 %86
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ 0, %91 ], [ %99, %93 ]
%95 = tail call i32* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%96 = tail call float @atof(i32* %95)
%97 = load float*, float** %92
%98 = getelementptr inbounds float, float* %97, i64 %94
store float %96, float* %98
%99 = add nuw nsw i64 %94, 1
%100 = icmp eq i64 %99, %84
br i1 %100, label %101, label %93
101: ; preds = %93, %85
%102 = add nuw nsw i64 %86, 1
%103 = icmp eq i64 %102, %83
br i1 %103, label %104, label %85
104: ; preds = %101, %76
%105 = tail call i32 @fclose(i32* %28)
%106 = tail call i32 @free(i8* %77)
br label %107
107: ; preds = %18, %104, %30, %13
%108 = phi i32 [ 0, %13 ], [ 0, %30 ], [ 1, %104 ], [ 1, %18 ]
ret i32 %108
}