#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*/ outfiles;
typedef int /*<<< orphan*/ infiles;
typedef int /*<<< orphan*/ dumpfiles;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int sscanf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int cmio_in_read_files_in(char (*infiles)[3][80], char (*outfiles)[3][80],
                          char (*dumpfiles)[4][80]) {
  if (infiles == NULL || outfiles == NULL || dumpfiles == NULL) {
    fputs("cmio_read_messages_in: one of the arrays is NULL\n", stderr);
    return -1;
  }
  const char *fin_fname = "files.in";
  FILE *files_in = fopen(fin_fname, "r");
  if (files_in == NULL) {
    fprintf(stderr, "cmio_read_files_in: unable to open %s: %s\n", fin_fname,
            (errno == ENOENT) ? "file doesn't exist."
                              : "an error occurred while reading the file.");
    return -1;
  }
  int success = 0;
  for (size_t i = 0; i < 3 + 3 + 4; i++) {
    void *r = NULL;
    if (i < 3) {
      r = fgets(infiles[0][i], sizeof(infiles[0][i]), files_in);
    } else if (i < 6) {
      r = fgets(outfiles[0][i % 3], sizeof(outfiles[0][i % 3]), files_in);
    } else {
      r = fgets(dumpfiles[0][i % 4], sizeof(dumpfiles[0][i % 4]), files_in);
    }
    if (r == NULL) {
      perror("cmio_read_files_in: fgets()");
      fprintf(stderr, "cmio_read_files_in: fgets() failed at line #%lu\n", i);
      success = -1;
      break;
    } else {
      int result = 0;
      if (i < 3) {
        result = sscanf(infiles[0][i], " %s\n", infiles[0][i]);
      } else if (i < 6) {
        result = sscanf(outfiles[0][i % 3], " %s\n", outfiles[0][i % 3]);
      } else {
        result = sscanf(dumpfiles[0][i % 4], " %s\n", dumpfiles[0][i % 4]);
      }
      if (result != 1) {
        fprintf(stderr, "cmio_read_files_in: sscanf failed for line #%lu\n", i);
        success = -1;
        break;
      }
    }
  }
  fclose(files_in);
  return success;
}


x86 assembly (clang, -O0):
<cmio_in_read_files_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a5 <cmio_in_read_files_in+0x35>
cmpq   $0x0,-0x18(%rbp)
je     11a5 <cmio_in_read_files_in+0x35>
cmpq   $0x0,-0x20(%rbp)
jne    11c6 <cmio_in_read_files_in+0x56>
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0xe4b(%rip),%rdi
call   1040 <fputs@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1462 <cmio_in_read_files_in+0x2f2>
lea    0xe65(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1240 <cmio_in_read_files_in+0xd0>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    0x2dd4(%rip),%rax
mov    (%rax),%rsi
mov    0x2dba(%rip),%rax
mov    (%rax),%r8
lea    0xe64(%rip),%rcx
lea    0xe49(%rip),%rax
cmp    %r8,%rsi
cmove  %rax,%rcx
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1462 <cmio_in_read_files_in+0x2f2>
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
cmpq   $0xa,-0x40(%rbp)
jae    1453 <cmio_in_read_files_in+0x2e3>
movq   $0x0,-0x48(%rbp)
cmpq   $0x3,-0x40(%rbp)
jae    1290 <cmio_in_read_files_in+0x120>
mov    -0x10(%rbp),%rdi
imul   $0x50,-0x40(%rbp),%rax
add    %rax,%rdi
mov    -0x30(%rbp),%rdx
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %rax,-0x48(%rbp)
jmp    12f5 <cmio_in_read_files_in+0x185>
cmpq   $0x6,-0x40(%rbp)
jae    12cb <cmio_in_read_files_in+0x15b>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x50,%rdx,%rax
add    %rax,%rdi
mov    -0x30(%rbp),%rdx
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %rax,-0x48(%rbp)
jmp    12f0 <cmio_in_read_files_in+0x180>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rax
and    $0x3,%rax
imul   $0x50,%rax,%rax
add    %rax,%rdi
mov    -0x30(%rbp),%rdx
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %rax,-0x48(%rbp)
jmp    12f5 <cmio_in_read_files_in+0x185>
cmpq   $0x0,-0x48(%rbp)
jne    1333 <cmio_in_read_files_in+0x1c3>
lea    0xd9f(%rip),%rdi
call   1090 <perror@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x34(%rbp)
jmp    1453 <cmio_in_read_files_in+0x2e3>
movl   $0x0,-0x4c(%rbp)
cmpq   $0x3,-0x40(%rbp)
jae    1371 <cmio_in_read_files_in+0x201>
mov    -0x10(%rbp),%rdi
imul   $0x50,-0x40(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rdx
imul   $0x50,-0x40(%rbp),%rax
add    %rax,%rdx
lea    0xcff(%rip),%rsi
call   1070 <sscanf@plt>
mov    %eax,-0x4c(%rbp)
jmp    1407 <cmio_in_read_files_in+0x297>
cmpq   $0x6,-0x40(%rbp)
jae    13cd <cmio_in_read_files_in+0x25d>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x50,%rdx,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
mov    -0x58(%rbp),%rdx
imul   $0x50,%rax,%rax
add    %rax,%rdx
lea    0xca3(%rip),%rsi
call   1070 <sscanf@plt>
mov    %eax,-0x4c(%rbp)
jmp    1402 <cmio_in_read_files_in+0x292>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rax
and    $0x3,%rax
imul   $0x50,%rax,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rdx
mov    -0x40(%rbp),%rax
and    $0x3,%rax
imul   $0x50,%rax,%rax
add    %rax,%rdx
lea    0xc69(%rip),%rsi
call   1070 <sscanf@plt>
mov    %eax,-0x4c(%rbp)
jmp    1407 <cmio_in_read_files_in+0x297>
cmpl   $0x1,-0x4c(%rbp)
je     1438 <cmio_in_read_files_in+0x2c8>
mov    0x2bc8(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0xffffffff,-0x34(%rbp)
jmp    1453 <cmio_in_read_files_in+0x2e3>
jmp    143d <cmio_in_read_files_in+0x2cd>
jmp    1442 <cmio_in_read_files_in+0x2d2>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    124f <cmio_in_read_files_in+0xdf>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmio_in_read_files_in>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     12bb <cmio_in_read_files_in+0x14b>
mov    %rsi,%r12
test   %rsi,%rsi
je     12bb <cmio_in_read_files_in+0x14b>
mov    %rdx,%r14
test   %rdx,%rdx
je     12bb <cmio_in_read_files_in+0x14b>
mov    %rdi,%r13
lea    0xe8c(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     12d7 <cmio_in_read_files_in+0x167>
mov    %rax,%r15
xor    %ebx,%ebx
mov    %rbx,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
cmp    $0x3,%rbx
jae    1210 <cmio_in_read_files_in+0xa0>
mov    %r13,%rdi
mov    $0x50,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     135a <cmio_in_read_files_in+0x1ea>
mov    %r13,%rdi
lea    0xe6a(%rip),%rsi
mov    %r13,%rdx
jmp    1290 <cmio_in_read_files_in+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x5,%rbx
ja     1250 <cmio_in_read_files_in+0xe0>
shr    %rdx
imul   $0xffffffffffffff10,%rdx,%rbp
add    %r12,%rbp
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     135a <cmio_in_read_files_in+0x1ea>
mov    %rbp,%rdi
lea    0xe1d(%rip),%rsi
mov    %rbp,%rdx
jmp    1290 <cmio_in_read_files_in+0x120>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
and    $0x3,%eax
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
mov    $0x50,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     135a <cmio_in_read_files_in+0x1ea>
mov    %ebx,%eax
and    $0x3,%eax
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
add    %r14,%rdi
lea    0xdd6(%rip),%rsi
mov    %rdi,%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
jne    1322 <cmio_in_read_files_in+0x1b2>
add    $0x1,%rbx
add    $0x50,%r13
add    $0x50,%r12
cmp    $0xa,%rbx
jne    11c0 <cmio_in_read_files_in+0x50>
xor    %ebx,%ebx
jmp    1341 <cmio_in_read_files_in+0x1d1>
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
lea    0xd35(%rip),%rdi
call   1040 <fputs@plt>
mov    $0xffffffff,%ebx
jmp    1349 <cmio_in_read_files_in+0x1d9>
mov    0x2d02(%rip),%rax
mov    (%rax),%edi
mov    0x2cf1(%rip),%rax
mov    (%rax),%rax
mov    0x2cd7(%rip),%rcx
cmp    (%rcx),%rax
lea    0xd6d(%rip),%rax
lea    0xd7a(%rip),%rcx
cmove  %rax,%rcx
lea    0xd30(%rip),%rsi
lea    0xd1e(%rip),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebx
jmp    1349 <cmio_in_read_files_in+0x1d9>
lea    0xdca(%rip),%rsi
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd45(%rip),%rdi
call   1090 <perror@plt>
lea    0xd55(%rip),%rsi
jmp    1329 <cmio_in_read_files_in+0x1b9>

LLVM IR (-O0):
@.str = [50 x i8] c"cmio_read_messages_in: one of the arrays is NULL\0A\00"
@stderr = global i32 0
@.str.1 = [9 x i8] c"files.in\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [43 x i8] c"cmio_read_files_in: unable to open %s: %s\0A\00"
@errno = global i64 0
@ENOENT = global i64 0
@.str.4 = [20 x i8] c"file doesn't exist.\00"
@.str.5 = [42 x i8] c"an error occurred while reading the file.\00"
@.str.6 = [28 x i8] c"cmio_read_files_in: fgets()\00"
@.str.7 = [49 x i8] c"cmio_read_files_in: fgets() failed at line #%lu\0A\00"
@.str.8 = [5 x i8] c" %s\0A\00"
@.str.9 = [49 x i8] c"cmio_read_files_in: sscanf failed for line #%lu\0A\00"
define i32 @cmio_in_read_files_in([3 x [80 x i8]]* %0, [3 x [80 x i8]]* %1, [4 x [80 x i8]]* %2) {
%4 = alloca i32
%5 = alloca [3 x [80 x i8]]*
%6 = alloca [3 x [80 x i8]]*
%7 = alloca [4 x [80 x i8]]*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i32
store [3 x [80 x i8]]* %0, [3 x [80 x i8]]** %5
store [3 x [80 x i8]]* %1, [3 x [80 x i8]]** %6
store [4 x [80 x i8]]* %2, [4 x [80 x i8]]** %7
%14 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %5
%15 = icmp eq [3 x [80 x i8]]* %14, null
br i1 %15, label %22, label %16
16: ; preds = %3
%17 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %6
%18 = icmp eq [3 x [80 x i8]]* %17, null
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load [4 x [80 x i8]]*, [4 x [80 x i8]]** %7
%21 = icmp eq [4 x [80 x i8]]* %20, null
br i1 %21, label %22, label %25
22: ; preds = %19, %16, %3
%23 = load i32, i32* @stderr
%24 = call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %23)
store i32 -1, i32* %4
br label %147
25: ; preds = %19
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %8
%26 = load i8*, i8** %8
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %27, i32** %9
%28 = load i32*, i32** %9
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %39
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = load i8*, i8** %8
%33 = load i64, i64* @errno
%34 = load i64, i64* @ENOENT
%35 = icmp eq i64 %33, %34
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0)
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* %32, i8* %37)
store i32 -1, i32* %4
br label %147
39: ; preds = %25
store i32 0, i32* %10
store i64 0, i64* %11
br label %40
40: ; preds = %140, %39
%41 = load i64, i64* %11
%42 = icmp ult i64 %41, 10
br i1 %42, label %43, label %143
43: ; preds = %40
store i8* null, i8** %12
%44 = load i64, i64* %11
%45 = icmp ult i64 %44, 3
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %5
%48 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %47, i64 0
%49 = load i64, i64* %11
%50 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %48, i64 0, i64 %49
%51 = getelementptr inbounds [80 x i8], [80 x i8]* %50, i64 0, i64 0
%52 = load i32*, i32** %9
%53 = call i8* @fgets(i8* %51, i32 80, i32* %52)
store i8* %53, i8** %12
br label %76
54: ; preds = %43
%55 = load i64, i64* %11
%56 = icmp ult i64 %55, 6
br i1 %56, label %57, label %66
57: ; preds = %54
%58 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %6
%59 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %58, i64 0
%60 = load i64, i64* %11
%61 = urem i64 %60, 3
%62 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %59, i64 0, i64 %61
%63 = getelementptr inbounds [80 x i8], [80 x i8]* %62, i64 0, i64 0
%64 = load i32*, i32** %9
%65 = call i8* @fgets(i8* %63, i32 80, i32* %64)
store i8* %65, i8** %12
br label %75
66: ; preds = %54
%67 = load [4 x [80 x i8]]*, [4 x [80 x i8]]** %7
%68 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %67, i64 0
%69 = load i64, i64* %11
%70 = urem i64 %69, 4
%71 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %68, i64 0, i64 %70
%72 = getelementptr inbounds [80 x i8], [80 x i8]* %71, i64 0, i64 0
%73 = load i32*, i32** %9
%74 = call i8* @fgets(i8* %72, i32 80, i32* %73)
store i8* %74, i8** %12
br label %75
75: ; preds = %66, %57
br label %76
76: ; preds = %75, %46
%77 = load i8*, i8** %12
%78 = icmp eq i8* %77, null
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%81 = load i32, i32* @stderr
%82 = load i64, i64* %11
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i64 %82)
store i32 -1, i32* %10
br label %143
84: ; preds = %76
store i32 0, i32* %13
%85 = load i64, i64* %11
%86 = icmp ult i64 %85, 3
br i1 %86, label %87, label %99
87: ; preds = %84
%88 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %5
%89 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %88, i64 0
%90 = load i64, i64* %11
%91 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %89, i64 0, i64 %90
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %91, i64 0, i64 0
%93 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %5
%94 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %93, i64 0
%95 = load i64, i64* %11
%96 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %94, i64 0, i64 %95
%97 = getelementptr inbounds [80 x i8], [80 x i8]* %96, i64 0, i64 0
%98 = call i32 @sscanf(i8* %92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %97)
store i32 %98, i32* %13
br label %131
99: ; preds = %84
%100 = load i64, i64* %11
%101 = icmp ult i64 %100, 6
br i1 %101, label %102, label %116
102: ; preds = %99
%103 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %6
%104 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %103, i64 0
%105 = load i64, i64* %11
%106 = urem i64 %105, 3
%107 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %104, i64 0, i64 %106
%108 = getelementptr inbounds [80 x i8], [80 x i8]* %107, i64 0, i64 0
%109 = load [3 x [80 x i8]]*, [3 x [80 x i8]]** %6
%110 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %109, i64 0
%111 = load i64, i64* %11
%112 = urem i64 %111, 3
%113 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %110, i64 0, i64 %112
%114 = getelementptr inbounds [80 x i8], [80 x i8]* %113, i64 0, i64 0
%115 = call i32 @sscanf(i8* %108, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %114)
store i32 %115, i32* %13
br label %130
116: ; preds = %99
%117 = load [4 x [80 x i8]]*, [4 x [80 x i8]]** %7
%118 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %117, i64 0
%119 = load i64, i64* %11
%120 = urem i64 %119, 4
%121 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %118, i64 0, i64 %120
%122 = getelementptr inbounds [80 x i8], [80 x i8]* %121, i64 0, i64 0
%123 = load [4 x [80 x i8]]*, [4 x [80 x i8]]** %7
%124 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %123, i64 0
%125 = load i64, i64* %11
%126 = urem i64 %125, 4
%127 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %124, i64 0, i64 %126
%128 = getelementptr inbounds [80 x i8], [80 x i8]* %127, i64 0, i64 0
%129 = call i32 @sscanf(i8* %122, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %128)
store i32 %129, i32* %13
br label %130
130: ; preds = %116, %102
br label %131
131: ; preds = %130, %87
%132 = load i32, i32* %13
%133 = icmp ne i32 %132, 1
br i1 %133, label %134, label %138
134: ; preds = %131
%135 = load i32, i32* @stderr
%136 = load i64, i64* %11
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i64 %136)
store i32 -1, i32* %10
br label %143
138: ; preds = %131
br label %139
139: ; preds = %138
br label %140
140: ; preds = %139
%141 = load i64, i64* %11
%142 = add i64 %141, 1
store i64 %142, i64* %11
br label %40
143: ; preds = %134, %79, %40
%144 = load i32*, i32** %9
%145 = call i32 @fclose(i32* %144)
%146 = load i32, i32* %10
store i32 %146, i32* %4
br label %147
147: ; preds = %143, %30, %22
%148 = load i32, i32* %4
ret i32 %148
}

LLVM IR (-O2):
@.str = [50 x i8] c"cmio_read_messages_in: one of the arrays is NULL\0A\00"
@stderr = global i32 0
@.str.1 = [9 x i8] c"files.in\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [43 x i8] c"cmio_read_files_in: unable to open %s: %s\0A\00"
@errno = global i64 0
@ENOENT = global i64 0
@.str.4 = [20 x i8] c"file doesn't exist.\00"
@.str.5 = [42 x i8] c"an error occurred while reading the file.\00"
@.str.6 = [28 x i8] c"cmio_read_files_in: fgets()\00"
@.str.7 = [49 x i8] c"cmio_read_files_in: fgets() failed at line #%lu\0A\00"
@.str.8 = [5 x i8] c" %s\0A\00"
@.str.9 = [49 x i8] c"cmio_read_files_in: sscanf failed for line #%lu\0A\00"
define i32 @cmio_in_read_files_in([3 x [80 x i8]]* %0, [3 x [80 x i8]]* %1, [4 x [80 x i8]]* %2) {
%4 = icmp eq [3 x [80 x i8]]* %0, null
%5 = icmp eq [3 x [80 x i8]]* %1, null
%6 = or i1 %4, %5
%7 = icmp eq [4 x [80 x i8]]* %2, null
%8 = or i1 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %71
12: ; preds = %3
%13 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = load i64, i64* @errno
%18 = load i64, i64* @ENOENT
%19 = icmp eq i64 %17, %18
%20 = select i1 %19, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0)
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %71
22: ; preds = %12, %61
%23 = phi i64 [ %62, %61 ], [ 0, %12 ]
%24 = icmp ult i64 %23, 3
br i1 %24, label %39, label %25
25: ; preds = %22
%26 = icmp ult i64 %23, 6
br i1 %26, label %27, label %34
27: ; preds = %25
%28 = trunc i64 %23 to i8
%29 = urem i8 %28, 3
%30 = zext i8 %29 to i64
%31 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %1, i64 0, i64 %30, i64 0
%32 = tail call i8* @fgets(i8* %31, i32 80, i32* %13)
%33 = icmp eq i8* %32, null
br i1 %33, label %43, label %48
34: ; preds = %25
%35 = and i64 %23, 3
%36 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %2, i64 0, i64 %35, i64 0
%37 = tail call i8* @fgets(i8* %36, i32 80, i32* %13)
%38 = icmp eq i8* %37, null
br i1 %38, label %43, label %54
39: ; preds = %22
%40 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %0, i64 0, i64 %23, i64 0
%41 = tail call i8* @fgets(i8* %40, i32 80, i32* %13)
%42 = icmp eq i8* %41, null
br i1 %42, label %43, label %45
43: ; preds = %34, %39, %27
%44 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %64
45: ; preds = %39
%46 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %0, i64 0, i64 %23, i64 0
%47 = tail call i32 @sscanf(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %46)
br label %58
48: ; preds = %27
%49 = trunc i64 %23 to i8
%50 = urem i8 %49, 3
%51 = zext i8 %50 to i64
%52 = getelementptr inbounds [3 x [80 x i8]], [3 x [80 x i8]]* %1, i64 0, i64 %51, i64 0
%53 = tail call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %52)
br label %58
54: ; preds = %34
%55 = and i64 %23, 3
%56 = getelementptr inbounds [4 x [80 x i8]], [4 x [80 x i8]]* %2, i64 0, i64 %55, i64 0
%57 = tail call i32 @sscanf(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %56)
br label %58
58: ; preds = %48, %54, %45
%59 = phi i32 [ %47, %45 ], [ %53, %48 ], [ %57, %54 ]
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = add nuw nsw i64 %23, 1
%63 = icmp eq i64 %62, 10
br i1 %63, label %68, label %22
64: ; preds = %58, %43
%65 = phi i8* [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), %43 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), %58 ]
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* %65, i64 %23)
br label %68
68: ; preds = %61, %64
%69 = phi i32 [ -1, %64 ], [ 0, %61 ]
%70 = tail call i32 @fclose(i32* %13)
br label %71
71: ; preds = %15, %68, %9
%72 = phi i32 [ -1, %9 ], [ -1, %15 ], [ %69, %68 ]
ret i32 %72
}