#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 */
float **convert_matrix(float *, int, int, int, int);
int /*<<< orphan*/ eigsrt(float *, float **, int);
int /*<<< orphan*/ free_convert_matrix(float **, int, int, int, int);
int /*<<< orphan*/ free_matrix(float **, int, int, int, int);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ jacobi(float **, int, float *, float **, int *);
float **matrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
float *vector(int, int);
int main(void) {
  int i, j, nrot;
  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};
  float *d, **v, **e;
  d = vector(1, 10);
  v = matrix(1, 10, 1, 10);
  e = convert_matrix(&c[0][0], 1, 10, 1, 10);
  printf("****** Finding Eigenvectors ******\n");
  jacobi(e, 10, d, v, &nrot);
  printf("unsorted eigenvectors:\n");
  for (i = 1; i <= 10; i++) {
    printf("eigenvalue %3d = %12.6f\n", i, d[i]);
    printf("eigenvector:\n");
    for (j = 1; j <= 10; j++) {
      printf("%12.6f", v[j][i]);
      if ((j % 5) == 0)
        printf("\n");
    }
    printf("\n");
  }
  printf("\n****** Sorting Eigenvectors ******\n\n");
  eigsrt(d, v, 10);
  printf("sorted eigenvectors:\n");
  for (i = 1; i <= 10; i++) {
    printf("eigenvalue %3d = %12.6f\n", i, d[i]);
    printf("eigenvector:\n");
    for (j = 1; j <= 10; j++) {
      printf("%12.6f", v[j][i]);
      if ((j % 5) == 0)
        printf("\n");
    }
    printf("\n");
  }
  free_convert_matrix(e, 1, 10, 1, 10);
  free_matrix(v, 1, 10, 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   1090 <vector@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edx
mov    $0xa,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1080 <matrix@plt>
mov    %rax,-0x20(%rbp)
lea    0x2ea0(%rip),%rdi
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   10b0 <convert_matrix@plt>
mov    %rax,-0x28(%rbp)
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xa,%esi
lea    -0x10(%rbp),%r8
call   1030 <jacobi@plt>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     12e9 <main+0x159>
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf1(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     12cd <main+0x13d>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd2(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12ba <main+0x12a>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12bf <main+0x12f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1267 <main+0xd7>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1226 <main+0x96>
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   10a0 <eigsrt@plt>
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     13e1 <main+0x251>
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcf9(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     13c5 <main+0x235>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcda(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13b2 <main+0x222>
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13b7 <main+0x227>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    135f <main+0x1cf>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    131e <main+0x18e>
mov    -0x28(%rbp),%rdi
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1040 <free_convert_matrix@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%ecx
mov    $0xa,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1050 <free_matrix@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1070 <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
mov    $0x1,%edx
mov    $0xa,%ecx
call   10a0 <matrix@plt>
mov    %rax,%r12
lea    0x2e8d(%rip),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
call   10d0 <convert_matrix@plt>
mov    %rax,%rbp
lea    0xe09(%rip),%rdi
call   1060 <puts@plt>
lea    0x14(%rsp),%r8
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
mov    $0xa,%esi
mov    %rbx,(%rsp)
mov    %rbx,%rdx
mov    %r12,%rcx
call   1040 <jacobi@plt>
lea    0xdff(%rip),%rdi
call   1060 <puts@plt>
mov    $0x1,%ebx
lea    0xdc4(%rip),%r15
jmp    1278 <main+0xc8>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xb,%rbx
je     12f7 <main+0x147>
mov    (%rsp),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd74(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xde3(%rip),%rdi
call   1060 <puts@plt>
mov    $0xff,%r13b
mov    $0x1,%ebp
jmp    12be <main+0x10e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
add    $0xff,%r13b
cmp    $0xb,%rbp
je     1260 <main+0xb0>
movzbl %bpl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%r14d
mov    (%r12,%rbp,8),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1080 <printf@plt>
add    %r13b,%r14b
jne    12b0 <main+0x100>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    12b0 <main+0x100>
lea    0xd5c(%rip),%rdi
call   1060 <puts@plt>
mov    (%rsp),%rdi
mov    %r12,%rsi
mov    $0xa,%edx
call   10c0 <eigsrt@plt>
lea    0xd2a(%rip),%rdi
call   1060 <puts@plt>
mov    $0x1,%ebx
lea    0xced(%rip),%r14
jmp    1348 <main+0x198>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0xb,%rbx
je     13c6 <main+0x216>
mov    (%rsp),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xca4(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd13(%rip),%rdi
call   1060 <puts@plt>
mov    $0xff,%r13b
mov    $0x1,%r15d
jmp    138e <main+0x1de>
nopl   0x0(%rax)
add    $0x1,%r15
add    $0xff,%r13b
cmp    $0xb,%r15
je     1330 <main+0x180>
movzbl %r15b,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%ebp
mov    (%r12,%r15,8),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1080 <printf@plt>
add    %r13b,%bpl
jne    1380 <main+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1380 <main+0x1d0>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
call   1050 <free_convert_matrix@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
call   1070 <free_matrix@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1090 <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 = [36 x i8] c"****** Finding Eigenvectors ******\0A\00"
@.str.1 = [24 x i8] c"unsorted eigenvectors:\0A\00"
@.str.2 = [25 x i8] c"eigenvalue %3d = %12.6f\0A\00"
@.str.3 = [14 x i8] c"eigenvector:\0A\00"
@.str.4 = [7 x i8] c"%12.6f\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [38 x i8] c"\0A****** Sorting Eigenvectors ******\0A\0A\00"
@.str.7 = [22 x i8] c"sorted eigenvectors:\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**
store i32 0, i32* %1
%8 = call float* @vector(i32 1, i32 10)
store float* %8, float** %5
%9 = call float** @matrix(i32 1, i32 10, i32 1, i32 10)
store float** %9, float*** %6
%10 = call float** @convert_matrix(float* getelementptr inbounds ([10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 0, i64 0), i32 1, i32 10, i32 1, i32 10)
store float** %10, float*** %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = load float**, float*** %7
%13 = load float*, float** %5
%14 = load float**, float*** %6
%15 = call i32 @jacobi(float** %12, i32 10, float* %13, float** %14, i32* %4)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %17
17: ; preds = %56, %0
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 10
br i1 %19, label %20, label %59
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load float*, float** %5
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %21, double %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %30
30: ; preds = %51, %20
%31 = load i32, i32* %3
%32 = icmp sle i32 %31, 10
br i1 %32, label %33, label %54
33: ; preds = %30
%34 = load float**, float*** %6
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float*, float** %34, i64 %36
%38 = load float*, float** %37
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds float, float* %38, i64 %40
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %43)
%45 = load i32, i32* %3
%46 = srem i32 %45, 5
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %33
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %50
50: ; preds = %48, %33
br label %51
51: ; preds = %50
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %30
54: ; preds = %30
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %56
56: ; preds = %54
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %17
59: ; preds = %17
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%61 = load float*, float** %5
%62 = load float**, float*** %6
%63 = call i32 @eigsrt(float* %61, float** %62, i32 10)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %65
65: ; preds = %104, %59
%66 = load i32, i32* %2
%67 = icmp sle i32 %66, 10
br i1 %67, label %68, label %107
68: ; preds = %65
%69 = load i32, i32* %2
%70 = load float*, float** %5
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds float, float* %70, i64 %72
%74 = load float, float* %73
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %69, double %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %78
78: ; preds = %99, %68
%79 = load i32, i32* %3
%80 = icmp sle i32 %79, 10
br i1 %80, label %81, label %102
81: ; preds = %78
%82 = load float**, float*** %6
%83 = load i32, i32* %3
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds float*, float** %82, i64 %84
%86 = load float*, float** %85
%87 = load i32, i32* %2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds float, float* %86, i64 %88
%90 = load float, float* %89
%91 = fpext float %90 to double
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %91)
%93 = load i32, i32* %3
%94 = srem i32 %93, 5
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %81
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %98
98: ; preds = %96, %81
br label %99
99: ; preds = %98
%100 = load i32, i32* %3
%101 = add nsw i32 %100, 1
store i32 %101, i32* %3
br label %78
102: ; preds = %78
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %104
104: ; preds = %102
%105 = load i32, i32* %2
%106 = add nsw i32 %105, 1
store i32 %106, i32* %2
br label %65
107: ; preds = %65
%108 = load float**, float*** %7
%109 = call i32 @free_convert_matrix(float** %108, i32 1, i32 10, i32 1, i32 10)
%110 = load float**, float*** %6
%111 = call i32 @free_matrix(float** %110, i32 1, i32 10, i32 1, i32 10)
%112 = load float*, float** %5
%113 = call i32 @free_vector(float* %112, i32 1, i32 10)
ret i32 0
}

LLVM IR (-O2):
@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.2 = [25 x i8] c"eigenvalue %3d = %12.6f\0A\00"
@.str.4 = [7 x i8] c"%12.6f\00"
@str = [35 x i8] c"****** Finding Eigenvectors ******\00"
@str.8 = [23 x i8] c"unsorted eigenvectors:\00"
@str.9 = [37 x i8] c"\0A****** Sorting Eigenvectors ******\0A\00"
@str.10 = [21 x i8] c"sorted eigenvectors:\00"
@str.12 = [13 x i8] c"eigenvector:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call float* @vector(i32 1, i32 10)
%4 = tail call float** @matrix(i32 1, i32 10, i32 1, i32 10)
%5 = tail call float** @convert_matrix(float* getelementptr inbounds ([10 x [10 x float]], [10 x [10 x float]]* @main.c, i64 0, i64 0, i64 0), i32 1, i32 10, i32 1, i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%7 = call i32 @jacobi(float** %5, i32 10, float* %3, float** %4, i32* %1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
br label %9
9: ; preds = %0, %33
%10 = phi i64 [ 1, %0 ], [ %35, %33 ]
%11 = getelementptr inbounds float, float* %3, i64 %10
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = trunc i64 %10 to i32
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %14, double %13)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
br label %17
17: ; preds = %9, %30
%18 = phi i64 [ 1, %9 ], [ %31, %30 ]
%19 = getelementptr inbounds float*, float** %4, i64 %18
%20 = load float*, float** %19
%21 = getelementptr inbounds float, float* %20, i64 %10
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %23)
%25 = trunc i64 %18 to i8
%26 = urem i8 %25, 5
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %17
%29 = call i32 @putchar(i32 10)
br label %30
30: ; preds = %17, %28
%31 = add nuw nsw i64 %18, 1
%32 = icmp eq i64 %31, 11
br i1 %32, label %33, label %17
33: ; preds = %30
%34 = call i32 @putchar(i32 10)
%35 = add nuw nsw i64 %10, 1
%36 = icmp eq i64 %35, 11
br i1 %36, label %37, label %9
37: ; preds = %33
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.9, i64 0, i64 0))
%39 = call i32 @eigsrt(float* %3, float** %4, i32 10)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
br label %41
41: ; preds = %37, %65
%42 = phi i64 [ 1, %37 ], [ %67, %65 ]
%43 = getelementptr inbounds float, float* %3, i64 %42
%44 = load float, float* %43
%45 = fpext float %44 to double
%46 = trunc i64 %42 to i32
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %46, double %45)
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
br label %49
49: ; preds = %41, %62
%50 = phi i64 [ 1, %41 ], [ %63, %62 ]
%51 = getelementptr inbounds float*, float** %4, i64 %50
%52 = load float*, float** %51
%53 = getelementptr inbounds float, float* %52, i64 %42
%54 = load float, float* %53
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %55)
%57 = trunc i64 %50 to i8
%58 = urem i8 %57, 5
%59 = icmp eq i8 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %49
%61 = call i32 @putchar(i32 10)
br label %62
62: ; preds = %49, %60
%63 = add nuw nsw i64 %50, 1
%64 = icmp eq i64 %63, 11
br i1 %64, label %65, label %49
65: ; preds = %62
%66 = call i32 @putchar(i32 10)
%67 = add nuw nsw i64 %42, 1
%68 = icmp eq i64 %67, 11
br i1 %68, label %69, label %41
69: ; preds = %65
%70 = call i32 @free_convert_matrix(float** %5, i32 1, i32 10, i32 1, i32 10)
%71 = call i32 @free_matrix(float** %4, i32 1, i32 10, i32 1, i32 10)
%72 = call i32 @free_vector(float* %3, i32 1, i32 10)
ret i32 0
}