#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 */
char EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char getc(int /*<<< orphan*/ *);
size_t local(char *, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("quantidades de arquivos insulficiente\n");
    system("pause");
    return -1;
  }
  FILE *cripto;
  FILE *textoclaro;
  FILE *chave;
  char alfabeto[62] =
      "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  char textochave[62];
  char letraclaro;
  char letrachave;
  int i = 0;
  cripto = fopen("decripto.txt", "w");
  textoclaro = fopen(argv[1], "r");
  chave = fopen(argv[2], "r");
  letrachave = getc(chave);
  while (letrachave != EOF) {
    printf("%c", letrachave);
    textochave[i] = letrachave;
    letrachave = getc(chave);
    i++;
  }
  letraclaro = getc(textoclaro);
  while (letraclaro != EOF) {
    printf("%c", letraclaro);
    if (letraclaro != 32)
      fprintf(cripto, "%c", alfabeto[local(textochave, letraclaro)]);
    else
      fprintf(cripto, " ");
    letraclaro = getc(textoclaro);
  }
  fclose(cripto);
  fclose(textoclaro);
  fclose(chave);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c9 <main+0x49>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1040 <system@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1381 <main+0x201>
lea    -0x70(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x3e,%edx
call   1070 <memcpy@plt>
movl   $0x0,-0xb8(%rbp)
lea    0xe3e(%rip),%rdi
lea    0xe44(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe16(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0xb2(%rbp)
movsbl -0xb2(%rbp),%eax
mov    0x2d9c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     12a3 <main+0x123>
movsbl -0xb2(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xb2(%rbp),%cl
movslq -0xb8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
mov    -0x28(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0xb2(%rbp)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    123e <main+0xbe>
mov    -0x20(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
mov    0x2d28(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1353 <main+0x1d3>
movsbl -0xb1(%rbp),%esi
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0xb1(%rbp),%eax
cmp    $0x20,%eax
je     132d <main+0x1ad>
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0xb0(%rbp),%rdi
movsbl -0xb1(%rbp),%esi
call   1080 <local@plt>
mov    -0xc0(%rbp),%rdi
movsbl -0x70(%rbp,%rax,1),%edx
lea    0xd1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    133f <main+0x1bf>
mov    -0x18(%rbp),%rdi
lea    0xd09(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0xb1(%rbp)
jmp    12b2 <main+0x132>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xcb2(%rip),%rdi
call   1040 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x2,%edi
jg     11b5 <main+0x35>
lea    0xe7d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5a(%rip),%rdi
call   1060 <system@plt>
mov    $0xffffffff,%eax
jmp    1263 <main+0xe3>
mov    %rsi,%rbx
lea    0xe47(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
lea    0xe3c(%rip),%rbp
mov    %rbp,%rsi
call   1090 <fopen@plt>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
mov    %rbp,%rsi
call   1090 <fopen@plt>
mov    %rax,%r13
mov    %rax,%rdi
call   10a0 <getc@plt>
mov    0x2de6(%rip),%r12
cmp    (%r12),%al
je     122f <main+0xaf>
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %bpl,(%rbx)
mov    %r13,%rdi
call   10a0 <getc@plt>
add    $0x1,%rbx
cmp    (%r12),%al
jne    1210 <main+0x90>
mov    %r15,%rdi
call   10a0 <getc@plt>
cmp    (%r12),%al
jne    1272 <main+0xf2>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xda4(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdc7(%rip),%rbx
jmp    1296 <main+0x116>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1070 <fputc@plt>
mov    %r15,%rdi
call   10a0 <getc@plt>
cmp    (%r12),%al
je     123d <main+0xbd>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
cmp    $0x20,%bpl
je     1280 <main+0x100>
mov    %rsp,%rdi
mov    %ebp,%esi
call   1080 <local@plt>
movsbl (%rax,%rbx,1),%edi
jmp    1280 <main+0x100>

LLVM IR (-O0):
@.str = [39 x i8] c"quantidades de arquivos insulficiente\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@__const.main.alfabeto = [62 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
@.str.2 = [13 x i8] c"decripto.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [62 x i8]
%10 = alloca [62 x i8]
%11 = alloca i8
%12 = alloca i8
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %89
19: ; preds = %2
%20 = bitcast [62 x i8]* %9 to i8*
store i32 0, i32* %13
%21 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %21, i32** %6
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %25, i32** %7
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %29, i32** %8
%30 = load i32*, i32** %8
%31 = call signext i8 @getc(i32* %30)
store i8 %31, i8* %12
br label %32
32: ; preds = %38, %19
%33 = load i8, i8* %12
%34 = sext i8 %33 to i32
%35 = load i8, i8* @EOF
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %34, %36
br i1 %37, label %38, label %50
38: ; preds = %32
%39 = load i8, i8* %12
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = load i8, i8* %12
%43 = load i32, i32* %13
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [62 x i8], [62 x i8]* %10, i64 0, i64 %44
store i8 %42, i8* %45
%46 = load i32*, i32** %8
%47 = call signext i8 @getc(i32* %46)
store i8 %47, i8* %12
%48 = load i32, i32* %13
%49 = add nsw i32 %48, 1
store i32 %49, i32* %13
br label %32
50: ; preds = %32
%51 = load i32*, i32** %7
%52 = call signext i8 @getc(i32* %51)
store i8 %52, i8* %11
br label %53
53: ; preds = %78, %50
%54 = load i8, i8* %11
%55 = sext i8 %54 to i32
%56 = load i8, i8* @EOF
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %55, %57
br i1 %58, label %59, label %81
59: ; preds = %53
%60 = load i8, i8* %11
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %61)
%63 = load i8, i8* %11
%64 = sext i8 %63 to i32
%65 = icmp ne i32 %64, 32
br i1 %65, label %66, label %75
66: ; preds = %59
%67 = load i32*, i32** %6
%68 = getelementptr inbounds [62 x i8], [62 x i8]* %10, i64 0, i64 0
%69 = load i8, i8* %11
%70 = call i64 @local(i8* %68, i8 signext %69)
%71 = getelementptr inbounds [62 x i8], [62 x i8]* %9, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %73)
br label %78
75: ; preds = %59
%76 = load i32*, i32** %6
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %78
78: ; preds = %75, %66
%79 = load i32*, i32** %7
%80 = call signext i8 @getc(i32* %79)
store i8 %80, i8* %11
br label %53
81: ; preds = %53
%82 = load i32*, i32** %6
%83 = call i32 @fclose(i32* %82)
%84 = load i32*, i32** %7
%85 = call i32 @fclose(i32* %84)
%86 = load i32*, i32** %8
%87 = call i32 @fclose(i32* %86)
%88 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %89
89: ; preds = %81, %16
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@__const.main.alfabeto = [62 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
@.str.2 = [13 x i8] c"decripto.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [2 x i8] c"r\00"
@EOF = global i8 0
@str = [38 x i8] c"quantidades de arquivos insulficiente\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [62 x i8]
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %55
8: ; preds = %2
%9 = getelementptr inbounds [62 x i8], [62 x i8]* %3, i64 0, i64 0
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = tail call signext i8 @getc(i32* %16)
%18 = load i8, i8* @EOF
%19 = icmp eq i8 %17, %18
br i1 %19, label %30, label %20
20: ; preds = %8, %20
%21 = phi i64 [ %27, %20 ], [ 0, %8 ]
%22 = phi i8 [ %26, %20 ], [ %17, %8 ]
%23 = sext i8 %22 to i32
%24 = tail call i32 @putchar(i32 %23)
%25 = getelementptr inbounds [62 x i8], [62 x i8]* %3, i64 0, i64 %21
store i8 %22, i8* %25
%26 = tail call signext i8 @getc(i32* %16)
%27 = add nuw i64 %21, 1
%28 = load i8, i8* @EOF
%29 = icmp eq i8 %26, %28
br i1 %29, label %30, label %20
30: ; preds = %20, %8
%31 = tail call signext i8 @getc(i32* %13)
%32 = load i8, i8* @EOF
%33 = icmp eq i8 %31, %32
br i1 %33, label %50, label %34
34: ; preds = %30, %44
%35 = phi i8 [ %47, %44 ], [ %31, %30 ]
%36 = sext i8 %35 to i32
%37 = call i32 @putchar(i32 %36)
%38 = icmp eq i8 %35, 32
br i1 %38, label %44, label %39
39: ; preds = %34
%40 = call i64 @local(i8* %9, i8 signext %35)
%41 = getelementptr inbounds [62 x i8], [62 x i8]* @__const.main.alfabeto, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
br label %44
44: ; preds = %34, %39
%45 = phi i32 [ %43, %39 ], [ 32, %34 ]
%46 = call i32 @fputc(i32 %45, i32* %10)
%47 = call signext i8 @getc(i32* %13)
%48 = load i8, i8* @EOF
%49 = icmp eq i8 %47, %48
br i1 %49, label %50, label %34
50: ; preds = %44, %30
%51 = call i32 @fclose(i32* %10)
%52 = call i32 @fclose(i32* %13)
%53 = call i32 @fclose(i32* %16)
%54 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %55
55: ; preds = %50, %5
%56 = phi i32 [ -1, %5 ], [ 0, %50 ]
ret i32 %56
}