#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 */
long *crypt_messageA(char *, long, long);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
long *genere_confirmationB(char *c, long e, long n) {
  long *message = malloc(sizeof(long));
  if (c[0] == 'A' && c[1] == 'B' && c[2] == '?' && c[3] == '!') {
    printf("-----------------CONFIRMATION DANS B----------------\n");
    char *M = malloc(4 * sizeof(char));
    M[0] = 'A';
    M[1] = 'B';
    M[2] = 'O';
    M[3] = 'K';
    message = crypt_messageA(M, e, n);
  } else {
    message[0] = '0';
  }
  return message;
}


x86 assembly (clang, -O0):
<genere_confirmationB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jne    11e8 <genere_confirmationB+0xb8>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x42,%eax
jne    11e8 <genere_confirmationB+0xb8>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x3f,%eax
jne    11e8 <genere_confirmationB+0xb8>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x21,%eax
jne    11e8 <genere_confirmationB+0xb8>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x41,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x42,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x4f,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x4b,0x3(%rax)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <crypt_messageA@plt>
mov    %rax,-0x20(%rbp)
jmp    11f3 <genere_confirmationB+0xc3>
mov    -0x20(%rbp),%rax
movq   $0x30,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genere_confirmationB>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x8,%edi
call   1050 <malloc@plt>
cmpb   $0x41,(%rbx)
jne    118e <genere_confirmationB+0x5e>
cmpb   $0x42,0x1(%rbx)
jne    118e <genere_confirmationB+0x5e>
cmpb   $0x3f,0x2(%rbx)
jne    118e <genere_confirmationB+0x5e>
cmpb   $0x21,0x3(%rbx)
jne    118e <genere_confirmationB+0x5e>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
movl   $0x4b4f4241,(%rax)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <crypt_messageA@plt>
movq   $0x30,(%rax)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [54 x i8] c"-----------------CONFIRMATION DANS B----------------\0A\00"
define i64* @genere_confirmationB(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = call i8* @malloc(i32 8)
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %7
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 65
br i1 %15, label %16, label %49
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 66
br i1 %21, label %22, label %49
22: ; preds = %16
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 63
br i1 %27, label %28, label %49
28: ; preds = %22
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 3
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 33
br i1 %33, label %34, label %49
34: ; preds = %28
%35 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%36 = call i8* @malloc(i32 4)
store i8* %36, i8** %8
%37 = load i8*, i8** %8
%38 = getelementptr inbounds i8, i8* %37, i64 0
store i8 65, i8* %38
%39 = load i8*, i8** %8
%40 = getelementptr inbounds i8, i8* %39, i64 1
store i8 66, i8* %40
%41 = load i8*, i8** %8
%42 = getelementptr inbounds i8, i8* %41, i64 2
store i8 79, i8* %42
%43 = load i8*, i8** %8
%44 = getelementptr inbounds i8, i8* %43, i64 3
store i8 75, i8* %44
%45 = load i8*, i8** %8
%46 = load i64, i64* %5
%47 = load i64, i64* %6
%48 = call i64* @crypt_messageA(i8* %45, i64 %46, i64 %47)
store i64* %48, i64** %7
br label %52
49: ; preds = %28, %22, %16, %3
%50 = load i64*, i64** %7
%51 = getelementptr inbounds i64, i64* %50, i64 0
store i64 48, i64* %51
br label %52
52: ; preds = %49, %34
%53 = load i64*, i64** %7
ret i64* %53
}

LLVM IR (-O2):
@str = [53 x i8] c"-----------------CONFIRMATION DANS B----------------\00"
define i64* @genere_confirmationB(i8* nocapture %0, i64 %1, i64 %2) {
%4 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%5 = bitcast i8* %4 to i64*
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 65
br i1 %7, label %8, label %27
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 66
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 63
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %0, i64 3
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 33
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%22 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
store i8 65, i8* %22
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 66, i8* %23
%24 = getelementptr inbounds i8, i8* %22, i64 2
store i8 79, i8* %24
%25 = getelementptr inbounds i8, i8* %22, i64 3
store i8 75, i8* %25
%26 = tail call i64* @crypt_messageA(i8* %22, i64 %1, i64 %2)
br label %28
27: ; preds = %16, %12, %8, %3
store i64 48, i64* %5
br label %28
28: ; preds = %27, %20
%29 = phi i64* [ %26, %20 ], [ %5, %27 ]
ret i64* %29
}