#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 EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void decrypt1(char *crypt_path, char *decrypt_path) {
  FILE *normal_fp = fopen(crypt_path, "r");
  FILE *crypt_fp = fopen(decrypt_path, "w");
  int ch;
  while ((ch = fgetc(normal_fp)) != EOF) {
    fputc(ch ^ 9, crypt_fp);
  }
  fclose(crypt_fp);
  fclose(normal_fp);
}


x86 assembly (clang, -O0):
<decrypt1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%eax
je     11a7 <decrypt1+0x67>
mov    -0x24(%rbp),%edi
xor    $0x9,%edi
mov    -0x20(%rbp),%rsi
call   1050 <fputc@plt>
jmp    1178 <decrypt1+0x38>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt1>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
lea    0xeb1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <fgetc@plt>
mov    0x2e70(%rip),%r15
cmp    (%r15),%eax
je     119a <decrypt1+0x5a>
nopl   (%rax)
xor    $0x9,%eax
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>
cmp    (%r15),%eax
jne    1180 <decrypt1+0x40>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
@EOF = global i32 0
define void @decrypt1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i8*, i8** %4
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %6
br label %12
12: ; preds = %17, %2
%13 = load i32*, i32** %5
%14 = call i32 @fgetc(i32* %13)
store i32 %14, i32* %7
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load i32, i32* %7
%19 = xor i32 %18, 9
%20 = load i32*, i32** %6
%21 = call i32 @fputc(i32 %19, i32* %20)
br label %12
22: ; preds = %12
%23 = load i32*, i32** %6
%24 = call i32 @fclose(i32* %23)
%25 = load i32*, i32** %5
%26 = call i32 @fclose(i32* %25)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
@EOF = global i32 0
define void @decrypt1(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fgetc(i32* %3)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %15, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %12, %8 ], [ %5, %2 ]
%10 = xor i32 %9, 9
%11 = tail call i32 @fputc(i32 %10, i32* %4)
%12 = tail call i32 @fgetc(i32* %3)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %8
15: ; preds = %8, %2
%16 = tail call i32 @fclose(i32* %4)
%17 = tail call i32 @fclose(i32* %3)
ret void
}