#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*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, long, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, long, int /*<<< orphan*/ *);
scalar_t__ malloc(long);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int main() {
  FILE *fin, *fout;
  long dataSize;
  unsigned char *data;
  int i, j, max;
  int freqs[4][256];
  int key[4];
  char strKey[5];
  fin = fopen("crypt.bin", "rb");
  fseek(fin, 0, SEEK_END);
  dataSize = ftell(fin);
  rewind(fin);
  data = (unsigned char *)malloc(dataSize);
  fread(data, dataSize, 1, fin);
  fclose(fin);
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 256; j++) {
      freqs[i][j] = 0;
    }
  }
  for (i = 0; i < 4; i++)
    key[i] = 0;
  for (i = 0; i < dataSize; i++) {
    j = i % 4;
    freqs[j][data[i]]++;
    if (freqs[j][data[i]] > freqs[j][key[j]])
      key[j] = data[i];
  }
  for (i = 0; i < 4; i++) {
    key[i] = key[i] ^ 101;
    strKey[i] = (char)key[i];
  }
  strKey[4] = 0;
  for (i = 0; i < dataSize; i++) {
    j = i % 4;
    data[i] ^= key[j];
  }
  fout = fopen("crypt_plain.txt", "wb");
  fwrite(data, 1, dataSize, fout);
  fclose(fout);
  printf("key: %s\nplain text: crypt_plain.txt\n", strKey);
  free(data);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe47(%rip),%rdi
lea    0xe4a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e14(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x20(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fread@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    1282 <main+0xe2>
movl   $0x0,-0x30(%rbp)
cmpl   $0x100,-0x30(%rbp)
jge    126f <main+0xcf>
movslq -0x2c(%rbp),%rcx
lea    -0x1040(%rbp),%rax
shl    $0xa,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1237 <main+0x97>
jmp    1274 <main+0xd4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1226 <main+0x86>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    12b0 <main+0x110>
movslq -0x2c(%rbp),%rax
movl   $0x0,-0x1050(%rbp,%rax,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1289 <main+0xe9>
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    136c <main+0x1cc>
mov    -0x2c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
movslq -0x30(%rbp),%rcx
lea    -0x1040(%rbp),%rax
shl    $0xa,%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0x30(%rbp),%rcx
lea    -0x1040(%rbp),%rax
shl    $0xa,%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
mov    (%rax,%rcx,4),%eax
movslq -0x30(%rbp),%rdx
lea    -0x1040(%rbp),%rcx
shl    $0xa,%rdx
add    %rdx,%rcx
movslq -0x30(%rbp),%rdx
movslq -0x1050(%rbp,%rdx,4),%rdx
ff
cmp    (%rcx,%rdx,4),%eax
jle    1359 <main+0x1b9>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movslq -0x30(%rbp),%rax
mov    %ecx,-0x1050(%rbp,%rax,4)
jmp    135e <main+0x1be>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12b7 <main+0x117>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    13bc <main+0x21c>
movslq -0x2c(%rbp),%rax
mov    -0x1050(%rbp,%rax,4),%ecx
xor    $0x65,%ecx
movslq -0x2c(%rbp),%rax
mov    %ecx,-0x1050(%rbp,%rax,4)
movslq -0x2c(%rbp),%rax
mov    -0x1050(%rbp,%rax,4),%eax
mov    %al,%cl
movslq -0x2c(%rbp),%rax
mov    %cl,-0x1055(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1373 <main+0x1d3>
movb   $0x0,-0x1051(%rbp)
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1410 <main+0x270>
mov    -0x2c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x30(%rbp)
movslq -0x30(%rbp),%rax
mov    -0x1050(%rbp,%rax,4),%esi
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13ca <main+0x22a>
lea    0xbf6(%rip),%rdi
lea    0xbff(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   10c0 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x1055(%rbp),%rsi
lea    0xbcc(%rip),%rdi
call   1060 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x1060,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1028,%rsp
lea    0xe5b(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
call   1090 <ftell@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1070 <rewind@plt>
mov    %r14,%rdi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
lea    0x20(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   1080 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
test   %r14,%r14
jle    12ce <main+0x11e>
xor    %eax,%eax
jmp    1259 <main+0xa9>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rax,%r14
je     128a <main+0xda>
mov    %eax,%ecx
and    $0x3,%ecx
movzbl (%r12,%rax,1),%edx
mov    %rcx,%rsi
shl    $0xa,%rsi
add    %rsp,%rsi
add    $0x20,%rsi
mov    (%rsi,%rdx,4),%edi
lea    0x1(%rdi),%ebx
mov    %ebx,(%rsi,%rdx,4)
movslq 0x10(%rsp,%rcx,4),%rbx
cmp    (%rsi,%rbx,4),%edi
jl     1250 <main+0xa0>
mov    %edx,0x10(%rsp,%rcx,4)
jmp    1250 <main+0xa0>
movdqa 0x10(%rsp),%xmm0
pxor   0xd68(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
pand   0xd6a(%rip),%xmm0
packuswb %xmm0,%xmm0
packuswb %xmm0,%xmm0
movd   %xmm0,0x8(%rsp)
movb   $0x0,0xc(%rsp)
test   %r14,%r14
jle    1327 <main+0x177>
test   $0x1,%r14b
jne    12eb <main+0x13b>
xor    %eax,%eax
cmp    $0x1,%r14
jne    1300 <main+0x150>
jmp    1327 <main+0x177>
movdqa 0xd2a(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
movl   $0x65656565,0x8(%rsp)
65
movb   $0x0,0xc(%rsp)
jmp    1327 <main+0x177>
mov    0x10(%rsp),%al
xor    %al,(%r12)
mov    $0x1,%eax
cmp    $0x1,%r14
je     1327 <main+0x177>
xchg   %ax,%ax
mov    %eax,%ecx
and    $0x3,%ecx
movzbl 0x10(%rsp,%rcx,4),%ecx
xor    %cl,(%r12,%rax,1)
lea    0x1(%rax),%ecx
and    $0x3,%ecx
movzbl 0x10(%rsp,%rcx,4),%ecx
xor    %cl,0x1(%r12,%rax,1)
add    $0x2,%rax
cmp    %rax,%r14
jne    1300 <main+0x150>
lea    0xcff(%rip),%rdi
lea    0xd08(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
lea    0xce1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <printf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"crypt.bin\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [16 x i8] c"crypt_plain.txt\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [37 x i8] c"key: %s\0Aplain text: crypt_plain.txt\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x [256 x i32]]
%10 = alloca [4 x i32]
%11 = alloca [5 x i8]
store i32 0, i32* %1
%12 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = load i32, i32* @SEEK_END
%15 = call i32 @fseek(i32* %13, i32 0, i32 %14)
%16 = load i32*, i32** %2
%17 = call i64 @ftell(i32* %16)
store i64 %17, i64* %4
%18 = load i32*, i32** %2
%19 = call i32 @rewind(i32* %18)
%20 = load i64, i64* %4
%21 = call i64 @malloc(i64 %20)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %5
%23 = load i8*, i8** %5
%24 = load i64, i64* %4
%25 = load i32*, i32** %2
%26 = call i32 @fread(i8* %23, i64 %24, i32 1, i32* %25)
%27 = load i32*, i32** %2
%28 = call i32 @fclose(i32* %27)
store i32 0, i32* %6
br label %29
29: ; preds = %47, %0
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 4
br i1 %31, label %32, label %50
32: ; preds = %29
store i32 0, i32* %7
br label %33
33: ; preds = %43, %32
%34 = load i32, i32* %7
%35 = icmp slt i32 %34, 256
br i1 %35, label %36, label %46
36: ; preds = %33
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %9, i64 0, i64 %38
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [256 x i32], [256 x i32]* %39, i64 0, i64 %41
store i32 0, i32* %42
br label %43
43: ; preds = %36
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %33
46: ; preds = %33
br label %47
47: ; preds = %46
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
br label %29
50: ; preds = %29
store i32 0, i32* %6
br label %51
51: ; preds = %58, %50
%52 = load i32, i32* %6
%53 = icmp slt i32 %52, 4
br i1 %53, label %54, label %61
54: ; preds = %51
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %56
store i32 0, i32* %57
br label %58
58: ; preds = %54
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %51
61: ; preds = %51
store i32 0, i32* %6
br label %62
62: ; preds = %115, %61
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = load i64, i64* %4
%66 = icmp slt i64 %64, %65
br i1 %66, label %67, label %118
67: ; preds = %62
%68 = load i32, i32* %6
%69 = srem i32 %68, 4
store i32 %69, i32* %7
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %9, i64 0, i64 %71
%73 = load i8*, i8** %5
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %73, i64 %75
%77 = load i8, i8* %76
%78 = zext i8 %77 to i64
%79 = getelementptr inbounds [256 x i32], [256 x i32]* %72, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = add nsw i32 %80, 1
store i32 %81, i32* %79
%82 = load i32, i32* %7
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %9, i64 0, i64 %83
%85 = load i8*, i8** %5
%86 = load i32, i32* %6
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = load i8, i8* %88
%90 = zext i8 %89 to i64
%91 = getelementptr inbounds [256 x i32], [256 x i32]* %84, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %9, i64 0, i64 %94
%96 = load i32, i32* %7
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %97
%99 = load i32, i32* %98
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [256 x i32], [256 x i32]* %95, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = icmp sgt i32 %92, %102
br i1 %103, label %104, label %114
104: ; preds = %67
%105 = load i8*, i8** %5
%106 = load i32, i32* %6
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %105, i64 %107
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %112
store i32 %110, i32* %113
br label %114
114: ; preds = %104, %67
br label %115
115: ; preds = %114
%116 = load i32, i32* %6
%117 = add nsw i32 %116, 1
store i32 %117, i32* %6
br label %62
118: ; preds = %62
store i32 0, i32* %6
br label %119
119: ; preds = %139, %118
%120 = load i32, i32* %6
%121 = icmp slt i32 %120, 4
br i1 %121, label %122, label %142
122: ; preds = %119
%123 = load i32, i32* %6
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = xor i32 %126, 101
%128 = load i32, i32* %6
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %129
store i32 %127, i32* %130
%131 = load i32, i32* %6
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %132
%134 = load i32, i32* %133
%135 = trunc i32 %134 to i8
%136 = load i32, i32* %6
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 %137
store i8 %135, i8* %138
br label %139
139: ; preds = %122
%140 = load i32, i32* %6
%141 = add nsw i32 %140, 1
store i32 %141, i32* %6
br label %119
142: ; preds = %119
%143 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 4
store i8 0, i8* %143
store i32 0, i32* %6
br label %144
144: ; preds = %164, %142
%145 = load i32, i32* %6
%146 = sext i32 %145 to i64
%147 = load i64, i64* %4
%148 = icmp slt i64 %146, %147
br i1 %148, label %149, label %167
149: ; preds = %144
%150 = load i32, i32* %6
%151 = srem i32 %150, 4
store i32 %151, i32* %7
%152 = load i32, i32* %7
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %153
%155 = load i32, i32* %154
%156 = load i8*, i8** %5
%157 = load i32, i32* %6
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %156, i64 %158
%160 = load i8, i8* %159
%161 = zext i8 %160 to i32
%162 = xor i32 %161, %155
%163 = trunc i32 %162 to i8
store i8 %163, i8* %159
br label %164
164: ; preds = %149
%165 = load i32, i32* %6
%166 = add nsw i32 %165, 1
store i32 %166, i32* %6
br label %144
167: ; preds = %144
%168 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %168, i32** %3
%169 = load i8*, i8** %5
%170 = load i64, i64* %4
%171 = load i32*, i32** %3
%172 = call i32 @fwrite(i8* %169, i32 1, i64 %170, i32* %171)
%173 = load i32*, i32** %3
%174 = call i32 @fclose(i32* %173)
%175 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%176 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %175)
%177 = load i8*, i8** %5
%178 = call i32 @free(i8* %177)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"crypt.bin\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [16 x i8] c"crypt_plain.txt\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [37 x i8] c"key: %s\0Aplain text: crypt_plain.txt\0A\00"
define i32 @main() {
%1 = alloca [4 x [256 x i32]]
%2 = bitcast [4 x [256 x i32]]* %1 to i8*
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @SEEK_END
%9 = tail call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = tail call i64 @ftell(i32* %7)
%11 = tail call i32 @rewind(i32* %7)
%12 = tail call i64 @malloc(i64 %10)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @fread(i8* %13, i64 %10, i32 1, i32* %7)
%15 = tail call i32 @fclose(i32* %7)
%16 = icmp sgt i64 %10, 0
br i1 %16, label %35, label %74
17: ; preds = %52
%18 = load <4 x i32>, <4 x i32>* %3
%19 = xor <4 x i32> %18, <i32 101, i32 101, i32 101, i32 101>
store <4 x i32> %19, <4 x i32>* %3
%20 = trunc <4 x i32> %19 to <4 x i8>
%21 = bitcast [5 x i8]* %5 to <4 x i8>*
store <4 x i8> %20, <4 x i8>* %21
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
store i8 0, i8* %22
br i1 %16, label %23, label %77
23: ; preds = %17
%24 = and i64 %10, 1
%25 = icmp eq i64 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
%28 = load i32, i32* %27
%29 = load i8, i8* %13
%30 = trunc i32 %28 to i8
%31 = xor i8 %29, %30
store i8 %31, i8* %13
br label %32
32: ; preds = %26, %23
%33 = phi i64 [ 0, %23 ], [ 1, %26 ]
%34 = icmp eq i64 %10, 1
br i1 %34, label %77, label %55
35: ; preds = %0, %52
%36 = phi i64 [ %53, %52 ], [ 0, %0 ]
%37 = and i64 %36, 3
%38 = getelementptr inbounds i8, i8* %13, i64 %36
%39 = load i8, i8* %38
%40 = zext i8 %39 to i64
%41 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %1, i64 0, i64 %37, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
%44 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 %37
%45 = load i32, i32* %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4 x [256 x i32]], [4 x [256 x i32]]* %1, i64 0, i64 %37, i64 %46
%48 = load i32, i32* %47
%49 = icmp slt i32 %42, %48
br i1 %49, label %52, label %50
50: ; preds = %35
%51 = zext i8 %39 to i32
store i32 %51, i32* %44
br label %52
52: ; preds = %35, %50
%53 = add nuw nsw i64 %36, 1
%54 = icmp eq i64 %53, %10
br i1 %54, label %17, label %35
55: ; preds = %32, %55
%56 = phi i64 [ %72, %55 ], [ %33, %32 ]
%57 = and i64 %56, 3
%58 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = getelementptr inbounds i8, i8* %13, i64 %56
%61 = load i8, i8* %60
%62 = trunc i32 %59 to i8
%63 = xor i8 %61, %62
store i8 %63, i8* %60
%64 = add nuw nsw i64 %56, 1
%65 = and i64 %64, 3
%66 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = getelementptr inbounds i8, i8* %13, i64 %64
%69 = load i8, i8* %68
%70 = trunc i32 %67 to i8
%71 = xor i8 %69, %70
store i8 %71, i8* %68
%72 = add nuw nsw i64 %56, 2
%73 = icmp eq i64 %72, %10
br i1 %73, label %77, label %55
74: ; preds = %0
store <4 x i32> <i32 101, i32 101, i32 101, i32 101>, <4 x i32>* %3
%75 = bitcast [5 x i8]* %5 to <4 x i8>*
store <4 x i8> <i8 101, i8 101, i8 101, i8 101>, <4 x i8>* %75
%76 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
store i8 0, i8* %76
br label %77
77: ; preds = %32, %55, %74, %17
%78 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%79 = tail call i32 @fwrite(i8* %13, i32 1, i64 %10, i32* %78)
%80 = tail call i32 @fclose(i32* %78)
%81 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%82 = call i32 @free(i8* %13)
ret i32 0
}