#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *f;
  int c1, c2, c3, c4;
  long cont;
  if (argc < 2) {
    printf("\nUso: %s <archivo.j2c>\n", argv[0]);
    return 0;
  }
  f = fopen(argv[1], "rb");
  if (f == NULL) {
    printf("\nError al abrir el archivo: %s\n", argv[1]);
    return 0;
  }
  cont = 0;
  long numByte = 1;
  long startByte = -1;
  long firstByte = 0;
  long header_size = 0;
  long total = 0;
  while (!feof(f)) {
    c1 = fgetc(f);
    numByte++;
    if (c1 == 0xFF) {
      c2 = fgetc(f);
      numByte++;
      if (c2 == 0x91) {
        c3 = fgetc(f);
        numByte++;
        if (c3 == 0x00) {
          c4 = fgetc(f);
          numByte++;
          if (c4 == 0x04) {
            if (cont == 0) {
              firstByte = numByte - 4 - 1;
            } else {
              if ((numByte - startByte) == 7) {
                header_size = 7;
              } else {
                header_size = 6;
              }
              total += header_size;
              printf("  Packet size: %ld\tHeader size: %ld",
                     (numByte - startByte), header_size);
            }
            startByte = numByte;
            printf("\n%ld\tStart at Byte: %ld\t- %X %X -", cont, (numByte - 4),
                   c1, c2);
            cont++;
          }
        }
      }
    }
  }
  fclose(f);
  if ((numByte - startByte + 1) == 7) {
    header_size = 7;
  } else {
    header_size = 6;
  }
  total += header_size;
  printf("  Packet size: %ld\tHeader size: %ld", numByte - startByte + 1,
         header_size);
  printf("\n\n# SOPs: %ld", cont);
  printf("\n# Header codestream: %ld", firstByte);
  printf("\n# Header layers: %ld", total);
  printf("\n# Total headers: %ld", firstByte + total);
  printf("\nOUT %ld\n", firstByte + total + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1191 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1433 <main+0x2e3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe78(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11d6 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1433 <main+0x2e3>
movq   $0x0,-0x30(%rbp)
movq   $0x1,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1224 <main+0xd4>
jmp    1368 <main+0x218>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jne    1363 <main+0x213>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x91,-0x20(%rbp)
jne    135e <main+0x20e>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1359 <main+0x209>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x4,-0x28(%rbp)
jne    1354 <main+0x204>
cmpq   $0x0,-0x30(%rbp)
jne    12d2 <main+0x182>
mov    -0x38(%rbp),%rax
sub    $0x4,%rax
sub    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    131f <main+0x1cf>
mov    -0x38(%rbp),%rax
sub    -0x40(%rbp),%rax
cmp    $0x7,%rax
jne    12f1 <main+0x1a1>
movq   $0x7,-0x50(%rbp)
jmp    12f9 <main+0x1a9>
movq   $0x6,-0x50(%rbp)
mov    -0x50(%rbp),%rax
add    -0x58(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%rsi
sub    -0x40(%rbp),%rsi
mov    -0x50(%rbp),%rdx
lea    0xd23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
sub    $0x4,%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1359 <main+0x209>
jmp    135e <main+0x20e>
jmp    1363 <main+0x213>
jmp    1206 <main+0xb6>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x38(%rbp),%rax
sub    -0x40(%rbp),%rax
add    $0x1,%rax
cmp    $0x7,%rax
jne    1394 <main+0x244>
movq   $0x7,-0x50(%rbp)
jmp    139c <main+0x24c>
movq   $0x6,-0x50(%rbp)
mov    -0x50(%rbp),%rax
add    -0x58(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%rsi
sub    -0x40(%rbp),%rsi
add    $0x1,%rsi
mov    -0x50(%rbp),%rdx
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xcb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%rsi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rsi
add    -0x58(%rbp),%rsi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rsi
add    -0x58(%rbp),%rsi
add    $0x2,%rsi
lea    0xcb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
cmp    $0x1,%edi
jg     1173 <main+0x23>
mov    0x0(%rbp),%rsi
lea    0xe92(%rip),%rdi
jmp    1252 <main+0x102>
mov    0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1247 <main+0xf7>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     126a <main+0x11a>
mov    $0xffffffffffffffff,%r12
mov    $0x1,%r13d
xor    %r15d,%r15d
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,(%rsp)
sub    %r12,%r13
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x1,%r13
xor    %edx,%edx
cmp    $0x7,%r13
sete   %dl
mov    (%rsp),%rax
lea    (%rdx,%rax,1),%rbx
add    $0x6,%rbx
or     $0x6,%rdx
lea    0xe54(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rbx,%r14,1),%rsi
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r14,%rbx,1),%rsi
add    $0x2,%rsi
lea    0xe90(%rip),%rdi
jmp    1252 <main+0x102>
mov    0x8(%rbp),%rsi
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
mov    $0xffffffffffffffff,%r12
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    12aa <main+0x15a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbp
mov    %rbp,%r13
mov    %rbx,%rdi
call   1060 <feof@plt>
mov    %r13,%rbp
test   %eax,%eax
jne    11b8 <main+0x68>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
cmp    $0xff,%eax
jne    1290 <main+0x140>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
cmp    $0x91,%eax
jne    12e0 <main+0x190>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
test   %eax,%eax
je     12e6 <main+0x196>
add    $0x3,%rbp
jmp    1294 <main+0x144>
nopw   0x0(%rax,%rax,1)
add    $0x2,%rbp
jmp    1294 <main+0x144>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
lea    0x4(%rbp),%r13
cmp    $0x4,%eax
jne    1297 <main+0x147>
test   %r15,%r15
je     132e <main+0x1de>
mov    %r13,%rsi
sub    %r12,%rsi
xor    %edx,%edx
cmp    $0x7,%rsi
sete   %dl
mov    (%rsp),%rax
add    %rdx,%rax
add    $0x6,%rax
mov    %rax,(%rsp)
or     $0x6,%rdx
lea    0xd16(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1332 <main+0x1e2>
lea    -0x1(%rbp),%r14
lea    0xd26(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    $0xff,%ecx
mov    $0x91,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
mov    %r13,%r12
jmp    1297 <main+0x147>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AUso: %s <archivo.j2c>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [32 x i8] c"\0AError al abrir el archivo: %s\0A\00"
@.str.3 = [36 x i8] c" Packet size: %ld\09Header size: %ld\00"
@.str.4 = [34 x i8] c"\0A%ld\09Start at Byte: %ld\09- %X %X -\00"
@.str.5 = [14 x i8] c"\0A\0A# SOPs: %ld\00"
@.str.6 = [26 x i8] c"\0A# Header codestream: %ld\00"
@.str.7 = [22 x i8] c"\0A# Header layers: %ld\00"
@.str.8 = [22 x i8] c"\0A# Total headers: %ld\00"
@.str.9 = [10 x i8] c"\0AOUT %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %24
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 0, i32* %3
br label %142
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32* @fopen(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %28, i32** %6
%29 = load i32*, i32** %6
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %36
31: ; preds = %24
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %34)
store i32 0, i32* %3
br label %142
36: ; preds = %24
store i64 0, i64* %11
store i64 1, i64* %12
store i64 -1, i64* %13
store i64 0, i64* %14
store i64 0, i64* %15
store i64 0, i64* %16
br label %37
37: ; preds = %106, %36
%38 = load i32*, i32** %6
%39 = call i32 @feof(i32* %38)
%40 = icmp ne i32 %39, 0
%41 = xor i1 %40, true
br i1 %41, label %42, label %107
42: ; preds = %37
%43 = load i32*, i32** %6
%44 = call i32 @fgetc(i32* %43)
store i32 %44, i32* %7
%45 = load i64, i64* %12
%46 = add nsw i64 %45, 1
store i64 %46, i64* %12
%47 = load i32, i32* %7
%48 = icmp eq i32 %47, 255
br i1 %48, label %49, label %106
49: ; preds = %42
%50 = load i32*, i32** %6
%51 = call i32 @fgetc(i32* %50)
store i32 %51, i32* %8
%52 = load i64, i64* %12
%53 = add nsw i64 %52, 1
store i64 %53, i64* %12
%54 = load i32, i32* %8
%55 = icmp eq i32 %54, 145
br i1 %55, label %56, label %105
56: ; preds = %49
%57 = load i32*, i32** %6
%58 = call i32 @fgetc(i32* %57)
store i32 %58, i32* %9
%59 = load i64, i64* %12
%60 = add nsw i64 %59, 1
store i64 %60, i64* %12
%61 = load i32, i32* %9
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %104
63: ; preds = %56
%64 = load i32*, i32** %6
%65 = call i32 @fgetc(i32* %64)
store i32 %65, i32* %10
%66 = load i64, i64* %12
%67 = add nsw i64 %66, 1
store i64 %67, i64* %12
%68 = load i32, i32* %10
%69 = icmp eq i32 %68, 4
br i1 %69, label %70, label %103
70: ; preds = %63
%71 = load i64, i64* %11
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load i64, i64* %12
%75 = sub nsw i64 %74, 4
%76 = sub nsw i64 %75, 1
store i64 %76, i64* %14
br label %93
77: ; preds = %70
%78 = load i64, i64* %12
%79 = load i64, i64* %13
%80 = sub nsw i64 %78, %79
%81 = icmp eq i64 %80, 7
br i1 %81, label %82, label %83
82: ; preds = %77
store i64 7, i64* %15
br label %84
83: ; preds = %77
store i64 6, i64* %15
br label %84
84: ; preds = %83, %82
%85 = load i64, i64* %15
%86 = load i64, i64* %16
%87 = add nsw i64 %86, %85
store i64 %87, i64* %16
%88 = load i64, i64* %12
%89 = load i64, i64* %13
%90 = sub nsw i64 %88, %89
%91 = load i64, i64* %15
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i64 %90, i64 %91)
br label %93
93: ; preds = %84, %73
%94 = load i64, i64* %12
store i64 %94, i64* %13
%95 = load i64, i64* %11
%96 = load i64, i64* %12
%97 = sub nsw i64 %96, 4
%98 = load i32, i32* %7
%99 = load i32, i32* %8
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 %95, i64 %97, i32 %98, i32 %99)
%101 = load i64, i64* %11
%102 = add nsw i64 %101, 1
store i64 %102, i64* %11
br label %103
103: ; preds = %93, %63
br label %104
104: ; preds = %103, %56
br label %105
105: ; preds = %104, %49
br label %106
106: ; preds = %105, %42
br label %37
107: ; preds = %37
%108 = load i32*, i32** %6
%109 = call i32 @fclose(i32* %108)
%110 = load i64, i64* %12
%111 = load i64, i64* %13
%112 = sub nsw i64 %110, %111
%113 = add nsw i64 %112, 1
%114 = icmp eq i64 %113, 7
br i1 %114, label %115, label %116
115: ; preds = %107
store i64 7, i64* %15
br label %117
116: ; preds = %107
store i64 6, i64* %15
br label %117
117: ; preds = %116, %115
%118 = load i64, i64* %15
%119 = load i64, i64* %16
%120 = add nsw i64 %119, %118
store i64 %120, i64* %16
%121 = load i64, i64* %12
%122 = load i64, i64* %13
%123 = sub nsw i64 %121, %122
%124 = add nsw i64 %123, 1
%125 = load i64, i64* %15
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i64 %124, i64 %125)
%127 = load i64, i64* %11
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i64 %127)
%129 = load i64, i64* %14
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i64 %129)
%131 = load i64, i64* %16
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i64 %131)
%133 = load i64, i64* %14
%134 = load i64, i64* %16
%135 = add nsw i64 %133, %134
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 %135)
%137 = load i64, i64* %14
%138 = load i64, i64* %16
%139 = add nsw i64 %137, %138
%140 = add nsw i64 %139, 2
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i64 %140)
store i32 0, i32* %3
br label %142
142: ; preds = %117, %31, %19
%143 = load i32, i32* %3
ret i32 %143
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AUso: %s <archivo.j2c>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [32 x i8] c"\0AError al abrir el archivo: %s\0A\00"
@.str.3 = [36 x i8] c" Packet size: %ld\09Header size: %ld\00"
@.str.4 = [34 x i8] c"\0A%ld\09Start at Byte: %ld\09- %X %X -\00"
@.str.5 = [14 x i8] c"\0A\0A# SOPs: %ld\00"
@.str.6 = [26 x i8] c"\0A# Header codestream: %ld\00"
@.str.7 = [22 x i8] c"\0A# Header layers: %ld\00"
@.str.8 = [22 x i8] c"\0A# Total headers: %ld\00"
@.str.9 = [10 x i8] c"\0AOUT %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %82
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = tail call i32 @feof(i32* %10)
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %62
15: ; preds = %7
%16 = load i8*, i8** %8
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %82
18: ; preds = %12, %54
%19 = phi i64 [ %59, %54 ], [ 0, %12 ]
%20 = phi i64 [ %58, %54 ], [ 0, %12 ]
%21 = phi i64 [ %57, %54 ], [ -1, %12 ]
%22 = phi i64 [ %56, %54 ], [ 1, %12 ]
%23 = phi i64 [ %55, %54 ], [ 0, %12 ]
%24 = tail call i32 @fgetc(i32* %10)
%25 = add nsw i64 %22, 1
%26 = icmp eq i32 %24, 255
br i1 %26, label %27, label %54
27: ; preds = %18
%28 = tail call i32 @fgetc(i32* %10)
%29 = add nsw i64 %22, 2
%30 = icmp eq i32 %28, 145
br i1 %30, label %31, label %54
31: ; preds = %27
%32 = tail call i32 @fgetc(i32* %10)
%33 = add nsw i64 %22, 3
%34 = icmp eq i32 %32, 0
br i1 %34, label %35, label %54
35: ; preds = %31
%36 = tail call i32 @fgetc(i32* %10)
%37 = add nsw i64 %22, 4
%38 = icmp eq i32 %36, 4
br i1 %38, label %39, label %54
39: ; preds = %35
%40 = icmp eq i64 %23, 0
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = add nsw i64 %22, -1
br label %49
43: ; preds = %39
%44 = sub nsw i64 %37, %21
%45 = icmp eq i64 %44, 7
%46 = select i1 %45, i64 7, i64 6
%47 = add nsw i64 %46, %19
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i64 %44, i64 %46)
br label %49
49: ; preds = %43, %41
%50 = phi i64 [ %42, %41 ], [ %20, %43 ]
%51 = phi i64 [ %19, %41 ], [ %47, %43 ]
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i64 %23, i64 %22, i32 255, i32 145)
%53 = add nsw i64 %23, 1
br label %54
54: ; preds = %27, %35, %49, %31, %18
%55 = phi i64 [ %53, %49 ], [ %23, %35 ], [ %23, %31 ], [ %23, %27 ], [ %23, %18 ]
%56 = phi i64 [ %37, %49 ], [ %37, %35 ], [ %33, %31 ], [ %29, %27 ], [ %25, %18 ]
%57 = phi i64 [ %37, %49 ], [ %21, %35 ], [ %21, %31 ], [ %21, %27 ], [ %21, %18 ]
%58 = phi i64 [ %50, %49 ], [ %20, %35 ], [ %20, %31 ], [ %20, %27 ], [ %20, %18 ]
%59 = phi i64 [ %51, %49 ], [ %19, %35 ], [ %19, %31 ], [ %19, %27 ], [ %19, %18 ]
%60 = tail call i32 @feof(i32* %10)
%61 = icmp eq i32 %60, 0
br i1 %61, label %18, label %62
62: ; preds = %54, %12
%63 = phi i64 [ 0, %12 ], [ %55, %54 ]
%64 = phi i64 [ 1, %12 ], [ %56, %54 ]
%65 = phi i64 [ -1, %12 ], [ %57, %54 ]
%66 = phi i64 [ 0, %12 ], [ %58, %54 ]
%67 = phi i64 [ 0, %12 ], [ %59, %54 ]
%68 = tail call i32 @fclose(i32* %10)
%69 = sub nsw i64 %64, %65
%70 = add nsw i64 %69, 1
%71 = icmp eq i64 %70, 7
%72 = select i1 %71, i64 7, i64 6
%73 = add nsw i64 %72, %67
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i64 %70, i64 %72)
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i64 %63)
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i64 %66)
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i64 %73)
%78 = add nsw i64 %73, %66
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 %78)
%80 = add nsw i64 %78, 2
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i64 %80)
br label %82
82: ; preds = %62, %15, %4
ret i32 0
}