#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int addcr(unsigned char *p0, unsigned char **pname) {
  static unsigned char namebuf0[1024];
  unsigned char *s, *t = namebuf0, *p1, *name = *pname, c, flag;
  FILE *fp;
  while ((*t++ = *name++) > ' ')
    ;
  t[-1] = '\0';
  fp = fopen((char *)namebuf0, "rb");
  if (fp == NULL)
    goto error;
  p1 = p0 + fread(p0, 1, (32 * 1024 * 1024) / 2, fp);
  fclose(fp);
  if (p1 - p0 == (32 * 1024 * 1024) / 2)
    goto error;
  flag = 0;
  s = p0;
  t = p0 + (32 * 1024 * 1024) / 2;
  while (s < p1) {
    c = *s++;
    if (c >= ' ' || c == '\t') {
      *t++ = c;
      continue;
    }
    if (c == '\r') {
      *t++ = c;
      *t++ = '\n';
      if (s < p1 && *s == '\n') {
        s++;
        continue;
      }
      flag = 1;
      continue;
    }
    if (c == '\n') {
      *t++ = '\r';
      *t++ = '\n';
      flag = 1;
      continue;
    }
  }
  if (flag == 0)
    fprintf(stdout, "addcr:skip -- \"%s\".\n", namebuf0);
  else {
    fp = fopen((char *)namebuf0, "wb");
    if (fp == NULL)
      goto error;
    if (fwrite(p0 + (32 * 1024 * 1024) / 2, 1,
               t - (p0 + (32 * 1024 * 1024) / 2),
               fp) != t - (p0 + (32 * 1024 * 1024) / 2))
      goto error2;
    fclose(fp);
    fprintf(stdout, "addcr:add %6ld[bytes] -- \"%s\".\n",
            t - s - (32 * 1024 * 1024) / 2, namebuf0);
  }
  *pname = name;
  return 0;
error2:
  fclose(fp);
error:
  fprintf(stderr, "addcr:error -- \"%s\".\n", namebuf0);
  return 1;
}


x86 assembly (clang, -O0):
<addcr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0x2ef9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
mov    (%rax),%al
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %al,(%rcx)
movzbl %al,%eax
cmp    $0x20,%eax
jle    11a9 <addcr+0x59>
jmp    1176 <addcr+0x26>
mov    -0x28(%rbp),%rax
movb   $0x0,-0x1(%rax)
lea    0x2ea8(%rip),%rdi
lea    0xe41(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    11d8 <addcr+0x88>
jmp    1444 <addcr+0x2f4>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x1,%esi
mov    $0x1000000,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x1000000,%rax
jne    122c <addcr+0xdc>
jmp    1444 <addcr+0x2f4>
movb   $0x0,-0x3a(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1000000,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1345 <addcr+0x1f5>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x39(%rbp)
movzbl -0x39(%rbp),%eax
cmp    $0x20,%eax
jge    1282 <addcr+0x132>
movzbl -0x39(%rbp),%eax
cmp    $0x9,%eax
jne    129b <addcr+0x14b>
mov    -0x39(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    1246 <addcr+0xf6>
movzbl -0x39(%rbp),%eax
cmp    $0xd,%eax
jne    1306 <addcr+0x1b6>
mov    -0x39(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0xa,(%rax)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    12fd <addcr+0x1ad>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
jne    12fd <addcr+0x1ad>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1246 <addcr+0xf6>
movb   $0x1,-0x3a(%rbp)
jmp    1246 <addcr+0xf6>
movzbl -0x39(%rbp),%eax
cmp    $0xa,%eax
jne    1340 <addcr+0x1f0>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0xd,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0xa,(%rax)
movb   $0x1,-0x3a(%rbp)
jmp    1246 <addcr+0xf6>
jmp    1246 <addcr+0xf6>
movzbl -0x3a(%rbp),%eax
cmp    $0x0,%eax
jne    1375 <addcr+0x225>
mov    0x2c7f(%rip),%rax
mov    (%rax),%edi
lea    0xca1(%rip),%rsi
lea    0x2cf7(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1424 <addcr+0x2d4>
lea    0x2ce4(%rip),%rdi
lea    0xc95(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    139c <addcr+0x24c>
jmp    1444 <addcr+0x2f4>
mov    -0x10(%rbp),%rdi
add    $0x1000000,%rdi
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1000000,%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    -0x48(%rbp),%rcx
mov    $0x1,%esi
call   1070 <fwrite@plt>
cltq
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rdx
add    $0x1000000,%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
je     13eb <addcr+0x29b>
jmp    143b <addcr+0x2eb>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2bdd(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
sub    %rax,%rdx
sub    $0x1000000,%rdx
lea    0xc05(%rip),%rsi
lea    0x2c43(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1469 <addcr+0x319>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    0xbe7(%rip),%rsi
lea    0x2c05(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addcr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r13
mov    (%rsi),%r12
lea    0x2ef5(%rip),%rax
nopl   0x0(%rax,%rax,1)
movzbl (%r12),%ecx
add    $0x1,%r12
mov    %cl,(%rax)
add    $0x1,%rax
cmp    $0x20,%cl
ja     1170 <addcr+0x20>
movb   $0x0,-0x1(%rax)
lea    0x2ed1(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     11ca <addcr+0x7a>
mov    %rax,%rbx
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1000000,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
cmp    $0x1000000,%ebp
jne    11f2 <addcr+0xa2>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
lea    0x2e7f(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    1333 <addcr+0x1e3>
movslq %ebp,%rax
add    %r13,%rax
lea    0x1000000(%r13),%rbp
mov    $0x1,%cl
mov    %rbp,%r15
mov    %r15,%rbx
sub    %r13,%rbx
add    $0xffffffffff000000,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %rax,%r13
jae    129f <addcr+0x14f>
movzbl 0x0(%r13),%edx
cmp    $0x1f,%dl
ja     1270 <addcr+0x120>
cmp    $0x9,%dl
je     1270 <addcr+0x120>
add    $0x1,%r13
cmp    $0xa,%dl
je     1280 <addcr+0x130>
add    $0xffffffffffffffff,%rbx
cmp    $0xd,%dl
jne    1220 <addcr+0xd0>
movw   $0xa0d,(%r15)
add    $0x2,%r15
cmp    %rax,%r13
jae    1291 <addcr+0x141>
cmpb   $0xa,0x0(%r13)
jne    1298 <addcr+0x148>
add    $0x1,%r13
jmp    1204 <addcr+0xb4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %dl,(%r15)
add    $0x1,%r15
add    $0x1,%r13
jmp    1204 <addcr+0xb4>
nopl   (%rax)
movw   $0xa0d,(%r15)
add    $0x2,%r15
xor    %ecx,%ecx
jmp    1204 <addcr+0xb4>
xor    %ecx,%ecx
jmp    1204 <addcr+0xb4>
xor    %ecx,%ecx
jmp    1204 <addcr+0xb4>
test   $0x1,%cl
je     12c4 <addcr+0x174>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
lea    0xd4f(%rip),%rsi
lea    0x2da5(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    132e <addcr+0x1de>
lea    0x2d95(%rip),%rdi
lea    0xd46(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     11ca <addcr+0x7a>
mov    %rax,%r13
sub    %rbp,%r15
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    %rax,%rcx
call   1070 <fwrite@plt>
movslq %eax,%rbp
mov    %r13,%rdi
call   1040 <fclose@plt>
cmp    %rbp,%r15
jne    11ca <addcr+0x7a>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xcfe(%rip),%rsi
lea    0x2d3c(%rip),%rcx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %r12,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@addcr.namebuf0 = internal global [1024 x i8] zeroinitializer
@.str = [3 x i8] c"rb\00"
@stdout = global i32 0
@.str.1 = [21 x i8] c"addcr:skip -- \22%s\22.\0A\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [32 x i8] c"addcr:add %6ld[bytes] -- \22%s\22.\0A\00"
@stderr = global i32 0
@.str.4 = [22 x i8] c"addcr:error -- \22%s\22.\0A\00"
define i32 @addcr(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0), %2 ], [ %9, %4 ]
%6 = phi i8* [ %3, %2 ], [ %7, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = icmp ugt i8 %8, 32
br i1 %10, label %4, label %11
11: ; preds = %4
store i8 0, i8* %5
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %81, label %14
14: ; preds = %11
%15 = tail call i32 @fread(i8* %0, i32 1, i32 16777216, i32* %12)
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = tail call i32 @fclose(i32* %12)
%19 = icmp eq i32 %15, 16777216
br i1 %19, label %81, label %20
20: ; preds = %14
%21 = getelementptr inbounds i8, i8* %0, i64 16777216
br label %22
22: ; preds = %56, %20
%23 = phi i8* [ %21, %20 ], [ %57, %56 ]
%24 = phi i8* [ %0, %20 ], [ %33, %56 ]
%25 = phi i1 [ true, %20 ], [ false, %56 ]
br label %26
26: ; preds = %40, %22
%27 = phi i8* [ %23, %22 ], [ %41, %40 ]
%28 = phi i8* [ %24, %22 ], [ %42, %40 ]
br label %29
29: ; preds = %26, %43
%30 = phi i8* [ %33, %43 ], [ %28, %26 ]
%31 = icmp ult i8* %30, %17
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = getelementptr inbounds i8, i8* %30, i64 1
%34 = load i8, i8* %30
%35 = icmp ugt i8 %34, 31
%36 = icmp eq i8 %34, 9
%37 = or i1 %35, %36
br i1 %37, label %38, label %43
38: ; preds = %32
%39 = getelementptr inbounds i8, i8* %27, i64 1
store i8 %34, i8* %27
br label %40
40: ; preds = %38, %51
%41 = phi i8* [ %46, %51 ], [ %39, %38 ]
%42 = phi i8* [ %52, %51 ], [ %33, %38 ]
br label %26
43: ; preds = %32
switch i8 %34, label %29 [
i8 13, label %44
i8 10, label %53
]
44: ; preds = %43
%45 = getelementptr inbounds i8, i8* %27, i64 1
store i8 13, i8* %27
%46 = getelementptr inbounds i8, i8* %27, i64 2
store i8 10, i8* %45
%47 = icmp ult i8* %33, %17
br i1 %47, label %48, label %56
48: ; preds = %44
%49 = load i8, i8* %33
%50 = icmp eq i8 %49, 10
br i1 %50, label %51, label %56
51: ; preds = %48
%52 = getelementptr inbounds i8, i8* %30, i64 2
br label %40
53: ; preds = %43
%54 = getelementptr inbounds i8, i8* %27, i64 1
store i8 13, i8* %27
%55 = getelementptr inbounds i8, i8* %27, i64 2
store i8 10, i8* %54
br label %56
56: ; preds = %48, %44, %53
%57 = phi i8* [ %55, %53 ], [ %46, %44 ], [ %46, %48 ]
br label %22
58: ; preds = %29
br i1 %25, label %59, label %62
59: ; preds = %58
%60 = load i32, i32* @stdout
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0))
br label %80
62: ; preds = %58
%63 = tail call i32* @fopen(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%64 = icmp eq i32* %63, null
br i1 %64, label %81, label %65
65: ; preds = %62
%66 = ptrtoint i8* %27 to i64
%67 = ptrtoint i8* %21 to i64
%68 = sub i64 %66, %67
%69 = trunc i64 %68 to i32
%70 = tail call i32 @fwrite(i8* %21, i32 1, i32 %69, i32* %63)
%71 = sext i32 %70 to i64
%72 = icmp eq i64 %68, %71
%73 = tail call i32 @fclose(i32* %63)
br i1 %72, label %74, label %81
74: ; preds = %65
%75 = load i32, i32* @stdout
%76 = ptrtoint i8* %30 to i64
%77 = add i64 %66, -16777216
%78 = sub i64 %77, %76
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i64 %78, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0))
br label %80
80: ; preds = %74, %59
store i8* %7, i8** %1
br label %84
81: ; preds = %65, %62, %14, %11
%82 = load i32, i32* @stderr
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @addcr.namebuf0, i64 0, i64 0))
br label %84
84: ; preds = %81, %80
%85 = phi i32 [ 1, %81 ], [ 0, %80 ]
ret i32 %85
}