#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*/ remove(char *);
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ viderDossierInventaireSauvegarde(char const *);
int /*<<< orphan*/ viderDossierNiveauSauvegarde(char const *);
void viderDossierSauvegarde(const char *nomPartie) {
  char chemin[200];
  viderDossierNiveauSauvegarde(nomPartie);
  viderDossierInventaireSauvegarde(nomPartie);
  sprintf(chemin, "Sauvegarde/%s/detail_personnage.txt", nomPartie);
  remove(chemin);
  sprintf(chemin, "Sauvegarde/%s", nomPartie);
  rmdir(chemin);
}


x86 assembly (clang, -O0):
<viderDossierSauvegarde>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <viderDossierNiveauSauvegarde@plt>
mov    -0x8(%rbp),%rdi
call   1070 <viderDossierInventaireSauvegarde@plt>
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe7d(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <remove@plt>
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe7e(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
call   1040 <rmdir@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viderDossierSauvegarde>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rdi,%rbx
call   1050 <viderDossierNiveauSauvegarde@plt>
mov    %rbx,%rdi
call   1070 <viderDossierInventaireSauvegarde@plt>
lea    0xe8f(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1030 <remove@plt>
lea    0xe96(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <rmdir@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Sauvegarde/%s/detail_personnage.txt\00"
@.str.1 = [14 x i8] c"Sauvegarde/%s\00"
define void @viderDossierSauvegarde(i8* %0) {
%2 = alloca i8*
%3 = alloca [200 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @viderDossierNiveauSauvegarde(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @viderDossierInventaireSauvegarde(i8* %6)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%12 = call i32 @remove(i8* %11)
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%14 = load i8*, i8** %2
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%17 = call i32 @rmdir(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Sauvegarde/%s/detail_personnage.txt\00"
@.str.1 = [14 x i8] c"Sauvegarde/%s\00"
define void @viderDossierSauvegarde(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @viderDossierNiveauSauvegarde(i8* %0)
%5 = tail call i32 @viderDossierInventaireSauvegarde(i8* %0)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @remove(i8* %3)
%8 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = call i32 @rmdir(i8* %3)
ret void
}