#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 ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ EX_IOERR;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ O_RDONLY;
int STDIN_FILENO;
int /*<<< orphan*/ emit_help();
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
int open(char *, int /*<<< orphan*/);
scalar_t__ optind;
int read(int, char *, int);
int /*<<< orphan*/ report(unsigned long, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
scalar_t__ strncmp(char *, char *, size_t);
int main(int argc, char *argv[]) {
  char buf[8192], *fname;
  int ch, fd, previous;
  ssize_t amount;
  unsigned long count = 1;
  setlocale(LC_ALL, "C");
  while ((ch = getopt(argc, argv, "h?")) != -1) {
    switch (ch) {
    case 'h':
    case '?':
    default:
      emit_help();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc == 0 || (argc == 1 && strncmp(*argv, "-", (size_t)2) == 0)) {
    fd = STDIN_FILENO;
    fname = "-";
  } else {
    if ((fd = open(*argv, O_RDONLY)) == -1)
      err(EX_IOERR, "could not open '%s'", *argv);
    fname = *argv;
  }
  if ((amount = read(fd, buf, 1)) != 1)
    err(EX_IOERR, "read() on %s failed", fname);
  previous = buf[0];
  while (1) {
    amount = read(fd, buf, 8192);
    if (amount > 0) {
      for (ssize_t i = 0; i < amount; i++) {
        if (buf[i] != previous) {
          report(count, previous);
          previous = buf[i];
          count = 0;
        }
        count++;
      }
    } else if (amount == 0) {
      break;
    } else if (amount == -1) {
      err(EX_IOERR, "read() on %s failed", fname);
    } else {
      errx(EX_IOERR, "unexpected read() on %s: %ld", fname, amount);
    }
  }
  if (count > 0)
    report(count, previous);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x2030(%rbp)
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0xe2c(%rip),%rsi
call   1080 <setlocale@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe1b(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x201c(%rbp)
cmp    $0xffffffff,%eax
je     123a <main+0x9a>
mov    -0x201c(%rbp),%eax
mov    %eax,-0x2038(%rbp)
sub    $0x3f,%eax
je     1229 <main+0x89>
jmp    1215 <main+0x75>
mov    -0x2038(%rbp),%eax
sub    $0x68,%eax
jne    122e <main+0x8e>
jmp    1229 <main+0x89>
jmp    122e <main+0x8e>
mov    $0x0,%al
call   1040 <emit_help@plt>
jmp    11d9 <main+0x39>
mov    0x2d97(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2d83(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     129a <main+0xfa>
cmpl   $0x1,-0x8(%rbp)
jne    12bc <main+0x11c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd7f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12bc <main+0x11c>
mov    0x2d1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2020(%rbp)
lea    0xd55(%rip),%rax
mov    %rax,-0x2018(%rbp)
jmp    130a <main+0x16a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x2020(%rbp)
cmp    $0xffffffff,%eax
jne    12fc <main+0x15c>
mov    0x2cf9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd10(%rip),%rsi
call   1070 <err@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x2018(%rbp)
mov    -0x2020(%rbp),%edi
lea    -0x2010(%rbp),%rsi
mov    $0x1,%edx
call   1060 <read@plt>
mov    %eax,-0x2028(%rbp)
cmp    $0x1,%eax
je     134c <main+0x1ac>
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
mov    -0x2018(%rbp),%rdx
lea    0xcd4(%rip),%rsi
call   1070 <err@plt>
movsbl -0x2010(%rbp),%eax
mov    %eax,-0x2024(%rbp)
mov    -0x2020(%rbp),%edi
lea    -0x2010(%rbp),%rsi
mov    $0x2000,%edx
call   1060 <read@plt>
mov    %eax,-0x2028(%rbp)
cmpl   $0x0,-0x2028(%rbp)
jle    1417 <main+0x277>
movl   $0x0,-0x2034(%rbp)
mov    -0x2034(%rbp),%eax
cmp    -0x2028(%rbp),%eax
jge    1412 <main+0x272>
movslq -0x2034(%rbp),%rax
movsbl -0x2010(%rbp,%rax,1),%eax
ff
cmp    -0x2024(%rbp),%eax
je     13ec <main+0x24c>
mov    -0x2030(%rbp),%rdi
mov    -0x2024(%rbp),%esi
call   10c0 <report@plt>
movslq -0x2034(%rbp),%rax
movsbl -0x2010(%rbp,%rax,1),%eax
ff
mov    %eax,-0x2024(%rbp)
movq   $0x0,-0x2030(%rbp)
mov    -0x2030(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2030(%rbp)
mov    -0x2034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2034(%rbp)
jmp    138d <main+0x1ed>
jmp    1483 <main+0x2e3>
cmpl   $0x0,-0x2028(%rbp)
jne    1429 <main+0x289>
jmp    1488 <main+0x2e8>
cmpl   $0xffffffff,-0x2028(%rbp)
jne    1457 <main+0x2b7>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
mov    -0x2018(%rbp),%rdx
lea    0xbce(%rip),%rsi
call   1070 <err@plt>
jmp    1479 <main+0x2d9>
mov    0x2b82(%rip),%rax
mov    (%rax),%edi
mov    -0x2018(%rbp),%rdx
mov    -0x2028(%rbp),%ecx
lea    0xbbb(%rip),%rsi
call   1050 <errx@plt>
jmp    147e <main+0x2de>
jmp    1483 <main+0x2e3>
jmp    1359 <main+0x1b9>
cmpq   $0x0,-0x2030(%rbp)
jbe    14a8 <main+0x308>
mov    -0x2030(%rbp),%rdi
mov    -0x2024(%rbp),%esi
call   10c0 <report@plt>
mov    0x2b19(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2008,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xe3a(%rip),%rsi
call   1080 <setlocale@plt>
lea    0xe30(%rip),%rdx
mov    %ebp,%edi
mov    %r15,%rsi
call   10a0 <getopt@plt>
cmp    $0xffffffff,%eax
je     1209 <main+0x69>
lea    0xe1a(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <emit_help@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   10a0 <getopt@plt>
cmp    $0xffffffff,%eax
jne    11f0 <main+0x50>
mov    0x2dc8(%rip),%rax
mov    (%rax),%rbx
sub    %ebx,%ebp
je     1236 <main+0x96>
cmp    $0x1,%ebp
jne    1249 <main+0xa9>
mov    (%r15,%rbx,8),%rdi
lea    0xdde(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1249 <main+0xa9>
mov    0x2d83(%rip),%rax
mov    (%rax),%r14d
lea    0xdbe(%rip),%r15
jmp    1280 <main+0xe0>
mov    (%r15,%rbx,8),%rdi
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    127c <main+0xdc>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
mov    (%r15,%rbx,8),%rdx
lea    0xd90(%rip),%rsi
call   1070 <err@plt>
mov    (%r15,%rbx,8),%r15
mov    %rsp,%rsi
mov    %r14d,%edi
mov    $0x1,%edx
call   1060 <read@plt>
cmp    $0x1,%eax
je     12ad <main+0x10d>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
lea    0xd76(%rip),%rsi
mov    %r15,%rdx
call   1070 <err@plt>
movsbl (%rsp),%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %rsp,%r12
mov    0x2d16(%rip),%r13
jmp    12e3 <main+0x143>
nopl   0x0(%rax)
mov    0x0(%r13),%edi
lea    0xd40(%rip),%rsi
mov    %r15,%rdx
call   1070 <err@plt>
mov    %r14d,%edi
mov    %r12,%rsi
mov    $0x2000,%edx
call   1060 <read@plt>
test   %eax,%eax
jg     1320 <main+0x180>
cmp    $0xffffffff,%eax
je     12d0 <main+0x130>
test   %eax,%eax
je     135a <main+0x1ba>
mov    0x0(%r13),%edi
lea    0xd24(%rip),%rsi
mov    %r15,%rdx
mov    %eax,%ecx
call   1050 <errx@plt>
jmp    12e3 <main+0x143>
nopw   0x0(%rax,%rax,1)
mov    %eax,%r13d
xor    %r12d,%r12d
mov    %ebp,%esi
jmp    134d <main+0x1ad>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10c0 <report@plt>
xor    %ebx,%ebx
mov    %ebp,%esi
add    $0x1,%rbx
add    $0x1,%r12
cmp    %r12,%r13
je     12c0 <main+0x120>
movsbl (%rsp,%r12,1),%ebp
cmp    %ebp,%esi
jne    1330 <main+0x190>
mov    %esi,%ebp
jmp    133c <main+0x19c>
test   %rbx,%rbx
je     1369 <main+0x1c9>
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <report@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [3 x i8] c"h?\00"
@optind = global i64 0
@.str.2 = [2 x i8] c"-\00"
@STDIN_FILENO = global i32 0
@O_RDONLY = global i32 0
@EX_IOERR = global i32 0
@.str.3 = [20 x i8] c"could not open '%s'\00"
@.str.4 = [20 x i8] c"read() on %s failed\00"
@.str.5 = [29 x i8] c"unexpected read() on %s: %ld\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8192 x i8]
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1, i64* %12
%14 = load i32, i32* @LC_ALL
%15 = call i32 @setlocale(i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %26, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %19, i32* %8
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %27
21: ; preds = %16
%22 = load i32, i32* %8
switch i32 %22, label %24 [
i32 104, label %23
i32 63, label %23
]
23: ; preds = %21, %21
br label %24
24: ; preds = %21, %23
%25 = call i32 (...) @emit_help()
br label %26
26: ; preds = %24
br label %16
27: ; preds = %16
%28 = load i64, i64* @optind
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = sub nsw i64 %30, %28
%32 = trunc i64 %31 to i32
store i32 %32, i32* %4
%33 = load i64, i64* @optind
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 %33
store i8** %35, i8*** %5
%36 = load i32, i32* %4
%37 = icmp eq i32 %36, 0
br i1 %37, label %46, label %38
38: ; preds = %27
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %48
41: ; preds = %38
%42 = load i8**, i8*** %5
%43 = load i8*, i8** %42
%44 = call i64 @strncmp(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i64 2)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %41, %27
%47 = load i32, i32* @STDIN_FILENO
store i32 %47, i32* %9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7
br label %62
48: ; preds = %41, %38
%49 = load i8**, i8*** %5
%50 = load i8*, i8** %49
%51 = load i32, i32* @O_RDONLY
%52 = call i32 @open(i8* %50, i32 %51)
store i32 %52, i32* %9
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %59
54: ; preds = %48
%55 = load i32, i32* @EX_IOERR
%56 = load i8**, i8*** %5
%57 = load i8*, i8** %56
%58 = call i32 @err(i32 %55, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %54, %48
%60 = load i8**, i8*** %5
%61 = load i8*, i8** %60
store i8* %61, i8** %7
br label %62
62: ; preds = %59, %46
%63 = load i32, i32* %9
%64 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%65 = call i32 @read(i32 %63, i8* %64, i32 1)
store i32 %65, i32* %11
%66 = icmp ne i32 %65, 1
br i1 %66, label %67, label %71
67: ; preds = %62
%68 = load i32, i32* @EX_IOERR
%69 = load i8*, i8** %7
%70 = call i32 @err(i32 %68, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %67, %62
%72 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
store i32 %74, i32* %10
br label %75
75: ; preds = %71, %128
%76 = load i32, i32* %9
%77 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%78 = call i32 @read(i32 %76, i8* %77, i32 8192)
store i32 %78, i32* %11
%79 = load i32, i32* %11
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %110
81: ; preds = %75
store i32 0, i32* %13
br label %82
82: ; preds = %106, %81
%83 = load i32, i32* %13
%84 = load i32, i32* %11
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %109
86: ; preds = %82
%87 = load i32, i32* %13
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = load i32, i32* %10
%93 = icmp ne i32 %91, %92
br i1 %93, label %94, label %103
94: ; preds = %86
%95 = load i64, i64* %12
%96 = load i32, i32* %10
%97 = call i32 @report(i64 %95, i32 %96)
%98 = load i32, i32* %13
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
store i32 %102, i32* %10
store i64 0, i64* %12
br label %103
103: ; preds = %94, %86
%104 = load i64, i64* %12
%105 = add i64 %104, 1
store i64 %105, i64* %12
br label %106
106: ; preds = %103
%107 = load i32, i32* %13
%108 = add nsw i32 %107, 1
store i32 %108, i32* %13
br label %82
109: ; preds = %82
br label %128
110: ; preds = %75
%111 = load i32, i32* %11
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %110
br label %129
114: ; preds = %110
%115 = load i32, i32* %11
%116 = icmp eq i32 %115, -1
br i1 %116, label %117, label %121
117: ; preds = %114
%118 = load i32, i32* @EX_IOERR
%119 = load i8*, i8** %7
%120 = call i32 @err(i32 %118, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %119)
br label %126
121: ; preds = %114
%122 = load i32, i32* @EX_IOERR
%123 = load i8*, i8** %7
%124 = load i32, i32* %11
%125 = call i32 @errx(i32 %122, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %123, i32 %124)
br label %126
126: ; preds = %121, %117
br label %127
127: ; preds = %126
br label %128
128: ; preds = %127, %109
br label %75
129: ; preds = %113
%130 = load i64, i64* %12
%131 = icmp ugt i64 %130, 0
br i1 %131, label %132, label %136
132: ; preds = %129
%133 = load i64, i64* %12
%134 = load i32, i32* %10
%135 = call i32 @report(i64 %133, i32 %134)
br label %136
136: ; preds = %132, %129
%137 = load i32, i32* @EXIT_SUCCESS
%138 = call i32 @exit(i32 %137)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [3 x i8] c"h?\00"
@optind = global i64 0
@.str.2 = [2 x i8] c"-\00"
@STDIN_FILENO = global i32 0
@O_RDONLY = global i32 0
@EX_IOERR = global i32 0
@.str.3 = [20 x i8] c"could not open '%s'\00"
@.str.4 = [20 x i8] c"read() on %s failed\00"
@.str.5 = [29 x i8] c"unexpected read() on %s: %ld\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %13, label %9
9: ; preds = %2, %9
%10 = tail call i32 (...) @emit_help()
%11 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %9
13: ; preds = %9, %2
%14 = load i64, i64* @optind
%15 = trunc i64 %14 to i32
%16 = sub i32 %0, %15
%17 = getelementptr inbounds i8*, i8** %1, i64 %14
switch i32 %16, label %24 [
i32 0, label %22
i32 1, label %18
]
18: ; preds = %13
%19 = load i8*, i8** %17
%20 = tail call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i64 2)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %13, %18
%23 = load i32, i32* @STDIN_FILENO
br label %35
24: ; preds = %13, %18
%25 = load i8*, i8** %17
%26 = load i32, i32* @O_RDONLY
%27 = tail call i32 @open(i8* %25, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = load i32, i32* @EX_IOERR
%31 = load i8*, i8** %17
%32 = tail call i32 @err(i32 %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %29, %24
%34 = load i8*, i8** %17
br label %35
35: ; preds = %33, %22
%36 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %22 ], [ %34, %33 ]
%37 = phi i32 [ %23, %22 ], [ %27, %33 ]
%38 = call i32 @read(i32 %37, i8* %4, i32 1)
%39 = icmp eq i32 %38, 1
br i1 %39, label %43, label %40
40: ; preds = %35
%41 = load i32, i32* @EX_IOERR
%42 = tail call i32 @err(i32 %41, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %36)
br label %43
43: ; preds = %40, %35
%44 = load i8, i8* %4
%45 = sext i8 %44 to i32
br label %46
46: ; preds = %64, %43
%47 = phi i32 [ %45, %43 ], [ %65, %64 ]
%48 = phi i64 [ 1, %43 ], [ %67, %64 ]
br label %49
49: ; preds = %77, %46
%50 = call i32 @read(i32 %37, i8* %4, i32 8192)
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %70
52: ; preds = %49
%53 = zext i32 %50 to i64
br label %54
54: ; preds = %52, %64
%55 = phi i64 [ 0, %52 ], [ %68, %64 ]
%56 = phi i64 [ %48, %52 ], [ %67, %64 ]
%57 = phi i32 [ %47, %52 ], [ %65, %64 ]
%58 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %55
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %57, %60
br i1 %61, label %64, label %62
62: ; preds = %54
%63 = tail call i32 @report(i64 %56, i32 %57)
br label %64
64: ; preds = %62, %54
%65 = phi i32 [ %60, %62 ], [ %57, %54 ]
%66 = phi i64 [ 0, %62 ], [ %56, %54 ]
%67 = add i64 %66, 1
%68 = add nuw nsw i64 %55, 1
%69 = icmp eq i64 %68, %53
br i1 %69, label %46, label %54
70: ; preds = %49
switch i32 %50, label %74 [
i32 0, label %78
i32 -1, label %71
]
71: ; preds = %70
%72 = load i32, i32* @EX_IOERR
%73 = tail call i32 @err(i32 %72, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %36)
br label %77
74: ; preds = %70
%75 = load i32, i32* @EX_IOERR
%76 = tail call i32 @errx(i32 %75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* %36, i32 %50)
br label %77
77: ; preds = %74, %71
br label %49
78: ; preds = %70
%79 = icmp eq i64 %48, 0
br i1 %79, label %82, label %80
80: ; preds = %78
%81 = tail call i32 @report(i64 %48, i32 %47)
br label %82
82: ; preds = %80, %78
%83 = load i32, i32* @EXIT_SUCCESS
%84 = tail call i32 @exit(i32 %83)
unreachable
}