#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 atoi(char *);
char *encriptarchave(char *, int *);
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 < 4) {
    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("temp.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);
  FILE *textoclarotransp;
  FILE *chavetransp;
  FILE *saida;
  saida = fopen("cripto.txt", "w");
  textoclarotransp = fopen("temp.txt", "r");
  chavetransp = fopen(argv[3], "r");
  i = 0;
  int textochaveTransp[8];
  char letrasClaroTransp[8];
  char letraTransp = '1';
  printf("%c %d\n", letraTransp, atoi(&letraTransp));
  letraTransp = getc(chavetransp);
  while (letraTransp != EOF) {
    textochaveTransp[i] = letraTransp;
    printf("%c %c\n", letraTransp, textochaveTransp[i]);
    letraTransp = getc(chavetransp);
    i++;
  }
  system("pause");
  letraTransp = getc(textoclarotransp);
  while (letraTransp != EOF) {
    for (i = 0; i < 8; i++) {
      letrasClaroTransp[i] = letraTransp;
      letraTransp = getc(textoclarotransp);
    }
    printf("\n%s", letrasClaroTransp);
    printf("\n%s\n", encriptarchave(letrasClaroTransp, textochaveTransp));
    for (i = 0; i < 8; i++) {
      fprintf(saida, "%c", letrasClaroTransp[i]);
    }
  }
  fclose(saida);
  fclose(textoclaro);
  fclose(chave);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11e9 <main+0x49>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe4f(%rip),%rdi
call   1050 <system@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    15ec <main+0x44c>
lea    -0x70(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x3e,%edx
call   1080 <memcpy@plt>
movl   $0x0,-0xb8(%rbp)
lea    0xe1e(%rip),%rdi
lea    0xe20(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdf2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xb2(%rbp)
movsbl -0xb2(%rbp),%eax
mov    0x2d7c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     12c3 <main+0x123>
movsbl -0xb2(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb2(%rbp),%cl
movslq -0xb8(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
mov    -0x28(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xb2(%rbp)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    125e <main+0xbe>
mov    -0x20(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
mov    0x2d08(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1373 <main+0x1d3>
movsbl -0xb1(%rbp),%esi
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0xb1(%rbp),%eax
cmp    $0x20,%eax
je     134d <main+0x1ad>
mov    -0x18(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0x70(%rbp),%rdi
movsbl -0xb1(%rbp),%esi
call   1090 <local@plt>
mov    -0x108(%rbp),%rdi
movsbl -0xb0(%rbp,%rax,1),%edx
ff
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    135f <main+0x1bf>
mov    -0x18(%rbp),%rdi
lea    0xce5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xb1(%rbp)
jmp    12d2 <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    0xcaa(%rip),%rdi
lea    0xc9a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xd0(%rbp)
lea    0xc7e(%rip),%rdi
lea    0xc82(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc67(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xb8(%rbp)
movb   $0x31,-0xf9(%rbp)
movsbl -0xf9(%rbp),%eax
mov    %eax,-0x10c(%rbp)
lea    -0xf9(%rbp),%rdi
call   10b0 <atoi@plt>
mov    -0x10c(%rbp),%esi
mov    %eax,%edx
lea    0xc34(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc8(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xf9(%rbp)
movsbl -0xf9(%rbp),%eax
mov    0x2bab(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     14a6 <main+0x306>
movsbl -0xf9(%rbp),%ecx
movslq -0xb8(%rbp),%rax
mov    %ecx,-0xf0(%rbp,%rax,4)
movsbl -0xf9(%rbp),%esi
movslq -0xb8(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%edx
lea    0xbd8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc8(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xf9(%rbp)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    142f <main+0x28f>
lea    0xb7a(%rip),%rdi
call   1050 <system@plt>
mov    -0xc0(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xf9(%rbp)
movsbl -0xf9(%rbp),%eax
mov    0x2b16(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     15bb <main+0x41b>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x8,-0xb8(%rbp)
jge    152e <main+0x38e>
mov    -0xf9(%rbp),%cl
movslq -0xb8(%rbp),%rax
mov    %cl,-0xf8(%rbp,%rax,1)
mov    -0xc0(%rbp),%rdi
call   10c0 <getc@plt>
mov    %al,-0xf9(%rbp)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    14e7 <main+0x347>
lea    -0xf8(%rbp),%rsi
lea    0xb1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xf8(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <encriptarchave@plt>
mov    %rax,%rsi
lea    0xafc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x8,-0xb8(%rbp)
jge    15b6 <main+0x416>
mov    -0xd0(%rbp),%rdi
movslq -0xb8(%rbp),%rax
movsbl -0xf8(%rbp,%rax,1),%edx
ff
lea    0xa9f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1571 <main+0x3d1>
jmp    14c4 <main+0x324>
mov    -0xd0(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xa47(%rip),%rdi
call   1050 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
cmp    $0x3,%edi
jg     11e8 <main+0x38>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
lea    0xe27(%rip),%rdi
call   1070 <system@plt>
mov    $0xffffffff,%eax
jmp    14eb <main+0x33b>
mov    %rsi,%r15
movups 0xe9c(%rip),%xmm0
movups %xmm0,0x4e(%rsp)
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe66(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe4a(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xde4(%rip),%rdi
lea    0xde6(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
mov    0x8(%r15),%rdi
lea    0xdd5(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <fopen@plt>
mov    %rax,0x18(%rsp)
mov    0x10(%r15),%rdi
mov    %rbp,%rsi
call   10b0 <fopen@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   10d0 <getc@plt>
mov    0x2d81(%rip),%r13
cmp    0x0(%r13),%al
je     129f <main+0xef>
lea    0x80(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %bpl,(%rbx)
mov    %r14,%rdi
call   10d0 <getc@plt>
add    $0x1,%rbx
cmp    0x0(%r13),%al
jne    1280 <main+0xd0>
mov    %r14,0x10(%rsp)
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <getc@plt>
cmp    0x0(%r13),%al
jne    14fd <main+0x34d>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
lea    0xd37(%rip),%rdi
lea    0xd2c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
lea    0xd14(%rip),%rdi
lea    0xd18(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
mov    0x18(%r15),%rdi
mov    %rbp,%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
movb   $0x31,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   10c0 <atoi@plt>
lea    0xcf5(%rip),%rdi
mov    $0x31,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   10d0 <getc@plt>
mov    %al,0x7(%rsp)
cmp    0x0(%r13),%al
je     1384 <main+0x1d4>
lea    0x60(%rsp),%rbp
lea    0xcd0(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edx
mov    %edx,0x0(%rbp)
mov    %r14,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   10d0 <getc@plt>
add    $0x4,%rbp
cmp    0x0(%r13),%al
jne    1360 <main+0x1b0>
lea    0xc75(%rip),%rdi
call   1070 <system@plt>
mov    %rbx,%rdi
call   10d0 <getc@plt>
cmp    0x0(%r13),%al
je     14c1 <main+0x311>
mov    %eax,%r15d
lea    0x8(%rsp),%rbp
lea    0xc7f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15b,0x8(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0x9(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xa(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xb(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xc(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xd(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xe(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %al,0xf(%rsp)
mov    %rbx,%rdi
call   10d0 <getc@plt>
mov    %eax,%r15d
lea    0xc01(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
lea    0x60(%rsp),%rsi
call   1060 <encriptarchave@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
movsbl 0x8(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0x9(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xa(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xb(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xc(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xd(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xe(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
movsbl 0xf(%rsp),%edi
mov    %r12,%rsi
call   1090 <fputc@plt>
cmp    0x0(%r13),%r15b
jne    13c0 <main+0x210>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
lea    0xb1c(%rip),%rdi
call   1070 <system@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x20(%rsp),%r14
jmp    152a <main+0x37a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rsi
call   1090 <fputc@plt>
mov    %rbx,%rdi
call   10d0 <getc@plt>
cmp    0x0(%r13),%al
je     12bb <main+0x10b>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
cmp    $0x20,%bpl
je     1510 <main+0x360>
mov    %r14,%rdi
mov    %ebp,%esi
call   10a0 <local@plt>
movsbl 0x80(%rsp,%rax,1),%edi
jmp    1510 <main+0x360>

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 = [9 x i8] c"temp.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"
@.str.7 = [11 x i8] c"cripto.txt\00"
@.str.8 = [7 x i8] c"%c %d\0A\00"
@.str.9 = [7 x i8] c"%c %c\0A\00"
@.str.10 = [4 x i8] c"\0A%s\00"
@.str.11 = [5 x i8] c"\0A%s\0A\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
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca [8 x i32]
%18 = alloca [8 x i8]
%19 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 4
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%24 = 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 %183
25: ; preds = %2
%26 = bitcast [62 x i8]* %9 to i8*
store i32 0, i32* %13
%27 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 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* %27, i32** %6
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %31, i32** %7
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %35, i32** %8
%36 = load i32*, i32** %8
%37 = call signext i8 @getc(i32* %36)
store i8 %37, i8* %12
br label %38
38: ; preds = %44, %25
%39 = load i8, i8* %12
%40 = sext i8 %39 to i32
%41 = load i8, i8* @EOF
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %40, %42
br i1 %43, label %44, label %56
44: ; preds = %38
%45 = load i8, i8* %12
%46 = sext i8 %45 to i32
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = load i8, i8* %12
%49 = load i32, i32* %13
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [62 x i8], [62 x i8]* %10, i64 0, i64 %50
store i8 %48, i8* %51
%52 = load i32*, i32** %8
%53 = call signext i8 @getc(i32* %52)
store i8 %53, i8* %12
%54 = load i32, i32* %13
%55 = add nsw i32 %54, 1
store i32 %55, i32* %13
br label %38
56: ; preds = %38
%57 = load i32*, i32** %7
%58 = call signext i8 @getc(i32* %57)
store i8 %58, i8* %11
br label %59
59: ; preds = %84, %56
%60 = load i8, i8* %11
%61 = sext i8 %60 to i32
%62 = load i8, i8* @EOF
%63 = sext i8 %62 to i32
%64 = icmp ne i32 %61, %63
br i1 %64, label %65, label %87
65: ; preds = %59
%66 = load i8, i8* %11
%67 = sext i8 %66 to i32
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %67)
%69 = load i8, i8* %11
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 32
br i1 %71, label %72, label %81
72: ; preds = %65
%73 = load i32*, i32** %6
%74 = getelementptr inbounds [62 x i8], [62 x i8]* %9, i64 0, i64 0
%75 = load i8, i8* %11
%76 = call i64 @local(i8* %74, i8 signext %75)
%77 = getelementptr inbounds [62 x i8], [62 x i8]* %10, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %79)
br label %84
81: ; preds = %65
%82 = load i32*, i32** %6
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %84
84: ; preds = %81, %72
%85 = load i32*, i32** %7
%86 = call signext i8 @getc(i32* %85)
store i8 %86, i8* %11
br label %59
87: ; preds = %59
%88 = load i32*, i32** %6
%89 = call i32 @fclose(i32* %88)
%90 = load i32*, i32** %7
%91 = call i32 @fclose(i32* %90)
%92 = load i32*, i32** %8
%93 = call i32 @fclose(i32* %92)
%94 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %94, i32** %16
%95 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %95, i32** %14
%96 = load i8**, i8*** %5
%97 = getelementptr inbounds i8*, i8** %96, i64 3
%98 = load i8*, i8** %97
%99 = call i32* @fopen(i8* %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %99, i32** %15
store i32 0, i32* %13
store i8 49, i8* %19
%100 = load i8, i8* %19
%101 = sext i8 %100 to i32
%102 = call i32 @atoi(i8* %19)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %101, i32 %102)
%104 = load i32*, i32** %15
%105 = call signext i8 @getc(i32* %104)
store i8 %105, i8* %19
br label %106
106: ; preds = %112, %87
%107 = load i8, i8* %19
%108 = sext i8 %107 to i32
%109 = load i8, i8* @EOF
%110 = sext i8 %109 to i32
%111 = icmp ne i32 %108, %110
br i1 %111, label %112, label %129
112: ; preds = %106
%113 = load i8, i8* %19
%114 = sext i8 %113 to i32
%115 = load i32, i32* %13
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 %116
store i32 %114, i32* %117
%118 = load i8, i8* %19
%119 = sext i8 %118 to i32
%120 = load i32, i32* %13
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %119, i32 %123)
%125 = load i32*, i32** %15
%126 = call signext i8 @getc(i32* %125)
store i8 %126, i8* %19
%127 = load i32, i32* %13
%128 = add nsw i32 %127, 1
store i32 %128, i32* %13
br label %106
129: ; preds = %106
%130 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%131 = load i32*, i32** %14
%132 = call signext i8 @getc(i32* %131)
store i8 %132, i8* %19
br label %133
133: ; preds = %174, %129
%134 = load i8, i8* %19
%135 = sext i8 %134 to i32
%136 = load i8, i8* @EOF
%137 = sext i8 %136 to i32
%138 = icmp ne i32 %135, %137
br i1 %138, label %139, label %175
139: ; preds = %133
store i32 0, i32* %13
br label %140
140: ; preds = %150, %139
%141 = load i32, i32* %13
%142 = icmp slt i32 %141, 8
br i1 %142, label %143, label %153
143: ; preds = %140
%144 = load i8, i8* %19
%145 = load i32, i32* %13
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 %146
store i8 %144, i8* %147
%148 = load i32*, i32** %14
%149 = call signext i8 @getc(i32* %148)
store i8 %149, i8* %19
br label %150
150: ; preds = %143
%151 = load i32, i32* %13
%152 = add nsw i32 %151, 1
store i32 %152, i32* %13
br label %140
153: ; preds = %140
%154 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 0
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %154)
%156 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 0
%157 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%158 = call i8* @encriptarchave(i8* %156, i32* %157)
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* %158)
store i32 0, i32* %13
br label %160
160: ; preds = %171, %153
%161 = load i32, i32* %13
%162 = icmp slt i32 %161, 8
br i1 %162, label %163, label %174
163: ; preds = %160
%164 = load i32*, i32** %16
%165 = load i32, i32* %13
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 %166
%168 = load i8, i8* %167
%169 = sext i8 %168 to i32
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %169)
br label %171
171: ; preds = %163
%172 = load i32, i32* %13
%173 = add nsw i32 %172, 1
store i32 %173, i32* %13
br label %160
174: ; preds = %160
br label %133
175: ; preds = %133
%176 = load i32*, i32** %16
%177 = call i32 @fclose(i32* %176)
%178 = load i32*, i32** %7
%179 = call i32 @fclose(i32* %178)
%180 = load i32*, i32** %8
%181 = call i32 @fclose(i32* %180)
%182 = 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 %183
183: ; preds = %175, %22
%184 = load i32, i32* %3
ret i32 %184
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@__const.main.alfabeto = [62 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
@.str.2 = [9 x i8] c"temp.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.7 = [11 x i8] c"cripto.txt\00"
@.str.8 = [7 x i8] c"%c %d\0A\00"
@.str.9 = [7 x i8] c"%c %c\0A\00"
@.str.10 = [4 x i8] c"\0A%s\00"
@.str.11 = [5 x i8] c"\0A%s\0A\00"
@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 = alloca [8 x i32]
%6 = alloca [8 x i8]
%7 = alloca i8
%8 = icmp slt i32 %0, 4
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %139
12: ; preds = %2
%13 = getelementptr inbounds [62 x i8], [62 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 0
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%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 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call signext i8 @getc(i32* %21)
%23 = load i8, i8* @EOF
%24 = icmp eq i8 %22, %23
br i1 %24, label %35, label %25
25: ; preds = %12, %25
%26 = phi i64 [ %32, %25 ], [ 0, %12 ]
%27 = phi i8 [ %31, %25 ], [ %22, %12 ]
%28 = sext i8 %27 to i32
%29 = tail call i32 @putchar(i32 %28)
%30 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 %26
store i8 %27, i8* %30
%31 = tail call signext i8 @getc(i32* %21)
%32 = add nuw i64 %26, 1
%33 = load i8, i8* @EOF
%34 = icmp eq i8 %31, %33
br i1 %34, label %35, label %25
35: ; preds = %25, %12
%36 = tail call signext i8 @getc(i32* %18)
%37 = load i8, i8* @EOF
%38 = icmp eq i8 %36, %37
br i1 %38, label %55, label %39
39: ; preds = %35, %49
%40 = phi i8 [ %52, %49 ], [ %36, %35 ]
%41 = sext i8 %40 to i32
%42 = call i32 @putchar(i32 %41)
%43 = icmp eq i8 %40, 32
br i1 %43, label %49, label %44
44: ; preds = %39
%45 = call i64 @local(i8* %13, i8 signext %40)
%46 = getelementptr inbounds [62 x i8], [62 x i8]* %4, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
br label %49
49: ; preds = %39, %44
%50 = phi i32 [ %48, %44 ], [ 32, %39 ]
%51 = call i32 @fputc(i32 %50, i32* %15)
%52 = call signext i8 @getc(i32* %18)
%53 = load i8, i8* @EOF
%54 = icmp eq i8 %52, %53
br i1 %54, label %55, label %39
55: ; preds = %49, %35
%56 = call i32 @fclose(i32* %15)
%57 = call i32 @fclose(i32* %18)
%58 = call i32 @fclose(i32* %21)
%59 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%60 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%61 = getelementptr inbounds i8*, i8** %1, i64 3
%62 = load i8*, i8** %61
%63 = call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%64 = bitcast [8 x i32]* %5 to i8*
%65 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
store i8 49, i8* %7
%66 = call i32 @atoi(i8* %7)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 49, i32 %66)
%68 = call signext i8 @getc(i32* %63)
store i8 %68, i8* %7
%69 = load i8, i8* @EOF
%70 = icmp eq i8 %68, %69
br i1 %70, label %81, label %71
71: ; preds = %55, %71
%72 = phi i64 [ %78, %71 ], [ 0, %55 ]
%73 = phi i8 [ %77, %71 ], [ %68, %55 ]
%74 = sext i8 %73 to i32
%75 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %72
store i32 %74, i32* %75
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %74, i32 %74)
%77 = call signext i8 @getc(i32* %63)
%78 = add nuw i64 %72, 1
%79 = load i8, i8* @EOF
%80 = icmp eq i8 %77, %79
br i1 %80, label %81, label %71
81: ; preds = %71, %55
%82 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%83 = call signext i8 @getc(i32* %60)
%84 = load i8, i8* @EOF
%85 = icmp eq i8 %83, %84
br i1 %85, label %134, label %86
86: ; preds = %81
%87 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%88 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 1
%89 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 2
%90 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 3
%91 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 4
%92 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 5
%93 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 6
%94 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 7
br label %95
95: ; preds = %86, %95
%96 = phi i8 [ %83, %86 ], [ %104, %95 ]
store i8 %96, i8* %65
%97 = call signext i8 @getc(i32* %60)
store i8 %97, i8* %88
%98 = call signext i8 @getc(i32* %60)
store i8 %98, i8* %89
%99 = call signext i8 @getc(i32* %60)
store i8 %99, i8* %90
%100 = call signext i8 @getc(i32* %60)
store i8 %100, i8* %91
%101 = call signext i8 @getc(i32* %60)
store i8 %101, i8* %92
%102 = call signext i8 @getc(i32* %60)
store i8 %102, i8* %93
%103 = call signext i8 @getc(i32* %60)
store i8 %103, i8* %94
%104 = call signext i8 @getc(i32* %60)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %65)
%106 = call i8* @encriptarchave(i8* %65, i32* %87)
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* %106)
%108 = load i8, i8* %65
%109 = sext i8 %108 to i32
%110 = call i32 @fputc(i32 %109, i32* %59)
%111 = load i8, i8* %88
%112 = sext i8 %111 to i32
%113 = call i32 @fputc(i32 %112, i32* %59)
%114 = load i8, i8* %89
%115 = sext i8 %114 to i32
%116 = call i32 @fputc(i32 %115, i32* %59)
%117 = load i8, i8* %90
%118 = sext i8 %117 to i32
%119 = call i32 @fputc(i32 %118, i32* %59)
%120 = load i8, i8* %91
%121 = sext i8 %120 to i32
%122 = call i32 @fputc(i32 %121, i32* %59)
%123 = load i8, i8* %92
%124 = sext i8 %123 to i32
%125 = call i32 @fputc(i32 %124, i32* %59)
%126 = load i8, i8* %93
%127 = sext i8 %126 to i32
%128 = call i32 @fputc(i32 %127, i32* %59)
%129 = load i8, i8* %94
%130 = sext i8 %129 to i32
%131 = call i32 @fputc(i32 %130, i32* %59)
%132 = load i8, i8* @EOF
%133 = icmp eq i8 %104, %132
br i1 %133, label %134, label %95
134: ; preds = %95, %81
%135 = call i32 @fclose(i32* %59)
%136 = call i32 @fclose(i32* %18)
%137 = call i32 @fclose(i32* %21)
%138 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %139
139: ; preds = %134, %9
%140 = phi i32 [ -1, %9 ], [ 0, %134 ]
ret i32 %140
}