#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 EXIT_FAILURE;
int EXIT_SUCCESS;
double comparePicture(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int);
double compareSound(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int, int,
                    int);
double compareText(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ splitHeader(char *, char *, int *, int *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  FILE *descriptorFile1;
  FILE *descriptorFile2;
  char header1[100];
  char header2[100];
  char date1[100] = {0};
  char fileDate1[100] = {0};
  char headerID1[100] = {0};
  char type1[100] = {0};
  char id1[100] = {0};
  char date2[100] = {0};
  char fileDate2[100] = {0};
  char headerID2[100] = {0};
  char type2[100] = {0};
  char id2[100] = {0};
  int nbColumns1;
  int nbLines1;
  int nbColumns2;
  int nbLines2;
  int nbColumnsMin;
  int nbColumnsMax;
  int nbLinesMin;
  int nbLinesMax;
  int value;
  int descMax = 0;
  if (argc < 3) {
    fprintf(stderr,
            "Usage : <Descriptor 1> <Descriptor 2> of the same type \n");
    return (EXIT_FAILURE);
  }
  descriptorFile1 = fopen(argv[1], "r");
  descriptorFile2 = fopen(argv[2], "r");
  if (descriptorFile1 == NULL || descriptorFile2 == NULL) {
    fprintf(stderr, "DESCRIPTOR OPENNING FAILED \n");
    return (EXIT_FAILURE);
  }
  fgets(header1, 100, descriptorFile1);
  fgets(header2, 100, descriptorFile2);
  splitHeader(header1, id1, &nbColumns1, &nbLines1, type1, date1);
  splitHeader(header2, id2, &nbColumns2, &nbLines2, type2, date2);
  if (strcmp(type1, type2) != 0) {
    fprintf(stderr, "NOT SAME TYPE %s vs %s\n", type1, type2);
    return (EXIT_FAILURE);
  }
  if (nbLines1 < nbLines2) {
    nbLinesMin = nbLines1;
    nbLinesMax = nbLines2;
  } else {
    nbLinesMin = nbLines2;
    nbLinesMax = nbLines1;
  }
  if (nbColumns1 < nbColumns2) {
    nbColumnsMin = nbColumns1;
    nbColumnsMax = nbColumns2;
  } else {
    nbColumnsMin = nbColumns2;
    nbColumnsMax = nbColumns1;
  }
  if (strcmp(type1, "picture") == 0) {
    printf("%f\n", comparePicture(descriptorFile1, descriptorFile2, nbLinesMin,
                                  nbLinesMax));
  } else if (strcmp(type1, "sound") == 0) {
    printf("%f\n", compareSound(descriptorFile1, descriptorFile2, nbLinesMin,
                                nbLinesMax, nbColumnsMin, nbColumnsMax));
  } else if (strcmp(type1, "text") == 0) {
    printf("%f\n",
           compareText(descriptorFile1, descriptorFile2, nbLines1, nbLines2));
  } else {
    printf("NOT RECONIZED TYPE \n");
  }
  fclose(descriptorFile1);
  fclose(descriptorFile2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x590,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
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>
lea    -0x3a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x480(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x4f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x560(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
movl   $0x0,-0x588(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    12c3 <main+0x113>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xd55(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2d1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15b9 <main+0x409>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd67(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd4f(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1309 <main+0x159>
cmpq   $0x0,-0x20(%rbp)
jne    1331 <main+0x181>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
lea    0xd22(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2cb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15b9 <main+0x409>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    -0x100(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x64,%esi
call   1070 <fgets@plt>
lea    -0x90(%rbp),%rdi
lea    -0x330(%rbp),%rsi
lea    -0x2c0(%rbp),%r8
lea    -0x170(%rbp),%r9
lea    -0x564(%rbp),%rdx
lea    -0x568(%rbp),%rcx
call   10d0 <splitHeader@plt>
lea    -0x100(%rbp),%rdi
lea    -0x560(%rbp),%rsi
lea    -0x4f0(%rbp),%r8
lea    -0x3a0(%rbp),%r9
lea    -0x56c(%rbp),%rdx
lea    -0x570(%rbp),%rcx
call   10d0 <splitHeader@plt>
lea    -0x2c0(%rbp),%rdi
lea    -0x4f0(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     140c <main+0x25c>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
lea    -0x2c0(%rbp),%rdx
lea    -0x4f0(%rbp),%rcx
lea    0xc64(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2bd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15b9 <main+0x409>
mov    -0x568(%rbp),%eax
cmp    -0x570(%rbp),%eax
jge    143b <main+0x28b>
mov    -0x568(%rbp),%eax
mov    %eax,-0x57c(%rbp)
mov    -0x570(%rbp),%eax
mov    %eax,-0x580(%rbp)
jmp    1453 <main+0x2a3>
mov    -0x570(%rbp),%eax
mov    %eax,-0x57c(%rbp)
mov    -0x568(%rbp),%eax
mov    %eax,-0x580(%rbp)
mov    -0x564(%rbp),%eax
cmp    -0x56c(%rbp),%eax
jge    1482 <main+0x2d2>
mov    -0x564(%rbp),%eax
mov    %eax,-0x574(%rbp)
mov    -0x56c(%rbp),%eax
mov    %eax,-0x578(%rbp)
jmp    149a <main+0x2ea>
mov    -0x56c(%rbp),%eax
mov    %eax,-0x574(%rbp)
mov    -0x564(%rbp),%eax
mov    %eax,-0x578(%rbp)
lea    -0x2c0(%rbp),%rdi
lea    0xbc8(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    14e3 <main+0x333>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x57c(%rbp),%edx
mov    -0x580(%rbp),%ecx
call   1050 <comparePicture@plt>
lea    0xba1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    159b <main+0x3eb>
lea    -0x2c0(%rbp),%rdi
lea    0xb8b(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    153a <main+0x38a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x57c(%rbp),%edx
mov    -0x580(%rbp),%ecx
mov    -0x574(%rbp),%r8d
mov    -0x578(%rbp),%r9d
call   1080 <compareSound@plt>
lea    0xb4a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1596 <main+0x3e6>
lea    -0x2c0(%rbp),%rdi
lea    0xb3a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1583 <main+0x3d3>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x568(%rbp),%edx
mov    -0x570(%rbp),%ecx
call   10b0 <compareText@plt>
lea    0xb01(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1591 <main+0x3e1>
lea    0xafd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1596 <main+0x3e6>
jmp    159b <main+0x3eb>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2a1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x590,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x388,%rsp
xorps  %xmm0,%xmm0
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,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,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,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)
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)
cmp    $0x2,%edi
jg     132b <main+0x17b>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xcda(%rip),%rsi
jmp    1430 <main+0x280>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xd00(%rip),%rbp
mov    %rbp,%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
test   %r15,%r15
je     1420 <main+0x270>
mov    %rax,%r14
test   %rax,%rax
je     1420 <main+0x270>
lea    0x320(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
lea    0x2b0(%rsp),%r12
mov    %r12,%rdi
mov    $0x64,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
lea    0x1d0(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x10(%rsp),%rbp
lea    0x240(%rsp),%r9
mov    %rbx,%rdi
mov    %rbp,%r8
call   10d0 <splitHeader@plt>
lea    0xf0(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
lea    0x80(%rsp),%rbx
lea    0x160(%rsp),%r9
mov    %r12,%rdi
mov    %rbx,%r8
call   10d0 <splitHeader@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1452 <main+0x2a2>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
lea    0xc4e(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x80(%rsp),%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1437 <main+0x287>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
lea    0xc0b(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2b9a(%rip),%rax
mov    (%rax),%eax
add    $0x388,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x4(%rsp),%ebx
mov    (%rsp),%eax
cmp    %eax,%ebx
mov    %eax,%r12d
cmovl  %ebx,%r12d
cmovl  %eax,%ebx
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebp
cmp    %ebp,%eax
mov    %eax,%r13d
cmovl  %ebp,%r13d
cmovl  %eax,%ebp
lea    0xbf0(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14c9 <main+0x319>
lea    0xbe6(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14db <main+0x32b>
lea    0xbd6(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     14f3 <main+0x343>
lea    0xbc5(%rip),%rdi
call   1030 <puts@plt>
jmp    1513 <main+0x363>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
call   1060 <comparePicture@plt>
jmp    1505 <main+0x355>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %r13d,%r9d
call   1080 <compareSound@plt>
jmp    1505 <main+0x355>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %r15,%rdi
mov    %r14,%rsi
call   10b0 <compareText@plt>
lea    0xb6c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x2aa6(%rip),%rax
jmp    143e <main+0x28e>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage : <Descriptor 1> <Descriptor 2> of the same type \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"DESCRIPTOR OPENNING FAILED \0A\00"
@.str.3 = [24 x i8] c"NOT SAME TYPE %s vs %s\0A\00"
@.str.4 = [8 x i8] c"picture\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [6 x i8] c"sound\00"
@.str.7 = [5 x i8] c"text\00"
@.str.8 = [21 x i8] c"NOT RECONIZED TYPE \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [100 x i8]
%9 = alloca [100 x 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 [100 x i8]
%18 = alloca [100 x i8]
%19 = alloca [100 x i8]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = bitcast [100 x i8]* %10 to i8*
%31 = bitcast [100 x i8]* %11 to i8*
%32 = bitcast [100 x i8]* %12 to i8*
%33 = bitcast [100 x i8]* %13 to i8*
%34 = bitcast [100 x i8]* %14 to i8*
%35 = bitcast [100 x i8]* %15 to i8*
%36 = bitcast [100 x i8]* %16 to i8*
%37 = bitcast [100 x i8]* %17 to i8*
%38 = bitcast [100 x i8]* %18 to i8*
%39 = bitcast [100 x i8]* %19 to i8*
store i32 0, i32* %29
%40 = load i32, i32* %4
%41 = icmp slt i32 %40, 3
br i1 %41, label %42, label %46
42: ; preds = %2
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
store i32 %45, i32* %3
br label %156
46: ; preds = %2
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %50, i32** %6
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i32* @fopen(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %54, i32** %7
%55 = load i32*, i32** %6
%56 = icmp eq i32* %55, null
br i1 %56, label %60, label %57
57: ; preds = %46
%58 = load i32*, i32** %7
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %64
60: ; preds = %57, %46
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
store i32 %63, i32* %3
br label %156
64: ; preds = %57
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%66 = load i32*, i32** %6
%67 = call i32 @fgets(i8* %65, i32 100, i32* %66)
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%69 = load i32*, i32** %7
%70 = call i32 @fgets(i8* %68, i32 100, i32* %69)
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%75 = call i32 @splitHeader(i8* %71, i8* %72, i32* %20, i32* %21, i8* %73, i8* %74)
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %18, i64 0, i64 0
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%80 = call i32 @splitHeader(i8* %76, i8* %77, i32* %22, i32* %23, i8* %78, i8* %79)
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%82 = getelementptr inbounds [100 x i8], [100 x i8]* %18, i64 0, i64 0
%83 = call i64 @strcmp(i8* %81, i8* %82)
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %91
85: ; preds = %64
%86 = load i32, i32* @stderr
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %18, i64 0, i64 0
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %87, i8* %88)
%90 = load i32, i32* @EXIT_FAILURE
store i32 %90, i32* %3
br label %156
91: ; preds = %64
%92 = load i32, i32* %21
%93 = load i32, i32* %23
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %98
95: ; preds = %91
%96 = load i32, i32* %21
store i32 %96, i32* %26
%97 = load i32, i32* %23
store i32 %97, i32* %27
br label %101
98: ; preds = %91
%99 = load i32, i32* %23
store i32 %99, i32* %26
%100 = load i32, i32* %21
store i32 %100, i32* %27
br label %101
101: ; preds = %98, %95
%102 = load i32, i32* %20
%103 = load i32, i32* %22
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %108
105: ; preds = %101
%106 = load i32, i32* %20
store i32 %106, i32* %24
%107 = load i32, i32* %22
store i32 %107, i32* %25
br label %111
108: ; preds = %101
%109 = load i32, i32* %22
store i32 %109, i32* %24
%110 = load i32, i32* %20
store i32 %110, i32* %25
br label %111
111: ; preds = %108, %105
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%113 = call i64 @strcmp(i8* %112, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %122
115: ; preds = %111
%116 = load i32*, i32** %6
%117 = load i32*, i32** %7
%118 = load i32, i32* %26
%119 = load i32, i32* %27
%120 = call double @comparePicture(i32* %116, i32* %117, i32 %118, i32 %119)
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %120)
br label %150
122: ; preds = %111
%123 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
br i1 %125, label %126, label %135
126: ; preds = %122
%127 = load i32*, i32** %6
%128 = load i32*, i32** %7
%129 = load i32, i32* %26
%130 = load i32, i32* %27
%131 = load i32, i32* %24
%132 = load i32, i32* %25
%133 = call double @compareSound(i32* %127, i32* %128, i32 %129, i32 %130, i32 %131, i32 %132)
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %133)
br label %149
135: ; preds = %122
%136 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%137 = call i64 @strcmp(i8* %136, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %146
139: ; preds = %135
%140 = load i32*, i32** %6
%141 = load i32*, i32** %7
%142 = load i32, i32* %21
%143 = load i32, i32* %23
%144 = call double @compareText(i32* %140, i32* %141, i32 %142, i32 %143)
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %144)
br label %148
146: ; preds = %135
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %148
148: ; preds = %146, %139
br label %149
149: ; preds = %148, %126
br label %150
150: ; preds = %149, %115
%151 = load i32*, i32** %6
%152 = call i32 @fclose(i32* %151)
%153 = load i32*, i32** %7
%154 = call i32 @fclose(i32* %153)
%155 = load i32, i32* @EXIT_SUCCESS
store i32 %155, i32* %3
br label %156
156: ; preds = %150, %85, %60, %42
%157 = load i32, i32* %3
ret i32 %157
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage : <Descriptor 1> <Descriptor 2> of the same type \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"DESCRIPTOR OPENNING FAILED \0A\00"
@.str.3 = [24 x i8] c"NOT SAME TYPE %s vs %s\0A\00"
@.str.4 = [8 x i8] c"picture\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [6 x i8] c"sound\00"
@.str.7 = [5 x i8] c"text\00"
@EXIT_SUCCESS = global i32 0
@str = [20 x i8] c"NOT RECONIZED TYPE \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%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 i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%23 = bitcast i32* %11 to i8*
%24 = bitcast i32* %12 to i8*
%25 = bitcast i32* %13 to i8*
%26 = bitcast i32* %14 to i8*
%27 = icmp slt i32 %0, 3
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %89
31: ; preds = %2
%32 = getelementptr inbounds i8*, i8** %1, i64 1
%33 = load i8*, i8** %32
%34 = tail call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%35 = getelementptr inbounds i8*, i8** %1, i64 2
%36 = load i8*, i8** %35
%37 = tail call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i32* %34, null
%39 = icmp eq i32* %37, null
%40 = or i1 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %31
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %89
44: ; preds = %31
%45 = call i32 @fgets(i8* %15, i32 100, i32* %34)
%46 = call i32 @fgets(i8* %16, i32 100, i32* %37)
%47 = call i32 @splitHeader(i8* %15, i8* %19, i32* %11, i32* %12, i8* %18, i8* %17)
%48 = call i32 @splitHeader(i8* %16, i8* %22, i32* %13, i32* %14, i8* %21, i8* %20)
%49 = call i64 @strcmp(i8* %18, i8* %21)
%50 = icmp eq i64 %49, 0
br i1 %50, label %54, label %51
51: ; preds = %44
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %18, i8* %21)
br label %89
54: ; preds = %44
%55 = load i32, i32* %12
%56 = load i32, i32* %14
%57 = icmp slt i32 %55, %56
%58 = select i1 %57, i32 %55, i32 %56
%59 = select i1 %57, i32 %56, i32 %55
%60 = load i32, i32* %11
%61 = load i32, i32* %13
%62 = icmp slt i32 %60, %61
%63 = select i1 %62, i32 %61, i32 %60
%64 = select i1 %62, i32 %60, i32 %61
%65 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %54
%68 = call double @comparePicture(i32* %34, i32* %37, i32 %58, i32 %59)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %68)
br label %86
70: ; preds = %54
%71 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = call double @compareSound(i32* %34, i32* %37, i32 %58, i32 %59, i32 %64, i32 %63)
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %74)
br label %86
76: ; preds = %70
%77 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = load i32, i32* %12
%81 = load i32, i32* %14
%82 = call double @compareText(i32* %34, i32* %37, i32 %80, i32 %81)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %82)
br label %86
84: ; preds = %76
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %86
86: ; preds = %73, %84, %79, %67
%87 = call i32 @fclose(i32* %34)
%88 = call i32 @fclose(i32* %37)
br label %89
89: ; preds = %86, %51, %41, %28
%90 = phi i32* [ @EXIT_FAILURE, %28 ], [ @EXIT_FAILURE, %41 ], [ @EXIT_FAILURE, %51 ], [ @EXIT_SUCCESS, %86 ]
%91 = load i32, i32* %90
ret i32 %91
}