#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ shift_cipher(char *);
int main(int argc, char *argv[]) {
  char *file_to_hide = argv[1];
  char *file_to_write_to = argv[2];
  FILE *in = fopen(file_to_hide, "r");
  FILE *out_file = fopen(file_to_write_to, "w");
  char line[80];
  while (fscanf(in, "%79[^\n]\n", line) == 1) {
    shift_cipher(line);
    fprintf(out_file, "%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    0xe5c(%rip),%rsi
call   1040 <fscanf@plt>
cmp    $0x1,%eax
jne    11d8 <main+0x98>
lea    -0x80(%rbp),%rdi
call   1030 <shift_cipher@plt>
mov    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    0xe3f(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1199 <main+0x59>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rbx
lea    0xea6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0xe89(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    11c6 <main+0x86>
mov    %rsp,%rbx
lea    0xe6f(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <shift_cipher@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     11a0 <main+0x60>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [9 x i8] c"%79[^\0A]\0A\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
store i8* %16, i8** %7
%17 = load i8*, i8** %6
%18 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %18, i32** %8
%19 = load i8*, i8** %7
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %9
br label %21
21: ; preds = %26, %2
%22 = load i32*, i32** %8
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%24 = call i32 @fscanf(i32* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %32
26: ; preds = %21
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%28 = call i32 @shift_cipher(i8* %27)
%29 = load i32*, i32** %9
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%31 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %21
32: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [9 x i8] c"%79[^\0A]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %2, %13
%14 = call i32 @shift_cipher(i8* %10)
%15 = call i32 @fputs(i8* %10, i32* %9)
%16 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%17 = icmp eq i32 %16, 1
br i1 %17, label %13, label %18
18: ; preds = %13, %2
ret i32 0
}