#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*/ *fopen(char const *, char *);
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char const *, char *);
FILE *verifierFichier(const char *nom_fichier) {
  FILE *fichier = NULL;
  if (nom_fichier == NULL) {
    fichier = stdout;
  } else if (nom_fichier != NULL &&
             strcmp(nom_fichier, "temp_region.txt") != 0) {
    fichier = fopen(nom_fichier, "w+");
  } else if (strcmp(nom_fichier, "temp_region.txt") == 0) {
    fichier = fopen(nom_fichier, "a+");
  }
  return fichier;
}


x86 assembly (clang, -O0):
<verifierFichier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <verifierFichier+0x32>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    11c8 <verifierFichier+0xa8>
cmpq   $0x0,-0x8(%rbp)
je     1190 <verifierFichier+0x70>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1190 <verifierFichier+0x70>
mov    -0x8(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    11c3 <verifierFichier+0xa3>
mov    -0x8(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11be <verifierFichier+0x9e>
mov    -0x8(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    11c3 <verifierFichier+0xa3>
jmp    11c8 <verifierFichier+0xa8>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifierFichier>:
push   %rbx
test   %rdi,%rdi
je     114a <verifierFichier+0x2a>
mov    %rdi,%rbx
lea    0xed0(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1156 <verifierFichier+0x36>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fopen@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     116e <verifierFichier+0x4e>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe9e(%rip),%rsi
jmp    1141 <verifierFichier+0x21>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [16 x i8] c"temp_region.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [3 x i8] c"a+\00"
define i32* @verifierFichier(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** @stdout
store i32* %7, i32** %3
br label %27
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %2
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %3
br label %26
18: ; preds = %11, %8
%19 = load i8*, i8** %2
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i8*, i8** %2
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %24, i32** %3
br label %25
25: ; preds = %22, %18
br label %26
26: ; preds = %25, %15
br label %27
27: ; preds = %26, %6
%28 = load i32*, i32** %3
ret i32* %28
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [16 x i8] c"temp_region.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [3 x i8] c"a+\00"
define i32* @verifierFichier(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32*, i32** @stdout
br label %15
5: ; preds = %1
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %15
10: ; preds = %5
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %8, %13, %10, %3
%16 = phi i32* [ %4, %3 ], [ %9, %8 ], [ %14, %13 ], [ null, %10 ]
ret i32* %16
}