#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 */
unsigned char atoi(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int byte_read;
  int first_found;
  unsigned char stream_id;
  FILE *file_pes;
  unsigned char pes_header[4];
  unsigned char byte;
  unsigned char length;
  if (argc > 2) {
    file_pes = fopen(argv[1], "rb");
    stream_id = atoi(argv[2]);
  } else {
    fprintf(stderr, "Usage: 'pes2es filename.pes stream_id_header_to_skip'\n");
    fprintf(stderr,
            "Example for audio: 'pes2es filename.pes 192', 192 is 0xc0 \n");
    fprintf(stderr,
            "Example for video: 'pes2es filename.pes 224', 224 is 0xe0\n");
    return 2;
  }
  if (file_pes == 0) {
    fprintf(stderr, "Can't find file %s\n", argv[1]);
    return 2;
  }
  first_found = 0;
  byte_read = fread(pes_header, 1, 4, file_pes);
  while (byte_read) {
    if ((pes_header[0] == 0x00) && (pes_header[1] == 0x00) &&
        (pes_header[2] == 0x01) && (pes_header[3] == stream_id)) {
      first_found = 1;
      int i = 0;
      for (i = 0; i < 4; i++) {
        fread(&byte, 1, 1, file_pes);
      }
      fread(&length, 1, 1, file_pes);
      for (i = 0; i < length; i++) {
        fread(&byte, 1, 1, file_pes);
      }
      byte_read = fread(pes_header, 1, 4, file_pes);
    } else {
      if (first_found) {
        fwrite(pes_header, 1, 1, stdout);
      }
      pes_header[0] = pes_header[1];
      pes_header[1] = pes_header[2];
      pes_header[2] = pes_header[3];
      byte_read = fread(pes_header + 3, 1, 1, file_pes);
    }
  }
  fwrite(pes_header, 1, 3, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    119d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %al,-0x19(%rbp)
jmp    11ee <main+0x9e>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    13aa <main+0x25a>
cmpq   $0x0,-0x28(%rbp)
jne    1224 <main+0xd4>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    13aa <main+0x25a>
movl   $0x0,-0x18(%rbp)
lea    -0x2c(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1387 <main+0x237>
movzbl -0x2c(%rbp),%eax
cmp    $0x0,%eax
jne    1332 <main+0x1e2>
movzbl -0x2b(%rbp),%eax
cmp    $0x0,%eax
jne    1332 <main+0x1e2>
movzbl -0x2a(%rbp),%eax
cmp    $0x1,%eax
jne    1332 <main+0x1e2>
movzbl -0x29(%rbp),%eax
movzbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1332 <main+0x1e2>
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    12c7 <main+0x177>
mov    -0x28(%rbp),%rcx
lea    -0x2d(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    129b <main+0x14b>
mov    -0x28(%rbp),%rcx
lea    -0x2e(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
movzbl -0x2e(%rbp),%ecx
cmp    %ecx,%eax
jge    1313 <main+0x1c3>
mov    -0x28(%rbp),%rcx
lea    -0x2d(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12e2 <main+0x192>
lea    -0x2c(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
jmp    1382 <main+0x232>
cmpl   $0x0,-0x18(%rbp)
je     1355 <main+0x205>
lea    -0x2c(%rbp),%rdi
mov    0x2c91(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <fwrite@plt>
mov    -0x2b(%rbp),%al
mov    %al,-0x2c(%rbp)
mov    -0x2a(%rbp),%al
mov    %al,-0x2b(%rbp)
mov    -0x29(%rbp),%al
mov    %al,-0x2a(%rbp)
lea    -0x2c(%rbp),%rdi
add    $0x3,%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
jmp    1245 <main+0xf5>
lea    -0x2c(%rbp),%rdi
mov    0x2c46(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x3,%edx
call   1070 <fwrite@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x3,%edi
jl     1305 <main+0x1b5>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
call   1060 <atoi@plt>
test   %rbx,%rbx
je     135f <main+0x20f>
mov    %eax,%r15d
lea    0x2(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
test   %eax,%eax
je     133e <main+0x1ee>
xor    %r14d,%r14d
lea    0x7(%rsp),%r12
lea    0x2(%rsp),%r13
jmp    11eb <main+0x9b>
nopl   (%rax)
mov    %al,0x2(%rsp)
mov    %cl,0x3(%rsp)
mov    %dl,0x4(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
test   %eax,%eax
je     133e <main+0x1ee>
cmpb   $0x0,0x2(%rsp)
mov    0x3(%rsp),%al
mov    0x4(%rsp),%cl
mov    0x5(%rsp),%dl
jne    12d0 <main+0x180>
test   %al,%al
jne    12d0 <main+0x180>
cmp    $0x1,%cl
jne    12d0 <main+0x180>
cmp    %r15b,%dl
jne    12d0 <main+0x180>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzbl 0x6(%rsp),%ebp
test   %ebp,%ebp
je     12aa <main+0x15a>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
add    $0xffffffff,%ebp
jne    1290 <main+0x140>
mov    $0x1,%r14d
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
jmp    11db <main+0x8b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r14d,%r14d
je     11c0 <main+0x70>
mov    0x2cf8(%rip),%rax
mov    (%rax),%ecx
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1070 <fwrite@plt>
mov    0x3(%rsp),%al
mov    0x4(%rsp),%cl
mov    0x5(%rsp),%dl
jmp    11c0 <main+0x70>
mov    0x2cd4(%rip),%rbx
mov    (%rbx),%edi
lea    0xcee(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd15(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd41(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    137a <main+0x22a>
mov    0x2c93(%rip),%rax
mov    (%rax),%ecx
lea    0x2(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1070 <fwrite@plt>
xor    %eax,%eax
jmp    137f <main+0x22f>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xd3e(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Usage: 'pes2es filename.pes stream_id_header_to_skip'\0A\00"
@.str.2 = [60 x i8] c"Example for audio: 'pes2es filename.pes 192', 192 is 0xc0 \0A\00"
@.str.3 = [59 x i8] c"Example for video: 'pes2es filename.pes 224', 224 is 0xe0\0A\00"
@.str.4 = [20 x i8] c"Can't find file %s\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32*
%10 = alloca [4 x i8]
%11 = alloca i8
%12 = alloca i8
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 2
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %20, i32** %9
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call zeroext i8 @atoi(i8* %23)
store i8 %24, i8* %8
br label %32
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %3
br label %124
32: ; preds = %16
%33 = load i32*, i32** %9
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %41
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %39)
store i32 2, i32* %3
br label %124
41: ; preds = %32
store i32 0, i32* %7
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%43 = load i32*, i32** %9
%44 = call i32 @fread(i8* %42, i32 1, i32 4, i32* %43)
store i32 %44, i32* %6
br label %45
45: ; preds = %119, %41
%46 = load i32, i32* %6
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %120
48: ; preds = %45
%49 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %98
53: ; preds = %48
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 1
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %98
58: ; preds = %53
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 2
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = icmp eq i32 %61, 1
br i1 %62, label %63, label %98
63: ; preds = %58
%64 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 3
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = load i8, i8* %8
%68 = zext i8 %67 to i32
%69 = icmp eq i32 %66, %68
br i1 %69, label %70, label %98
70: ; preds = %63
store i32 1, i32* %7
store i32 0, i32* %13
store i32 0, i32* %13
br label %71
71: ; preds = %77, %70
%72 = load i32, i32* %13
%73 = icmp slt i32 %72, 4
br i1 %73, label %74, label %80
74: ; preds = %71
%75 = load i32*, i32** %9
%76 = call i32 @fread(i8* %11, i32 1, i32 1, i32* %75)
br label %77
77: ; preds = %74
%78 = load i32, i32* %13
%79 = add nsw i32 %78, 1
store i32 %79, i32* %13
br label %71
80: ; preds = %71
%81 = load i32*, i32** %9
%82 = call i32 @fread(i8* %12, i32 1, i32 1, i32* %81)
store i32 0, i32* %13
br label %83
83: ; preds = %91, %80
%84 = load i32, i32* %13
%85 = load i8, i8* %12
%86 = zext i8 %85 to i32
%87 = icmp slt i32 %84, %86
br i1 %87, label %88, label %94
88: ; preds = %83
%89 = load i32*, i32** %9
%90 = call i32 @fread(i8* %11, i32 1, i32 1, i32* %89)
br label %91
91: ; preds = %88
%92 = load i32, i32* %13
%93 = add nsw i32 %92, 1
store i32 %93, i32* %13
br label %83
94: ; preds = %83
%95 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%96 = load i32*, i32** %9
%97 = call i32 @fread(i8* %95, i32 1, i32 4, i32* %96)
store i32 %97, i32* %6
br label %119
98: ; preds = %63, %58, %53, %48
%99 = load i32, i32* %7
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %98
%102 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%103 = load i32, i32* @stdout
%104 = call i32 @fwrite(i8* %102, i32 1, i32 1, i32 %103)
br label %105
105: ; preds = %101, %98
%106 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 1
%107 = load i8, i8* %106
%108 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
store i8 %107, i8* %108
%109 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 2
%110 = load i8, i8* %109
%111 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 1
store i8 %110, i8* %111
%112 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 3
%113 = load i8, i8* %112
%114 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 2
store i8 %113, i8* %114
%115 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%116 = getelementptr inbounds i8, i8* %115, i64 3
%117 = load i32*, i32** %9
%118 = call i32 @fread(i8* %116, i32 1, i32 1, i32* %117)
store i32 %118, i32* %6
br label %119
119: ; preds = %105, %94
br label %45
120: ; preds = %45
%121 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%122 = load i32, i32* @stdout
%123 = call i32 @fwrite(i8* %121, i32 1, i32 3, i32 %122)
store i32 0, i32* %3
br label %124
124: ; preds = %120, %35, %25
%125 = load i32, i32* %3
ret i32 %125
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Usage: 'pes2es filename.pes stream_id_header_to_skip'\0A\00"
@.str.2 = [60 x i8] c"Example for audio: 'pes2es filename.pes 192', 192 is 0xc0 \0A\00"
@.str.3 = [59 x i8] c"Example for video: 'pes2es filename.pes 224', 224 is 0xe0\0A\00"
@.str.4 = [20 x i8] c"Can't find file %s\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i8]
%4 = alloca i8
%5 = alloca i8
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = icmp sgt i32 %0, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call zeroext i8 @atoi(i8* %13)
%15 = icmp eq i32* %11, null
br i1 %15, label %23, label %27
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
br label %83
23: ; preds = %8
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %9
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %25)
br label %83
27: ; preds = %8
%28 = call i32 @fread(i8* %6, i32 1, i32 4, i32* %11)
%29 = icmp eq i32 %28, 0
br i1 %29, label %80, label %30
30: ; preds = %27
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
br label %34
34: ; preds = %30, %76
%35 = phi i32 [ 0, %30 ], [ %77, %76 ]
%36 = load i8, i8* %6
%37 = icmp eq i8 %36, 0
%38 = load i8, i8* %31
%39 = icmp eq i8 %38, 0
%40 = select i1 %37, i1 %39, i1 false
%41 = load i8, i8* %32
%42 = icmp eq i8 %41, 1
%43 = select i1 %40, i1 %42, i1 false
%44 = load i8, i8* %33
%45 = icmp eq i8 %44, %14
%46 = select i1 %43, i1 %45, i1 false
br i1 %46, label %47, label %63
47: ; preds = %34
%48 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %11)
%49 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %11)
%50 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %11)
%51 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %11)
%52 = call i32 @fread(i8* %5, i32 1, i32 1, i32* %11)
%53 = load i8, i8* %5
%54 = zext i8 %53 to i32
%55 = icmp eq i8 %53, 0
br i1 %55, label %61, label %56
56: ; preds = %47, %56
%57 = phi i32 [ %59, %56 ], [ 0, %47 ]
%58 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %11)
%59 = add nuw nsw i32 %57, 1
%60 = icmp eq i32 %59, %54
br i1 %60, label %61, label %56
61: ; preds = %56, %47
%62 = call i32 @fread(i8* %6, i32 1, i32 4, i32* %11)
br label %76
63: ; preds = %34
%64 = icmp eq i32 %35, 0
br i1 %64, label %71, label %65
65: ; preds = %63
%66 = load i32, i32* @stdout
%67 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32 %66)
%68 = load i8, i8* %31
%69 = load i8, i8* %32
%70 = load i8, i8* %33
br label %71
71: ; preds = %65, %63
%72 = phi i8 [ %70, %65 ], [ %44, %63 ]
%73 = phi i8 [ %69, %65 ], [ %41, %63 ]
%74 = phi i8 [ %68, %65 ], [ %38, %63 ]
store i8 %74, i8* %6
store i8 %73, i8* %31
store i8 %72, i8* %32
%75 = call i32 @fread(i8* %33, i32 1, i32 1, i32* %11)
br label %76
76: ; preds = %71, %61
%77 = phi i32 [ 1, %61 ], [ %35, %71 ]
%78 = phi i32 [ %62, %61 ], [ %75, %71 ]
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %34
80: ; preds = %76, %27
%81 = load i32, i32* @stdout
%82 = call i32 @fwrite(i8* %6, i32 1, i32 3, i32 %81)
br label %83
83: ; preds = %80, %23, %16
%84 = phi i32 [ 2, %23 ], [ 0, %80 ], [ 2, %16 ]
ret i32 %84
}