// File: /workspace/github_c_makefile_star2_O0/trumabrat[P]GrandProjet/troisInstancesMain.c
// Function: main
int main()
{
    FILE* f = NULL;
    clock_t start, end;
    double t_diff;
    FILE* f2 = NULL;

    // Instance 1
    // lecture et creation d'une instance de Chaines et de Reseau
    
    f = fopen("00014_burma.cha", "r");
    Chaines *c = lectureChaines(f);
    fclose(f);

    // construction du reseau, hachage et arbre
    // avec calcul du temps, et son ecriture dans un fichier
    start = clock();
    Reseau *L = reconstitueReseauListe(c);
    end = clock();
    f2 = fopen("00014_burmaListe.txt", "w");
    t_diff = (double)(end - start)/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(L);
    
    // Reconstruction par table hachage
    Reseau *H = NULL;
    f2 = fopen("00014_burmaHachage.txt", "w");
    for(int i = 2; i < 30; i+=2){
        start = clock();
        H = reconstitueReseauHachage(c, i);
        end = clock();
        t_diff = (double)(end - start)/(CLOCKS_PER_SEC);
        fprintf(f2, "%d %lf\n", i, t_diff);
        liberation_reseau(H);
    }
    fclose(f2);
    
    // Reconstruiction par Arbre
    start = clock();
    Reseau* A = reconstitueReseauArbre(c);
    end = clock();
    f2 = fopen("00014_burmaArbreQuat.txt", "w");
    t_diff = (double)(end - start)/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(A);


    // liberation de memoire
    liberer_chaines(c);

    // Instance 2
    // lecture et creation d'une instance de Chaines et de Reseau
    f = fopen("05000_USA-road-d-NY.cha", "r");
    Chaines* c2 = lectureChaines(f);
    fclose(f);

    // construction du reseau, hachage et arbre
    // avec calcul du temps, et son ecriture dans un fichier
    start = clock();
    Reseau* L2 = reconstitueReseauListe(c2);
    end = clock();
    f2 = fopen("05000_USA-road-d-NYListe.txt", "w");
    t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(L2);
    
    // Reconstruction par table hachage
    Reseau* H2 = NULL;
    f2 = fopen("05000_USA-road-d-NYHachage.txt", "w");
    for(int i = 5; i <= 100; i+=5){
        start = clock();
        H2 = reconstitueReseauHachage(c2, i);
        end = clock();
        t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
        fprintf(f2, "%d %lf\n", i, t_diff);
        liberation_reseau(H2);
    }
    fclose(f2);
    
    // Reconstruiction par Arbre
    start = clock();
    Reseau* A2 = reconstitueReseauArbre(c2);
    end = clock();
    f2 = fopen("05000_USA-road-d-NYArbreQuat.txt", "w");
    t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(A2);


    // liberation de memoire
    liberer_chaines(c2);

    // Instance 3
    // lecture et creation d'une instance de Chaines et de Reseau
    f = fopen("07397_pla.cha", "r");
    Chaines* c3 = lectureChaines(f);
    fclose(f);

    // construction du reseau, hachage et arbre
    // avec calcul du temps, et son ecriture dans un fichier
    start = clock();
    Reseau* L3 = reconstitueReseauListe(c3);
    end = clock();
    f2 = fopen("07397_plaListe.txt", "w");
    t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(L3);
    
    // Reconstruction par table hachage
    Reseau* H3 = NULL;
    f2 = fopen("07397_plaHachage.txt", "w");
    for(int i = 10; i <= 1000; i+=10){
        start = clock();
        H3 = reconstitueReseauHachage(c3, i);
        end = clock();
        t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
        fprintf(f2, "%d %lf\n", i, t_diff);
        liberation_reseau(H3);
    }
    fclose(f2);
    
    // Reconstruiction par Arbre
    start = clock();
    Reseau* A3 = reconstitueReseauArbre(c3);
    end = clock();
    f2 = fopen("07397_plaArbreQuat.txt", "w");
    t_diff = (double)(end - start)*1.0/(CLOCKS_PER_SEC);
    fprintf(f2, "temps de calcusls: %lf\n", t_diff);
    fclose(f2);
    liberation_reseau(A3);

    // liberation de memoire
    liberer_chaines(c3);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0x3dbf(%rip), %rdi      # 0x5018
leaq 0x3dc8(%rip), %rsi      # 0x5028
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x19c0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2540
movq %rax, -0x40(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x3d85(%rip), %rdi      # 0x502a
leaq 0x3d93(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3d3e(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x3d5e(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0x40(%rbp), %rdi
callq 0x2e00
movq $0x0, -0x48(%rbp)
leaq 0x3d4e(%rip), %rdi      # 0x5059
leaq 0x3d2d(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movl $0x2, -0x4c(%rbp)
cmpl $0x1e, -0x4c(%rbp)
jge 0x1396
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x31f0
movq %rax, -0x48(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3ca9(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movl -0x4c(%rbp), %edx
movsd -0x28(%rbp), %xmm0
leaq 0x3cf5(%rip), %rsi      # 0x5070
movb $0x1, %al
callq 0x10c0
movq -0x48(%rbp), %rdi
callq 0x2e00
movl -0x4c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1322
movq -0x30(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3f90
movq %rax, -0x58(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x3cb3(%rip), %rdi      # 0x5078
leaq 0x3c73(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3c1e(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x3c3e(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0x58(%rbp), %rdi
callq 0x2e00
movq -0x38(%rbp), %rdi
callq 0x2210
leaq 0x3c65(%rip), %rdi      # 0x5091
leaq 0x3bf5(%rip), %rsi      # 0x5028
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x19c0
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x60(%rbp), %rdi
callq 0x2540
movq %rax, -0x68(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x3c31(%rip), %rdi      # 0x50a9
leaq 0x3bc0(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3b73(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x3b5f(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x3b7f(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0x68(%rbp), %rdi
callq 0x2e00
movq $0x0, -0x70(%rbp)
leaq 0x3bdc(%rip), %rdi      # 0x50c6
leaq 0x3b4e(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movl $0x5, -0x74(%rbp)
cmpl $0x64, -0x74(%rbp)
jg 0x1581
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x60(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x31f0
movq %rax, -0x70(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3ad2(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x3abe(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movl -0x74(%rbp), %edx
movsd -0x28(%rbp), %xmm0
leaq 0x3b0a(%rip), %rsi      # 0x5070
movb $0x1, %al
callq 0x10c0
movq -0x70(%rbp), %rdi
callq 0x2e00
movl -0x74(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x74(%rbp)
jmp 0x1501
movq -0x30(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x60(%rbp), %rdi
callq 0x3f90
movq %rax, -0x80(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x3b35(%rip), %rdi      # 0x50e5
leaq 0x3a88(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3a3b(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x3a27(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x3a47(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0x80(%rbp), %rdi
callq 0x2e00
movq -0x60(%rbp), %rdi
callq 0x2210
leaq 0x3ae3(%rip), %rdi      # 0x5106
leaq 0x39fe(%rip), %rsi      # 0x5028
callq 0x10e0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x19c0
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x88(%rbp), %rdi
callq 0x2540
movq %rax, -0x90(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x3a9c(%rip), %rdi      # 0x5114
leaq 0x39c0(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x3973(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x395f(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x397f(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0x90(%rbp), %rdi
callq 0x2e00
movq $0x0, -0x98(%rbp)
leaq 0x3a37(%rip), %rdi      # 0x5127
leaq 0x3948(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movl $0xa, -0x9c(%rbp)
cmpl $0x3e8, -0x9c(%rbp)     # imm = 0x3E8
jg 0x17ac
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x88(%rbp), %rdi
movl -0x9c(%rbp), %esi
callq 0x31f0
movq %rax, -0x98(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x38b6(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x38a2(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movl -0x9c(%rbp), %edx
movsd -0x28(%rbp), %xmm0
leaq 0x38eb(%rip), %rsi      # 0x5070
movb $0x1, %al
callq 0x10c0
movq -0x98(%rbp), %rdi
callq 0x2e00
movl -0x9c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x9c(%rbp)
jmp 0x170a
movq -0x30(%rbp), %rdi
callq 0x1080
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x88(%rbp), %rdi
callq 0x3f90
movq %rax, -0xa8(%rbp)
callq 0x1070
movq %rax, -0x20(%rbp)
leaq 0x395b(%rip), %rdi      # 0x513c
leaq 0x3857(%rip), %rsi      # 0x503f
callq 0x10e0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x380a(%rip), %xmm1     # 0x5010
mulsd %xmm1, %xmm0
movsd 0x37f6(%rip), %xmm1     # 0x5008
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0x3816(%rip), %rsi      # 0x5041
movb $0x1, %al
callq 0x10c0
movq -0x30(%rbp), %rdi
callq 0x1080
movq -0xa8(%rbp), %rdi
callq 0x2e00
movq -0x88(%rbp), %rdi
callq 0x2210
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbp
retq
nop