#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 */
double fabs(float);
int /*<<< orphan*/ free_matrix(float **, int, int, int, int);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ getchar();
float **matrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ tqli(float *, float *, int, float **);
int /*<<< orphan*/ tred2(float **, int, float *, float *);
float *vector(int, int);
int main(void) {
  int i, j, k;
  float *d, *e, *f, **a;
  static float c[10][10] = {
      5.0,  4.3, 3.0, 2.0,  1.0,  0.0,  -1.0, -2.0, -3.0, -4.0, 4.3,  5.1,
      4.0,  3.0, 2.0, 1.0,  0.0,  -1.0, -2.0, -3.0, 3.0,  4.0,  5.0,  4.0,
      3.0,  2.0, 1.0, 0.0,  -1.0, -2.0, 2.0,  3.0,  4.0,  5.0,  4.0,  3.0,
      2.0,  1.0, 0.0, -1.0, 1.0,  2.0,  3.0,  4.0,  5.0,  4.0,  3.0,  2.0,
      1.0,  0.0, 0.0, 1.0,  2.0,  3.0,  4.0,  5.0,  4.0,  3.0,  2.0,  1.0,
      -1.0, 0.0, 1.0, 2.0,  3.0,  4.0,  5.0,  4.0,  3.0,  2.0,  -2.0, -1.0,
      0.0,  1.0, 2.0, 3.0,  4.0,  5.0,  4.0,  3.0,  -3.0, -2.0, -1.0, 0.0,
      1.0,  2.0, 3.0, 4.0,  5.0,  4.0,  -4.0, -3.0, -2.0, -1.0, 0.0,  1.0,
      2.0,  3.0, 4.0, 5.0};
  d = vector(1, 10);
  e = vector(1, 10);
  f = vector(1, 10);
  a = matrix(1, 10, 1, 10);
  for (i = 1; i <= 10; i++)
    for (j = 1; j <= 10; j++)
      a[i][j] = c[i - 1][j - 1];
  tred2(a, 10, d, e);
  tqli(d, e, 10, a);
  printf("\nEigenvectors for a real symmetric matrix\n");
  for (i = 1; i <= 10; i++) {
    for (j = 1; j <= 10; j++) {
      f[j] = 0.0;
      for (k = 1; k <= 10; k++)
        f[j] += (c[j - 1][k - 1] * a[k][i]);
    }
    printf("%s %3d %s %10.6f\n", "eigenvalue", i, " =", d[i]);
    printf("%11s %14s %9s\n", "vector", "mtrx*vect.", "ratio");
    for (j = 1; j <= 10; j++) {
      if (fabs(a[j][i]) < 1.0e-6)
        printf("%12.6f %12.6f %12s\n", a[j][i], f[j], "div. by 0");
      else
        printf("%12.6f %12.6f %12.6f\n", a[j][i], f[j], f[j] / a[j][i]);
    }
    printf("Press ENTER to continue...\n");
    (void)getchar();
  }
  free_matrix(a, 1, 10, 1, 10);
  free_vector(f, 1, 10);
  free_vector(e, 1, 10);
  free_vector(d, 1, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   10a0 <vector@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   10a0 <vector@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   10a0 <vector@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1,%edx
mov    $0xa,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1090 <matrix@plt>
mov    %rax,-0x30(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     126c <main+0xdc>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     1259 <main+0xc9>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2e4f(%rip),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1207 <main+0x77>
jmp    125e <main+0xce>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f6 <main+0x66>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xa,%esi
call   10b0 <tred2@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rcx
mov    $0xa,%edx
call   1060 <tqli@plt>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     14c9 <main+0x339>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     135e <main+0x1ce>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     134b <main+0x1bb>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d77(%rip),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12df <main+0x14f>
jmp    1350 <main+0x1c0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12be <main+0x12e>
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcba(%rip),%rdi
lea    0xcc5(%rip),%rsi
lea    0xcc9(%rip),%rcx
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xcbe(%rip),%rdi
lea    0xcc6(%rip),%rsi
lea    0xcc6(%rip),%rdx
lea    0xcca(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     14a6 <main+0x316>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xc19(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1435 <main+0x2a5>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc58(%rip),%rdi
lea    0xc65(%rip),%rsi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1493 <main+0x303>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
divss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xc0c(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
jmp    1498 <main+0x308>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13b8 <main+0x228>
lea    0xc01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12ad <main+0x11d>
mov    -0x30(%rbp),%rdi
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1030 <free_matrix@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%edi
mov    $0xa,%esi
call   10b0 <vector@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0xa,%esi
call   10b0 <vector@plt>
mov    %rax,%rbp
mov    $0x1,%edi
mov    $0xa,%esi
call   10b0 <vector@plt>
mov    %rax,%r13
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x1,%edx
mov    $0xa,%ecx
call   10a0 <matrix@plt>
mov    %rax,%r12
mov    0x8(%rax),%rax
movaps 0xe05(%rip),%xmm0
movups %xmm0,0x4(%rax)
movaps 0xe0a(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0xe0f(%rip),%rcx
mov    %rcx,0x24(%rax)
mov    0x10(%r12),%rax
mov    0xe27(%rip),%rcx
mov    %rcx,0x24(%rax)
movups 0xdfc(%rip),%xmm0
movups %xmm0,0x4(%rax)
movups 0xe01(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0x18(%r12),%rax
movaps 0xe09(%rip),%xmm0
movups %xmm0,0x4(%rax)
movaps 0xe0e(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0xe13(%rip),%rcx
mov    %rcx,0x24(%rax)
mov    0x20(%r12),%rax
movups 0xe0b(%rip),%xmm0
movups %xmm0,0x4(%rax)
movups 0xe10(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0xe15(%rip),%rcx
mov    %rcx,0x24(%rax)
mov    0x28(%r12),%rax
movaps 0xe0d(%rip),%xmm0
movups %xmm0,0x4(%rax)
movaps 0xe12(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0xe17(%rip),%rcx
mov    %rcx,0x24(%rax)
mov    0x30(%r12),%rax
mov    0xe2f(%rip),%rcx
mov    %rcx,0x24(%rax)
movups 0xe14(%rip),%xmm0
movups %xmm0,0x14(%rax)
movups 0xdf9(%rip),%xmm0
movups %xmm0,0x4(%rax)
mov    0x38(%r12),%rax
mov    0xe31(%rip),%rcx
mov    %rcx,0x24(%rax)
movaps 0xe16(%rip),%xmm0
movups %xmm0,0x14(%rax)
movaps 0xdfb(%rip),%xmm0
movups %xmm0,0x4(%rax)
mov    0x40(%r12),%rax
movups 0xe23(%rip),%xmm0
movups %xmm0,0x14(%rax)
mov    0xe28(%rip),%rcx
mov    %rcx,0x24(%rax)
movups 0xdfd(%rip),%xmm0
movups %xmm0,0x4(%rax)
mov    0x48(%r12),%rax
mov    0xe35(%rip),%rcx
mov    %rcx,0x24(%rax)
movaps 0xe1a(%rip),%xmm0
movups %xmm0,0x14(%rax)
movaps 0xdff(%rip),%xmm0
movups %xmm0,0x4(%rax)
mov    0x50(%r12),%rax
mov    0xe37(%rip),%rcx
mov    %rcx,0x24(%rax)
movups 0xe1c(%rip),%xmm0
movups %xmm0,0x14(%rax)
movups 0xe01(%rip),%xmm0
movups %xmm0,0x4(%rax)
mov    %r12,%rdi
mov    $0xa,%esi
mov    %rbx,%rdx
mov    %rbp,%rcx
call   10c0 <tred2@plt>
mov    %rbx,0x8(%rsp)
mov    %rbx,%rdi
mov    %rbp,0x10(%rsp)
mov    %rbp,%rsi
mov    $0xa,%edx
mov    %r12,%rcx
call   1070 <tqli@plt>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
xorps  %xmm2,%xmm2
jmp    13f4 <main+0x254>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <getchar@plt>
add    $0x1,%rbx
cmp    $0xb,%rbx
xorps  %xmm2,%xmm2
je     1610 <main+0x470>
mov    0x8(%r12),%r8
mov    0x10(%r12),%r9
mov    0x18(%r12),%r10
mov    0x20(%r12),%r11
mov    0x28(%r12),%rdi
mov    0x30(%r12),%rbp
mov    0x38(%r12),%rax
mov    0x40(%r12),%rcx
mov    0x48(%r12),%rdx
mov    0x50(%r12),%rsi
lea    0xc07(%rip),%r14
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movl   $0x0,0x0(%r13,%r15,4)
movss  -0x24(%r14),%xmm0
mulss  (%r8,%rbx,4),%xmm0
addss  %xmm2,%xmm0
movss  %xmm0,0x0(%r13,%r15,4)
movss  -0x20(%r14),%xmm1
mulss  (%r9,%rbx,4),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%r15,4)
movss  -0x1c(%r14),%xmm0
mulss  (%r10,%rbx,4),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x0(%r13,%r15,4)
movss  -0x18(%r14),%xmm1
mulss  (%r11,%rbx,4),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%r15,4)
movss  -0x14(%r14),%xmm0
mulss  (%rdi,%rbx,4),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x0(%r13,%r15,4)
movss  -0x10(%r14),%xmm1
mulss  0x0(%rbp,%rbx,4),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%r15,4)
movss  -0xc(%r14),%xmm0
mulss  (%rax,%rbx,4),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x0(%r13,%r15,4)
movss  -0x8(%r14),%xmm1
mulss  (%rcx,%rbx,4),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%r15,4)
movss  -0x4(%r14),%xmm0
mulss  (%rdx,%rbx,4),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x0(%r13,%r15,4)
movss  (%r14),%xmm1
mulss  (%rsi,%rbx,4),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%r15,4)
add    $0x1,%r15
add    $0x28,%r14
cmp    $0xb,%r15
jne    1440 <main+0x2a0>
mov    0x8(%rsp),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc50(%rip),%rdi
lea    0xc5b(%rip),%rsi
mov    %ebx,%edx
lea    0xc5d(%rip),%rcx
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc52(%rip),%rdi
lea    0xc5a(%rip),%rsi
lea    0xc5a(%rip),%rdx
lea    0xc5e(%rip),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
lea    0xc51(%rip),%r14
lea    0xc5e(%rip),%r15
jmp    15c7 <main+0x427>
nop
divss  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
lea    0xc53(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0xb,%rbp
je     13d0 <main+0x230>
mov    (%r12,%rbp,8),%rax
movss  (%rax,%rbx,4),%xmm0
call   1080 <fabs@plt>
movsd  0xa23(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    (%r12,%rbp,8),%rax
movss  (%rax,%rbx,4),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
movss  0x0(%r13,%rbp,4),%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
jbe    15a0 <main+0x400>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    15b9 <main+0x419>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
call   1040 <free_matrix@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@main.c = internal global [10 x [10 x float]] [[10 x float] [float 5.000000e+00, float 0x4011333340000000, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00, float -3.000000e+00, float -4.000000e+00], [10 x float] [float 0x4011333340000000, float 0x4014666660000000, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00, float -3.000000e+00], [10 x float] [float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00], [10 x float] [float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00], [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00], [10 x float] [float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00], [10 x float] [float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00], [10 x float] [float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00], [10 x float] [float -3.000000e+00, float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00], [10 x float] [float -4.000000e+00, float -3.000000e+00, float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00]]
@.str = [43 x i8] c"\0AEigenvectors for a real symmetric matrix\0A\00"
@.str.1 = [18 x i8] c"%s %3d %s %10.6f\0A\00"
@.str.2 = [11 x i8] c"eigenvalue\00"
@.str.3 = [3 x i8] c" =\00"
@.str.4 = [15 x i8] c"%11s %14s %9s\0A\00"
@.str.5 = [7 x i8] c"vector\00"
@.str.6 = [11 x i8] c"mtrx*vect.\00"
@.str.7 = [6 x i8] c"ratio\00"
@.str.8 = [20 x i8] c"%12.6f %12.6f %12s\0A\00"
@.str.9 = [10 x i8] c"div. by 0\00"
@.str.10 = [22 x i8] c"%12.6f %12.6f %12.6f\0A\00"
@.str.11 = [28 x i8] c"Press ENTER to continue...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float**
store i32 0, i32* %1
%9 = call float* @vector(i32 1, i32 10)
store float* %9, float** %5
%10 = call float* @vector(i32 1, i32 10)
store float* %10, float** %6
%11 = call float* @vector(i32 1, i32 10)
store float* %11, float** %7
%12 = call float** @matrix(i32 1, i32 10, i32 1, i32 10)
store float** %12, float*** %8
store i32 1, i32* %2
br label %13
13: ; preds = %42, %0
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 10
br i1 %15, label %16, label %45
16: ; preds = %13
store i32 1, i32* %3
br label %17
17: ; preds = %38, %16
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 10
br i1 %19, label %20, label %41
20: ; preds = %17
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %23
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x float], [10 x float]* %24, i64 0, i64 %27
%29 = load float, float* %28
%30 = load float**, float*** %8
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds float*, float** %30, i64 %32
%34 = load float*, float** %33
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
store float %29, float* %37
br label %38
38: ; preds = %20
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %17
41: ; preds = %17
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %13
45: ; preds = %13
%46 = load float**, float*** %8
%47 = load float*, float** %5
%48 = load float*, float** %6
%49 = call i32 @tred2(float** %46, i32 10, float* %47, float* %48)
%50 = load float*, float** %5
%51 = load float*, float** %6
%52 = load float**, float*** %8
%53 = call i32 @tqli(float* %50, float* %51, i32 10, float** %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %55
55: ; preds = %186, %45
%56 = load i32, i32* %2
%57 = icmp sle i32 %56, 10
br i1 %57, label %58, label %189
58: ; preds = %55
store i32 1, i32* %3
br label %59
59: ; preds = %99, %58
%60 = load i32, i32* %3
%61 = icmp sle i32 %60, 10
br i1 %61, label %62, label %102
62: ; preds = %59
%63 = load float*, float** %7
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds float, float* %63, i64 %65
store float 0.000000e+00, float* %66
store i32 1, i32* %4
br label %67
67: ; preds = %95, %62
%68 = load i32, i32* %4
%69 = icmp sle i32 %68, 10
br i1 %69, label %70, label %98
70: ; preds = %67
%71 = load i32, i32* %3
%72 = sub nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73
%75 = load i32, i32* %4
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [10 x float], [10 x float]* %74, i64 0, i64 %77
%79 = load float, float* %78
%80 = load float**, float*** %8
%81 = load i32, i32* %4
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds float*, float** %80, i64 %82
%84 = load float*, float** %83
%85 = load i32, i32* %2
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds float, float* %84, i64 %86
%88 = load float, float* %87
%89 = load float*, float** %7
%90 = load i32, i32* %3
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds float, float* %89, i64 %91
%93 = load float, float* %92
%94 = call float @llvm.fmuladd.f32(float %79, float %88, float %93)
store float %94, float* %92
br label %95
95: ; preds = %70
%96 = load i32, i32* %4
%97 = add nsw i32 %96, 1
store i32 %97, i32* %4
br label %67
98: ; preds = %67
br label %99
99: ; preds = %98
%100 = load i32, i32* %3
%101 = add nsw i32 %100, 1
store i32 %101, i32* %3
br label %59
102: ; preds = %59
%103 = load i32, i32* %2
%104 = load float*, float** %5
%105 = load i32, i32* %2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds float, float* %104, i64 %106
%108 = load float, float* %107
%109 = fpext float %108 to double
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %112
112: ; preds = %180, %102
%113 = load i32, i32* %3
%114 = icmp sle i32 %113, 10
br i1 %114, label %115, label %183
115: ; preds = %112
%116 = load float**, float*** %8
%117 = load i32, i32* %3
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds float*, float** %116, i64 %118
%120 = load float*, float** %119
%121 = load i32, i32* %2
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds float, float* %120, i64 %122
%124 = load float, float* %123
%125 = call double @fabs(float %124)
%126 = fcmp olt double %125, 0x3EB0C6F7A0B5ED8D
br i1 %126, label %127, label %145
127: ; preds = %115
%128 = load float**, float*** %8
%129 = load i32, i32* %3
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds float*, float** %128, i64 %130
%132 = load float*, float** %131
%133 = load i32, i32* %2
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds float, float* %132, i64 %134
%136 = load float, float* %135
%137 = fpext float %136 to double
%138 = load float*, float** %7
%139 = load i32, i32* %3
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds float, float* %138, i64 %140
%142 = load float, float* %141
%143 = fpext float %142 to double
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), double %137, double %143, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %179
145: ; preds = %115
%146 = load float**, float*** %8
%147 = load i32, i32* %3
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds float*, float** %146, i64 %148
%150 = load float*, float** %149
%151 = load i32, i32* %2
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds float, float* %150, i64 %152
%154 = load float, float* %153
%155 = fpext float %154 to double
%156 = load float*, float** %7
%157 = load i32, i32* %3
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds float, float* %156, i64 %158
%160 = load float, float* %159
%161 = fpext float %160 to double
%162 = load float*, float** %7
%163 = load i32, i32* %3
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds float, float* %162, i64 %164
%166 = load float, float* %165
%167 = load float**, float*** %8
%168 = load i32, i32* %3
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds float*, float** %167, i64 %169
%171 = load float*, float** %170
%172 = load i32, i32* %2
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds float, float* %171, i64 %173
%175 = load float, float* %174
%176 = fdiv float %166, %175
%177 = fpext float %176 to double
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), double %155, double %161, double %177)
br label %179
179: ; preds = %145, %127
br label %180
180: ; preds = %179
%181 = load i32, i32* %3
%182 = add nsw i32 %181, 1
store i32 %182, i32* %3
br label %112
183: ; preds = %112
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%185 = call i32 (...) @getchar()
br label %186
186: ; preds = %183
%187 = load i32, i32* %2
%188 = add nsw i32 %187, 1
store i32 %188, i32* %2
br label %55
189: ; preds = %55
%190 = load float**, float*** %8
%191 = call i32 @free_matrix(float** %190, i32 1, i32 10, i32 1, i32 10)
%192 = load float*, float** %7
%193 = call i32 @free_vector(float* %192, i32 1, i32 10)
%194 = load float*, float** %6
%195 = call i32 @free_vector(float* %194, i32 1, i32 10)
%196 = load float*, float** %5
%197 = call i32 @free_vector(float* %196, i32 1, i32 10)
ret i32 0
}

LLVM IR (-O2):
@main.c = internal unnamed_addr constant [10 x [10 x float]] [[10 x float] [float 5.000000e+00, float 0x4011333340000000, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00, float -3.000000e+00, float -4.000000e+00], [10 x float] [float 0x4011333340000000, float 0x4014666660000000, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00, float -3.000000e+00], [10 x float] [float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -2.000000e+00], [10 x float] [float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00], [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 0.000000e+00], [10 x float] [float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00, float 1.000000e+00], [10 x float] [float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00, float 2.000000e+00], [10 x float] [float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00, float 3.000000e+00], [10 x float] [float -3.000000e+00, float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 4.000000e+00], [10 x float] [float -4.000000e+00, float -3.000000e+00, float -2.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00]]
@.str.1 = [18 x i8] c"%s %3d %s %10.6f\0A\00"
@.str.2 = [11 x i8] c"eigenvalue\00"
@.str.3 = [3 x i8] c" =\00"
@.str.4 = [15 x i8] c"%11s %14s %9s\0A\00"
@.str.5 = [7 x i8] c"vector\00"
@.str.6 = [11 x i8] c"mtrx*vect.\00"
@.str.7 = [6 x i8] c"ratio\00"
@.str.8 = [20 x i8] c"%12.6f %12.6f %12s\0A\00"
@.str.9 = [10 x i8] c"div. by 0\00"
@.str.10 = [22 x i8] c"%12.6f %12.6f %12.6f\0A\00"
@str = [42 x i8] c"\0AEigenvectors for a real symmetric matrix\00"
@str.12 = [27 x i8] c"Press ENTER to continue...\00"
define i32 @main() {
%1 = tail call float* @vector(i32 1, i32 10)
%2 = tail call float* @vector(i32 1, i32 10)
%3 = tail call float* @vector(i32 1, i32 10)
%4 = tail call float** @matrix(i32 1, i32 10, i32 1, i32 10)
%5 = getelementptr inbounds float*, float** %4, i64 1
%6 = load float*, float** %5
%7 = getelementptr float, float* %6, i64 1
%8 = bitcast float* %7 to i8*
%9 = getelementptr inbounds float*, float** %4, i64 2
%10 = load float*, float** %9
%11 = getelementptr float, float* %10, i64 1
%12 = bitcast float* %11 to i8*
%13 = getelementptr inbounds float*, float** %4, i64 3
%14 = load float*, float** %13
%15 = getelementptr float, float* %14, i64 1
%16 = bitcast float* %15 to i8*
%17 = getelementptr inbounds float*, float** %4, i64 4
%18 = load float*, float** %17
%19 = getelementptr float, float* %18, i64 1
%20 = bitcast float* %19 to i8*
%21 = getelementptr inbounds float*, float** %4, i64 5
%22 = load float*, float** %21
%23 = getelementptr float, float* %22, i64 1
%24 = bitcast float* %23 to i8*
%25 = getelementptr inbounds float*, float** %4, i64 6
%26 = load float*, float** %25
%27 = getelementptr float, float* %26, i64 1
%28 = bitcast float* %27 to i8*
%29 = getelementptr inbounds float*, float** %4, i64 7
%30 = load float*, float** %29
%31 = getelementptr float, float* %30, i64 1
%32 = bitcast float* %31 to i8*
%33 = getelementptr inbounds float*, float** %4, i64 8
%34 = load float*, float** %33
%35 = getelementptr float, float* %34, i64 1
%36 = bitcast float* %35 to i8*
%37 = getelementptr inbounds float*, float** %4, i64 9
%38 = load float*, float** %37
%39 = getelementptr float, float* %38, i64 1
%40 = bitcast float* %39 to i8*
%41 = getelementptr inbounds float*, float** %4, i64 10
%42 = load float*, float** %41
%43 = getelementptr float, float* %42, i64 1
%44 = bitcast float* %43 to i8*
%45 = tail call i32 @tred2(float** %4, i32 10, float* %1, float* %2)
%46 = tail call i32 @tqli(float* %1, float* %2, i32 10, float** %4)
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %48
48: ; preds = %0, %147
%49 = phi i64 [ 1, %0 ], [ %150, %147 ]
%50 = load float*, float** %5
%51 = load float*, float** %9
%52 = load float*, float** %13
%53 = load float*, float** %17
%54 = load float*, float** %21
%55 = load float*, float** %25
%56 = load float*, float** %29
%57 = load float*, float** %33
%58 = load float*, float** %37
%59 = load float*, float** %41
%60 = getelementptr inbounds float, float* %50, i64 %49
%61 = getelementptr inbounds float, float* %51, i64 %49
%62 = getelementptr inbounds float, float* %52, i64 %49
%63 = getelementptr inbounds float, float* %53, i64 %49
%64 = getelementptr inbounds float, float* %54, i64 %49
%65 = getelementptr inbounds float, float* %55, i64 %49
%66 = getelementptr inbounds float, float* %56, i64 %49
%67 = getelementptr inbounds float, float* %57, i64 %49
%68 = getelementptr inbounds float, float* %58, i64 %49
%69 = getelementptr inbounds float, float* %59, i64 %49
br label %70
70: ; preds = %48, %70
%71 = phi i64 [ 1, %48 ], [ %114, %70 ]
%72 = getelementptr inbounds float, float* %3, i64 %71
store float 0.000000e+00, float* %72
%73 = add nsw i64 %71, -1
%74 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 0
%75 = load float, float* %74
%76 = load float, float* %60
%77 = tail call float @llvm.fmuladd.f32(float %75, float %76, float 0.000000e+00)
store float %77, float* %72
%78 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 1
%79 = load float, float* %78
%80 = load float, float* %61
%81 = tail call float @llvm.fmuladd.f32(float %79, float %80, float %77)
store float %81, float* %72
%82 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 2
%83 = load float, float* %82
%84 = load float, float* %62
%85 = tail call float @llvm.fmuladd.f32(float %83, float %84, float %81)
store float %85, float* %72
%86 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 3
%87 = load float, float* %86
%88 = load float, float* %63
%89 = tail call float @llvm.fmuladd.f32(float %87, float %88, float %85)
store float %89, float* %72
%90 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 4
%91 = load float, float* %90
%92 = load float, float* %64
%93 = tail call float @llvm.fmuladd.f32(float %91, float %92, float %89)
store float %93, float* %72
%94 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 5
%95 = load float, float* %94
%96 = load float, float* %65
%97 = tail call float @llvm.fmuladd.f32(float %95, float %96, float %93)
store float %97, float* %72
%98 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 6
%99 = load float, float* %98
%100 = load float, float* %66
%101 = tail call float @llvm.fmuladd.f32(float %99, float %100, float %97)
store float %101, float* %72
%102 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 7
%103 = load float, float* %102
%104 = load float, float* %67
%105 = tail call float @llvm.fmuladd.f32(float %103, float %104, float %101)
store float %105, float* %72
%106 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 8
%107 = load float, float* %106
%108 = load float, float* %68
%109 = tail call float @llvm.fmuladd.f32(float %107, float %108, float %105)
store float %109, float* %72
%110 = getelementptr inbounds [10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 %73, i64 9
%111 = load float, float* %110
%112 = load float, float* %69
%113 = tail call float @llvm.fmuladd.f32(float %111, float %112, float %109)
store float %113, float* %72
%114 = add nuw nsw i64 %71, 1
%115 = icmp eq i64 %114, 11
br i1 %115, label %116, label %70
116: ; preds = %70
%117 = getelementptr inbounds float, float* %1, i64 %49
%118 = load float, float* %117
%119 = fpext float %118 to double
%120 = trunc i64 %49 to i32
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %120, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %119)
%122 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %123
123: ; preds = %116, %144
%124 = phi i64 [ 1, %116 ], [ %145, %144 ]
%125 = getelementptr inbounds float*, float** %4, i64 %124
%126 = load float*, float** %125
%127 = getelementptr inbounds float, float* %126, i64 %49
%128 = load float, float* %127
%129 = tail call double @fabs(float %128)
%130 = fcmp olt double %129, 0x3EB0C6F7A0B5ED8D
%131 = load float*, float** %125
%132 = getelementptr inbounds float, float* %131, i64 %49
%133 = load float, float* %132
%134 = fpext float %133 to double
%135 = getelementptr inbounds float, float* %3, i64 %124
%136 = load float, float* %135
%137 = fpext float %136 to double
br i1 %130, label %138, label %140
138: ; preds = %123
%139 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), double %134, double %137, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %144
140: ; preds = %123
%141 = fdiv float %136, %133
%142 = fpext float %141 to double
%143 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), double %134, double %137, double %142)
br label %144
144: ; preds = %138, %140
%145 = add nuw nsw i64 %124, 1
%146 = icmp eq i64 %145, 11
br i1 %146, label %147, label %123
147: ; preds = %144
%148 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
%149 = tail call i32 (...) @getchar()
%150 = add nuw nsw i64 %49, 1
%151 = icmp eq i64 %150, 11
br i1 %151, label %152, label %48
152: ; preds = %147
%153 = tail call i32 @free_matrix(float** %4, i32 1, i32 10, i32 1, i32 10)
%154 = tail call i32 @free_vector(float* %3, i32 1, i32 10)
%155 = tail call i32 @free_vector(float* %2, i32 1, i32 10)
%156 = tail call i32 @free_vector(float* %1, i32 1, i32 10)
ret i32 0
}