#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*/ Saisie_Chaine(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void Saisie_nom(char **nom, char **prenom, char chaine[255]) {
  puts("Entrez le nom du client.");
  Saisie_Chaine(chaine);
  *nom = (char *)malloc(sizeof(char) * strlen(chaine));
  strcpy(*nom, chaine);
  while (chaine[0] == '\0') {
    puts("Entrez le nom du client. Ceci est obligatoire !");
    Saisie_Chaine(chaine);
    *nom = (char *)malloc(sizeof(char) * strlen(chaine));
    strcpy(*nom, chaine);
  }
  puts("Entrez le prenom du client.");
  Saisie_Chaine(chaine);
  *prenom = (char *)malloc(sizeof(char) * strlen(chaine));
  strcpy(*prenom, chaine);
  while (chaine[0] == '\0') {
    puts("Entrez le prenom du client. Ceci est obligatoire !");
    Saisie_Chaine(chaine);
    *prenom = (char *)malloc(sizeof(char) * strlen(chaine));
    strcpy(*prenom, chaine);
  }
}


x86 assembly (clang, -O0):
<Saisie_nom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1060 <Saisie_Chaine@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1203 <Saisie_nom+0xb3>
lea    0xe59(%rip),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1060 <Saisie_Chaine@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11a9 <Saisie_nom+0x59>
lea    0xe3f(%rip),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1060 <Saisie_Chaine@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12a2 <Saisie_nom+0x152>
lea    0xe06(%rip),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1060 <Saisie_Chaine@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1248 <Saisie_nom+0xf8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Saisie_nom>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xe98(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <Saisie_Chaine@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
cmpb   $0x0,(%rbx)
jne    11d2 <Saisie_nom+0x82>
lea    0xe7b(%rip),%r12
xchg   %ax,%ax
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <Saisie_Chaine@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
cmpb   $0x0,(%rbx)
je     11a0 <Saisie_nom+0x50>
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <Saisie_Chaine@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
cmpb   $0x0,(%rbx)
jne    1242 <Saisie_nom+0xf2>
lea    0xe56(%rip),%r15
nop
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <Saisie_Chaine@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
cmpb   $0x0,(%rbx)
je     1210 <Saisie_nom+0xc0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Entrez le nom du client.\00"
@.str.1 = [48 x i8] c"Entrez le nom du client. Ceci est obligatoire !\00"
@.str.2 = [28 x i8] c"Entrez le prenom du client.\00"
@.str.3 = [51 x i8] c"Entrez le prenom du client. Ceci est obligatoire !\00"
define void @Saisie_nom(i8** %0, i8** %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8*
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %6
%9 = call i32 @Saisie_Chaine(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
%17 = load i8**, i8*** %4
store i8* %16, i8** %17
%18 = load i8**, i8*** %4
%19 = load i8*, i8** %18
%20 = load i8*, i8** %6
%21 = call i32 @strcpy(i8* %19, i8* %20)
br label %22
22: ; preds = %28, %3
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %44
28: ; preds = %22
%29 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%30 = load i8*, i8** %6
%31 = call i32 @Saisie_Chaine(i8* %30)
%32 = load i8*, i8** %6
%33 = call i32 @strlen(i8* %32)
%34 = sext i32 %33 to i64
%35 = mul i64 1, %34
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to i8*
%39 = load i8**, i8*** %4
store i8* %38, i8** %39
%40 = load i8**, i8*** %4
%41 = load i8*, i8** %40
%42 = load i8*, i8** %6
%43 = call i32 @strcpy(i8* %41, i8* %42)
br label %22
44: ; preds = %22
%45 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%46 = load i8*, i8** %6
%47 = call i32 @Saisie_Chaine(i8* %46)
%48 = load i8*, i8** %6
%49 = call i32 @strlen(i8* %48)
%50 = sext i32 %49 to i64
%51 = mul i64 1, %50
%52 = trunc i64 %51 to i32
%53 = call i64 @malloc(i32 %52)
%54 = inttoptr i64 %53 to i8*
%55 = load i8**, i8*** %5
store i8* %54, i8** %55
%56 = load i8**, i8*** %5
%57 = load i8*, i8** %56
%58 = load i8*, i8** %6
%59 = call i32 @strcpy(i8* %57, i8* %58)
br label %60
60: ; preds = %66, %44
%61 = load i8*, i8** %6
%62 = getelementptr inbounds i8, i8* %61, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %82
66: ; preds = %60
%67 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%68 = load i8*, i8** %6
%69 = call i32 @Saisie_Chaine(i8* %68)
%70 = load i8*, i8** %6
%71 = call i32 @strlen(i8* %70)
%72 = sext i32 %71 to i64
%73 = mul i64 1, %72
%74 = trunc i64 %73 to i32
%75 = call i64 @malloc(i32 %74)
%76 = inttoptr i64 %75 to i8*
%77 = load i8**, i8*** %5
store i8* %76, i8** %77
%78 = load i8**, i8*** %5
%79 = load i8*, i8** %78
%80 = load i8*, i8** %6
%81 = call i32 @strcpy(i8* %79, i8* %80)
br label %60
82: ; preds = %60
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Entrez le nom du client.\00"
@.str.1 = [48 x i8] c"Entrez le nom du client. Ceci est obligatoire !\00"
@.str.2 = [28 x i8] c"Entrez le prenom du client.\00"
@.str.3 = [51 x i8] c"Entrez le prenom du client. Ceci est obligatoire !\00"
define void @Saisie_nom(i8** nocapture writeonly %0, i8** nocapture writeonly %1, i8* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @Saisie_Chaine(i8* %2)
%6 = tail call i32 @strlen(i8* %2)
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %0
%9 = tail call i32 @strcpy(i8* %8, i8* %2)
%10 = load i8, i8* %2
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %3, %12
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @Saisie_Chaine(i8* %2)
%15 = tail call i32 @strlen(i8* %2)
%16 = tail call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %0
%18 = tail call i32 @strcpy(i8* %17, i8* %2)
%19 = load i8, i8* %2
%20 = icmp eq i8 %19, 0
br i1 %20, label %12, label %21
21: ; preds = %12, %3
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i32 @Saisie_Chaine(i8* %2)
%24 = tail call i32 @strlen(i8* %2)
%25 = tail call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %1
%27 = tail call i32 @strcpy(i8* %26, i8* %2)
%28 = load i8, i8* %2
%29 = icmp eq i8 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %21, %30
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%32 = tail call i32 @Saisie_Chaine(i8* %2)
%33 = tail call i32 @strlen(i8* %2)
%34 = tail call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to i8*
store i8* %35, i8** %1
%36 = tail call i32 @strcpy(i8* %35, i8* %2)
%37 = load i8, i8* %2
%38 = icmp eq i8 %37, 0
br i1 %38, label %30, label %39
39: ; preds = %30, %21
ret void
}