#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*/ DiagDomMat();
double Jacobi(double *, double *, int);
double MatVecMult(double *, int);
int Norm(double *);
double fabs(int);
int /*<<< orphan*/ printf(char *, ...);
double main() {
  int i;
  double x0[20], x[20], b[20];
  double tol = 0.00005;
  int iter = 0;
  double error = 10.0 * tol;
  int maxIter = 100;
  DiagDomMat();
  for (i = 0; i < 20; i++) {
    x0[i] = 1.0;
  }
  for (i = 0; i < 20; i++) {
    b[i] = MatVecMult(x0, i);
  }
  while (iter <= maxIter && error > tol) {
    for (i = 0; i < 20; i++) {
      x[i] = Jacobi(x0, b, i);
    }
    error = fabs((Norm(x) - Norm(x0)) / Norm(x));
    for (i = 0; i < 20; i++) {
      x0[i] = x[i];
    }
    iter = iter + 1;
  }
  printf("The solution of Ax = b is x = \n");
  for (i = 0; i < 20; i++) {
    printf("%f \n", x[i]);
  }
  printf("Number of iterations: %d \n", iter);
  printf("Error: %3f \t \n", error);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
movl   $0x0,-0x1fc(%rbp)
movsd  0xe73(%rip),%xmm0
mulsd  -0x1f8(%rbp),%xmm0
ff
movsd  %xmm0,-0x208(%rbp)
ff
movl   $0x64,-0x20c(%rbp)
mov    $0x0,%al
call   1040 <DiagDomMat@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    11e2 <main+0x82>
movslq -0xc(%rbp),%rax
movsd  0xe45(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b5 <main+0x55>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    121d <main+0xbd>
lea    -0xb0(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <MatVecMult@plt>
movslq -0xc(%rbp),%rax
movsd  %xmm0,-0x1f0(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e9 <main+0x89>
jmp    1222 <main+0xc2>
mov    -0x1fc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x20c(%rbp),%ecx
mov    %al,-0x20d(%rbp)
jg     1255 <main+0xf5>
movsd  -0x208(%rbp),%xmm0
ff
ucomisd -0x1f8(%rbp),%xmm0
ff
seta   %al
mov    %al,-0x20d(%rbp)
mov    -0x20d(%rbp),%al
test   $0x1,%al
jne    1268 <main+0x108>
jmp    134b <main+0x1eb>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    12aa <main+0x14a>
lea    -0xb0(%rbp),%rdi
lea    -0x1f0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1080 <Jacobi@plt>
movslq -0xc(%rbp),%rax
movsd  %xmm0,-0x150(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    126f <main+0x10f>
lea    -0x150(%rbp),%rdi
call   1050 <Norm@plt>
mov    %eax,-0x218(%rbp)
lea    -0xb0(%rbp),%rdi
call   1050 <Norm@plt>
mov    %eax,%ecx
mov    -0x218(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x214(%rbp)
lea    -0x150(%rbp),%rdi
call   1050 <Norm@plt>
mov    %eax,%ecx
mov    -0x214(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1070 <fabs@plt>
movsd  %xmm0,-0x208(%rbp)
ff
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1337 <main+0x1d7>
movslq -0xc(%rbp),%rax
movsd  -0x150(%rbp,%rax,8),%xmm0
ff ff
movslq -0xc(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1305 <main+0x1a5>
mov    -0x1fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1fc(%rbp)
jmp    1222 <main+0xc2>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1393 <main+0x233>
movslq -0xc(%rbp),%rax
movsd  -0x150(%rbp,%rax,8),%xmm0
ff ff
lea    0xcba(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1360 <main+0x200>
mov    -0x1fc(%rbp),%esi
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsd  -0x208(%rbp),%xmm0
ff
lea    0xca2(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f8,%rsp
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <DiagDomMat@plt>
movapd 0xe5d(%rip),%xmm0
movapd %xmm0,0x150(%rsp)
movapd %xmm0,0x160(%rsp)
movapd %xmm0,0x170(%rsp)
movapd %xmm0,0x180(%rsp)
movapd %xmm0,0x190(%rsp)
movapd %xmm0,0x1a0(%rsp)
movapd %xmm0,0x1b0(%rsp)
movapd %xmm0,0x1c0(%rsp)
movapd %xmm0,0x1d0(%rsp)
movapd %xmm0,0x1e0(%rsp)
lea    0x150(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xb0(%rsp)
mov    %r12,%rdi
mov    $0x1,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xb8(%rsp)
mov    %r12,%rdi
mov    $0x2,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xc0(%rsp)
mov    %r12,%rdi
mov    $0x3,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xc8(%rsp)
mov    %r12,%rdi
mov    $0x4,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xd0(%rsp)
mov    %r12,%rdi
mov    $0x5,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xd8(%rsp)
mov    %r12,%rdi
mov    $0x6,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xe0(%rsp)
mov    %r12,%rdi
mov    $0x7,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xe8(%rsp)
mov    %r12,%rdi
mov    $0x8,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xf0(%rsp)
mov    %r12,%rdi
mov    $0x9,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0xf8(%rsp)
mov    %r12,%rdi
mov    $0xa,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x100(%rsp)
mov    %r12,%rdi
mov    $0xb,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x108(%rsp)
mov    %r12,%rdi
mov    $0xc,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x110(%rsp)
mov    %r12,%rdi
mov    $0xd,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x118(%rsp)
mov    %r12,%rdi
mov    $0xe,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x120(%rsp)
mov    %r12,%rdi
mov    $0xf,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x128(%rsp)
mov    %r12,%rdi
mov    $0x10,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x130(%rsp)
mov    %r12,%rdi
mov    $0x11,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x138(%rsp)
mov    %r12,%rdi
mov    $0x12,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x140(%rsp)
mov    %r12,%rdi
mov    $0x13,%esi
call   1030 <MatVecMult@plt>
movsd  %xmm0,0x148(%rsp)
lea    0xb0(%rsp),%rbp
lea    0x10(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14d,%r13d
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %edx,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x20(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x28(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x4,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x30(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x5,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x40(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x7,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x48(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x8,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x50(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x9,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x58(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xa,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x60(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xb,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x68(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xc,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x70(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xd,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x78(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xe,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x80(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0xf,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x88(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x10,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x90(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x11,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0x98(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x12,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0xa0(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x13,%edx
call   10a0 <Jacobi@plt>
movsd  %xmm0,0xa8(%rsp)
mov    %r15,%rdi
call   1060 <Norm@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1060 <Norm@plt>
sub    %eax,%ebx
mov    %r15,%rdi
call   1060 <Norm@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1080 <fabs@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0xa0,%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1090 <memcpy@plt>
lea    0x1(%r13),%r14d
cmp    $0x63,%r13d
ja     15f8 <main+0x478>
movsd  0x8(%rsp),%xmm0
ucomisd 0xa1e(%rip),%xmm0
ja     13d0 <main+0x250>
lea    0xa48(%rip),%rdi
call   1040 <puts@plt>
movsd  0x10(%rsp),%xmm0
lea    0xa07(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x40(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x48(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x50(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x58(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x60(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x68(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x70(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x78(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x80(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x88(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x90(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x98(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xa0(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0xa8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0x8b9(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x8c3(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"The solution of Ax = b is x = \0A\00"
@.str.1 = [5 x i8] c"%f \0A\00"
@.str.2 = [27 x i8] c"Number of iterations: %d \0A\00"
@.str.3 = [15 x i8] c"Error: %3f \09 \0A\00"
define double @main() {
%1 = alloca double
%2 = alloca i32
%3 = alloca [20 x double]
%4 = alloca [20 x double]
%5 = alloca [20 x double]
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
store double 5.000000e-05, double* %6
store i32 0, i32* %7
%10 = load double, double* %6
%11 = fmul double 1.000000e+01, %10
store double %11, double* %8
store i32 100, i32* %9
%12 = call i32 (...) @DiagDomMat()
store i32 0, i32* %2
br label %13
13: ; preds = %20, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 20
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 %18
store double 1.000000e+00, double* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %13
23: ; preds = %13
store i32 0, i32* %2
br label %24
24: ; preds = %34, %23
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 20
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 0
%29 = load i32, i32* %2
%30 = call double @MatVecMult(double* %28, i32 %29)
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 %32
store double %30, double* %33
br label %34
34: ; preds = %27
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %24
37: ; preds = %24
br label %38
38: ; preds = %87, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %9
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = load double, double* %8
%44 = load double, double* %6
%45 = fcmp ogt double %43, %44
br label %46
46: ; preds = %42, %38
%47 = phi i1 [ false, %38 ], [ %45, %42 ]
br i1 %47, label %48, label %90
48: ; preds = %46
store i32 0, i32* %2
br label %49
49: ; preds = %60, %48
%50 = load i32, i32* %2
%51 = icmp slt i32 %50, 20
br i1 %51, label %52, label %63
52: ; preds = %49
%53 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 0
%54 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 0
%55 = load i32, i32* %2
%56 = call double @Jacobi(double* %53, double* %54, i32 %55)
%57 = load i32, i32* %2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 %58
store double %56, double* %59
br label %60
60: ; preds = %52
%61 = load i32, i32* %2
%62 = add nsw i32 %61, 1
store i32 %62, i32* %2
br label %49
63: ; preds = %49
%64 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 0
%65 = call i32 @Norm(double* %64)
%66 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 0
%67 = call i32 @Norm(double* %66)
%68 = sub nsw i32 %65, %67
%69 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 0
%70 = call i32 @Norm(double* %69)
%71 = sdiv i32 %68, %70
%72 = call double @fabs(i32 %71)
store double %72, double* %8
store i32 0, i32* %2
br label %73
73: ; preds = %84, %63
%74 = load i32, i32* %2
%75 = icmp slt i32 %74, 20
br i1 %75, label %76, label %87
76: ; preds = %73
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 %78
%80 = load double, double* %79
%81 = load i32, i32* %2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 %82
store double %80, double* %83
br label %84
84: ; preds = %76
%85 = load i32, i32* %2
%86 = add nsw i32 %85, 1
store i32 %86, i32* %2
br label %73
87: ; preds = %73
%88 = load i32, i32* %7
%89 = add nsw i32 %88, 1
store i32 %89, i32* %7
br label %38
90: ; preds = %46
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %92
92: ; preds = %101, %90
%93 = load i32, i32* %2
%94 = icmp slt i32 %93, 20
br i1 %94, label %95, label %104
95: ; preds = %92
%96 = load i32, i32* %2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [20 x double], [20 x double]* %4, i64 0, i64 %97
%99 = load double, double* %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %99)
br label %101
101: ; preds = %95
%102 = load i32, i32* %2
%103 = add nsw i32 %102, 1
store i32 %103, i32* %2
br label %92
104: ; preds = %92
%105 = load i32, i32* %7
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %105)
%107 = load double, double* %8
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %107)
%109 = load double, double* %1
ret double %109
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%f \0A\00"
@.str.2 = [27 x i8] c"Number of iterations: %d \0A\00"
@.str.3 = [15 x i8] c"Error: %3f \09 \0A\00"
@str = [31 x i8] c"The solution of Ax = b is x = \00"
define double @main() {
%1 = alloca [20 x double]
%2 = bitcast [20 x double]* %1 to i8*
%3 = alloca [20 x double]
%4 = bitcast [20 x double]* %3 to i8*
%5 = alloca [20 x double]
%6 = bitcast [20 x double]* %5 to i8*
%7 = tail call i32 (...) @DiagDomMat()
%8 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 0
%9 = bitcast [20 x double]* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %9
%10 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 2
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %11
%12 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 4
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %13
%14 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 6
%15 = bitcast double* %14 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %15
%16 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 8
%17 = bitcast double* %16 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %17
%18 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 10
%19 = bitcast double* %18 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %19
%20 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 12
%21 = bitcast double* %20 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %21
%22 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 14
%23 = bitcast double* %22 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %23
%24 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 16
%25 = bitcast double* %24 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %25
%26 = getelementptr inbounds [20 x double], [20 x double]* %1, i64 0, i64 18
%27 = bitcast double* %26 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %27
%28 = call double @MatVecMult(double* %8, i32 0)
%29 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 0
store double %28, double* %29
%30 = call double @MatVecMult(double* %8, i32 1)
%31 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 1
store double %30, double* %31
%32 = call double @MatVecMult(double* %8, i32 2)
%33 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 2
store double %32, double* %33
%34 = call double @MatVecMult(double* %8, i32 3)
%35 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 3
store double %34, double* %35
%36 = call double @MatVecMult(double* %8, i32 4)
%37 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 4
store double %36, double* %37
%38 = call double @MatVecMult(double* %8, i32 5)
%39 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 5
store double %38, double* %39
%40 = call double @MatVecMult(double* %8, i32 6)
%41 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 6
store double %40, double* %41
%42 = call double @MatVecMult(double* %8, i32 7)
%43 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 7
store double %42, double* %43
%44 = call double @MatVecMult(double* %8, i32 8)
%45 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 8
store double %44, double* %45
%46 = call double @MatVecMult(double* %8, i32 9)
%47 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 9
store double %46, double* %47
%48 = call double @MatVecMult(double* %8, i32 10)
%49 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 10
store double %48, double* %49
%50 = call double @MatVecMult(double* %8, i32 11)
%51 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 11
store double %50, double* %51
%52 = call double @MatVecMult(double* %8, i32 12)
%53 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 12
store double %52, double* %53
%54 = call double @MatVecMult(double* %8, i32 13)
%55 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 13
store double %54, double* %55
%56 = call double @MatVecMult(double* %8, i32 14)
%57 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 14
store double %56, double* %57
%58 = call double @MatVecMult(double* %8, i32 15)
%59 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 15
store double %58, double* %59
%60 = call double @MatVecMult(double* %8, i32 16)
%61 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 16
store double %60, double* %61
%62 = call double @MatVecMult(double* %8, i32 17)
%63 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 17
store double %62, double* %63
%64 = call double @MatVecMult(double* %8, i32 18)
%65 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 18
store double %64, double* %65
%66 = call double @MatVecMult(double* %8, i32 19)
%67 = getelementptr inbounds [20 x double], [20 x double]* %5, i64 0, i64 19
store double %66, double* %67
%68 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 0
%69 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 1
%70 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 2
%71 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 3
%72 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 4
%73 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 5
%74 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 6
%75 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 7
%76 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 8
%77 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 9
%78 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 10
%79 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 11
%80 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 12
%81 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 13
%82 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 14
%83 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 15
%84 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 16
%85 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 17
%86 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 18
%87 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 19
br label %88
88: ; preds = %0, %88
%89 = phi i32 [ 0, %0 ], [ %116, %88 ]
%90 = call double @Jacobi(double* %8, double* %29, i32 0)
store double %90, double* %68
%91 = call double @Jacobi(double* %8, double* %29, i32 1)
store double %91, double* %69
%92 = call double @Jacobi(double* %8, double* %29, i32 2)
store double %92, double* %70
%93 = call double @Jacobi(double* %8, double* %29, i32 3)
store double %93, double* %71
%94 = call double @Jacobi(double* %8, double* %29, i32 4)
store double %94, double* %72
%95 = call double @Jacobi(double* %8, double* %29, i32 5)
store double %95, double* %73
%96 = call double @Jacobi(double* %8, double* %29, i32 6)
store double %96, double* %74
%97 = call double @Jacobi(double* %8, double* %29, i32 7)
store double %97, double* %75
%98 = call double @Jacobi(double* %8, double* %29, i32 8)
store double %98, double* %76
%99 = call double @Jacobi(double* %8, double* %29, i32 9)
store double %99, double* %77
%100 = call double @Jacobi(double* %8, double* %29, i32 10)
store double %100, double* %78
%101 = call double @Jacobi(double* %8, double* %29, i32 11)
store double %101, double* %79
%102 = call double @Jacobi(double* %8, double* %29, i32 12)
store double %102, double* %80
%103 = call double @Jacobi(double* %8, double* %29, i32 13)
store double %103, double* %81
%104 = call double @Jacobi(double* %8, double* %29, i32 14)
store double %104, double* %82
%105 = call double @Jacobi(double* %8, double* %29, i32 15)
store double %105, double* %83
%106 = call double @Jacobi(double* %8, double* %29, i32 16)
store double %106, double* %84
%107 = call double @Jacobi(double* %8, double* %29, i32 17)
store double %107, double* %85
%108 = call double @Jacobi(double* %8, double* %29, i32 18)
store double %108, double* %86
%109 = call double @Jacobi(double* %8, double* %29, i32 19)
store double %109, double* %87
%110 = call i32 @Norm(double* %68)
%111 = call i32 @Norm(double* %8)
%112 = sub nsw i32 %110, %111
%113 = call i32 @Norm(double* %68)
%114 = sdiv i32 %112, %113
%115 = call double @fabs(i32 %114)
%116 = add nuw nsw i32 %89, 1
%117 = icmp ult i32 %89, 100
%118 = fcmp ogt double %115, 5.000000e-05
%119 = select i1 %117, i1 %118, i1 false
br i1 %119, label %88, label %120
120: ; preds = %88
%121 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 1
%122 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 2
%123 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 3
%124 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 4
%125 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 5
%126 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 6
%127 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 7
%128 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 8
%129 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 9
%130 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 10
%131 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 11
%132 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 12
%133 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 13
%134 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 14
%135 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 15
%136 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 16
%137 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 17
%138 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 18
%139 = getelementptr inbounds [20 x double], [20 x double]* %3, i64 0, i64 19
%140 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%141 = load double, double* %68
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %141)
%143 = load double, double* %121
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %143)
%145 = load double, double* %122
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %145)
%147 = load double, double* %123
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %147)
%149 = load double, double* %124
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %149)
%151 = load double, double* %125
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %151)
%153 = load double, double* %126
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %153)
%155 = load double, double* %127
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %155)
%157 = load double, double* %128
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %157)
%159 = load double, double* %129
%160 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %159)
%161 = load double, double* %130
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %161)
%163 = load double, double* %131
%164 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %163)
%165 = load double, double* %132
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %165)
%167 = load double, double* %133
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %167)
%169 = load double, double* %134
%170 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %169)
%171 = load double, double* %135
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %171)
%173 = load double, double* %136
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %173)
%175 = load double, double* %137
%176 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %175)
%177 = load double, double* %138
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %177)
%179 = load double, double* %139
%180 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %179)
%181 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %116)
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %115)
ret double undef
}