#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 */
scalar_t__ check_key(char *, char *);
int /*<<< orphan*/ cript(char *);
scalar_t__ pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ t_p(char *, char *, char *);
void main() {
  char msg[30];
  char t[5], p[5];
  printf("Informe a 1 chave: ");
  scanf("%s", t);
  printf("Informe a 2 chave: ");
  scanf("%s", p);
  if (check_key(t, p) == (pow(2, 10) + pow(2, 6) + 1)) {
    printf("Informe a mensagem: ");
    scanf("%s", msg);
    t_p(msg, t, p);
    printf("Resultado: %s\n", msg);
    cript(msg);
  } else {
    printf("Verifique suas chaves!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x25(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2a(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x25(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1080 <check_key@plt>
mov    %rax,-0x38(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
call   1070 <pow@plt>
mov    %rax,-0x40(%rbp)
mov    $0x2,%edi
mov    $0x6,%esi
call   1070 <pow@plt>
mov    -0x40(%rbp),%rcx
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
add    %rdx,%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1241 <main+0xe1>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe09(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
lea    -0x2a(%rbp),%rdx
call   1050 <t_p@plt>
lea    -0x20(%rbp),%rsi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <cript@plt>
jmp    124f <main+0xef>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe86(%rip),%r15
lea    0xb(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x6(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <check_key@plt>
mov    %rax,%r14
mov    $0x2,%edi
mov    $0xa,%esi
call   1080 <pow@plt>
mov    %rax,%rbx
mov    $0x2,%edi
mov    $0x6,%esi
call   1080 <pow@plt>
add    %rbx,%rax
add    $0x1,%rax
cmp    %rax,%r14
jne    1246 <main+0xd6>
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe08(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0xb(%rsp),%rsi
lea    0x6(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <t_p@plt>
lea    0xe0e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <cript@plt>
jmp    1252 <main+0xe2>
lea    0xe02(%rip),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Informe a 1 chave: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Informe a 2 chave: \00"
@.str.3 = [21 x i8] c"Informe a mensagem: \00"
@.str.4 = [15 x i8] c"Resultado: %s\0A\00"
@.str.5 = [24 x i8] c"Verifique suas chaves!\0A\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%12 = call i64 @check_key(i8* %10, i8* %11)
%13 = call i64 @pow(i32 2, i32 10)
%14 = call i64 @pow(i32 2, i32 6)
%15 = add nsw i64 %13, %14
%16 = add nsw i64 %15, 1
%17 = icmp eq i64 %12, %16
br i1 %17, label %18, label %30
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%25 = call i32 @t_p(i8* %22, i8* %23, i8* %24)
%26 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%29 = call i32 @cript(i8* %28)
br label %32
30: ; preds = %0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %18
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe a 1 chave: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Informe a 2 chave: \00"
@.str.3 = [21 x i8] c"Informe a mensagem: \00"
@.str.4 = [15 x i8] c"Resultado: %s\0A\00"
@str = [23 x i8] c"Verifique suas chaves!\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%11 = call i64 @check_key(i8* %5, i8* %6)
%12 = call i64 @pow(i32 2, i32 10)
%13 = call i64 @pow(i32 2, i32 6)
%14 = add i64 %12, 1
%15 = add i64 %14, %13
%16 = icmp eq i64 %11, %15
br i1 %16, label %17, label %23
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%20 = call i32 @t_p(i8* %4, i8* %5, i8* %6)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%22 = call i32 @cript(i8* %4)
br label %25
23: ; preds = %0
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %23, %17
ret void
}