#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*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, size_t, int, int /*<<< orphan*/ *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  unsigned char *src = NULL;
  size_t src_size = 0;
  printf("Gaia decode tool ("
         "Mar 15 2022"
         ") (c)RuRuRu\n");
  if (argc < 3) {
    usage();
    return -1;
  }
  {
    FILE *fh = fopen(argv[1], "rb");
    if (!fh) {
      printf("File open error.\n");
      return -1;
    } else {
      fseek(fh, 0, SEEK_END);
      src_size = ftell(fh);
      fseek(fh, 0, SEEK_SET);
      src = (unsigned char *)malloc(src_size);
      fread(src, 1, src_size, fh);
      fclose(fh);
    }
  }
  {
    size_t i;
    unsigned char dec, dec_val;
    int num = atoi(argv[2]);
    switch (num) {
    case 1:
      dec_val = 0x55;
      break;
    case 2:
      dec_val = 0xaa;
      break;
    case 3:
      dec_val = 0x5f;
      break;
    case 0:
    default:
      dec_val = 0xff;
      break;
    }
    for (i = 0; i < src_size; i++) {
      dec = src[i] ^ dec_val;
      src[i] = dec;
    }
  }
  {
    FILE *fh = fopen(argv[1], "wb");
    if (!fh) {
      printf("File open error. (write)\n");
      return -2;
    } else {
      fseek(fh, 0, SEEK_SET);
      fwrite(src, src_size, 1, fh);
      fclose(fh);
    }
  }
  free(src);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe33(%rip),%rdi
call   1060 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    11ff <main+0x4f>
mov    $0x0,%al
call   10a0 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13bc <main+0x20c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    123a <main+0x8a>
lea    0xe14(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13bc <main+0x20c>
mov    -0x28(%rbp),%rdi
mov    0x2da3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x28(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    0x2d72(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %rax,-0x48(%rbp)
sub    $0x3,%rax
ja     12f0 <main+0x140>
mov    -0x48(%rbp),%rax
lea    0xd39(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x55,-0x32(%rbp)
jmp    12f4 <main+0x144>
movb   $0xaa,-0x32(%rbp)
jmp    12f4 <main+0x144>
movb   $0x5f,-0x32(%rbp)
jmp    12f4 <main+0x144>
jmp    12f0 <main+0x140>
movb   $0xff,-0x32(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    133e <main+0x18e>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x32(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    12fc <main+0x14c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd02(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1379 <main+0x1c9>
lea    0xcea(%rip),%rdi
call   1060 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    13bc <main+0x20c>
mov    -0x40(%rbp),%rdi
mov    0x2c54(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x40(%rbp),%rcx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
cmp    $0x2,%ebx
jg     11df <main+0x2f>
xor    %eax,%eax
call   10a0 <usage@plt>
mov    $0xffffffff,%ebp
jmp    140b <main+0x25b>
mov    0x8(%r14),%rdi
lea    0xe16(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     128e <main+0xde>
mov    %rax,%r12
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r12,%rdi
call   1070 <ftell@plt>
mov    %rax,%r15
mov    0x2db8(%rip),%rbp
mov    0x0(%rbp),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r15,%rdi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r12,%rcx
call   1050 <fread@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x10(%r14),%rdi
call   10c0 <atoi@plt>
lea    -0x8(,%rax,8),%ecx
add    $0xffffffff,%eax
mov    $0x5faa55,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0xff,%eax
cmovb  %edx,%eax
test   %r15,%r15
je     13ae <main+0x1fe>
cmp    $0x8,%r15
jae    12a4 <main+0xf4>
xor    %ecx,%ecx
jmp    13a2 <main+0x1f2>
lea    0xd9a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebp
jmp    140b <main+0x25b>
movzbl %al,%r8d
cmp    $0x20,%r15
jae    12b5 <main+0x105>
xor    %ecx,%ecx
jmp    1366 <main+0x1b6>
mov    %r15,%rcx
and    $0xffffffffffffffe0,%rcx
movd   %r8d,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x20(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x5,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1399 <main+0x1e9>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movdqu (%rbx,%rsi,1),%xmm1
movdqu 0x10(%rbx,%rsi,1),%xmm2
movdqu 0x20(%rbx,%rsi,1),%xmm3
movdqu 0x30(%rbx,%rsi,1),%xmm4
pxor   %xmm0,%xmm1
pxor   %xmm0,%xmm2
movdqu %xmm1,(%rbx,%rsi,1)
movdqu %xmm2,0x10(%rbx,%rsi,1)
pxor   %xmm0,%xmm3
pxor   %xmm0,%xmm4
movdqu %xmm3,0x20(%rbx,%rsi,1)
movdqu %xmm4,0x30(%rbx,%rsi,1)
add    $0x40,%rsi
add    $0xfffffffffffffffe,%rdi
jne    12f0 <main+0x140>
test   $0x1,%dl
je     135b <main+0x1ab>
movdqu (%rbx,%rsi,1),%xmm1
movdqu 0x10(%rbx,%rsi,1),%xmm2
pxor   %xmm0,%xmm1
pxor   %xmm0,%xmm2
movdqu %xmm1,(%rbx,%rsi,1)
movdqu %xmm2,0x10(%rbx,%rsi,1)
cmp    %rcx,%r15
je     13ae <main+0x1fe>
test   $0x18,%r15b
je     13a2 <main+0x1f2>
mov    %rcx,%rdx
mov    %r15,%rcx
and    $0xfffffffffffffff8,%rcx
movd   %r8d,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
xchg   %ax,%ax
movq   (%rbx,%rdx,1),%xmm1
pxor   %xmm0,%xmm1
movq   %xmm1,(%rbx,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%rcx
jne    1380 <main+0x1d0>
jmp    13a9 <main+0x1f9>
xor    %esi,%esi
test   $0x1,%dl
jne    133d <main+0x18d>
jmp    135b <main+0x1ab>
xor    %al,(%rbx,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%r15
jne    13a2 <main+0x1f2>
mov    0x8(%r14),%rdi
lea    0xc4a(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13fa <main+0x24a>
mov    %rax,%r14
mov    0x0(%rbp),%edx
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    140b <main+0x25b>
lea    0xc3f(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffe,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Gaia decode tool (Mar 15 2022) (c)RuRuRu\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [18 x i8] c"File open error.\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [26 x i8] c"File open error. (write)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i64 0, i64* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %101
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %8
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %28, label %26
26: ; preds = %19
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %101
28: ; preds = %19
%29 = load i32*, i32** %8
%30 = load i32, i32* @SEEK_END
%31 = call i32 @fseek(i32* %29, i32 0, i32 %30)
%32 = load i32*, i32** %8
%33 = call i64 @ftell(i32* %32)
store i64 %33, i64* %7
%34 = load i32*, i32** %8
%35 = load i32, i32* @SEEK_SET
%36 = call i32 @fseek(i32* %34, i32 0, i32 %35)
%37 = load i64, i64* %7
%38 = call i64 @malloc(i64 %37)
%39 = inttoptr i64 %38 to i8*
store i8* %39, i8** %6
%40 = load i8*, i8** %6
%41 = load i64, i64* %7
%42 = load i32*, i32** %8
%43 = call i32 @fread(i8* %40, i32 1, i64 %41, i32* %42)
%44 = load i32*, i32** %8
%45 = call i32 @fclose(i32* %44)
br label %46
46: ; preds = %28
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
%50 = call i32 @atoi(i8* %49)
store i32 %50, i32* %12
%51 = load i32, i32* %12
switch i32 %51, label %56 [
i32 1, label %52
i32 2, label %53
i32 3, label %54
i32 0, label %55
]
52: ; preds = %46
store i8 85, i8* %11
br label %57
53: ; preds = %46
store i8 -86, i8* %11
br label %57
54: ; preds = %46
store i8 95, i8* %11
br label %57
55: ; preds = %46
br label %56
56: ; preds = %46, %55
store i8 -1, i8* %11
br label %57
57: ; preds = %56, %54, %53, %52
store i64 0, i64* %9
br label %58
58: ; preds = %76, %57
%59 = load i64, i64* %9
%60 = load i64, i64* %7
%61 = icmp ult i64 %59, %60
br i1 %61, label %62, label %79
62: ; preds = %58
%63 = load i8*, i8** %6
%64 = load i64, i64* %9
%65 = getelementptr inbounds i8, i8* %63, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = load i8, i8* %11
%69 = zext i8 %68 to i32
%70 = xor i32 %67, %69
%71 = trunc i32 %70 to i8
store i8 %71, i8* %10
%72 = load i8, i8* %10
%73 = load i8*, i8** %6
%74 = load i64, i64* %9
%75 = getelementptr inbounds i8, i8* %73, i64 %74
store i8 %72, i8* %75
br label %76
76: ; preds = %62
%77 = load i64, i64* %9
%78 = add i64 %77, 1
store i64 %78, i64* %9
br label %58
79: ; preds = %58
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %83, i32** %13
%84 = load i32*, i32** %13
%85 = icmp ne i32* %84, null
br i1 %85, label %88, label %86
86: ; preds = %79
%87 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
store i32 -2, i32* %3
br label %101
88: ; preds = %79
%89 = load i32*, i32** %13
%90 = load i32, i32* @SEEK_SET
%91 = call i32 @fseek(i32* %89, i32 0, i32 %90)
%92 = load i8*, i8** %6
%93 = load i64, i64* %7
%94 = load i32*, i32** %13
%95 = call i32 @fwrite(i8* %92, i64 %93, i32 1, i32* %94)
%96 = load i32*, i32** %13
%97 = call i32 @fclose(i32* %96)
br label %98
98: ; preds = %88
%99 = load i8*, i8** %6
%100 = call i32 @free(i8* %99)
store i32 0, i32* %3
br label %101
101: ; preds = %98, %86, %26, %17
%102 = load i32, i32* %3
ret i32 %102
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [3 x i8] c"wb\00"
@str = [41 x i8] c"Gaia decode tool (Mar 15 2022) (c)RuRuRu\00"
@str.5 = [17 x i8] c"File open error.\00"
@str.6 = [25 x i8] c"File open error. (write)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %135
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
br label %135
14: ; preds = %7
%15 = load i32, i32* @SEEK_END
%16 = tail call i32 @fseek(i32* %10, i32 0, i32 %15)
%17 = tail call i64 @ftell(i32* %10)
%18 = load i32, i32* @SEEK_SET
%19 = tail call i32 @fseek(i32* %10, i32 0, i32 %18)
%20 = tail call i64 @malloc(i64 %17)
%21 = inttoptr i64 %20 to i8*
%22 = tail call i32 @fread(i8* %21, i32 1, i64 %17, i32* %10)
%23 = tail call i32 @fclose(i32* %10)
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call i32 @atoi(i8* %25)
%27 = add i32 %26, -1
%28 = icmp ult i32 %27, 3
%29 = trunc i32 %27 to i24
%30 = shl i24 %29, 3
%31 = lshr i24 6269525, %30
%32 = trunc i24 %31 to i8
%33 = select i1 %28, i8 %32, i8 -1
%34 = icmp eq i64 %17, 0
br i1 %34, label %123, label %35
35: ; preds = %14
%36 = icmp ult i64 %17, 8
br i1 %36, label %114, label %37
37: ; preds = %35
%38 = icmp ult i64 %17, 32
br i1 %38, label %98, label %39
39: ; preds = %37
%40 = and i64 %17, -32
%41 = insertelement <16 x i8> poison, i8 %33, i64 0
%42 = shufflevector <16 x i8> %41, <16 x i8> poison, <16 x i32> zeroinitializer
%43 = insertelement <16 x i8> poison, i8 %33, i64 0
%44 = shufflevector <16 x i8> %43, <16 x i8> poison, <16 x i32> zeroinitializer
%45 = add i64 %40, -32
%46 = lshr exact i64 %45, 5
%47 = add nuw nsw i64 %46, 1
%48 = and i64 %47, 1
%49 = icmp eq i64 %45, 0
br i1 %49, label %79, label %50
50: ; preds = %39
%51 = and i64 %47, 1152921504606846974
br label %52
52: ; preds = %52, %50
%53 = phi i64 [ 0, %50 ], [ %76, %52 ]
%54 = phi i64 [ 0, %50 ], [ %77, %52 ]
%55 = getelementptr inbounds i8, i8* %21, i64 %53
%56 = bitcast i8* %55 to <16 x i8>*
%57 = load <16 x i8>, <16 x i8>* %56
%58 = getelementptr inbounds i8, i8* %55, i64 16
%59 = bitcast i8* %58 to <16 x i8>*
%60 = load <16 x i8>, <16 x i8>* %59
%61 = xor <16 x i8> %57, %42
%62 = xor <16 x i8> %60, %44
%63 = bitcast i8* %55 to <16 x i8>*
store <16 x i8> %61, <16 x i8>* %63
%64 = bitcast i8* %58 to <16 x i8>*
store <16 x i8> %62, <16 x i8>* %64
%65 = or i64 %53, 32
%66 = getelementptr inbounds i8, i8* %21, i64 %65
%67 = bitcast i8* %66 to <16 x i8>*
%68 = load <16 x i8>, <16 x i8>* %67
%69 = getelementptr inbounds i8, i8* %66, i64 16
%70 = bitcast i8* %69 to <16 x i8>*
%71 = load <16 x i8>, <16 x i8>* %70
%72 = xor <16 x i8> %68, %42
%73 = xor <16 x i8> %71, %44
%74 = bitcast i8* %66 to <16 x i8>*
store <16 x i8> %72, <16 x i8>* %74
%75 = bitcast i8* %69 to <16 x i8>*
store <16 x i8> %73, <16 x i8>* %75
%76 = add nuw i64 %53, 64
%77 = add i64 %54, 2
%78 = icmp eq i64 %77, %51
br i1 %78, label %79, label %52
79: ; preds = %52, %39
%80 = phi i64 [ 0, %39 ], [ %76, %52 ]
%81 = icmp eq i64 %48, 0
br i1 %81, label %93, label %82
82: ; preds = %79
%83 = getelementptr inbounds i8, i8* %21, i64 %80
%84 = bitcast i8* %83 to <16 x i8>*
%85 = load <16 x i8>, <16 x i8>* %84
%86 = getelementptr inbounds i8, i8* %83, i64 16
%87 = bitcast i8* %86 to <16 x i8>*
%88 = load <16 x i8>, <16 x i8>* %87
%89 = xor <16 x i8> %85, %42
%90 = xor <16 x i8> %88, %44
%91 = bitcast i8* %83 to <16 x i8>*
store <16 x i8> %89, <16 x i8>* %91
%92 = bitcast i8* %86 to <16 x i8>*
store <16 x i8> %90, <16 x i8>* %92
br label %93
93: ; preds = %79, %82
%94 = icmp eq i64 %17, %40
br i1 %94, label %123, label %95
95: ; preds = %93
%96 = and i64 %17, 24
%97 = icmp eq i64 %96, 0
br i1 %97, label %114, label %98
98: ; preds = %37, %95
%99 = phi i64 [ %40, %95 ], [ 0, %37 ]
%100 = and i64 %17, -8
%101 = insertelement <8 x i8> poison, i8 %33, i64 0
%102 = shufflevector <8 x i8> %101, <8 x i8> poison, <8 x i32> zeroinitializer
br label %103
103: ; preds = %103, %98
%104 = phi i64 [ %99, %98 ], [ %110, %103 ]
%105 = getelementptr inbounds i8, i8* %21, i64 %104
%106 = bitcast i8* %105 to <8 x i8>*
%107 = load <8 x i8>, <8 x i8>* %106
%108 = xor <8 x i8> %107, %102
%109 = bitcast i8* %105 to <8 x i8>*
store <8 x i8> %108, <8 x i8>* %109
%110 = add nuw i64 %104, 8
%111 = icmp eq i64 %110, %100
br i1 %111, label %112, label %103
112: ; preds = %103
%113 = icmp eq i64 %17, %100
br i1 %113, label %123, label %114
114: ; preds = %35, %95, %112
%115 = phi i64 [ 0, %35 ], [ %40, %95 ], [ %100, %112 ]
br label %116
116: ; preds = %114, %116
%117 = phi i64 [ %121, %116 ], [ %115, %114 ]
%118 = getelementptr inbounds i8, i8* %21, i64 %117
%119 = load i8, i8* %118
%120 = xor i8 %119, %33
store i8 %120, i8* %118
%121 = add nuw i64 %117, 1
%122 = icmp eq i64 %121, %17
br i1 %122, label %123, label %116
123: ; preds = %116, %93, %112, %14
%124 = load i8*, i8** %8
%125 = tail call i32* @fopen(i8* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%126 = icmp eq i32* %125, null
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
br label %135
129: ; preds = %123
%130 = load i32, i32* @SEEK_SET
%131 = tail call i32 @fseek(i32* %125, i32 0, i32 %130)
%132 = tail call i32 @fwrite(i8* %21, i64 %17, i32 1, i32* %125)
%133 = tail call i32 @fclose(i32* %125)
%134 = tail call i32 @free(i8* %21)
br label %135
135: ; preds = %127, %12, %129, %5
%136 = phi i32 [ -1, %5 ], [ 0, %129 ], [ -1, %12 ], [ -2, %127 ]
ret i32 %136
}