#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*/ IDCT(int, float *, float *);
int /*<<< orphan*/ ImprimirMatriz(int, float **);
int /*<<< orphan*/ TDC(int, float *, float *);
int /*<<< orphan*/ angulo(int, float *, float *);
int /*<<< orphan*/ distanciaMatrizes(int, float **, float **);
int /*<<< orphan*/ distanciaVetores(int, float *, float *);
int /*<<< orphan*/ normasMatriz(int, float **);
int /*<<< orphan*/ normasVetores(int, float *, float *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int DIM;
  int indiceVetor;
  int posicaoNoVetor;
  int indiceA, indiceB;
  int indiceX, indiceY;
  printf("Digite o numero (p) de vetores de dimensao (p) desejado: \n");
  printf("Lembrando que os vetores serao alocados horizontalmente!!!!\n");
  scanf("%d", &DIM);
  printf("Digite as posicoes dos dois vetores dos quais serão calculados a "
         "distancia entre si\n");
  printf("Serao calculadas as distancias entre esses vetores antes e depois da "
         "TDC\n");
  printf("(digite valores entre 0 e %d)\n", DIM - 1);
  scanf("%d", &indiceA);
  scanf("%d", &indiceB);
  printf("Digite as posicoes dos dois vetores dos quais serão \ncalculados "
         "produto interno e o angulo entre si\n");
  printf("Serao calculadas o prod. interno e o angulo entre esses vetores "
         "antes e depois da TDC\n");
  scanf("%d", &indiceX);
  scanf("%d", &indiceY);
  float conjuntoVetores[DIM][DIM];
  float matrizDaTransformada[DIM][DIM];
  float matrizIDCT[DIM][DIM];
  float vetorIDCT[DIM];
  float vetorPtemporario[DIM];
  float vetorTransformadaTemporario[DIM];
  for (indiceVetor = 0; indiceVetor < DIM; indiceVetor++) {
    for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
      printf("Digite a posição %d do vetor %d\n", posicaoNoVetor, indiceVetor);
      scanf("%f", &conjuntoVetores[indiceVetor][posicaoNoVetor]);
    }
  }
  for (indiceVetor = 0; indiceVetor < DIM; indiceVetor++) {
    for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
      vetorPtemporario[posicaoNoVetor] =
          conjuntoVetores[indiceVetor][posicaoNoVetor];
    }
    TDC(DIM, vetorPtemporario, vetorTransformadaTemporario);
    normasVetores(DIM, vetorPtemporario, vetorTransformadaTemporario,
                  indiceVetor);
    IDCT(DIM, vetorTransformadaTemporario, vetorIDCT);
    for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
      matrizDaTransformada[indiceVetor][posicaoNoVetor] =
          vetorTransformadaTemporario[posicaoNoVetor];
      matrizIDCT[indiceVetor][posicaoNoVetor] = vetorIDCT[posicaoNoVetor];
    }
  }
  printf("\nConjunto de vetores:\n");
  ImprimirMatriz(DIM, conjuntoVetores);
  printf("\nMatriz da Transformada:\n");
  ImprimirMatriz(DIM, matrizDaTransformada);
  printf("\nMatriz da Inversa da Transformada:\n");
  ImprimirMatriz(DIM, matrizIDCT);
  float vetorA[DIM];
  float vetorB[DIM];
  for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
    vetorA[posicaoNoVetor] = conjuntoVetores[indiceA][posicaoNoVetor];
    vetorB[posicaoNoVetor] = conjuntoVetores[indiceB][posicaoNoVetor];
  }
  printf("\nDistancia entre os vetores %d e %d dados pelo usuario:\n", indiceA,
         indiceB);
  distanciaVetores(DIM, vetorA, vetorB);
  for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
    vetorA[posicaoNoVetor] = matrizDaTransformada[indiceA][posicaoNoVetor];
    vetorB[posicaoNoVetor] = matrizDaTransformada[indiceB][posicaoNoVetor];
  }
  printf("\nDistancia entre os vetores %d e %d depois da TDC:\n", indiceA,
         indiceB);
  distanciaVetores(DIM, vetorA, vetorB);
  float vetorX[DIM];
  float vetorY[DIM];
  for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
    vetorX[posicaoNoVetor] = conjuntoVetores[indiceX][posicaoNoVetor];
    vetorY[posicaoNoVetor] = conjuntoVetores[indiceY][posicaoNoVetor];
  }
  printf("\nProduto interno e angulo dos vetores %d e %d dados pelo usuario\n",
         indiceX, indiceY);
  angulo(DIM, vetorX, vetorY);
  for (posicaoNoVetor = 0; posicaoNoVetor < DIM; posicaoNoVetor++) {
    vetorA[posicaoNoVetor] = matrizDaTransformada[indiceA][posicaoNoVetor];
    vetorB[posicaoNoVetor] = matrizDaTransformada[indiceB][posicaoNoVetor];
  }
  printf("\nProduto interno e angulo dos vetores %d e %d da Transformada\n",
         indiceX, indiceY);
  angulo(DIM, vetorX, vetorY);
  printf("\nNormas da matriz dada pelo usuario(conjunto de vetores):\n");
  normasMatriz(DIM, conjuntoVetores);
  printf("\nNormas da matriz oriunda da TDC: \n");
  normasMatriz(DIM, matrizDaTransformada);
  printf("\nDistancia entre a matriz dada(conjuntoVetores) e a matriz da "
         "transformada:\n");
  distanciaMatrizes(DIM, conjuntoVetores, matrizDaTransformada);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe47(%rip),%rdi
xor    %eax,%eax
mov    %al,-0xd9(%rbp)
call   1050 <printf@plt>
mov    -0xd9(%rbp),%al
lea    0xe68(%rip),%rdi
call   1050 <printf@plt>
mov    -0xd9(%rbp),%al
lea    0xe93(%rip),%rdi
mov    %rdi,-0xe8(%rbp)
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0xd9(%rbp),%al
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
mov    -0xd9(%rbp),%al
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
mov    -0xd9(%rbp),%al
mov    -0x8(%rbp),%esi
add    $0xffffffff,%esi
lea    0xeef(%rip),%rdi
call   1050 <printf@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xd9(%rbp),%al
lea    -0x14(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xd9(%rbp),%al
lea    -0x18(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0xd9(%rbp),%al
lea    0xed0(%rip),%rdi
call   1050 <printf@plt>
mov    -0xd9(%rbp),%al
lea    0xf24(%rip),%rdi
call   1050 <printf@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xd9(%rbp),%al
lea    -0x1c(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0xe8(%rbp),%rdi
mov    -0xd9(%rbp),%al
lea    -0x20(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0xd8(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rcx
imul   %rcx,%rcx
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xd0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0xc8(%rbp)
mov    %rax,%rcx
imul   %rcx,%rcx
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0xb8(%rbp)
mov    %rax,%rcx
imul   %rcx,%rcx
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    144d <main+0x2ad>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    143a <main+0x29a>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xd8(%rbp),%rcx
mov    -0xd0(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    13d6 <main+0x236>
jmp    143f <main+0x29f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13c3 <main+0x223>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    159d <main+0x3fd>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14b7 <main+0x317>
mov    -0xa0(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    -0xd8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x10(%rbp),%rdx
movss  (%rcx,%rdx,4),%xmm0
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1467 <main+0x2c7>
mov    -0x98(%rbp),%rdx
mov    -0xa0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   10c0 <TDC@plt>
mov    -0xa0(%rbp),%rsi
mov    -0x98(%rbp),%rdx
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%ecx
call   1080 <normasVetores@plt>
mov    -0x98(%rbp),%rsi
mov    -0xa8(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   1070 <IDCT@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    158a <main+0x3ea>
mov    -0xb0(%rbp),%rax
mov    -0xb8(%rbp),%rdx
mov    -0xa8(%rbp),%rcx
mov    -0xc0(%rbp),%rsi
mov    -0xc8(%rbp),%r8
mov    -0x98(%rbp),%rdi
movslq -0x10(%rbp),%r9
movss  (%rdi,%r9,4),%xmm0
movslq -0xc(%rbp),%rdi
imul   %r8,%rdi
shl    $0x2,%rdi
add    %rdi,%rsi
movslq -0x10(%rbp),%rdi
movss  %xmm0,(%rsi,%rdi,4)
movslq -0x10(%rbp),%rsi
movss  (%rcx,%rsi,4),%xmm0
movslq -0xc(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1503 <main+0x363>
jmp    158f <main+0x3ef>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1454 <main+0x2b4>
lea    0xc79(%rip),%rdi
xor    %eax,%eax
mov    %al,-0xf9(%rbp)
call   1050 <printf@plt>
mov    -0xd0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   10b0 <ImprimirMatriz@plt>
mov    -0xf9(%rbp),%al
lea    0xc67(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   10b0 <ImprimirMatriz@plt>
mov    -0xf9(%rbp),%al
lea    0xc60(%rip),%rdi
call   1050 <printf@plt>
mov    -0xb0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   10b0 <ImprimirMatriz@plt>
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    16cb <main+0x52b>
mov    -0xf0(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    -0xd8(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
movslq -0x14(%rbp),%r8
imul   %rsi,%r8
shl    $0x2,%r8
mov    %rcx,%rdi
add    %r8,%rdi
movslq -0x10(%rbp),%r8
movss  (%rdi,%r8,4),%xmm0
movslq -0x10(%rbp),%rdi
movss  %xmm0,(%rdx,%rdi,4)
movslq -0x18(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x10(%rbp),%rdx
movss  (%rcx,%rdx,4),%xmm0
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    164f <main+0x4af>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xb9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rsi
mov    -0xf0(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   1060 <distanciaVetores@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1778 <main+0x5d8>
mov    -0xf0(%rbp),%rax
mov    -0xc0(%rbp),%rcx
mov    -0xc8(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
movslq -0x14(%rbp),%r8
imul   %rsi,%r8
shl    $0x2,%r8
mov    %rcx,%rdi
add    %r8,%rdi
movslq -0x10(%rbp),%r8
movss  (%rdi,%r8,4),%xmm0
movslq -0x10(%rbp),%rdi
movss  %xmm0,(%rdx,%rdi,4)
movslq -0x18(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x10(%rbp),%rdx
movss  (%rcx,%rdx,4),%xmm0
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    16fc <main+0x55c>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xb27(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rsi
mov    -0xf0(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   1060 <distanciaVetores@plt>
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x110(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x108(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1871 <main+0x6d1>
mov    -0x108(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    -0xd8(%rbp),%rsi
mov    -0x110(%rbp),%rdx
movslq -0x1c(%rbp),%r8
imul   %rsi,%r8
shl    $0x2,%r8
mov    %rcx,%rdi
add    %r8,%rdi
movslq -0x10(%rbp),%r8
movss  (%rdi,%r8,4),%xmm0
movslq -0x10(%rbp),%rdi
movss  %xmm0,(%rdx,%rdi,4)
movslq -0x20(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x10(%rbp),%rdx
movss  (%rcx,%rdx,4),%xmm0
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    17f5 <main+0x655>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xa62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x110(%rbp),%rsi
mov    -0x108(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   10a0 <angulo@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    191e <main+0x77e>
mov    -0xf0(%rbp),%rax
mov    -0xc0(%rbp),%rcx
mov    -0xc8(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
movslq -0x14(%rbp),%r8
imul   %rsi,%r8
shl    $0x2,%r8
mov    %rcx,%rdi
add    %r8,%rdi
movslq -0x10(%rbp),%r8
movss  (%rdi,%r8,4),%xmm0
movslq -0x10(%rbp),%rdi
movss  %xmm0,(%rdx,%rdi,4)
movslq -0x18(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x10(%rbp),%rdx
movss  (%rcx,%rdx,4),%xmm0
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    18a2 <main+0x702>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0x9f7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x110(%rbp),%rsi
mov    -0x108(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   10a0 <angulo@plt>
lea    0xa12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xd0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1040 <normasMatriz@plt>
lea    0xa30(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc0(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1040 <normasMatriz@plt>
lea    0xa37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xd0(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
mov    -0x8(%rbp),%edi
call   1030 <distanciaMatrizes@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xf5e(%rip),%rdi
call   1040 <puts@plt>
lea    0xf8c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe10(%rip),%rbx
lea    -0x2c(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xfa7(%rip),%rdi
call   1040 <puts@plt>
lea    0xff0(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%esi
add    $0xffffffff,%esi
lea    0xde0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    -0x44(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    -0x30(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xffd(%rip),%rdi
call   1040 <puts@plt>
lea    0x1056(%rip),%rdi
call   1040 <puts@plt>
lea    -0x40(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    -0x3c(%rbp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    %rsp,-0x98(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rax,%rcx
mov    %rax,-0x78(%rbp)
imul   %rax,%rax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    -0x2c(%rbp),%edx
mov    %rdx,%rax
imul   %rdx,%rax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
lea    0xf(,%rdx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,%rsp
mov    %rsp,%rdi
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rdx,-0x60(%rbp)
test   %edx,%edx
jle    149a <main+0x2da>
mov    %rdi,-0x88(%rbp)
mov    %rcx,-0x90(%rbp)
mov    -0x78(%rbp),%rax
lea    0x0(,%rax,4),%rax
mov    %rax,-0x70(%rbp)
lea    0xcf2(%rip),%rbx
lea    0xd0e(%rip),%r13
mov    -0x50(%rbp),%r14
mov    -0x60(%rbp),%r15
xor    %ecx,%ecx
mov    %rsi,-0x38(%rbp)
jmp    1360 <main+0x1a0>
nopw   0x0(%rax,%rax,1)
movslq %r15d,%rax
add    $0x1,%rcx
add    -0x70(%rbp),%r14
cmp    %rax,%rcx
jge    13b3 <main+0x1f3>
test   %r15d,%r15d
jle    1350 <main+0x190>
mov    %r14,-0x58(%rbp)
xor    %r12d,%r12d
nopl   0x0(%rax)
mov    %rbx,%r15
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %rcx,%rbx
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    %rbx,%rcx
mov    %r15,%rbx
add    $0x1,%r12
movslq -0x2c(%rbp),%r15
add    $0x4,%r14
cmp    %r15,%r12
jl     1370 <main+0x1b0>
mov    -0x38(%rbp),%rsi
mov    -0x58(%rbp),%r14
jmp    1350 <main+0x190>
test   %r15d,%r15d
jle    149a <main+0x2da>
mov    -0x60(%rbp),%rax
lea    0x0(,%rax,4),%rax
mov    %rax,-0xa0(%rbp)
xor    %r14d,%r14d
mov    -0x50(%rbp),%r12
xor    %r13d,%r13d
jmp    13fc <main+0x23c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
add    -0xa0(%rbp),%r14
add    -0x70(%rbp),%r12
cmp    %r13d,%r15d
mov    -0x38(%rbp),%rsi
jle    149a <main+0x2da>
test   %r15d,%r15d
jle    1417 <main+0x257>
mov    %r15d,%edx
shl    $0x2,%rdx
mov    %rsi,%rdi
mov    %r12,%rsi
call   1070 <memcpy@plt>
mov    -0x38(%rbp),%rsi
mov    %r15d,%edi
mov    %rsi,%r15
mov    -0x88(%rbp),%rbx
mov    %rbx,%rdx
call   10e0 <TDC@plt>
mov    -0x2c(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r13d,%ecx
call   10a0 <normasVetores@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    -0x90(%rbp),%rdx
call   1090 <IDCT@plt>
mov    -0x2c(%rbp),%r15d
test   %r15d,%r15d
jle    13e0 <main+0x220>
mov    -0x80(%rbp),%rax
add    %r14,%rax
mov    %rax,-0x58(%rbp)
mov    -0x68(%rbp),%rax
lea    (%rax,%r14,1),%rdi
lea    0x0(,%r15,4),%rbx
mov    -0x88(%rbp),%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    -0x58(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
jmp    13e0 <main+0x220>
lea    0xe64(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    -0x50(%rbp),%r15
mov    %r15,%rsi
call   10d0 <ImprimirMatriz@plt>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   10d0 <ImprimirMatriz@plt>
lea    0xe60(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    -0x80(%rbp),%rsi
call   10d0 <ImprimirMatriz@plt>
mov    -0x2c(%rbp),%ebx
mov    %rsp,%r13
lea    0xf(,%rbx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
movslq -0x44(%rbp),%r14
test   %ebx,%ebx
jle    1553 <main+0x393>
mov    %r14,%rax
mov    -0x78(%rbp),%rcx
imul   %rcx,%rax
lea    (%r15,%rax,4),%rsi
mov    %r15,%rdx
movslq -0x30(%rbp),%r15
mov    %r15,%rax
imul   %rcx,%rax
lea    (%rdx,%rax,4),%rax
mov    %rax,-0x38(%rbp)
shl    $0x2,%rbx
mov    %r13,%rdi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    %r12,%rdi
mov    -0x38(%rbp),%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
jmp    1557 <main+0x397>
mov    -0x30(%rbp),%r15d
lea    0xaea(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    %r13,%rsi
mov    %r12,%rdx
call   1080 <distanciaVetores@plt>
mov    -0x2c(%rbp),%ebx
movslq -0x44(%rbp),%r14
test   %ebx,%ebx
mov    %r12,-0x38(%rbp)
jle    15ce <main+0x40e>
mov    %r14,%rax
mov    -0x60(%rbp),%rcx
imul   %rcx,%rax
mov    -0x68(%rbp),%rdx
lea    (%rdx,%rax,4),%rsi
movslq -0x30(%rbp),%r15
mov    %r15,%rax
imul   %rcx,%rax
lea    (%rdx,%rax,4),%r12
shl    $0x2,%rbx
mov    %r13,%rdi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    -0x38(%rbp),%rdi
mov    %r12,%rsi
mov    -0x38(%rbp),%r12
mov    %rbx,%rdx
call   1070 <memcpy@plt>
jmp    15d2 <main+0x412>
mov    -0x30(%rbp),%r15d
lea    0xaa8(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    %r13,-0x70(%rbp)
mov    %r13,%rsi
mov    %r12,%rdx
call   1080 <distanciaVetores@plt>
mov    -0x2c(%rbp),%ebx
mov    %rsp,%r13
lea    0xf(,%rbx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
test   %ebx,%ebx
jle    1667 <main+0x4a7>
movslq -0x40(%rbp),%r14
mov    %r14,%rax
mov    -0x78(%rbp),%rdx
imul   %rdx,%rax
mov    -0x50(%rbp),%rcx
lea    (%rcx,%rax,4),%rsi
movslq -0x3c(%rbp),%r12
mov    %r12,%rax
imul   %rdx,%rax
lea    (%rcx,%rax,4),%rax
mov    %rax,-0x58(%rbp)
shl    $0x2,%rbx
mov    %r13,%rdi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    %r15,%rdi
mov    -0x58(%rbp),%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
jmp    166f <main+0x4af>
mov    -0x40(%rbp),%r14d
mov    -0x3c(%rbp),%r12d
lea    0xa3f(%rip),%rdi
mov    %r14d,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    %r13,%rsi
mov    %r15,%rdx
call   10c0 <angulo@plt>
mov    -0x2c(%rbp),%ebx
test   %ebx,%ebx
mov    -0x68(%rbp),%r12
jle    16d7 <main+0x517>
movslq -0x44(%rbp),%rax
mov    -0x60(%rbp),%rcx
imul   %rcx,%rax
lea    (%r12,%rax,4),%rsi
movslq -0x30(%rbp),%rax
imul   %rcx,%rax
lea    (%r12,%rax,4),%r14
shl    $0x2,%rbx
mov    -0x70(%rbp),%rdi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    -0x38(%rbp),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
lea    0xa13(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    %r13,%rsi
mov    %r15,%rdx
call   10c0 <angulo@plt>
lea    0xc58(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    -0x50(%rbp),%rbx
mov    %rbx,%rsi
call   1050 <normasMatriz@plt>
lea    0xc77(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    %r12,%rsi
call   1050 <normasMatriz@plt>
lea    0xc83(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <distanciaMatrizes@plt>
mov    -0x98(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"Digite o numero (p) de vetores de dimensao (p) desejado: \0A\00"
@.str.1 = [61 x i8] c"Lembrando que os vetores serao alocados horizontalmente!!!!\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [86 x i8] c"Digite as posicoes dos dois vetores dos quais ser\C3\A3o calculados a distancia entre si\0A\00"
@.str.4 = [74 x i8] c"Serao calculadas as distancias entre esses vetores antes e depois da TDC\0A\00"
@.str.5 = [31 x i8] c"(digite valores entre 0 e %d)\0A\00"
@.str.6 = [102 x i8] c"Digite as posicoes dos dois vetores dos quais ser\C3\A3o \0Acalculados produto interno e o angulo entre si\0A\00"
@.str.7 = [87 x i8] c"Serao calculadas o prod. interno e o angulo entre esses vetores antes e depois da TDC\0A\00"
@.str.8 = [35 x i8] c"Digite a posi\C3\A7\C3\A3o %d do vetor %d\0A\00"
@.str.9 = [3 x i8] c"%f\00"
@.str.10 = [23 x i8] c"\0AConjunto de vetores:\0A\00"
@.str.11 = [26 x i8] c"\0AMatriz da Transformada:\0A\00"
@.str.12 = [37 x i8] c"\0AMatriz da Inversa da Transformada:\0A\00"
@.str.13 = [57 x i8] c"\0ADistancia entre os vetores %d e %d dados pelo usuario:\0A\00"
@.str.14 = [52 x i8] c"\0ADistancia entre os vetores %d e %d depois da TDC:\0A\00"
@.str.15 = [66 x i8] c"\0AProduto interno e angulo dos vetores %d e %d dados pelo usuario\0A\00"
@.str.16 = [63 x i8] c"\0AProduto interno e angulo dos vetores %d e %d da Transformada\0A\00"
@.str.17 = [59 x i8] c"\0ANormas da matriz dada pelo usuario(conjunto de vetores):\0A\00"
@.str.18 = [36 x i8] c"\0ANormas da matriz oriunda da TDC: \0A\00"
@.str.19 = [77 x i8] c"\0ADistancia entre a matriz dada(conjuntoVetores) e a matriz da transformada:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
store i32 0, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.7, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %9
%42 = mul nuw i64 %38, %40
%43 = alloca float, i64 %42
store i64 %38, i64* %10
store i64 %40, i64* %11
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
%46 = load i32, i32* %2
%47 = zext i32 %46 to i64
%48 = mul nuw i64 %45, %47
%49 = alloca float, i64 %48
store i64 %45, i64* %12
store i64 %47, i64* %13
%50 = load i32, i32* %2
%51 = zext i32 %50 to i64
%52 = load i32, i32* %2
%53 = zext i32 %52 to i64
%54 = mul nuw i64 %51, %53
%55 = alloca float, i64 %54
store i64 %51, i64* %14
store i64 %53, i64* %15
%56 = load i32, i32* %2
%57 = zext i32 %56 to i64
%58 = alloca float, i64 %57
store i64 %57, i64* %16
%59 = load i32, i32* %2
%60 = zext i32 %59 to i64
%61 = alloca float, i64 %60
store i64 %60, i64* %17
%62 = load i32, i32* %2
%63 = zext i32 %62 to i64
%64 = alloca float, i64 %63
store i64 %63, i64* %18
store i32 0, i32* %3
br label %65
65: ; preds = %90, %0
%66 = load i32, i32* %3
%67 = load i32, i32* %2
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %93
69: ; preds = %65
store i32 0, i32* %4
br label %70
70: ; preds = %86, %69
%71 = load i32, i32* %4
%72 = load i32, i32* %2
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %89
74: ; preds = %70
%75 = load i32, i32* %4
%76 = load i32, i32* %3
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %75, i32 %76)
%78 = load i32, i32* %3
%79 = sext i32 %78 to i64
%80 = mul nsw i64 %79, %40
%81 = getelementptr inbounds float, float* %43, i64 %80
%82 = load i32, i32* %4
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %81, i64 %83
%85 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), float* %84)
br label %86
86: ; preds = %74
%87 = load i32, i32* %4
%88 = add nsw i32 %87, 1
store i32 %88, i32* %4
br label %70
89: ; preds = %70
br label %90
90: ; preds = %89
%91 = load i32, i32* %3
%92 = add nsw i32 %91, 1
store i32 %92, i32* %3
br label %65
93: ; preds = %65
store i32 0, i32* %3
br label %94
94: ; preds = %157, %93
%95 = load i32, i32* %3
%96 = load i32, i32* %2
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %160
98: ; preds = %94
store i32 0, i32* %4
br label %99
99: ; preds = %115, %98
%100 = load i32, i32* %4
%101 = load i32, i32* %2
%102 = icmp slt i32 %100, %101
br i1 %102, label %103, label %118
103: ; preds = %99
%104 = load i32, i32* %3
%105 = sext i32 %104 to i64
%106 = mul nsw i64 %105, %40
%107 = getelementptr inbounds float, float* %43, i64 %106
%108 = load i32, i32* %4
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds float, float* %107, i64 %109
%111 = load float, float* %110
%112 = load i32, i32* %4
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds float, float* %61, i64 %113
store float %111, float* %114
br label %115
115: ; preds = %103
%116 = load i32, i32* %4
%117 = add nsw i32 %116, 1
store i32 %117, i32* %4
br label %99
118: ; preds = %99
%119 = load i32, i32* %2
%120 = call i32 @TDC(i32 %119, float* %61, float* %64)
%121 = load i32, i32* %2
%122 = load i32, i32* %3
%123 = call i32 @normasVetores(i32 %121, float* %61, float* %64, i32 %122)
%124 = load i32, i32* %2
%125 = call i32 @IDCT(i32 %124, float* %64, float* %58)
store i32 0, i32* %4
br label %126
126: ; preds = %153, %118
%127 = load i32, i32* %4
%128 = load i32, i32* %2
%129 = icmp slt i32 %127, %128
br i1 %129, label %130, label %156
130: ; preds = %126
%131 = load i32, i32* %4
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds float, float* %64, i64 %132
%134 = load float, float* %133
%135 = load i32, i32* %3
%136 = sext i32 %135 to i64
%137 = mul nsw i64 %136, %47
%138 = getelementptr inbounds float, float* %49, i64 %137
%139 = load i32, i32* %4
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds float, float* %138, i64 %140
store float %134, float* %141
%142 = load i32, i32* %4
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds float, float* %58, i64 %143
%145 = load float, float* %144
%146 = load i32, i32* %3
%147 = sext i32 %146 to i64
%148 = mul nsw i64 %147, %53
%149 = getelementptr inbounds float, float* %55, i64 %148
%150 = load i32, i32* %4
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds float, float* %149, i64 %151
store float %145, float* %152
br label %153
153: ; preds = %130
%154 = load i32, i32* %4
%155 = add nsw i32 %154, 1
store i32 %155, i32* %4
br label %126
156: ; preds = %126
br label %157
157: ; preds = %156
%158 = load i32, i32* %3
%159 = add nsw i32 %158, 1
store i32 %159, i32* %3
br label %94
160: ; preds = %94
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%162 = load i32, i32* %2
%163 = bitcast float* %43 to float**
%164 = call i32 @ImprimirMatriz(i32 %162, float** %163)
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%166 = load i32, i32* %2
%167 = bitcast float* %49 to float**
%168 = call i32 @ImprimirMatriz(i32 %166, float** %167)
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
%170 = load i32, i32* %2
%171 = bitcast float* %55 to float**
%172 = call i32 @ImprimirMatriz(i32 %170, float** %171)
%173 = load i32, i32* %2
%174 = zext i32 %173 to i64
%175 = alloca float, i64 %174
store i64 %174, i64* %19
%176 = load i32, i32* %2
%177 = zext i32 %176 to i64
%178 = alloca float, i64 %177
store i64 %177, i64* %20
store i32 0, i32* %4
br label %179
179: ; preds = %206, %160
%180 = load i32, i32* %4
%181 = load i32, i32* %2
%182 = icmp slt i32 %180, %181
br i1 %182, label %183, label %209
183: ; preds = %179
%184 = load i32, i32* %5
%185 = sext i32 %184 to i64
%186 = mul nsw i64 %185, %40
%187 = getelementptr inbounds float, float* %43, i64 %186
%188 = load i32, i32* %4
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds float, float* %187, i64 %189
%191 = load float, float* %190
%192 = load i32, i32* %4
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds float, float* %175, i64 %193
store float %191, float* %194
%195 = load i32, i32* %6
%196 = sext i32 %195 to i64
%197 = mul nsw i64 %196, %40
%198 = getelementptr inbounds float, float* %43, i64 %197
%199 = load i32, i32* %4
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds float, float* %198, i64 %200
%202 = load float, float* %201
%203 = load i32, i32* %4
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds float, float* %178, i64 %204
store float %202, float* %205
br label %206
206: ; preds = %183
%207 = load i32, i32* %4
%208 = add nsw i32 %207, 1
store i32 %208, i32* %4
br label %179
209: ; preds = %179
%210 = load i32, i32* %5
%211 = load i32, i32* %6
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i32 %210, i32 %211)
%213 = load i32, i32* %2
%214 = call i32 @distanciaVetores(i32 %213, float* %175, float* %178)
store i32 0, i32* %4
br label %215
215: ; preds = %242, %209
%216 = load i32, i32* %4
%217 = load i32, i32* %2
%218 = icmp slt i32 %216, %217
br i1 %218, label %219, label %245
219: ; preds = %215
%220 = load i32, i32* %5
%221 = sext i32 %220 to i64
%222 = mul nsw i64 %221, %47
%223 = getelementptr inbounds float, float* %49, i64 %222
%224 = load i32, i32* %4
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds float, float* %223, i64 %225
%227 = load float, float* %226
%228 = load i32, i32* %4
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds float, float* %175, i64 %229
store float %227, float* %230
%231 = load i32, i32* %6
%232 = sext i32 %231 to i64
%233 = mul nsw i64 %232, %47
%234 = getelementptr inbounds float, float* %49, i64 %233
%235 = load i32, i32* %4
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds float, float* %234, i64 %236
%238 = load float, float* %237
%239 = load i32, i32* %4
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds float, float* %178, i64 %240
store float %238, float* %241
br label %242
242: ; preds = %219
%243 = load i32, i32* %4
%244 = add nsw i32 %243, 1
store i32 %244, i32* %4
br label %215
245: ; preds = %215
%246 = load i32, i32* %5
%247 = load i32, i32* %6
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i32 %246, i32 %247)
%249 = load i32, i32* %2
%250 = call i32 @distanciaVetores(i32 %249, float* %175, float* %178)
%251 = load i32, i32* %2
%252 = zext i32 %251 to i64
%253 = alloca float, i64 %252
store i64 %252, i64* %21
%254 = load i32, i32* %2
%255 = zext i32 %254 to i64
%256 = alloca float, i64 %255
store i64 %255, i64* %22
store i32 0, i32* %4
br label %257
257: ; preds = %284, %245
%258 = load i32, i32* %4
%259 = load i32, i32* %2
%260 = icmp slt i32 %258, %259
br i1 %260, label %261, label %287
261: ; preds = %257
%262 = load i32, i32* %7
%263 = sext i32 %262 to i64
%264 = mul nsw i64 %263, %40
%265 = getelementptr inbounds float, float* %43, i64 %264
%266 = load i32, i32* %4
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds float, float* %265, i64 %267
%269 = load float, float* %268
%270 = load i32, i32* %4
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds float, float* %253, i64 %271
store float %269, float* %272
%273 = load i32, i32* %8
%274 = sext i32 %273 to i64
%275 = mul nsw i64 %274, %40
%276 = getelementptr inbounds float, float* %43, i64 %275
%277 = load i32, i32* %4
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds float, float* %276, i64 %278
%280 = load float, float* %279
%281 = load i32, i32* %4
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds float, float* %256, i64 %282
store float %280, float* %283
br label %284
284: ; preds = %261
%285 = load i32, i32* %4
%286 = add nsw i32 %285, 1
store i32 %286, i32* %4
br label %257
287: ; preds = %257
%288 = load i32, i32* %7
%289 = load i32, i32* %8
%290 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.15, i64 0, i64 0), i32 %288, i32 %289)
%291 = load i32, i32* %2
%292 = call i32 @angulo(i32 %291, float* %253, float* %256)
store i32 0, i32* %4
br label %293
293: ; preds = %320, %287
%294 = load i32, i32* %4
%295 = load i32, i32* %2
%296 = icmp slt i32 %294, %295
br i1 %296, label %297, label %323
297: ; preds = %293
%298 = load i32, i32* %5
%299 = sext i32 %298 to i64
%300 = mul nsw i64 %299, %47
%301 = getelementptr inbounds float, float* %49, i64 %300
%302 = load i32, i32* %4
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds float, float* %301, i64 %303
%305 = load float, float* %304
%306 = load i32, i32* %4
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds float, float* %175, i64 %307
store float %305, float* %308
%309 = load i32, i32* %6
%310 = sext i32 %309 to i64
%311 = mul nsw i64 %310, %47
%312 = getelementptr inbounds float, float* %49, i64 %311
%313 = load i32, i32* %4
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds float, float* %312, i64 %314
%316 = load float, float* %315
%317 = load i32, i32* %4
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds float, float* %178, i64 %318
store float %316, float* %319
br label %320
320: ; preds = %297
%321 = load i32, i32* %4
%322 = add nsw i32 %321, 1
store i32 %322, i32* %4
br label %293
323: ; preds = %293
%324 = load i32, i32* %7
%325 = load i32, i32* %8
%326 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.16, i64 0, i64 0), i32 %324, i32 %325)
%327 = load i32, i32* %2
%328 = call i32 @angulo(i32 %327, float* %253, float* %256)
%329 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.17, i64 0, i64 0))
%330 = load i32, i32* %2
%331 = bitcast float* %43 to float**
%332 = call i32 @normasMatriz(i32 %330, float** %331)
%333 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%334 = load i32, i32* %2
%335 = bitcast float* %49 to float**
%336 = call i32 @normasMatriz(i32 %334, float** %335)
%337 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.19, i64 0, i64 0))
%338 = load i32, i32* %2
%339 = bitcast float* %43 to float**
%340 = bitcast float* %49 to float**
%341 = call i32 @distanciaMatrizes(i32 %338, float** %339, float** %340)
store i32 0, i32* %1
%342 = load i8*, i8** %9
%343 = load i32, i32* %1
ret i32 %343
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [31 x i8] c"(digite valores entre 0 e %d)\0A\00"
@.str.8 = [35 x i8] c"Digite a posi\C3\A7\C3\A3o %d do vetor %d\0A\00"
@.str.9 = [3 x i8] c"%f\00"
@.str.13 = [57 x i8] c"\0ADistancia entre os vetores %d e %d dados pelo usuario:\0A\00"
@.str.14 = [52 x i8] c"\0ADistancia entre os vetores %d e %d depois da TDC:\0A\00"
@.str.15 = [66 x i8] c"\0AProduto interno e angulo dos vetores %d e %d dados pelo usuario\0A\00"
@.str.16 = [63 x i8] c"\0AProduto interno e angulo dos vetores %d e %d da Transformada\0A\00"
@str = [58 x i8] c"Digite o numero (p) de vetores de dimensao (p) desejado: \00"
@str.20 = [60 x i8] c"Lembrando que os vetores serao alocados horizontalmente!!!!\00"
@str.21 = [85 x i8] c"Digite as posicoes dos dois vetores dos quais ser\C3\A3o calculados a distancia entre si\00"
@str.22 = [73 x i8] c"Serao calculadas as distancias entre esses vetores antes e depois da TDC\00"
@str.23 = [101 x i8] c"Digite as posicoes dos dois vetores dos quais ser\C3\A3o \0Acalculados produto interno e o angulo entre si\00"
@str.24 = [86 x i8] c"Serao calculadas o prod. interno e o angulo entre esses vetores antes e depois da TDC\00"
@str.25 = [22 x i8] c"\0AConjunto de vetores:\00"
@str.26 = [25 x i8] c"\0AMatriz da Transformada:\00"
@str.27 = [36 x i8] c"\0AMatriz da Inversa da Transformada:\00"
@str.28 = [58 x i8] c"\0ANormas da matriz dada pelo usuario(conjunto de vetores):\00"
@str.29 = [35 x i8] c"\0ANormas da matriz oriunda da TDC: \00"
@str.30 = [76 x i8] c"\0ADistancia entre a matriz dada(conjuntoVetores) e a matriz da transformada:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.20, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.21, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.22, i64 0, i64 0))
%16 = load i32, i32* %1
%17 = add nsw i32 %16, -1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str.23, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.24, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%25 = load i32, i32* %1
%26 = zext i32 %25 to i64
%27 = call i8* @llvm.stacksave()
%28 = mul nuw i64 %26, %26
%29 = alloca float, i64 %28
%30 = load i32, i32* %1
%31 = zext i32 %30 to i64
%32 = mul nuw i64 %31, %31
%33 = alloca float, i64 %32
%34 = alloca float, i64 %32
%35 = alloca float, i64 %31
%36 = bitcast float* %35 to i8*
%37 = alloca float, i64 %31
%38 = bitcast float* %37 to i8*
%39 = alloca float, i64 %31
%40 = bitcast float* %39 to i8*
%41 = icmp sgt i32 %30, 0
br i1 %41, label %42, label %98
42: ; preds = %0, %62
%43 = phi i32 [ %63, %62 ], [ %30, %0 ]
%44 = phi i64 [ %65, %62 ], [ 0, %0 ]
%45 = icmp sgt i32 %43, 0
br i1 %45, label %46, label %62
46: ; preds = %42
%47 = mul nuw nsw i64 %44, %26
%48 = getelementptr inbounds float, float* %29, i64 %47
%49 = trunc i64 %44 to i32
br label %52
50: ; preds = %62
%51 = icmp sgt i32 %63, 0
br i1 %51, label %67, label %98
52: ; preds = %46, %52
%53 = phi i64 [ 0, %46 ], [ %58, %52 ]
%54 = trunc i64 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i32 %54, i32 %49)
%56 = getelementptr inbounds float, float* %48, i64 %53
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), float* %56)
%58 = add nuw nsw i64 %53, 1
%59 = load i32, i32* %1
%60 = sext i32 %59 to i64
%61 = icmp slt i64 %58, %60
br i1 %61, label %52, label %62
62: ; preds = %52, %42
%63 = phi i32 [ %43, %42 ], [ %59, %52 ]
%64 = sext i32 %63 to i64
%65 = add nuw nsw i64 %44, 1
%66 = icmp slt i64 %65, %64
br i1 %66, label %42, label %50
67: ; preds = %50, %94
%68 = phi i64 [ %95, %94 ], [ 0, %50 ]
%69 = phi i32 [ %89, %94 ], [ %63, %50 ]
%70 = trunc i64 %68 to i32
%71 = mul nuw nsw i64 %68, %31
%72 = getelementptr float, float* %34, i64 %71
%73 = bitcast float* %72 to i8*
%74 = getelementptr float, float* %33, i64 %71
%75 = bitcast float* %74 to i8*
%76 = icmp sgt i32 %69, 0
br i1 %76, label %77, label %83
77: ; preds = %67
%78 = mul nuw nsw i64 %68, %26
%79 = getelementptr float, float* %29, i64 %78
%80 = bitcast float* %79 to i8*
%81 = zext i32 %69 to i64
%82 = shl nuw nsw i64 %81, 2
br label %83
83: ; preds = %77, %67
%84 = call i32 @TDC(i32 %69, float* %37, float* %39)
%85 = load i32, i32* %1
%86 = call i32 @normasVetores(i32 %85, float* %37, float* %39, i32 %70)
%87 = load i32, i32* %1
%88 = call i32 @IDCT(i32 %87, float* %39, float* %35)
%89 = load i32, i32* %1
%90 = icmp sgt i32 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %83
%92 = zext i32 %89 to i64
%93 = shl nuw nsw i64 %92, 2
br label %94
94: ; preds = %91, %83
%95 = add nuw nsw i64 %68, 1
%96 = trunc i64 %95 to i32
%97 = icmp sgt i32 %89, %96
br i1 %97, label %67, label %98
98: ; preds = %94, %0, %50
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.25, i64 0, i64 0))
%100 = load i32, i32* %1
%101 = bitcast float* %29 to float**
%102 = call i32 @ImprimirMatriz(i32 %100, float** %101)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.26, i64 0, i64 0))
%104 = load i32, i32* %1
%105 = bitcast float* %33 to float**
%106 = call i32 @ImprimirMatriz(i32 %104, float** %105)
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.27, i64 0, i64 0))
%108 = load i32, i32* %1
%109 = bitcast float* %34 to float**
%110 = call i32 @ImprimirMatriz(i32 %108, float** %109)
%111 = load i32, i32* %1
%112 = zext i32 %111 to i64
%113 = alloca float, i64 %112
%114 = bitcast float* %113 to i8*
%115 = alloca float, i64 %112
%116 = bitcast float* %115 to i8*
%117 = icmp sgt i32 %111, 0
%118 = load i32, i32* %2
br i1 %117, label %121, label %119
119: ; preds = %98
%120 = load i32, i32* %3
br label %132
121: ; preds = %98
%122 = sext i32 %118 to i64
%123 = mul nsw i64 %122, %26
%124 = getelementptr inbounds float, float* %29, i64 %123
%125 = bitcast float* %124 to i8*
%126 = load i32, i32* %3
%127 = sext i32 %126 to i64
%128 = mul nsw i64 %127, %26
%129 = getelementptr inbounds float, float* %29, i64 %128
%130 = bitcast float* %129 to i8*
%131 = shl nuw nsw i64 %112, 2
br label %132
132: ; preds = %119, %121
%133 = phi i32 [ %120, %119 ], [ %126, %121 ]
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i32 %118, i32 %133)
%135 = load i32, i32* %1
%136 = call i32 @distanciaVetores(i32 %135, float* %113, float* %115)
%137 = load i32, i32* %1
%138 = icmp sgt i32 %137, 0
%139 = load i32, i32* %2
br i1 %138, label %142, label %140
140: ; preds = %132
%141 = load i32, i32* %3
br label %154
142: ; preds = %132
%143 = sext i32 %139 to i64
%144 = mul nsw i64 %143, %31
%145 = getelementptr inbounds float, float* %33, i64 %144
%146 = bitcast float* %145 to i8*
%147 = load i32, i32* %3
%148 = sext i32 %147 to i64
%149 = mul nsw i64 %148, %31
%150 = getelementptr inbounds float, float* %33, i64 %149
%151 = bitcast float* %150 to i8*
%152 = zext i32 %137 to i64
%153 = shl nuw nsw i64 %152, 2
br label %154
154: ; preds = %140, %142
%155 = phi i32 [ %141, %140 ], [ %147, %142 ]
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), i32 %139, i32 %155)
%157 = load i32, i32* %1
%158 = call i32 @distanciaVetores(i32 %157, float* %113, float* %115)
%159 = load i32, i32* %1
%160 = zext i32 %159 to i64
%161 = alloca float, i64 %160
%162 = alloca float, i64 %160
%163 = icmp sgt i32 %159, 0
br i1 %163, label %167, label %164
164: ; preds = %154
%165 = load i32, i32* %4
%166 = load i32, i32* %5
br label %181
167: ; preds = %154
%168 = bitcast float* %162 to i8*
%169 = bitcast float* %161 to i8*
%170 = load i32, i32* %4
%171 = sext i32 %170 to i64
%172 = mul nsw i64 %171, %26
%173 = getelementptr inbounds float, float* %29, i64 %172
%174 = bitcast float* %173 to i8*
%175 = load i32, i32* %5
%176 = sext i32 %175 to i64
%177 = mul nsw i64 %176, %26
%178 = getelementptr inbounds float, float* %29, i64 %177
%179 = bitcast float* %178 to i8*
%180 = shl nuw nsw i64 %160, 2
br label %181
181: ; preds = %164, %167
%182 = phi i32 [ %166, %164 ], [ %175, %167 ]
%183 = phi i32 [ %165, %164 ], [ %170, %167 ]
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.15, i64 0, i64 0), i32 %183, i32 %182)
%185 = load i32, i32* %1
%186 = call i32 @angulo(i32 %185, float* %161, float* %162)
%187 = load i32, i32* %1
%188 = icmp sgt i32 %187, 0
br i1 %188, label %189, label %202
189: ; preds = %181
%190 = load i32, i32* %2
%191 = sext i32 %190 to i64
%192 = mul nsw i64 %191, %31
%193 = getelementptr inbounds float, float* %33, i64 %192
%194 = bitcast float* %193 to i8*
%195 = load i32, i32* %3
%196 = sext i32 %195 to i64
%197 = mul nsw i64 %196, %31
%198 = getelementptr inbounds float, float* %33, i64 %197
%199 = bitcast float* %198 to i8*
%200 = zext i32 %187 to i64
%201 = shl nuw nsw i64 %200, 2
br label %202
202: ; preds = %189, %181
%203 = load i32, i32* %4
%204 = load i32, i32* %5
%205 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.16, i64 0, i64 0), i32 %203, i32 %204)
%206 = load i32, i32* %1
%207 = call i32 @angulo(i32 %206, float* %161, float* %162)
%208 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.28, i64 0, i64 0))
%209 = load i32, i32* %1
%210 = call i32 @normasMatriz(i32 %209, float** %101)
%211 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.29, i64 0, i64 0))
%212 = load i32, i32* %1
%213 = call i32 @normasMatriz(i32 %212, float** %105)
%214 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.30, i64 0, i64 0))
%215 = load i32, i32* %1
%216 = call i32 @distanciaMatrizes(i32 %215, float** %101, float** %105)
ret i32 0
}