#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*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  char buffer[256 + 1];
  int top_secret = 0;
  if (argc <= 1) {
    printf("Veuillez indiquer une chaine en argument du programme !\n");
    return -1;
  }
  strcpy(buffer, argv[1]);
  printf("Vous avez entre : \n");
  printf(buffer);
  printf("\n\n");
  if (!strcmp(buffer, "code_secret"))
    top_secret = 1;
  if (top_secret)
    printf("Vous etes rentre dans la partie top secrete du programme !\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x124(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1175 <main+0x45>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f3 <main+0xc3>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x120(%rbp),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x120(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11d3 <main+0xa3>
movl   $0x1,-0x124(%rbp)
cmpl   $0x0,-0x124(%rbp)
je     11ec <main+0xbc>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
cmp    $0x1,%edi
jg     1150 <main+0x20>
lea    0xf18(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
jmp    11ab <main+0x7b>
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
movabs $0x6365735f65646f63,%rax
73 65 63
xor    (%rsp),%rax
mov    0x8(%rsp),%ecx
xor    $0x746572,%rcx
xor    %ebx,%ebx
or     %rax,%rcx
jne    11ab <main+0x7b>
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Veuillez indiquer une chaine en argument du programme !\0A\00"
@.str.1 = [20 x i8] c"Vous avez entre : \0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [12 x i8] c"code_secret\00"
@.str.4 = [60 x i8] c"Vous etes rentre dans la partie top secrete du programme !\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [257 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %32
12: ; preds = %2
%13 = getelementptr inbounds [257 x i8], [257 x i8]* %6, i64 0, i64 0
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %13, i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%19 = getelementptr inbounds [257 x i8], [257 x i8]* %6, i64 0, i64 0
%20 = call i32 @printf(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [257 x i8], [257 x i8]* %6, i64 0, i64 0
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %12
store i32 1, i32* %7
br label %26
26: ; preds = %25, %12
%27 = load i32, i32* %7
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %26
store i32 0, i32* %3
br label %32
32: ; preds = %31, %10
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str.3 = [12 x i8] c"code_secret\00"
@str = [19 x i8] c"Vous avez entre : \00"
@str.5 = [2 x i8] c"\0A\00"
@str.6 = [59 x i8] c"Vous etes rentre dans la partie top secrete du programme !\00"
@str.7 = [56 x i8] c"Veuillez indiquer une chaine en argument du programme !\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [257 x i8]
%4 = getelementptr inbounds [257 x i8], [257 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.7, i64 0, i64 0))
br label %19
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %4, i8* %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%13 = call i32 @printf(i8* %4)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
%15 = call i32 @bcmp(i8* dereferenceable(12) %4, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i64 12)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.6, i64 0, i64 0))
br label %19
19: ; preds = %8, %17, %6
%20 = phi i32 [ -1, %6 ], [ 0, %17 ], [ 0, %8 ]
ret i32 %20
}