#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*/ affichePhrase(char *, int);
int /*<<< orphan*/ crypte(char *, int, int);
int /*<<< orphan*/ decrypte(char *, int, int);
int lireCle();
int lirePhrase(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  int key = lireCle();
  printf("Phrase a chiffrer (entre \"):\n");
  char phrase[255];
  int count = lirePhrase(phrase);
  crypte(phrase, count, key);
  affichePhrase(phrase, count);
  printf("\n");
  decrypte(phrase, count, key);
  affichePhrase(phrase, count);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <lireCle@plt>
mov    %eax,-0x8(%rbp)
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <lirePhrase@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1070 <crypte@plt>
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
call   1050 <affichePhrase@plt>
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1080 <decrypte@plt>
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
call   1050 <affichePhrase@plt>
lea    0xe21(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1070 <lireCle@plt>
mov    %eax,%r14d
lea    0xe74(%rip),%rdi
call   1050 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <lirePhrase@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14d,%edx
call   1080 <crypte@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <affichePhrase@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1090 <decrypte@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <affichePhrase@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Phrase a chiffrer (entre \22):\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [255 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @lireCle()
store i32 %5, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @lirePhrase(i8* %7)
store i32 %8, i32* %4
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = call i32 @crypte(i8* %9, i32 %10, i32 %11)
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i32 @affichePhrase(i8* %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = call i32 @decrypte(i8* %17, i32 %18, i32 %19)
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%22 = load i32, i32* %4
%23 = call i32 @affichePhrase(i8* %21, i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Phrase a chiffrer (entre \22):\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = tail call i32 (...) @lireCle()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @lirePhrase(i8* %4)
%6 = call i32 @crypte(i8* %4, i32 %5, i32 %2)
%7 = call i32 @affichePhrase(i8* %4, i32 %5)
%8 = call i32 @putchar(i32 10)
%9 = call i32 @decrypte(i8* %4, i32 %5, i32 %2)
%10 = call i32 @affichePhrase(i8* %4, i32 %5)
%11 = call i32 @putchar(i32 10)
ret i32 0
}