#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*/ ajout_info_liste(int);
int creation_fichier_liste(char *);
char *get_message();
int /*<<< orphan*/ set_message(char *);
int /*<<< orphan*/ size_message();
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
creation_message_erreur(char nom[]) {
  int fd = creation_fichier_liste("erreur.txt");
  set_message("le fichier suivant n'existe pas : ");
  write(fd, get_message(), size_message());
  write(fd, nom, strlen(nom));
  set_message("\n\n");
  write(fd, get_message(), size_message());
  ajout_info_liste(fd);
}


x86 assembly (clang, -O0):
<creation_message_erreur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe7d(%rip),%rdi
call   1070 <creation_fichier_liste@plt>
mov    %eax,-0x14(%rbp)
lea    0xe79(%rip),%rdi
call   1090 <set_message@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   1080 <size_message@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
lea    0xe45(%rip),%rdi
call   1090 <set_message@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <size_message@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
call   1060 <ajout_info_liste@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creation_message_erreur>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xe81(%rip),%rdi
call   1070 <creation_fichier_liste@plt>
mov    %eax,%ebx
lea    0xe7e(%rip),%rdi
call   1090 <set_message@plt>
xor    %eax,%eax
call   1030 <get_message@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1080 <size_message@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <write@plt>
lea    0xe64(%rip),%rdi
call   1090 <set_message@plt>
xor    %eax,%eax
call   1030 <get_message@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1080 <size_message@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <ajout_info_liste@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"erreur.txt\00"
@.str.1 = [35 x i8] c"le fichier suivant n'existe pas : \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @creation_message_erreur(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 @creation_fichier_liste(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %4
%6 = call i32 @set_message(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i8* (...) @get_message()
%9 = call i32 (...) @size_message()
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @write(i32 %11, i8* %12, i32 %14)
%16 = call i32 @set_message(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = call i8* (...) @get_message()
%19 = call i32 (...) @size_message()
%20 = call i32 @write(i32 %17, i8* %18, i32 %19)
%21 = load i32, i32* %4
%22 = call i32 @ajout_info_liste(i32 %21)
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [11 x i8] c"erreur.txt\00"
@.str.1 = [35 x i8] c"le fichier suivant n'existe pas : \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @creation_message_erreur(i8* %0) {
%2 = tail call i32 @creation_fichier_liste(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @set_message(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* (...) @get_message()
%5 = tail call i32 (...) @size_message()
%6 = tail call i32 @write(i32 %2, i8* %4, i32 %5)
%7 = tail call i32 @strlen(i8* %0)
%8 = tail call i32 @write(i32 %2, i8* %0, i32 %7)
%9 = tail call i32 @set_message(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i8* (...) @get_message()
%11 = tail call i32 (...) @size_message()
%12 = tail call i32 @write(i32 %2, i8* %10, i32 %11)
%13 = tail call i32 @ajout_info_liste(i32 %2)
ret i32 undef
}