#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 */

/* Variables and functions */
int /*<<< orphan*/ bruteForceKeyGenerator(char **, char **);
char **malloc(int);
int /*<<< orphan*/ printf(char *);
char ***readPairs(char *, char **, char **);
void bruteForce() {
  char **plaintext = malloc(sizeof(char *) * 1000);
  char **ciphertext = malloc(sizeof(char *) * 1000);
  char ***pairGroup =
      readPairs("C:\\Users\\mario\\Documents\\GitHub\\SDES\\pares.txt",
                plaintext, ciphertext);
  plaintext = pairGroup[0];
  ciphertext = pairGroup[1];
  printf("Searching keys\n");
  bruteForceKeyGenerator(plaintext, ciphertext);
}


x86 assembly (clang, -O0):
<bruteForce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1f40,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1f40,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe8d(%rip),%rdi
call   1060 <readPairs@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <bruteForceKeyGenerator@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bruteForce>:
push   %r14
push   %rbx
push   %rax
mov    $0x1f40,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x1f40,%edi
call   1050 <malloc@plt>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1060 <readPairs@plt>
mov    (%rax),%rbx
mov    0x8(%rax),%r14
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <bruteForceKeyGenerator@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"C:\\Users\\mario\\Documents\\GitHub\\SDES\\pares.txt\00"
@.str.1 = [16 x i8] c"Searching keys\0A\00"
define void @bruteForce() {
%1 = alloca i8**
%2 = alloca i8**
%3 = alloca i8***
%4 = call i8** @malloc(i32 8000)
store i8** %4, i8*** %1
%5 = call i8** @malloc(i32 8000)
store i8** %5, i8*** %2
%6 = load i8**, i8*** %1
%7 = load i8**, i8*** %2
%8 = call i8*** @readPairs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %6, i8** %7)
store i8*** %8, i8**** %3
%9 = load i8***, i8**** %3
%10 = getelementptr inbounds i8**, i8*** %9, i64 0
%11 = load i8**, i8*** %10
store i8** %11, i8*** %1
%12 = load i8***, i8**** %3
%13 = getelementptr inbounds i8**, i8*** %12, i64 1
%14 = load i8**, i8*** %13
store i8** %14, i8*** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8**, i8*** %1
%17 = load i8**, i8*** %2
%18 = call i32 @bruteForceKeyGenerator(i8** %16, i8** %17)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"C:\\Users\\mario\\Documents\\GitHub\\SDES\\pares.txt\00"
@str = [15 x i8] c"Searching keys\00"
define void @bruteForce() {
%1 = tail call i8** @malloc(i32 8000)
%2 = tail call i8** @malloc(i32 8000)
%3 = tail call i8*** @readPairs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8**, i8*** %3, i64 1
%6 = load i8**, i8*** %5
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @bruteForceKeyGenerator(i8** %4, i8** %6)
ret void
}