#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_SET;
int /*<<< orphan*/ die(char *, char *, ...);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned char *readRotateXOR(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void unpackItems() {
  FILE *file;
  FILE *out;
  char *filename;
  char outFilename[16];
  int fileNo;
  unsigned char *data;
  unsigned char magic[4];
  long game1Offsets[] = {0x265cb, 0x268c9, 0x26bc7};
  long game2Offsets[] = {0x29dcd};
  int id;
  long offset;
  long *offsets;
  for (fileNo = 0; fileNo < 2; fileNo++) {
    filename = fileNo ? "game2" : "game1";
    offsets = fileNo ? game2Offsets : game1Offsets;
    file = fopen(filename, "rb");
    if (!file)
      die("Unable to open %s: %s\n", filename, strerror(errno));
    for (id = 0; id < (fileNo ? 1 : 3); id++) {
      offset = offsets[id];
      fseek(file, offset, SEEK_SET);
      fread(magic, 1, 4, file);
      if (magic[0] != 'm' || magic[1] != 's' || magic[2] != 'q')
        die("Invalid file: %s\n", filename);
      sprintf(outFilename, "itm%i", fileNo ? id + 4 : id);
      out = fopen(outFilename, "wb");
      data = readRotateXOR(file, 760, 760);
      fwrite(data, 1, 760, out);
      free(data);
      fclose(out);
    }
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<unpackItems>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0xe4e(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe48(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe45(%rip),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    13dc <unpackItems+0x23c>
mov    -0x34(%rbp),%edx
lea    0xe34(%rip),%rax
lea    0xe27(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     121e <unpackItems+0x7e>
lea    -0x68(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    1229 <unpackItems+0x89>
lea    -0x60(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xded(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1283 <unpackItems+0xe3>
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x90(%rbp),%rsi
mov    %eax,%edx
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1090 <die@plt>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    -0x34(%rbp),%esi
mov    $0x3,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jge    13c5 <unpackItems+0x225>
mov    -0x80(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    0x2d11(%rip),%rax
mov    (%rax),%edx
call   1070 <fseek@plt>
lea    -0x44(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fread@plt>
movzbl -0x44(%rbp),%eax
cmp    $0x6d,%eax
jne    130c <unpackItems+0x16c>
movzbl -0x43(%rbp),%eax
cmp    $0x73,%eax
jne    130c <unpackItems+0x16c>
movzbl -0x42(%rbp),%eax
cmp    $0x71,%eax
je     131e <unpackItems+0x17e>
mov    -0x18(%rbp),%rsi
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1090 <die@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x98(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1344 <unpackItems+0x1a4>
mov    -0x6c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x9c(%rbp)
jmp    134d <unpackItems+0x1ad>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0x9c(%rbp),%edx
lea    0xcf7(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
lea    0xced(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f8,%edx
mov    %edx,%esi
call   1040 <readRotateXOR@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2f8,%edx
call   10b0 <fwrite@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    128a <unpackItems+0xea>
mov    -0x8(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11de <unpackItems+0x3e>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackItems>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe54(%rip),%rdi
lea    0xe53(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    11eb <unpackItems+0x4b>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xe34(%rip),%rdi
lea    0xe24(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <die@plt>
mov    0x2de6(%rip),%r12
mov    (%r12),%edx
mov    $0x265cb,%esi
mov    %r14,%rdi
call   1070 <fseek@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
cmpb   $0x6d,0xc(%rsp)
jne    122f <unpackItems+0x8f>
cmpb   $0x73,0xd(%rsp)
jne    122f <unpackItems+0x8f>
cmpb   $0x71,0xe(%rsp)
je     1244 <unpackItems+0xa4>
lea    0xdf0(%rip),%rdi
lea    0xdc9(%rip),%rsi
xor    %eax,%eax
call   1090 <die@plt>
lea    0xded(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %edx,%edx
call   10a0 <sprintf@plt>
lea    0xddd(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    $0x2f8,%esi
mov    $0x2f8,%edx
call   1040 <readRotateXOR@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2f8,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    (%r12),%edx
mov    $0x268c9,%esi
mov    %r14,%rdi
call   1070 <fseek@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
cmpb   $0x6d,0xc(%rsp)
jne    12e3 <unpackItems+0x143>
cmpb   $0x73,0xd(%rsp)
jne    12e3 <unpackItems+0x143>
cmpb   $0x71,0xe(%rsp)
je     12f8 <unpackItems+0x158>
lea    0xd3c(%rip),%rdi
lea    0xd15(%rip),%rsi
xor    %eax,%eax
call   1090 <die@plt>
lea    0xd39(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   10a0 <sprintf@plt>
lea    0xd26(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    $0x2f8,%esi
mov    $0x2f8,%edx
call   1040 <readRotateXOR@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2f8,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    (%r12),%edx
mov    $0x26bc7,%esi
mov    %r14,%rdi
call   1070 <fseek@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
cmpb   $0x6d,0xc(%rsp)
jne    139a <unpackItems+0x1fa>
cmpb   $0x73,0xd(%rsp)
jne    139a <unpackItems+0x1fa>
cmpb   $0x71,0xe(%rsp)
je     13af <unpackItems+0x20f>
lea    0xc85(%rip),%rdi
lea    0xc5e(%rip),%rsi
xor    %eax,%eax
call   1090 <die@plt>
lea    0xc82(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%edx
call   10a0 <sprintf@plt>
lea    0xc6f(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    $0x2f8,%esi
mov    $0x2f8,%edx
call   1040 <readRotateXOR@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2f8,%edx
mov    %r15,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
lea    0xbdd(%rip),%rdi
lea    0xbe2(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    145c <unpackItems+0x2bc>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
lea    0xbc3(%rip),%rdi
lea    0xbad(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <die@plt>
mov    (%r12),%edx
mov    $0x29dcd,%esi
mov    %r15,%rdi
call   1070 <fseek@plt>
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1050 <fread@plt>
cmpb   $0x6d,0xc(%rsp)
jne    1499 <unpackItems+0x2f9>
cmpb   $0x73,0xd(%rsp)
jne    1499 <unpackItems+0x2f9>
cmpb   $0x71,0xe(%rsp)
je     14ae <unpackItems+0x30e>
lea    0xb86(%rip),%rdi
lea    0xb59(%rip),%rsi
xor    %eax,%eax
call   1090 <die@plt>
lea    0xb83(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%edx
call   10a0 <sprintf@plt>
lea    0xb70(%rip),%rsi
mov    %r14,%rdi
call   1080 <fopen@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    $0x2f8,%esi
mov    $0x2f8,%edx
call   1040 <readRotateXOR@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x2f8,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    %r15,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <fclose@plt>

LLVM IR (-O0):
@__const.unpackItems.game1Offsets = [3 x i64] [i64 157131, i64 157897, i64 158663]
@__const.unpackItems.game2Offsets = [1 x i64] [i64 171469]
@.str = [6 x i8] c"game2\00"
@.str.1 = [6 x i8] c"game1\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [23 x i8] c"Unable to open %s: %s\0A\00"
@errno = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [18 x i8] c"Invalid file: %s\0A\00"
@.str.5 = [6 x i8] c"itm%i\00"
@.str.6 = [3 x i8] c"wb\00"
define void @unpackItems() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca [16 x i8]
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [4 x i8]
%8 = alloca [3 x i64]
%9 = alloca [1 x i64]
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64*
%13 = bitcast [3 x i64]* %8 to i8*
%14 = bitcast [1 x i64]* %9 to i8*
store i32 0, i32* %5
br label %15
15: ; preds = %107, %0
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %110
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
store i8* %22, i8** %3
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
br label %29
27: ; preds = %18
%28 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 0
br label %29
29: ; preds = %27, %25
%30 = phi i64* [ %26, %25 ], [ %28, %27 ]
store i64* %30, i64** %12
%31 = load i8*, i8** %3
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %32, i32** %1
%33 = load i32*, i32** %1
%34 = icmp ne i32* %33, null
br i1 %34, label %40, label %35
35: ; preds = %29
%36 = load i8*, i8** %3
%37 = load i32, i32* @errno
%38 = call i32 @strerror(i32 %37)
%39 = call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %36, i32 %38)
br label %40
40: ; preds = %35, %29
store i32 0, i32* %10
br label %41
41: ; preds = %101, %40
%42 = load i32, i32* %10
%43 = load i32, i32* %5
%44 = icmp ne i32 %43, 0
%45 = zext i1 %44 to i64
%46 = select i1 %44, i32 1, i32 3
%47 = icmp slt i32 %42, %46
br i1 %47, label %48, label %104
48: ; preds = %41
%49 = load i64*, i64** %12
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i64, i64* %49, i64 %51
%53 = load i64, i64* %52
store i64 %53, i64* %11
%54 = load i32*, i32** %1
%55 = load i64, i64* %11
%56 = load i32, i32* @SEEK_SET
%57 = call i32 @fseek(i32* %54, i64 %55, i32 %56)
%58 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%59 = load i32*, i32** %1
%60 = call i32 @fread(i8* %58, i32 1, i32 4, i32* %59)
%61 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = icmp ne i32 %63, 109
br i1 %64, label %75, label %65
65: ; preds = %48
%66 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 1
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = icmp ne i32 %68, 115
br i1 %69, label %75, label %70
70: ; preds = %65
%71 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 2
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = icmp ne i32 %73, 113
br i1 %74, label %75, label %78
75: ; preds = %70, %65, %48
%76 = load i8*, i8** %3
%77 = call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %75, %70
%79 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%80 = load i32, i32* %5
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %85
82: ; preds = %78
%83 = load i32, i32* %10
%84 = add nsw i32 %83, 4
br label %87
85: ; preds = %78
%86 = load i32, i32* %10
br label %87
87: ; preds = %85, %82
%88 = phi i32 [ %84, %82 ], [ %86, %85 ]
%89 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %88)
%90 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%91 = call i32* @fopen(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %91, i32** %2
%92 = load i32*, i32** %1
%93 = call i8* @readRotateXOR(i32* %92, i32 760, i32 760)
store i8* %93, i8** %6
%94 = load i8*, i8** %6
%95 = load i32*, i32** %2
%96 = call i32 @fwrite(i8* %94, i32 1, i32 760, i32* %95)
%97 = load i8*, i8** %6
%98 = call i32 @free(i8* %97)
%99 = load i32*, i32** %2
%100 = call i32 @fclose(i32* %99)
br label %101
101: ; preds = %87
%102 = load i32, i32* %10
%103 = add nsw i32 %102, 1
store i32 %103, i32* %10
br label %41
104: ; preds = %41
%105 = load i32*, i32** %1
%106 = call i32 @fclose(i32* %105)
br label %107
107: ; preds = %104
%108 = load i32, i32* %5
%109 = add nsw i32 %108, 1
store i32 %109, i32* %5
br label %15
110: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"game2\00"
@.str.1 = [6 x i8] c"game1\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [23 x i8] c"Unable to open %s: %s\0A\00"
@errno = global i32 0
@SEEK_SET = global i32 0
@.str.4 = [18 x i8] c"Invalid file: %s\0A\00"
@.str.5 = [6 x i8] c"itm%i\00"
@.str.6 = [3 x i8] c"wb\00"
define void @unpackItems() {
%1 = alloca [16 x i8]
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* @errno
%11 = tail call i32 @strerror(i32 %10)
%12 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* @SEEK_SET
%15 = tail call i32 @fseek(i32* %7, i64 157131, i32 %14)
%16 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %7)
%17 = load i8, i8* %4
%18 = icmp ne i8 %17, 109
%19 = load i8, i8* %5
%20 = icmp ne i8 %19, 115
%21 = select i1 %18, i1 true, i1 %20
%22 = load i8, i8* %6
%23 = icmp ne i8 %22, 113
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %27
25: ; preds = %13
%26 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %13, %25
%28 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 0)
%29 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%30 = tail call i8* @readRotateXOR(i32* %7, i32 760, i32 760)
%31 = tail call i32 @fwrite(i8* %30, i32 1, i32 760, i32* %29)
%32 = tail call i32 @free(i8* %30)
%33 = tail call i32 @fclose(i32* %29)
%34 = load i32, i32* @SEEK_SET
%35 = tail call i32 @fseek(i32* %7, i64 157897, i32 %34)
%36 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %7)
%37 = load i8, i8* %4
%38 = icmp ne i8 %37, 109
%39 = load i8, i8* %5
%40 = icmp ne i8 %39, 115
%41 = select i1 %38, i1 true, i1 %40
%42 = load i8, i8* %6
%43 = icmp ne i8 %42, 113
%44 = select i1 %41, i1 true, i1 %43
br i1 %44, label %45, label %47
45: ; preds = %27
%46 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %45, %27
%48 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 1)
%49 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%50 = tail call i8* @readRotateXOR(i32* %7, i32 760, i32 760)
%51 = tail call i32 @fwrite(i8* %50, i32 1, i32 760, i32* %49)
%52 = tail call i32 @free(i8* %50)
%53 = tail call i32 @fclose(i32* %49)
%54 = load i32, i32* @SEEK_SET
%55 = tail call i32 @fseek(i32* %7, i64 158663, i32 %54)
%56 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %7)
%57 = load i8, i8* %4
%58 = icmp ne i8 %57, 109
%59 = load i8, i8* %5
%60 = icmp ne i8 %59, 115
%61 = select i1 %58, i1 true, i1 %60
%62 = load i8, i8* %6
%63 = icmp ne i8 %62, 113
%64 = select i1 %61, i1 true, i1 %63
br i1 %64, label %65, label %67
65: ; preds = %47
%66 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %67
67: ; preds = %65, %47
%68 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 2)
%69 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%70 = tail call i8* @readRotateXOR(i32* %7, i32 760, i32 760)
%71 = tail call i32 @fwrite(i8* %70, i32 1, i32 760, i32* %69)
%72 = tail call i32 @free(i8* %70)
%73 = tail call i32 @fclose(i32* %69)
%74 = tail call i32 @fclose(i32* %7)
%75 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %81
77: ; preds = %67
%78 = load i32, i32* @errno
%79 = tail call i32 @strerror(i32 %78)
%80 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %77, %67
%82 = load i32, i32* @SEEK_SET
%83 = tail call i32 @fseek(i32* %75, i64 171469, i32 %82)
%84 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %75)
%85 = load i8, i8* %4
%86 = icmp ne i8 %85, 109
%87 = load i8, i8* %5
%88 = icmp ne i8 %87, 115
%89 = select i1 %86, i1 true, i1 %88
%90 = load i8, i8* %6
%91 = icmp ne i8 %90, 113
%92 = select i1 %89, i1 true, i1 %91
br i1 %92, label %93, label %95
93: ; preds = %81
%94 = tail call i32 (i8*, i8*, ...) @die(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %95
95: ; preds = %93, %81
%96 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 4)
%97 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%98 = tail call i8* @readRotateXOR(i32* %75, i32 760, i32 760)
%99 = tail call i32 @fwrite(i8* %98, i32 1, i32 760, i32* %97)
%100 = tail call i32 @free(i8* %98)
%101 = tail call i32 @fclose(i32* %97)
%102 = tail call i32 @fclose(i32* %75)
ret void
}