#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("cripto.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", textochave[local(alfabeto, 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    0xe42(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe14(%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    0xdd7(%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    0xd63(%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    -0x70(%rbp),%rdi
movsbl -0xb1(%rbp),%esi
call   1080 <local@plt>
mov    -0xc0(%rbp),%rdi
movsbl -0xb0(%rbp,%rax,1),%edx
ff
lea    0xd1b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    133f <main+0x1bf>
mov    -0x18(%rbp),%rdi
lea    0xd07(%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    $0x88,%rsp
cmp    $0x2,%edi
jg     11b8 <main+0x38>
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
lea    0xe57(%rip),%rdi
call   1060 <system@plt>
mov    $0xffffffff,%eax
jmp    1293 <main+0x113>
mov    %rsi,%rbx
movups 0xeac(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe76(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe5a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe15(%rip),%rdi
lea    0xe19(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
lea    0xe08(%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    0x2db4(%rip),%r12
cmp    (%r12),%al
je     125f <main+0xdf>
lea    0x40(%rsp),%rbx
nop
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    1240 <main+0xc0>
mov    %r15,%rdi
call   10a0 <getc@plt>
cmp    (%r12),%al
jne    12a5 <main+0x125>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xd74(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rbx
jmp    12c6 <main+0x146>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1070 <fputc@plt>
mov    %r15,%rdi
call   10a0 <getc@plt>
cmp    (%r12),%al
je     126d <main+0xed>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
cmp    $0x20,%bpl
je     12b0 <main+0x130>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1080 <local@plt>
movsbl 0x40(%rsp,%rax,1),%edi
jmp    12b0 <main+0x130>

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 = [11 x i8] c"cripto.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 ([11 x i8], [11 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]* %9, 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]* %10, 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 = [11 x i8] c"cripto.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 = alloca [62 x i8]
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %57
9: ; preds = %2
%10 = getelementptr inbounds [62 x i8], [62 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 0
%12 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%19 = tail call signext i8 @getc(i32* %18)
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %19, %20
br i1 %21, label %32, label %22
22: ; preds = %9, %22
%23 = phi i64 [ %29, %22 ], [ 0, %9 ]
%24 = phi i8 [ %28, %22 ], [ %19, %9 ]
%25 = sext i8 %24 to i32
%26 = tail call i32 @putchar(i32 %25)
%27 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 %23
store i8 %24, i8* %27
%28 = tail call signext i8 @getc(i32* %18)
%29 = add nuw i64 %23, 1
%30 = load i8, i8* @EOF
%31 = icmp eq i8 %28, %30
br i1 %31, label %32, label %22
32: ; preds = %22, %9
%33 = tail call signext i8 @getc(i32* %15)
%34 = load i8, i8* @EOF
%35 = icmp eq i8 %33, %34
br i1 %35, label %52, label %36
36: ; preds = %32, %46
%37 = phi i8 [ %49, %46 ], [ %33, %32 ]
%38 = sext i8 %37 to i32
%39 = call i32 @putchar(i32 %38)
%40 = icmp eq i8 %37, 32
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = call i64 @local(i8* %10, i8 signext %37)
%43 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
br label %46
46: ; preds = %36, %41
%47 = phi i32 [ %45, %41 ], [ 32, %36 ]
%48 = call i32 @fputc(i32 %47, i32* %12)
%49 = call signext i8 @getc(i32* %15)
%50 = load i8, i8* @EOF
%51 = icmp eq i8 %49, %50
br i1 %51, label %52, label %36
52: ; preds = %46, %32
%53 = call i32 @fclose(i32* %12)
%54 = call i32 @fclose(i32* %15)
%55 = call i32 @fclose(i32* %18)
%56 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %57
57: ; preds = %52, %6
%58 = phi i32 [ -1, %6 ], [ 0, %52 ]
ret i32 %58
}