#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 */

/* Variables and functions */
int /*<<< orphan*/ Insercao(int, int *);
int /*<<< orphan*/ Mergesort(int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ Quicksort(int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ Selecao(int, int *);
double abst(double);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int num_buscas(int *, int *, int, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ sscanf(char *, char *, double *);
double tempo();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ vetor_copy(int *, int *, int);
int /*<<< orphan*/ vetor_rand(int *, int);
int main(int argc, char **argv) {
  double duracao, tempo_inicial, tempo_total, inicio_temp, tempo_ordenacao_sel,
      tempo_ordenacao_ins, tempo_ordenacao_merge, tempo_ordenacao_quick;
  int n, *v, *v_aux, buscas_sel, buscas_ins, buscas_merge, buscas_quick;
  char algoritmo;
  srand(time(NULL));
  if (argc != 3) {
    printf("Uso: %s tipo duracao\n", argv[0]);
    printf("   tipo: s(elecao) ou i(nsercao) ou m(ergesort) ou q(uicksort) ou "
           "t(odos)\n");
    printf("   duracao: duracao em segundos\n");
    return (0);
  }
  algoritmo = argv[1][0];
  if (algoritmo != 's' && algoritmo != 'i' && algoritmo != 'm' &&
      algoritmo != 'q' && algoritmo != 't') {
    printf("opcao nao valida\n");
    return (-1);
  }
  sscanf(argv[2], "%lf", &duracao);
  printf("|-------------------------[EP1 - Vale a pena "
         "ordenar?]--------------------|\n"
         "|  Algoritmo escolhido: %10s     Duracao dos testes: %9.2f           "
         "     |\n"
         "|            Tempos de Ordenacao                 Numero de Buscas    "
         "     |\n"
         "|            nome: Anderson Silva de Albuquerque                     "
         "     |\n"
         "|--------------------------------------------------------------------"
         "-----|\n"
         "|   n   | Insercao Selecao Merge. Quick. | Insercao Selecao Merge. "
         "Quick. |\n"
         "|-------|------------------------------------------------------------"
         "-----|\n",
         algoritmo == 's'   ? "selecao"
         : algoritmo == 'i' ? "insercao"
         : algoritmo == 'm' ? "mergesort"
         : algoritmo == 'q' ? "quicksort"
                            : "todos",
         duracao);
  tempo_inicial = tempo();
  tempo_total = 0;
  for (n = 2000; tempo_total < duracao; n += 2000) {
    v = malloc(n * sizeof(int));
    if (v == NULL) {
      printf("Erro na alocacao de memoria para o vetor v com %d elementos.\n",
             n);
      return (-1);
    }
    v_aux = malloc(n * sizeof(int));
    if (v_aux == NULL) {
      printf(
          "Erro na alocacao de memoria para o vetor v_aux com %d elementos.\n",
          n);
      return (-1);
    }
    vetor_rand(v, n);
    vetor_copy(v, v_aux, n);
    if (algoritmo == 's' || algoritmo == 't') {
      inicio_temp = tempo();
      Selecao(n, v_aux);
      tempo_ordenacao_sel = abst(tempo() - inicio_temp);
      buscas_sel = num_buscas(v, v_aux, n, tempo_ordenacao_sel);
      if (algoritmo != 't') {
        printf("%d  \t            %4.2f                              %d\t\n", n,
               tempo_ordenacao_sel, buscas_sel);
      }
      if (algoritmo != 's') {
        vetor_copy(v, v_aux, n);
      }
    }
    if (algoritmo == 'i' || algoritmo == 't') {
      inicio_temp = tempo();
      Insercao(n, v_aux);
      tempo_ordenacao_ins = abst(tempo() - inicio_temp);
      buscas_ins = num_buscas(v, v_aux, n, tempo_ordenacao_ins);
      if (algoritmo != 't') {
        printf("%d  \t    %4.2f                              %d\t\n", n,
               tempo_ordenacao_ins, buscas_ins);
      }
      if (algoritmo != 'i') {
        vetor_copy(v, v_aux, n);
      }
    }
    if (algoritmo == 'm' || algoritmo == 't') {
      inicio_temp = tempo();
      Mergesort(0, n - 1, v_aux);
      tempo_ordenacao_merge = abst(tempo() - inicio_temp);
      buscas_merge = num_buscas(v, v_aux, n, tempo_ordenacao_merge);
      if (algoritmo != 't') {
        printf("%d\t\t\t   %4.2f\t\t\t\t    %d\t\n", n, tempo_ordenacao_merge,
               buscas_merge);
      }
      if (algoritmo != 'm') {
        vetor_copy(v, v_aux, n);
      }
    }
    if (algoritmo == 'q' || algoritmo == 't') {
      inicio_temp = tempo();
      Quicksort(0, n - 1, v_aux);
      tempo_ordenacao_quick = abst(tempo() - inicio_temp);
      buscas_quick = num_buscas(v, v_aux, n, tempo_ordenacao_quick);
      if (algoritmo != 't') {
        printf("%d \t\t                   %4.2f                \t           "
               "%d\t\n",
               n, tempo_ordenacao_quick, buscas_quick);
      }
      if (algoritmo == 't') {
        printf("%d\t   %4.2f\t   %4.2f\t   %4.2f\t   %4.2f", n,
               tempo_ordenacao_ins, tempo_ordenacao_sel, tempo_ordenacao_merge,
               tempo_ordenacao_quick);
        printf("\t %d\t %d\t %d\t %d\n", buscas_ins, buscas_sel, buscas_merge,
               buscas_quick);
      }
    }
    free(v);
    free(v_aux);
    tempo_total = tempo() - tempo_inicial;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
cmpl   $0x3,-0x8(%rbp)
je     1260 <main+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    176b <main+0x57b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x79(%rbp)
movsbl -0x79(%rbp),%eax
cmp    $0x73,%eax
je     12c8 <main+0xd8>
movsbl -0x79(%rbp),%eax
cmp    $0x69,%eax
je     12c8 <main+0xd8>
movsbl -0x79(%rbp),%eax
cmp    $0x6d,%eax
je     12c8 <main+0xd8>
movsbl -0x79(%rbp),%eax
cmp    $0x71,%eax
je     12c8 <main+0xd8>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
je     12c8 <main+0xd8>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    176b <main+0x57b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdbd(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   10e0 <sscanf@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x73,%eax
jne    1300 <main+0x110>
lea    0xfb9(%rip),%rax
mov    %rax,-0x88(%rbp)
jmp    137c <main+0x18c>
movsbl -0x79(%rbp),%eax
cmp    $0x69,%eax
jne    1320 <main+0x130>
lea    0xfa1(%rip),%rax
mov    %rax,-0x90(%rbp)
jmp    136e <main+0x17e>
movsbl -0x79(%rbp),%eax
cmp    $0x6d,%eax
jne    1340 <main+0x150>
lea    0xf8a(%rip),%rax
mov    %rax,-0x98(%rbp)
jmp    1360 <main+0x170>
movsbl -0x79(%rbp),%edx
lea    0xf87(%rip),%rax
lea    0xf76(%rip),%rcx
cmp    $0x71,%edx
cmove  %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xd09(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x7d0,-0x54(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1764 <main+0x574>
movslq -0x54(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1400 <main+0x210>
mov    -0x54(%rbp),%esi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    176b <main+0x57b>
movslq -0x54(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    143b <main+0x24b>
mov    -0x54(%rbp),%esi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    176b <main+0x57b>
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1070 <vetor_rand@plt>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   10a0 <vetor_copy@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x73,%eax
je     1471 <main+0x281>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
jne    14ff <main+0x30f>
mov    $0x0,%al
call   10f0 <tempo@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   10c0 <Selecao@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
subsd  -0x30(%rbp),%xmm0
call   1100 <abst@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
movsd  -0x38(%rbp),%xmm0
call   1110 <num_buscas@plt>
mov    %eax,-0x6c(%rbp)
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
je     14dd <main+0x2ed>
mov    -0x54(%rbp),%esi
movsd  -0x38(%rbp),%xmm0
mov    -0x6c(%rbp),%edx
lea    0xe82(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x73,%eax
je     14fa <main+0x30a>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   10a0 <vetor_copy@plt>
jmp    14ff <main+0x30f>
movsbl -0x79(%rbp),%eax
cmp    $0x69,%eax
je     1519 <main+0x329>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
jne    15a7 <main+0x3b7>
mov    $0x0,%al
call   10f0 <tempo@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   1090 <Insercao@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
subsd  -0x30(%rbp),%xmm0
call   1100 <abst@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
movsd  -0x40(%rbp),%xmm0
call   1110 <num_buscas@plt>
mov    %eax,-0x70(%rbp)
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
je     1585 <main+0x395>
mov    -0x54(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
mov    -0x70(%rbp),%edx
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x69,%eax
je     15a2 <main+0x3b2>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   10a0 <vetor_copy@plt>
jmp    15a7 <main+0x3b7>
movsbl -0x79(%rbp),%eax
cmp    $0x6d,%eax
je     15c1 <main+0x3d1>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
jne    1654 <main+0x464>
mov    $0x0,%al
call   10f0 <tempo@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x54(%rbp),%esi
sub    $0x1,%esi
mov    -0x68(%rbp),%rdx
xor    %edi,%edi
call   1040 <Mergesort@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
subsd  -0x30(%rbp),%xmm0
call   1100 <abst@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
movsd  -0x48(%rbp),%xmm0
call   1110 <num_buscas@plt>
mov    %eax,-0x74(%rbp)
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
je     1632 <main+0x442>
mov    -0x54(%rbp),%esi
movsd  -0x48(%rbp),%xmm0
mov    -0x74(%rbp),%edx
lea    0xd97(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x6d,%eax
je     164f <main+0x45f>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   10a0 <vetor_copy@plt>
jmp    1654 <main+0x464>
movsbl -0x79(%rbp),%eax
cmp    $0x71,%eax
je     166e <main+0x47e>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
jne    1731 <main+0x541>
mov    $0x0,%al
call   10f0 <tempo@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x54(%rbp),%esi
sub    $0x1,%esi
mov    -0x68(%rbp),%rdx
xor    %edi,%edi
call   1050 <Quicksort@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
subsd  -0x30(%rbp),%xmm0
call   1100 <abst@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x54(%rbp),%edx
movsd  -0x50(%rbp),%xmm0
call   1110 <num_buscas@plt>
mov    %eax,-0x78(%rbp)
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
je     16df <main+0x4ef>
mov    -0x54(%rbp),%esi
movsd  -0x50(%rbp),%xmm0
mov    -0x78(%rbp),%edx
lea    0xd04(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsbl -0x79(%rbp),%eax
cmp    $0x74,%eax
jne    172c <main+0x53c>
mov    -0x54(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
lea    0xd10(%rip),%rdi
mov    $0x4,%al
call   1060 <printf@plt>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
mov    -0x74(%rbp),%ecx
mov    -0x78(%rbp),%r8d
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1731 <main+0x541>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   10f0 <tempo@plt>
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x54(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x54(%rbp)
jmp    13b1 <main+0x1c1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
cmp    $0x3,%ebx
jne    127b <main+0x7b>
mov    0x8(%r14),%rax
mov    (%rax),%bl
lea    -0x69(%rbx),%eax
cmp    $0xb,%al
ja     15e8 <main+0x3e8>
movzbl %al,%eax
mov    $0xd11,%ecx
bt     %rax,%rcx
jae    15e8 <main+0x3e8>
mov    0x10(%r14),%rdi
lea    0xdc0(%rip),%rsi
lea    0x18(%rsp),%rdx
call   10f0 <sscanf@plt>
cmp    $0x69,%bl
mov    %rbx,%r14
je     12a9 <main+0xa9>
cmp    $0x6d,%bl
je     12b2 <main+0xb2>
cmp    $0x73,%bl
jne    12bb <main+0xbb>
lea    0xfb6(%rip),%rsi
jmp    12d0 <main+0xd0>
mov    (%r14),%rsi
lea    0xd7b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1153(%rip),%rdi
call   1050 <puts@plt>
lea    0x1191(%rip),%rdi
call   1050 <puts@plt>
jmp    1614 <main+0x414>
lea    0xf87(%rip),%rsi
jmp    12d0 <main+0xd0>
lea    0xf87(%rip),%rsi
jmp    12d0 <main+0xd0>
cmp    $0x71,%bl
lea    0xf85(%rip),%rax
lea    0xf88(%rip),%rsi
cmove  %rax,%rsi
movsd  0x18(%rsp),%xmm0
lea    0xd3d(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1100 <tempo@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1614 <main+0x414>
lea    -0x73(%r14),%eax
mov    %eax,0x24(%rsp)
mov    $0x7d0,%ebx
mov    $0x1f40,%r13d
jmp    13ac <main+0x1ac>
lea    0x1076(%rip),%rdi
mov    %ebx,%esi
movsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  (%rsp),%xmm3
mov    $0x4,%al
call   1070 <printf@plt>
lea    0x1076(%rip),%rdi
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1100 <tempo@plt>
subsd  0x40(%rsp),%xmm0
add    $0x7d0,%ebx
movsd  0x18(%rsp),%xmm1
add    $0x1f40,%r13d
ucomisd %xmm0,%xmm1
jbe    1614 <main+0x414>
mov    %r13d,%edi
call   10e0 <malloc@plt>
test   %rax,%rax
je     15f6 <main+0x3f6>
mov    %rax,%r15
mov    %r13d,%edi
call   10e0 <malloc@plt>
test   %rax,%rax
je     15ff <main+0x3ff>
mov    %rax,%r12
mov    %r15,%rdi
mov    %ebx,%esi
call   1080 <vetor_rand@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10b0 <vetor_copy@plt>
cmpb   $0x1,0x24(%rsp)
ja     1470 <main+0x270>
xor    %eax,%eax
call   1100 <tempo@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
mov    %r12,%rsi
call   10d0 <Selecao@plt>
xor    %eax,%eax
call   1100 <tempo@plt>
subsd  (%rsp),%xmm0
call   1110 <abst@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
movsd  %xmm0,0x38(%rsp)
call   1120 <num_buscas@plt>
mov    %eax,0x14(%rsp)
mov    %r14,%rbp
cmp    $0x74,%bpl
je     1453 <main+0x253>
lea    0xe9a(%rip),%rdi
mov    %ebx,%esi
movsd  0x38(%rsp),%xmm0
mov    0x14(%rsp),%edx
mov    $0x1,%al
call   1070 <printf@plt>
cmp    $0x73,%bpl
je     1370 <main+0x170>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10b0 <vetor_copy@plt>
jmp    1479 <main+0x279>
nopl   0x0(%rax)
mov    %r14,%rbp
cmp    $0x69,%bpl
jne    14ee <main+0x2ee>
xor    %eax,%eax
call   1100 <tempo@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
mov    %r12,%rsi
call   10a0 <Insercao@plt>
xor    %eax,%eax
call   1100 <tempo@plt>
subsd  (%rsp),%xmm0
call   1110 <abst@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
movsd  %xmm0,0x30(%rsp)
call   1120 <num_buscas@plt>
mov    %eax,0x10(%rsp)
cmp    $0x74,%bpl
je     14d7 <main+0x2d7>
lea    0xe4f(%rip),%rdi
mov    %ebx,%esi
movsd  0x30(%rsp),%xmm0
mov    0x10(%rsp),%edx
mov    $0x1,%al
call   1070 <printf@plt>
cmp    $0x69,%bpl
je     1370 <main+0x170>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10b0 <vetor_copy@plt>
cmp    $0x74,%bpl
je     14fa <main+0x2fa>
cmp    $0x6d,%bpl
jne    1572 <main+0x372>
xor    %eax,%eax
call   1100 <tempo@plt>
movsd  %xmm0,(%rsp)
lea    -0x1(%rbx),%esi
xor    %edi,%edi
mov    %r12,%rdx
call   1040 <Mergesort@plt>
xor    %eax,%eax
call   1100 <tempo@plt>
subsd  (%rsp),%xmm0
call   1110 <abst@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
movsd  %xmm0,0x28(%rsp)
call   1120 <num_buscas@plt>
mov    %eax,0xc(%rsp)
cmp    $0x74,%bpl
je     155b <main+0x35b>
lea    0xdfc(%rip),%rdi
mov    %ebx,%esi
movsd  0x28(%rsp),%xmm0
mov    0xc(%rsp),%edx
mov    $0x1,%al
call   1070 <printf@plt>
cmp    $0x6d,%bpl
je     1370 <main+0x170>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10b0 <vetor_copy@plt>
cmp    $0x74,%bpl
je     1582 <main+0x382>
cmp    $0x71,%bpl
jne    1370 <main+0x170>
xor    %eax,%eax
call   1100 <tempo@plt>
movsd  %xmm0,(%rsp)
lea    -0x1(%rbx),%esi
xor    %edi,%edi
mov    %r12,%rdx
call   1060 <Quicksort@plt>
xor    %eax,%eax
call   1100 <tempo@plt>
subsd  (%rsp),%xmm0
call   1110 <abst@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
movsd  %xmm0,(%rsp)
call   1120 <num_buscas@plt>
mov    %rbp,%rcx
mov    %eax,%ebp
cmp    $0x74,%cl
je     131f <main+0x11f>
lea    0xd8b(%rip),%rdi
mov    %ebx,%esi
movsd  (%rsp),%xmm0
mov    %ebp,%edx
mov    $0x1,%al
call   1070 <printf@plt>
jmp    1370 <main+0x170>
lea    0xde6(%rip),%rdi
call   1050 <puts@plt>
jmp    160f <main+0x40f>
lea    0xc5d(%rip),%rdi
jmp    1606 <main+0x406>
lea    0xc92(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Uso: %s tipo duracao\0A\00"
@.str.1 = [75 x i8] c" tipo: s(elecao) ou i(nsercao) ou m(ergesort) ou q(uicksort) ou t(odos)\0A\00"
@.str.2 = [33 x i8] c" duracao: duracao em segundos\0A\00"
@.str.3 = [18 x i8] c"opcao nao valida\0A\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [533 x i8] c"|-------------------------[EP1 - Vale a pena ordenar?]--------------------|\0A| Algoritmo escolhido: %10s Duracao dos testes: %9.2f |\0A| Tempos de Ordenacao Numero de Buscas |\0A| nome: Anderson Silva de Albuquerque |\0A|-------------------------------------------------------------------------|\0A| n | Insercao Selecao Merge. Quick. | Insercao Selecao Merge. Quick. |\0A|-------|-----------------------------------------------------------------|\0A\00"
@.str.6 = [8 x i8] c"selecao\00"
@.str.7 = [9 x i8] c"insercao\00"
@.str.8 = [10 x i8] c"mergesort\00"
@.str.9 = [10 x i8] c"quicksort\00"
@.str.10 = [6 x i8] c"todos\00"
@.str.11 = [62 x i8] c"Erro na alocacao de memoria para o vetor v com %d elementos.\0A\00"
@.str.12 = [66 x i8] c"Erro na alocacao de memoria para o vetor v_aux com %d elementos.\0A\00"
@.str.13 = [57 x i8] c"%d \09 %4.2f %d\09\0A\00"
@.str.14 = [49 x i8] c"%d \09 %4.2f %d\09\0A\00"
@.str.15 = [26 x i8] c"%d\09\09\09 %4.2f\09\09\09\09 %d\09\0A\00"
@.str.16 = [62 x i8] c"%d \09\09 %4.2f \09 %d\09\0A\00"
@.str.17 = [39 x i8] c"%d\09 %4.2f\09 %4.2f\09 %4.2f\09 %4.2f\00"
@.str.18 = [18 x i8] c"\09 %d\09 %d\09 %d\09 %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = call i32 @time(i32* null)
%23 = call i32 @srand(i32 %22)
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 3
br i1 %25, label %26, label %33
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %308
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = getelementptr inbounds i8, i8* %36, i64 0
%38 = load i8, i8* %37
store i8 %38, i8* %21
%39 = load i8, i8* %21
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 115
br i1 %41, label %42, label %60
42: ; preds = %33
%43 = load i8, i8* %21
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 105
br i1 %45, label %46, label %60
46: ; preds = %42
%47 = load i8, i8* %21
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 109
br i1 %49, label %50, label %60
50: ; preds = %46
%51 = load i8, i8* %21
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 113
br i1 %53, label %54, label %60
54: ; preds = %50
%55 = load i8, i8* %21
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 116
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %308
60: ; preds = %54, %50, %46, %42, %33
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 2
%63 = load i8*, i8** %62
%64 = call i32 @sscanf(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %6)
%65 = load i8, i8* %21
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 115
br i1 %67, label %68, label %69
68: ; preds = %60
br label %89
69: ; preds = %60
%70 = load i8, i8* %21
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 105
br i1 %72, label %73, label %74
73: ; preds = %69
br label %87
74: ; preds = %69
%75 = load i8, i8* %21
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 109
br i1 %77, label %78, label %79
78: ; preds = %74
br label %85
79: ; preds = %74
%80 = load i8, i8* %21
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 113
%83 = zext i1 %82 to i64
%84 = select i1 %82, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
br label %85
85: ; preds = %79, %78
%86 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %78 ], [ %84, %79 ]
br label %87
87: ; preds = %85, %73
%88 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %73 ], [ %86, %85 ]
br label %89
89: ; preds = %87, %68
%90 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %68 ], [ %88, %87 ]
%91 = load double, double* %6
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([533 x i8], [533 x i8]* @.str.5, i64 0, i64 0), i8* %90, double %91)
%93 = call double (...) @tempo()
store double %93, double* %7
store double 0.000000e+00, double* %8
store i32 2000, i32* %14
br label %94
94: ; preds = %304, %89
%95 = load double, double* %8
%96 = load double, double* %6
%97 = fcmp olt double %95, %96
br i1 %97, label %98, label %307
98: ; preds = %94
%99 = load i32, i32* %14
%100 = sext i32 %99 to i64
%101 = mul i64 %100, 4
%102 = trunc i64 %101 to i32
%103 = call i32* @malloc(i32 %102)
store i32* %103, i32** %15
%104 = load i32*, i32** %15
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %109
106: ; preds = %98
%107 = load i32, i32* %14
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.11, i64 0, i64 0), i32 %107)
store i32 -1, i32* %3
br label %308
109: ; preds = %98
%110 = load i32, i32* %14
%111 = sext i32 %110 to i64
%112 = mul i64 %111, 4
%113 = trunc i64 %112 to i32
%114 = call i32* @malloc(i32 %113)
store i32* %114, i32** %16
%115 = load i32*, i32** %16
%116 = icmp eq i32* %115, null
br i1 %116, label %117, label %120
117: ; preds = %109
%118 = load i32, i32* %14
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i32 %118)
store i32 -1, i32* %3
br label %308
120: ; preds = %109
%121 = load i32*, i32** %15
%122 = load i32, i32* %14
%123 = call i32 @vetor_rand(i32* %121, i32 %122)
%124 = load i32*, i32** %15
%125 = load i32*, i32** %16
%126 = load i32, i32* %14
%127 = call i32 @vetor_copy(i32* %124, i32* %125, i32 %126)
%128 = load i8, i8* %21
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 115
br i1 %130, label %135, label %131
131: ; preds = %120
%132 = load i8, i8* %21
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 116
br i1 %134, label %135, label %167
135: ; preds = %131, %120
%136 = call double (...) @tempo()
store double %136, double* %9
%137 = load i32, i32* %14
%138 = load i32*, i32** %16
%139 = call i32 @Selecao(i32 %137, i32* %138)
%140 = call double (...) @tempo()
%141 = load double, double* %9
%142 = fsub double %140, %141
%143 = call double @abst(double %142)
store double %143, double* %10
%144 = load i32*, i32** %15
%145 = load i32*, i32** %16
%146 = load i32, i32* %14
%147 = load double, double* %10
%148 = call i32 @num_buscas(i32* %144, i32* %145, i32 %146, double %147)
store i32 %148, i32* %17
%149 = load i8, i8* %21
%150 = sext i8 %149 to i32
%151 = icmp ne i32 %150, 116
br i1 %151, label %152, label %157
152: ; preds = %135
%153 = load i32, i32* %14
%154 = load double, double* %10
%155 = load i32, i32* %17
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i32 %153, double %154, i32 %155)
br label %157
157: ; preds = %152, %135
%158 = load i8, i8* %21
%159 = sext i8 %158 to i32
%160 = icmp ne i32 %159, 115
br i1 %160, label %161, label %166
161: ; preds = %157
%162 = load i32*, i32** %15
%163 = load i32*, i32** %16
%164 = load i32, i32* %14
%165 = call i32 @vetor_copy(i32* %162, i32* %163, i32 %164)
br label %166
166: ; preds = %161, %157
br label %167
167: ; preds = %166, %131
%168 = load i8, i8* %21
%169 = sext i8 %168 to i32
%170 = icmp eq i32 %169, 105
br i1 %170, label %175, label %171
171: ; preds = %167
%172 = load i8, i8* %21
%173 = sext i8 %172 to i32
%174 = icmp eq i32 %173, 116
br i1 %174, label %175, label %207
175: ; preds = %171, %167
%176 = call double (...) @tempo()
store double %176, double* %9
%177 = load i32, i32* %14
%178 = load i32*, i32** %16
%179 = call i32 @Insercao(i32 %177, i32* %178)
%180 = call double (...) @tempo()
%181 = load double, double* %9
%182 = fsub double %180, %181
%183 = call double @abst(double %182)
store double %183, double* %11
%184 = load i32*, i32** %15
%185 = load i32*, i32** %16
%186 = load i32, i32* %14
%187 = load double, double* %11
%188 = call i32 @num_buscas(i32* %184, i32* %185, i32 %186, double %187)
store i32 %188, i32* %18
%189 = load i8, i8* %21
%190 = sext i8 %189 to i32
%191 = icmp ne i32 %190, 116
br i1 %191, label %192, label %197
192: ; preds = %175
%193 = load i32, i32* %14
%194 = load double, double* %11
%195 = load i32, i32* %18
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %193, double %194, i32 %195)
br label %197
197: ; preds = %192, %175
%198 = load i8, i8* %21
%199 = sext i8 %198 to i32
%200 = icmp ne i32 %199, 105
br i1 %200, label %201, label %206
201: ; preds = %197
%202 = load i32*, i32** %15
%203 = load i32*, i32** %16
%204 = load i32, i32* %14
%205 = call i32 @vetor_copy(i32* %202, i32* %203, i32 %204)
br label %206
206: ; preds = %201, %197
br label %207
207: ; preds = %206, %171
%208 = load i8, i8* %21
%209 = sext i8 %208 to i32
%210 = icmp eq i32 %209, 109
br i1 %210, label %215, label %211
211: ; preds = %207
%212 = load i8, i8* %21
%213 = sext i8 %212 to i32
%214 = icmp eq i32 %213, 116
br i1 %214, label %215, label %248
215: ; preds = %211, %207
%216 = call double (...) @tempo()
store double %216, double* %9
%217 = load i32, i32* %14
%218 = sub nsw i32 %217, 1
%219 = load i32*, i32** %16
%220 = call i32 @Mergesort(i32 0, i32 %218, i32* %219)
%221 = call double (...) @tempo()
%222 = load double, double* %9
%223 = fsub double %221, %222
%224 = call double @abst(double %223)
store double %224, double* %12
%225 = load i32*, i32** %15
%226 = load i32*, i32** %16
%227 = load i32, i32* %14
%228 = load double, double* %12
%229 = call i32 @num_buscas(i32* %225, i32* %226, i32 %227, double %228)
store i32 %229, i32* %19
%230 = load i8, i8* %21
%231 = sext i8 %230 to i32
%232 = icmp ne i32 %231, 116
br i1 %232, label %233, label %238
233: ; preds = %215
%234 = load i32, i32* %14
%235 = load double, double* %12
%236 = load i32, i32* %19
%237 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i32 %234, double %235, i32 %236)
br label %238
238: ; preds = %233, %215
%239 = load i8, i8* %21
%240 = sext i8 %239 to i32
%241 = icmp ne i32 %240, 109
br i1 %241, label %242, label %247
242: ; preds = %238
%243 = load i32*, i32** %15
%244 = load i32*, i32** %16
%245 = load i32, i32* %14
%246 = call i32 @vetor_copy(i32* %243, i32* %244, i32 %245)
br label %247
247: ; preds = %242, %238
br label %248
248: ; preds = %247, %211
%249 = load i8, i8* %21
%250 = sext i8 %249 to i32
%251 = icmp eq i32 %250, 113
br i1 %251, label %256, label %252
252: ; preds = %248
%253 = load i8, i8* %21
%254 = sext i8 %253 to i32
%255 = icmp eq i32 %254, 116
br i1 %255, label %256, label %296
256: ; preds = %252, %248
%257 = call double (...) @tempo()
store double %257, double* %9
%258 = load i32, i32* %14
%259 = sub nsw i32 %258, 1
%260 = load i32*, i32** %16
%261 = call i32 @Quicksort(i32 0, i32 %259, i32* %260)
%262 = call double (...) @tempo()
%263 = load double, double* %9
%264 = fsub double %262, %263
%265 = call double @abst(double %264)
store double %265, double* %13
%266 = load i32*, i32** %15
%267 = load i32*, i32** %16
%268 = load i32, i32* %14
%269 = load double, double* %13
%270 = call i32 @num_buscas(i32* %266, i32* %267, i32 %268, double %269)
store i32 %270, i32* %20
%271 = load i8, i8* %21
%272 = sext i8 %271 to i32
%273 = icmp ne i32 %272, 116
br i1 %273, label %274, label %279
274: ; preds = %256
%275 = load i32, i32* %14
%276 = load double, double* %13
%277 = load i32, i32* %20
%278 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0), i32 %275, double %276, i32 %277)
br label %279
279: ; preds = %274, %256
%280 = load i8, i8* %21
%281 = sext i8 %280 to i32
%282 = icmp eq i32 %281, 116
br i1 %282, label %283, label %295
283: ; preds = %279
%284 = load i32, i32* %14
%285 = load double, double* %11
%286 = load double, double* %10
%287 = load double, double* %12
%288 = load double, double* %13
%289 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i32 %284, double %285, double %286, double %287, double %288)
%290 = load i32, i32* %18
%291 = load i32, i32* %17
%292 = load i32, i32* %19
%293 = load i32, i32* %20
%294 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i32 %290, i32 %291, i32 %292, i32 %293)
br label %295
295: ; preds = %283, %279
br label %296
296: ; preds = %295, %252
%297 = load i32*, i32** %15
%298 = call i32 @free(i32* %297)
%299 = load i32*, i32** %16
%300 = call i32 @free(i32* %299)
%301 = call double (...) @tempo()
%302 = load double, double* %7
%303 = fsub double %301, %302
store double %303, double* %8
br label %304
304: ; preds = %296
%305 = load i32, i32* %14
%306 = add nsw i32 %305, 2000
store i32 %306, i32* %14
br label %94
307: ; preds = %94
store i32 0, i32* %3
br label %308
308: ; preds = %307, %117, %106, %58, %26
%309 = load i32, i32* %3
ret i32 %309
}

LLVM IR (-O2):
@.str = [22 x i8] c"Uso: %s tipo duracao\0A\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [533 x i8] c"|-------------------------[EP1 - Vale a pena ordenar?]--------------------|\0A| Algoritmo escolhido: %10s Duracao dos testes: %9.2f |\0A| Tempos de Ordenacao Numero de Buscas |\0A| nome: Anderson Silva de Albuquerque |\0A|-------------------------------------------------------------------------|\0A| n | Insercao Selecao Merge. Quick. | Insercao Selecao Merge. Quick. |\0A|-------|-----------------------------------------------------------------|\0A\00"
@.str.6 = [8 x i8] c"selecao\00"
@.str.7 = [9 x i8] c"insercao\00"
@.str.8 = [10 x i8] c"mergesort\00"
@.str.9 = [10 x i8] c"quicksort\00"
@.str.10 = [6 x i8] c"todos\00"
@.str.11 = [62 x i8] c"Erro na alocacao de memoria para o vetor v com %d elementos.\0A\00"
@.str.12 = [66 x i8] c"Erro na alocacao de memoria para o vetor v_aux com %d elementos.\0A\00"
@.str.13 = [57 x i8] c"%d \09 %4.2f %d\09\0A\00"
@.str.14 = [49 x i8] c"%d \09 %4.2f %d\09\0A\00"
@.str.15 = [26 x i8] c"%d\09\09\09 %4.2f\09\09\09\09 %d\09\0A\00"
@.str.16 = [62 x i8] c"%d \09\09 %4.2f \09 %d\09\0A\00"
@.str.17 = [39 x i8] c"%d\09 %4.2f\09 %4.2f\09 %4.2f\09 %4.2f\00"
@.str.18 = [18 x i8] c"\09 %d\09 %d\09 %d\09 %d\0A\00"
@str = [17 x i8] c"opcao nao valida\00"
@str.19 = [74 x i8] c" tipo: s(elecao) ou i(nsercao) ou m(ergesort) ou q(uicksort) ou t(odos)\00"
@str.20 = [32 x i8] c" duracao: duracao em segundos\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = icmp eq i32 %0, 3
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.20, i64 0, i64 0))
br label %138
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 115
%18 = icmp eq i8 %16, 105
%19 = icmp eq i8 %16, 109
%20 = icmp eq i8 %16, 116
switch i8 %16, label %21 [
i8 116, label %23
i8 115, label %23
i8 113, label %23
i8 109, label %23
i8 105, label %23
]
21: ; preds = %13
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %138
23: ; preds = %13, %13, %13, %13, %13
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @sscanf(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
switch i8 %16, label %27 [
i8 115, label %32
i8 105, label %30
i8 109, label %31
]
27: ; preds = %23
%28 = icmp eq i8 %16, 113
%29 = select i1 %28, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
br label %32
30: ; preds = %23
br label %32
31: ; preds = %23
br label %32
32: ; preds = %23, %31, %30, %27
%33 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %23 ], [ %29, %27 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %30 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %31 ]
%34 = load double, double* %3
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([533 x i8], [533 x i8]* @.str.5, i64 0, i64 0), i8* %33, double %34)
%36 = call double (...) @tempo()
%37 = load double, double* %3
%38 = fcmp ogt double %37, 0.000000e+00
br i1 %38, label %39, label %138
39: ; preds = %32
%40 = add nsw i8 %16, -115
%41 = icmp ult i8 %40, 2
br label %42
42: ; preds = %39, %124
%43 = phi i32 [ undef, %39 ], [ %125, %124 ]
%44 = phi i32 [ undef, %39 ], [ %127, %124 ]
%45 = phi i32 [ undef, %39 ], [ %129, %124 ]
%46 = phi double [ undef, %39 ], [ %130, %124 ]
%47 = phi i32 [ 2000, %39 ], [ %135, %124 ]
%48 = phi double [ undef, %39 ], [ %128, %124 ]
%49 = phi double [ undef, %39 ], [ %126, %124 ]
%50 = shl i32 %47, 2
%51 = call i32* @malloc(i32 %50)
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %55
53: ; preds = %42
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.11, i64 0, i64 0), i32 %47)
br label %138
55: ; preds = %42
%56 = call i32* @malloc(i32 %50)
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i32 %47)
br label %138
60: ; preds = %55
%61 = call i32 @vetor_rand(i32* %51, i32 %47)
%62 = call i32 @vetor_copy(i32* %51, i32* %56, i32 %47)
br i1 %41, label %63, label %75
63: ; preds = %60
%64 = call double (...) @tempo()
%65 = call i32 @Selecao(i32 %47, i32* %56)
%66 = call double (...) @tempo()
%67 = fsub double %66, %64
%68 = call double @abst(double %67)
%69 = call i32 @num_buscas(i32* %51, i32* %56, i32 %47, double %68)
br i1 %20, label %72, label %70
70: ; preds = %63
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i32 %47, double %68, i32 %69)
br label %72
72: ; preds = %70, %63
br i1 %17, label %124, label %73
73: ; preds = %72
%74 = call i32 @vetor_copy(i32* %51, i32* %56, i32 %47)
br label %76
75: ; preds = %60
br i1 %18, label %76, label %90
76: ; preds = %75, %73
%77 = phi i32 [ %69, %73 ], [ %45, %75 ]
%78 = phi double [ %68, %73 ], [ %46, %75 ]
%79 = call double (...) @tempo()
%80 = call i32 @Insercao(i32 %47, i32* %56)
%81 = call double (...) @tempo()
%82 = fsub double %81, %79
%83 = call double @abst(double %82)
%84 = call i32 @num_buscas(i32* %51, i32* %56, i32 %47, double %83)
br i1 %20, label %87, label %85
85: ; preds = %76
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0), i32 %47, double %83, i32 %84)
br label %87
87: ; preds = %85, %76
br i1 %18, label %124, label %88
88: ; preds = %87
%89 = call i32 @vetor_copy(i32* %51, i32* %56, i32 %47)
br label %90
90: ; preds = %75, %88
%91 = phi i32 [ %77, %88 ], [ %45, %75 ]
%92 = phi double [ %78, %88 ], [ %46, %75 ]
%93 = phi double [ %83, %88 ], [ %48, %75 ]
%94 = phi i32 [ %84, %88 ], [ %44, %75 ]
switch i8 %16, label %108 [
i8 116, label %95
i8 109, label %95
]
95: ; preds = %90, %90
%96 = call double (...) @tempo()
%97 = add nsw i32 %47, -1
%98 = call i32 @Mergesort(i32 0, i32 %97, i32* %56)
%99 = call double (...) @tempo()
%100 = fsub double %99, %96
%101 = call double @abst(double %100)
%102 = call i32 @num_buscas(i32* %51, i32* %56, i32 %47, double %101)
br i1 %20, label %105, label %103
103: ; preds = %95
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i32 %47, double %101, i32 %102)
br label %105
105: ; preds = %103, %95
br i1 %19, label %124, label %106
106: ; preds = %105
%107 = call i32 @vetor_copy(i32* %51, i32* %56, i32 %47)
br label %108
108: ; preds = %90, %106
%109 = phi double [ %101, %106 ], [ %49, %90 ]
%110 = phi i32 [ %102, %106 ], [ %43, %90 ]
switch i8 %16, label %124 [
i8 116, label %111
i8 113, label %111
]
111: ; preds = %108, %108
%112 = call double (...) @tempo()
%113 = add nsw i32 %47, -1
%114 = call i32 @Quicksort(i32 0, i32 %113, i32* %56)
%115 = call double (...) @tempo()
%116 = fsub double %115, %112
%117 = call double @abst(double %116)
%118 = call i32 @num_buscas(i32* %51, i32* %56, i32 %47, double %117)
br i1 %20, label %121, label %119
119: ; preds = %111
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0), i32 %47, double %117, i32 %118)
br label %124
121: ; preds = %111
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i32 %47, double %93, double %92, double %109, double %117)
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0), i32 %94, i32 %91, i32 %110, i32 %118)
br label %124
124: ; preds = %119, %87, %72, %105, %108, %121
%125 = phi i32 [ %110, %108 ], [ %110, %119 ], [ %110, %121 ], [ %102, %105 ], [ %43, %72 ], [ %43, %87 ]
%126 = phi double [ %109, %108 ], [ %109, %119 ], [ %109, %121 ], [ %101, %105 ], [ %49, %72 ], [ %49, %87 ]
%127 = phi i32 [ %94, %108 ], [ %94, %119 ], [ %94, %121 ], [ %94, %105 ], [ %44, %72 ], [ %84, %87 ]
%128 = phi double [ %93, %108 ], [ %93, %119 ], [ %93, %121 ], [ %93, %105 ], [ %48, %72 ], [ %83, %87 ]
%129 = phi i32 [ %91, %108 ], [ %91, %119 ], [ %91, %121 ], [ %91, %105 ], [ %69, %72 ], [ %77, %87 ]
%130 = phi double [ %92, %108 ], [ %92, %119 ], [ %92, %121 ], [ %92, %105 ], [ %68, %72 ], [ %78, %87 ]
%131 = call i32 @free(i32* %51)
%132 = call i32 @free(i32* %56)
%133 = call double (...) @tempo()
%134 = fsub double %133, %36
%135 = add nuw nsw i32 %47, 2000
%136 = load double, double* %3
%137 = fcmp olt double %134, %136
br i1 %137, label %42, label %138
138: ; preds = %124, %32, %58, %53, %21, %8
%139 = phi i32 [ 0, %8 ], [ -1, %21 ], [ -1, %53 ], [ -1, %58 ], [ 0, %32 ], [ 0, %124 ]
ret i32 %139
}