#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 */
struct stat {
  int /*<<< orphan*/ st_mtime;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ formatDate(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ getStringUntil(char *, char *, char);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ splitHeader(char *, char *, int *, int *, char *, char *);
int stat(char *, struct stat *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int getIfFileHasModified(char *id, char *fileName, FILE *log, char *baseType) {
  char buffer[100] = {0};
  char header[100] = {0};
  char currentID[100] = {0};
  char date[100] = {0};
  char fileDate[100] = {0};
  char headerID[100] = {0};
  char type[100] = {0};
  FILE *base;
  int nbColumns;
  int nbLines;
  struct stat st;
  if (strcmp(baseType, "sound") == 0) {
    base = fopen("Bases/base_descripteur_audio.base", "r");
  } else if (strcmp(baseType, "text") == 0) {
    base = fopen("Bases/base_descripteur_text.base", "r");
  } else if (strcmp(baseType, "image") == 0) {
    base = fopen("Bases/base_descripteur_image.base", "r");
  }
  if (base == NULL) {
    fprintf(log, "BASE OPENNING FAILED ");
    return (-1);
  }
  if (stat(fileName, &st) == -1) {
    fprintf(log, "STAT ERROR ");
    fclose(base);
    return (-1);
  }
  while (!feof(base)) {
    fgets(buffer, 100, base);
    if (buffer[0] != 'I') {
      continue;
    }
    getStringUntil(buffer, currentID, '\t');
    if (strcmp(currentID, id) == 0) {
      strcpy(header, buffer);
      splitHeader(header, headerID, &nbColumns, &nbLines, type, date);
      formatDate(date, buffer);
      formatDate(ctime(&st.st_mtime), fileDate);
      if (strcmp(buffer, fileDate) == 0) {
        fclose(base);
        return (1);
      } else {
        fclose(base);
        return (0);
      }
    }
    memset(currentID, 0, 100);
  }
  fclose(base);
  return (-1);
}


x86 assembly (clang, -O0):
<getIfFileHasModified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x170(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x1e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x250(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x2c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x330(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
mov    -0x28(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12a9 <getIfFileHasModified+0xd9>
lea    0xd75(%rip),%rdi
lea    0xd90(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x338(%rbp)
jmp    1320 <getIfFileHasModified+0x150>
mov    -0x28(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12e2 <getIfFileHasModified+0x112>
lea    0xd65(%rip),%rdi
lea    0xd57(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x338(%rbp)
jmp    131b <getIfFileHasModified+0x14b>
mov    -0x28(%rbp),%rdi
lea    0xd63(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1316 <getIfFileHasModified+0x146>
lea    0xd53(%rip),%rdi
lea    0xd1e(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x338(%rbp)
jmp    131b <getIfFileHasModified+0x14b>
jmp    1320 <getIfFileHasModified+0x150>
cmpq   $0x0,-0x338(%rbp)
jne    134a <getIfFileHasModified+0x17a>
mov    -0x20(%rbp),%rdi
lea    0xd3f(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <getIfFileHasModified+0x328>
mov    -0x18(%rbp),%rdi
lea    -0x348(%rbp),%rsi
call   10c0 <stat@plt>
cmp    $0xffffffff,%eax
jne    138b <getIfFileHasModified+0x1bb>
mov    -0x20(%rbp),%rdi
lea    0xd20(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x338(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14f8 <getIfFileHasModified+0x328>
jmp    1390 <getIfFileHasModified+0x1c0>
mov    -0x338(%rbp),%rdi
call   10b0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13b1 <getIfFileHasModified+0x1e1>
jmp    14e5 <getIfFileHasModified+0x315>
lea    -0x90(%rbp),%rdi
mov    -0x338(%rbp),%rdx
mov    $0x64,%esi
call   1070 <fgets@plt>
movsbl -0x90(%rbp),%eax
cmp    $0x49,%eax
je     13de <getIfFileHasModified+0x20e>
jmp    1390 <getIfFileHasModified+0x1c0>
lea    -0x90(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    $0x9,%edx
call   10d0 <getStringUntil@plt>
lea    -0x170(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    14cd <getIfFileHasModified+0x2fd>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x100(%rbp),%rdi
lea    -0x2c0(%rbp),%rsi
lea    -0x330(%rbp),%r8
lea    -0x1e0(%rbp),%r9
lea    -0x33c(%rbp),%rdx
lea    -0x340(%rbp),%rcx
call   10f0 <splitHeader@plt>
lea    -0x1e0(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1080 <formatDate@plt>
lea    -0x348(%rbp),%rdi
call   1050 <ctime@plt>
mov    %rax,%rdi
lea    -0x250(%rbp),%rsi
call   1080 <formatDate@plt>
lea    -0x90(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    14b5 <getIfFileHasModified+0x2e5>
mov    -0x338(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    14f8 <getIfFileHasModified+0x328>
mov    -0x338(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <getIfFileHasModified+0x328>
lea    -0x170(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
jmp    1390 <getIfFileHasModified+0x1c0>
mov    -0x338(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIfFileHasModified>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x320,%rsp
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
movaps %xmm0,0x300(%rsp)
movaps %xmm0,0x2f0(%rsp)
movaps %xmm0,0x2e0(%rsp)
movaps %xmm0,0x2d0(%rsp)
movaps %xmm0,0x2c0(%rsp)
movaps %xmm0,0x2b0(%rsp)
movl   $0x0,0x310(%rsp)
movaps %xmm0,0x290(%rsp)
movaps %xmm0,0x280(%rsp)
movaps %xmm0,0x270(%rsp)
movaps %xmm0,0x260(%rsp)
movaps %xmm0,0x250(%rsp)
movaps %xmm0,0x240(%rsp)
movl   $0x0,0x2a0(%rsp)
movaps %xmm0,0x220(%rsp)
movaps %xmm0,0x210(%rsp)
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movl   $0x0,0x230(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movl   $0x0,0x1c0(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movl   $0x0,0x150(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xe0(%rsp)
lea    0xc83(%rip),%rsi
mov    %rcx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13bf <getIfFileHasModified+0x1ef>
lea    0xc99(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13c8 <getIfFileHasModified+0x1f8>
lea    0xcab(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1474 <getIfFileHasModified+0x2a4>
lea    0xc99(%rip),%rdi
jmp    13cf <getIfFileHasModified+0x1ff>
lea    0xc40(%rip),%rdi
jmp    13cf <getIfFileHasModified+0x1ff>
lea    0xc60(%rip),%rdi
lea    0xc52(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1474 <getIfFileHasModified+0x2a4>
mov    %rax,%rbx
mov    %rsp,%rsi
mov    %r12,%rdi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
je     148f <getIfFileHasModified+0x2bf>
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    14a8 <getIfFileHasModified+0x2d8>
lea    0x10(%rsp),%r15
lea    0x240(%rsp),%r12
jmp    142c <getIfFileHasModified+0x25c>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    14a8 <getIfFileHasModified+0x2d8>
mov    %r15,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
cmpb   $0x49,0x10(%rsp)
jne    1420 <getIfFileHasModified+0x250>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x9,%edx
call   10c0 <getStringUntil@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14c7 <getIfFileHasModified+0x2f7>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
jmp    1420 <getIfFileHasModified+0x250>
lea    0xbfd(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10f0 <fwrite@plt>
jmp    14b0 <getIfFileHasModified+0x2e0>
lea    0xbf8(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x320,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x2b0(%rsp),%r15
lea    0x10(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xf0(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x80(%rsp),%r8
lea    0x1d0(%rsp),%rbp
mov    %r15,%rdi
mov    %rbp,%r9
call   10e0 <splitHeader@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1080 <formatDate@plt>
mov    %rsp,%rdi
call   1050 <ctime@plt>
lea    0x160(%rsp),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1080 <formatDate@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1090 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1040 <fclose@plt>
jmp    14b5 <getIfFileHasModified+0x2e5>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [6 x i8] c"sound\00"
@.str.1 = [34 x i8] c"Bases/base_descripteur_audio.base\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [33 x i8] c"Bases/base_descripteur_text.base\00"
@.str.5 = [6 x i8] c"image\00"
@.str.6 = [34 x i8] c"Bases/base_descripteur_image.base\00"
@.str.7 = [22 x i8] c"BASE OPENNING FAILED \00"
@.str.8 = [12 x i8] c"STAT ERROR \00"
define i32 @getIfFileHasModified(i8* %0, i8* %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca [100 x i8]
%11 = alloca [100 x i8]
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
%14 = alloca [100 x i8]
%15 = alloca [100 x i8]
%16 = alloca [100 x i8]
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca %struct.stat
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
%21 = bitcast [100 x i8]* %10 to i8*
%22 = bitcast [100 x i8]* %11 to i8*
%23 = bitcast [100 x i8]* %12 to i8*
%24 = bitcast [100 x i8]* %13 to i8*
%25 = bitcast [100 x i8]* %14 to i8*
%26 = bitcast [100 x i8]* %15 to i8*
%27 = bitcast [100 x i8]* %16 to i8*
%28 = load i8*, i8** %9
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %4
%32 = call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 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* %32, i32** %17
br label %47
33: ; preds = %4
%34 = load i8*, i8** %9
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32* @fopen(i8* getelementptr inbounds ([33 x i8], [33 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* %38, i32** %17
br label %46
39: ; preds = %33
%40 = load i8*, i8** %9
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32* @fopen(i8* getelementptr inbounds ([34 x i8], [34 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* %44, i32** %17
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45, %37
br label %47
47: ; preds = %46, %31
%48 = load i32*, i32** %17
%49 = icmp eq i32* %48, null
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32*, i32** %8
%52 = call i32 @fprintf(i32* %51, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %5
br label %117
53: ; preds = %47
%54 = load i8*, i8** %7
%55 = call i32 @stat(i8* %54, %struct.stat* %20)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %62
57: ; preds = %53
%58 = load i32*, i32** %8
%59 = call i32 @fprintf(i32* %58, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%60 = load i32*, i32** %17
%61 = call i32 @fclose(i32* %60)
store i32 -1, i32* %5
br label %117
62: ; preds = %53
br label %63
63: ; preds = %111, %76, %62
%64 = load i32*, i32** %17
%65 = call i32 @feof(i32* %64)
%66 = icmp ne i32 %65, 0
%67 = xor i1 %66, true
br i1 %67, label %68, label %114
68: ; preds = %63
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%70 = load i32*, i32** %17
%71 = call i32 @fgets(i8* %69, i32 100, i32* %70)
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 73
br i1 %75, label %76, label %77
76: ; preds = %68
br label %63
77: ; preds = %68
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%80 = call i32 @getStringUntil(i8* %78, i8* %79, i8 signext 9)
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%82 = load i8*, i8** %6
%83 = call i64 @strcmp(i8* %81, i8* %82)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %111
85: ; preds = %77
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%88 = call i32 @strcpy(i8* %86, i8* %87)
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%91 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i64 0, i64 0
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%93 = call i32 @splitHeader(i8* %89, i8* %90, i32* %18, i32* %19, i8* %91, i8* %92)
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%96 = call i32 @formatDate(i8* %94, i8* %95)
%97 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%98 = call i8* @ctime(i32* %97)
%99 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%100 = call i32 @formatDate(i8* %98, i8* %99)
%101 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%102 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%103 = call i64 @strcmp(i8* %101, i8* %102)
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %85
%106 = load i32*, i32** %17
%107 = call i32 @fclose(i32* %106)
store i32 1, i32* %5
br label %117
108: ; preds = %85
%109 = load i32*, i32** %17
%110 = call i32 @fclose(i32* %109)
store i32 0, i32* %5
br label %117
111: ; preds = %77
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%113 = call i32 @memset(i8* %112, i32 0, i32 100)
br label %63
114: ; preds = %63
%115 = load i32*, i32** %17
%116 = call i32 @fclose(i32* %115)
store i32 -1, i32* %5
br label %117
117: ; preds = %114, %108, %105, %57, %50
%118 = load i32, i32* %5
ret i32 %118
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [6 x i8] c"sound\00"
@.str.1 = [34 x i8] c"Bases/base_descripteur_audio.base\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [5 x i8] c"text\00"
@.str.4 = [33 x i8] c"Bases/base_descripteur_text.base\00"
@.str.5 = [6 x i8] c"image\00"
@.str.6 = [34 x i8] c"Bases/base_descripteur_image.base\00"
@.str.7 = [22 x i8] c"BASE OPENNING FAILED \00"
@.str.8 = [12 x i8] c"STAT ERROR \00"
define i32 @getIfFileHasModified(i8* %0, i8* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
%11 = alloca [100 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.stat
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%22 = bitcast i32* %12 to i8*
%23 = bitcast i32* %13 to i8*
%24 = bitcast %struct.stat* %14 to i8*
%25 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %33, label %27
27: ; preds = %4
%28 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %30, %27, %4
%34 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), %27 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), %30 ]
%35 = tail call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %39
37: ; preds = %30, %33
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i64 21, i64 1, i32* %2)
br label %74
39: ; preds = %33
%40 = call i32 @stat(i8* %1, %struct.stat* %14)
%41 = icmp eq i32 %40, -1
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = call i32 @feof(i32* %35)
%44 = icmp eq i32 %43, 0
br i1 %44, label %48, label %72
45: ; preds = %39
%46 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i64 11, i64 1, i32* %2)
%47 = tail call i32 @fclose(i32* %35)
br label %74
48: ; preds = %42, %69
%49 = call i32 @fgets(i8* %15, i32 100, i32* %35)
%50 = load i8, i8* %15
%51 = icmp eq i8 %50, 73
br i1 %51, label %52, label %69
52: ; preds = %48
%53 = call i32 @getStringUntil(i8* %15, i8* %17, i8 signext 9)
%54 = call i64 @strcmp(i8* %17, i8* %0)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %67
56: ; preds = %52
%57 = call i32 @strcpy(i8* %16, i8* %15)
%58 = call i32 @splitHeader(i8* %16, i8* %20, i32* %12, i32* %13, i8* %21, i8* %18)
%59 = call i32 @formatDate(i8* %18, i8* %15)
%60 = getelementptr inbounds %struct.stat, %struct.stat* %14, i64 0, i32 0
%61 = call i8* @ctime(i32* %60)
%62 = call i32 @formatDate(i8* %61, i8* %19)
%63 = call i64 @strcmp(i8* %15, i8* %19)
%64 = icmp eq i64 %63, 0
%65 = call i32 @fclose(i32* %35)
%66 = zext i1 %64 to i32
br label %74
67: ; preds = %52
%68 = call i32 @memset(i8* %17, i32 0, i32 100)
br label %69
69: ; preds = %67, %48
%70 = call i32 @feof(i32* %35)
%71 = icmp eq i32 %70, 0
br i1 %71, label %48, label %72
72: ; preds = %69, %42
%73 = call i32 @fclose(i32* %35)
br label %74
74: ; preds = %56, %72, %45, %37
%75 = phi i32 [ -1, %37 ], [ -1, %45 ], [ -1, %72 ], [ %66, %56 ]
ret i32 %75
}