#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*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void fileSimpleEncrypt(const char *sourcePath, const char *targetPath) {
  if (sourcePath == NULL || targetPath == NULL) {
    return;
  }
  FILE *rfile = fopen(sourcePath, "r");
  FILE *wfile = fopen(targetPath, "w");
  if (rfile == NULL || wfile == NULL) {
    return;
  }
  while (!feof(rfile)) {
    int ch = fgetc(rfile);
    if (ch != EOF) {
      ch += 1;
      fputc(ch, wfile);
    }
  }
}


x86 assembly (clang, -O0):
<fileSimpleEncrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <fileSimpleEncrypt+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    116b <fileSimpleEncrypt+0x2b>
jmp    1209 <fileSimpleEncrypt+0xc9>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a9 <fileSimpleEncrypt+0x69>
cmpq   $0x0,-0x20(%rbp)
jne    11ae <fileSimpleEncrypt+0x6e>
jmp    1209 <fileSimpleEncrypt+0xc9>
jmp    11b3 <fileSimpleEncrypt+0x73>
mov    -0x18(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d1 <fileSimpleEncrypt+0x91>
jmp    1209 <fileSimpleEncrypt+0xc9>
mov    -0x18(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2e01(%rip),%rcx
cmp    (%rcx),%eax
je     1204 <fileSimpleEncrypt+0xc4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <fputc@plt>
jmp    11b3 <fileSimpleEncrypt+0x73>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSimpleEncrypt>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1189 <fileSimpleEncrypt+0x49>
mov    %rsi,%r14
test   %rsi,%rsi
je     1189 <fileSimpleEncrypt+0x49>
lea    0xea7(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
test   %rbx,%rbx
je     1189 <fileSimpleEncrypt+0x49>
mov    %rax,%r14
test   %rax,%rax
je     1189 <fileSimpleEncrypt+0x49>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     118f <fileSimpleEncrypt+0x4f>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e52(%rip),%r15
jmp    11ac <fileSimpleEncrypt+0x6c>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1189 <fileSimpleEncrypt+0x49>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%eax
je     11a0 <fileSimpleEncrypt+0x60>
add    $0x1,%eax
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
jmp    11a0 <fileSimpleEncrypt+0x60>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
@EOF = global i32 0
define void @fileSimpleEncrypt(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 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %10, %2
br label %44
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %16, i32** %5
%17 = load i8*, i8** %4
%18 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %18, i32** %6
%19 = load i32*, i32** %5
%20 = icmp eq i32* %19, null
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = load i32*, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %21, %14
br label %44
25: ; preds = %21
br label %26
26: ; preds = %43, %25
%27 = load i32*, i32** %5
%28 = call i32 @feof(i32* %27)
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br i1 %30, label %31, label %44
31: ; preds = %26
%32 = load i32*, i32** %5
%33 = call i32 @fgetc(i32* %32)
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = load i32, i32* @EOF
%36 = icmp ne i32 %34, %35
br i1 %36, label %37, label %43
37: ; preds = %31
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = load i32*, i32** %6
%42 = call i32 @fputc(i32 %40, i32* %41)
br label %43
43: ; preds = %37, %31
br label %26
44: ; preds = %13, %24, %26
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 @fileSimpleEncrypt(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %25, label %6
6: ; preds = %2
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %7, null
%10 = icmp eq i32* %8, null
%11 = or i1 %9, %10
br i1 %11, label %25, label %12
12: ; preds = %6
%13 = tail call i32 @feof(i32* %7)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %12, %22
%16 = tail call i32 @fgetc(i32* %7)
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = add nsw i32 %16, 1
%21 = tail call i32 @fputc(i32 %20, i32* %8)
br label %22
22: ; preds = %19, %15
%23 = tail call i32 @feof(i32* %7)
%24 = icmp eq i32 %23, 0
br i1 %24, label %15, label %25
25: ; preds = %22, %12, %6, %2
ret void
}