#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*/ copierCharE(char *, void **);
int /*<<< orphan*/ libererSimple(void **);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, void *);
int copierCharE_test() {
  int returnValue = 0;
  char c1[] = "Bonjour, comment vas-tu ?";
  void *c2 = NULL;
  copierCharE(c1, &c2);
  printf("\tTest %d [", 1);
  if (strcmp(c1, c2) != 0) {
    printf("] Failed !\n");
    returnValue = 1;
  } else {
    printf("] OK !\n");
  }
  libererSimple((void **)&c2);
  return returnValue;
}


x86 assembly (clang, -O0):
<copierCharE_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0x8(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <copierCharE@plt>
lea    0xe83(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11d4 <copierCharE_test+0x94>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e2 <copierCharE_test+0xa2>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x28(%rbp),%rdi
call   1060 <libererSimple@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copierCharE_test>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movups 0xeac(%rip),%xmm0
movups %xmm0,0x1a(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <copierCharE@plt>
lea    0xe86(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xe69(%rip),%rax
lea    0xe69(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1070 <libererSimple@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.copierCharE_test.c1 = [26 x i8] c"Bonjour, comment vas-tu ?\00"
@.str = [11 x i8] c"\09Test %d [\00"
@.str.1 = [12 x i8] c"] Failed !\0A\00"
@.str.2 = [8 x i8] c"] OK !\0A\00"
define i32 @copierCharE_test() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [26 x i8]* %2 to i8*
store i8* null, i8** %3
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%6 = call i32 @copierCharE(i8* %5, i8** %3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = call i32 @libererSimple(i8** %3)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@__const.copierCharE_test.c1 = [26 x i8] c"Bonjour, comment vas-tu ?\00"
@.str = [11 x i8] c"\09Test %d [\00"
@str = [7 x i8] c"] OK !\00"
@str.3 = [11 x i8] c"] Failed !\00"
define i32 @copierCharE_test() {
%1 = alloca [26 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = call i32 @copierCharE(i8* %3, i8** %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %3, i8* %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0)
%11 = xor i1 %9, true
%12 = zext i1 %11 to i32
%13 = call i32 @puts(i8* dereferenceable(1) %10)
%14 = call i32 @libererSimple(i8** %2)
ret i32 %12
}