#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
int supprDescriptorHeader(FILE *base, char *line, char *baseType) {
  char buffer[100];
  FILE *bufferFile;
  int i = 0;
  rewind(base);
  if (strcmp(baseType, "sound") == 0) {
    bufferFile = fopen("Bases/liste_base_audio.base.tmp", "w");
  } else if (strcmp(baseType, "text") == 0) {
    bufferFile = fopen("Bases/liste_base_text.base.tmp", "w");
  } else if (strcmp(baseType, "image") == 0) {
    bufferFile = fopen("Bases/liste_base_image.base.tmp", "w");
  }
  if (bufferFile == NULL) {
    return (-1);
  }
  while (fgets(buffer, 100, base)) {
    if (strcmp(buffer, line) != 0) {
      fputs(buffer, bufferFile);
    }
  }
  fclose(bufferFile);
  fclose(base);
  if (strcmp(baseType, "sound") == 0) {
    rename("Bases/liste_base_audio.base.tmp", "Bases/liste_base_audio.base");
    base = fopen("Bases/liste_base_audio.base", "a+");
  } else if (strcmp(baseType, "text") == 0) {
    rename("Bases/liste_base_text.base.tmp", "Bases/liste_base_text.base");
    base = fopen("Bases/liste_base_text.base", "a+");
  } else if (strcmp(baseType, "image") == 0) {
    rename("Bases/liste_base_image.base.tmp", "Bases/liste_base_image.base");
    base = fopen("Bases/liste_base_image.base", "a+");
  }
  return (0);
}


x86 assembly (clang, -O0):
<supprDescriptorHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x20(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11d3 <supprDescriptorHeader+0x63>
lea    0xe4b(%rip),%rdi
lea    0xe64(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x98(%rbp)
jmp    124a <supprDescriptorHeader+0xda>
mov    -0x20(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    120c <supprDescriptorHeader+0x9c>
lea    0xe39(%rip),%rdi
lea    0xe2b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x98(%rbp)
jmp    1245 <supprDescriptorHeader+0xd5>
mov    -0x20(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1240 <supprDescriptorHeader+0xd0>
lea    0xe25(%rip),%rdi
lea    0xdf2(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x98(%rbp)
jmp    1245 <supprDescriptorHeader+0xd5>
jmp    124a <supprDescriptorHeader+0xda>
cmpq   $0x0,-0x98(%rbp)
jne    1264 <supprDescriptorHeader+0xf4>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b6 <supprDescriptorHeader+0x246>
jmp    1269 <supprDescriptorHeader+0xf9>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12ba <supprDescriptorHeader+0x14a>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12b5 <supprDescriptorHeader+0x145>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   1050 <fputs@plt>
jmp    1269 <supprDescriptorHeader+0xf9>
mov    -0x98(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
lea    0xd26(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1318 <supprDescriptorHeader+0x1a8>
lea    0xd16(%rip),%rdi
lea    0xd7b(%rip),%rsi
call   1090 <rename@plt>
lea    0xd6f(%rip),%rdi
lea    0xd84(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    13af <supprDescriptorHeader+0x23f>
mov    -0x20(%rbp),%rdi
lea    0xd05(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1361 <supprDescriptorHeader+0x1f1>
lea    0xcf4(%rip),%rdi
lea    0xd51(%rip),%rsi
call   1090 <rename@plt>
lea    0xd45(%rip),%rdi
lea    0xd3b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    13aa <supprDescriptorHeader+0x23a>
mov    -0x20(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13a5 <supprDescriptorHeader+0x235>
lea    0xcd0(%rip),%rdi
lea    0xd23(%rip),%rsi
call   1090 <rename@plt>
lea    0xd17(%rip),%rdi
lea    0xcf2(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    13aa <supprDescriptorHeader+0x23a>
jmp    13af <supprDescriptorHeader+0x23f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supprDescriptorHeader>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1040 <rewind@plt>
lea    0xe6e(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11d0 <supprDescriptorHeader+0x60>
lea    0xe82(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11d9 <supprDescriptorHeader+0x69>
lea    0xe92(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11f8 <supprDescriptorHeader+0x88>
lea    0xe84(%rip),%rdi
jmp    11e0 <supprDescriptorHeader+0x70>
lea    0xe2f(%rip),%rdi
jmp    11e0 <supprDescriptorHeader+0x70>
lea    0xe4d(%rip),%rdi
lea    0xe3f(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
je     12b3 <supprDescriptorHeader+0x143>
mov    %rsp,%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1252 <supprDescriptorHeader+0xe2>
mov    %rsp,%rbx
jmp    1235 <supprDescriptorHeader+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r12,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1252 <supprDescriptorHeader+0xe2>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1220 <supprDescriptorHeader+0xb0>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <fputs@plt>
jmp    1220 <supprDescriptorHeader+0xb0>
mov    %r13,%rdi
call   1030 <fclose@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
lea    0xd97(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12ba <supprDescriptorHeader+0x14a>
lea    0xdab(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12ca <supprDescriptorHeader+0x15a>
lea    0xdbb(%rip),%rsi
mov    %r14,%rdi
call   1070 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    12f1 <supprDescriptorHeader+0x181>
lea    0xda8(%rip),%rdi
lea    0xdfb(%rip),%rbx
jmp    12d8 <supprDescriptorHeader+0x168>
mov    $0xffffffff,%eax
jmp    12f1 <supprDescriptorHeader+0x181>
lea    0xd45(%rip),%rdi
lea    0xdaa(%rip),%rbx
jmp    12d8 <supprDescriptorHeader+0x168>
lea    0xd5c(%rip),%rdi
lea    0xdb9(%rip),%rbx
mov    %rbx,%rsi
call   1090 <rename@plt>
lea    0xda7(%rip),%rsi
mov    %rbx,%rdi
call   1080 <fopen@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"sound\00"
@.str.1 = [32 x i8] c"Bases/liste_base_audio.base.tmp\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [31 x i8] c"Bases/liste_base_text.base.tmp\00"
@.str.5 = [6 x i8] c"image\00"
@.str.6 = [32 x i8] c"Bases/liste_base_image.base.tmp\00"
@.str.7 = [28 x i8] c"Bases/liste_base_audio.base\00"
@.str.8 = [3 x i8] c"a+\00"
@.str.9 = [27 x i8] c"Bases/liste_base_text.base\00"
@.str.10 = [28 x i8] c"Bases/liste_base_image.base\00"
define i32 @supprDescriptorHeader(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [100 x i8]
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 0, i32* %10
%11 = load i32*, i32** %5
%12 = call i32 @rewind(i32* %11)
%13 = load i8*, i8** %7
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = call i32* @fopen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %17, i32** %9
br label %32
18: ; preds = %3
%19 = load i8*, i8** %7
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %23, i32** %9
br label %31
24: ; preds = %18
%25 = load i8*, i8** %7
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32* @fopen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %29, i32** %9
br label %30
30: ; preds = %28, %24
br label %31
31: ; preds = %30, %22
br label %32
32: ; preds = %31, %16
%33 = load i32*, i32** %9
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 -1, i32* %4
br label %80
36: ; preds = %32
br label %37
37: ; preds = %51, %36
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%39 = load i32*, i32** %5
%40 = call i64 @fgets(i8* %38, i32 100, i32* %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %52
42: ; preds = %37
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%44 = load i8*, i8** %6
%45 = call i64 @strcmp(i8* %43, i8* %44)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %42
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%49 = load i32*, i32** %9
%50 = call i32 @fputs(i8* %48, i32* %49)
br label %51
51: ; preds = %47, %42
br label %37
52: ; preds = %37
%53 = load i32*, i32** %9
%54 = call i32 @fclose(i32* %53)
%55 = load i32*, i32** %5
%56 = call i32 @fclose(i32* %55)
%57 = load i8*, i8** %7
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %52
%61 = call i32 @rename(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%62 = call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %62, i32** %5
br label %79
63: ; preds = %52
%64 = load i8*, i8** %7
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %63
%68 = call i32 @rename(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%69 = call i32* @fopen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %69, i32** %5
br label %78
70: ; preds = %63
%71 = load i8*, i8** %7
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = call i32 @rename(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%76 = call i32* @fopen(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %76, i32** %5
br label %77
77: ; preds = %74, %70
br label %78
78: ; preds = %77, %67
br label %79
79: ; preds = %78, %60
store i32 0, i32* %4
br label %80
80: ; preds = %79, %35
%81 = load i32, i32* %4
ret i32 %81
}

LLVM IR (-O2):
@.str = [6 x i8] c"sound\00"
@.str.1 = [32 x i8] c"Bases/liste_base_audio.base.tmp\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [31 x i8] c"Bases/liste_base_text.base.tmp\00"
@.str.5 = [6 x i8] c"image\00"
@.str.6 = [32 x i8] c"Bases/liste_base_image.base.tmp\00"
@.str.7 = [28 x i8] c"Bases/liste_base_audio.base\00"
@.str.8 = [3 x i8] c"a+\00"
@.str.9 = [27 x i8] c"Bases/liste_base_text.base\00"
@.str.10 = [28 x i8] c"Bases/liste_base_image.base\00"
define i32 @supprDescriptorHeader(i32* nocapture %0, i8* %1, i8* %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @rewind(i32* %0)
%7 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12, %9, %3
%16 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), %9 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), %12 ]
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %51, label %19
19: ; preds = %12, %15
%20 = phi i32* [ %17, %15 ], [ undef, %12 ]
%21 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%22 = icmp eq i64 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %19, %28
%24 = call i64 @strcmp(i8* %5, i8* %1)
%25 = icmp eq i64 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = call i32 @fputs(i8* %5, i32* %20)
br label %28
28: ; preds = %26, %23
%29 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %23
31: ; preds = %28, %19
%32 = call i32 @fclose(i32* %20)
%33 = call i32 @fclose(i32* %0)
%34 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @rename(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
br label %48
38: ; preds = %31
%39 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @rename(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
br label %48
43: ; preds = %38
%44 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = call i32 @rename(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
br label %48
48: ; preds = %41, %46, %36
%49 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), %36 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), %46 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), %41 ]
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %51
51: ; preds = %48, %43, %15
%52 = phi i32 [ -1, %15 ], [ 0, %43 ], [ 0, %48 ]
ret i32 %52
}