#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(double *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double pow(double, double);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ thomas_alg_block(double *, double *, double *, double *, int,
                                    int);
void test_3(int n, int m) {
  int size = m * m;
  FILE *f = fopen("input.dat", "r");
  double *md = (double *)malloc(sizeof(double) * n * size);
  double *ud = (double *)malloc(sizeof(double) * (n - 1) * size);
  double *ld = (double *)malloc(sizeof(double) * (n - 1) * size);
  double *fd = (double *)malloc(sizeof(double) * n * m);
  double *ans = (double *)malloc(sizeof(double) * n * m);
  fread(md, sizeof(double), n * size, f);
  fread(ud, sizeof(double), (n - 1) * size, f);
  fread(ld, sizeof(double), (n - 1) * size, f);
  fread(fd, sizeof(double), n * m, f);
  fread(ans, sizeof(double), n * m, f);
  int i;
  for (i = 0; i < n * m; i++)
    printf("%lg\n", fd[i]);
  thomas_alg_block(ld, md, ud, fd, n, m);
  for (i = 0; i < n * m; i++)
    printf("%lg\t%lg\n", fd[i], ans[i]);
  double err = 0;
  for (i = 0; i < n * m; i++)
    err += (fd[i] - ans[i]) * (fd[i] - ans[i]);
  err = pow(err / (n * m), .5);
  printf("Error is %.5e\n", err);
  free(md);
  free(ud);
  free(ld);
  free(fd);
  free(ans);
  return;
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe79(%rip),%rdi
lea    0xe7c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x3,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
imul   -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
imul   -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
mov    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
imul   -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
mov    -0x38(%rbp),%rdi
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
mov    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    12f3 <test_3+0x183>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd3a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12b8 <test_3+0x148>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
call   1070 <thomas_alg_block@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    135f <test_3+0x1ef>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xcca(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1317 <test_3+0x1a7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    13d4 <test_3+0x264>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    136e <test_3+0x1fe>
movsd  -0x50(%rbp),%xmm0
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xc10(%rip),%xmm1
call   1090 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xc17(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebx
mov    %rbx,0x20(%rsp)
mov    %esi,%r15d
mov    %esi,%r12d
imul   %esi,%r15d
lea    0xe72(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,0x30(%rsp)
lea    0x0(,%rbx,8),%ebp
mov    %r15d,%edi
imul   %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x18(%rsp)
lea    -0x1(%rbx),%r14d
imul   %r15d,%r14d
lea    0x0(,%r14,8),%ebx
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %r12d,%ebx
imul   %r12d,%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r13
imul   0x20(%rsp),%r15d
mov    0x18(%rsp),%rdi
mov    $0x8,%esi
mov    %r15d,%edx
mov    %ebx,%r15d
mov    0x30(%rsp),%rbx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    0x10(%rsp),%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    0x28(%rsp),%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r15d,0xc(%rsp)
mov    %r15d,%r14d
imul   0x20(%rsp),%r14d
mov    %r12,%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
test   %r14d,%r14d
jle    1351 <test_3+0x1e1>
mov    %r14d,%ebx
xor    %ebp,%ebp
lea    0xd81(%rip),%r15
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rbp,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    12a0 <test_3+0x130>
mov    0x28(%rsp),%rdi
mov    0x18(%rsp),%rbp
mov    %rbp,%rsi
mov    0x10(%rsp),%r15
mov    %r15,%rdx
mov    %r12,%rcx
mov    0x20(%rsp),%r8
mov    0xc(%rsp),%r9d
call   1070 <thomas_alg_block@plt>
xorpd  %xmm0,%xmm0
test   %r14d,%r14d
jle    142b <test_3+0x2bb>
xor    %ebp,%ebp
lea    0xd1e(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
movsd  (%r12,%rbp,8),%xmm0
movsd  0x0(%r13,%rbp,8),%xmm1
mov    %r15,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1300 <test_3+0x190>
test   %r14d,%r14d
mov    0x18(%rsp),%rbp
mov    0x10(%rsp),%r15
xorpd  %xmm0,%xmm0
jle    142b <test_3+0x2bb>
lea    -0x1(%rbx),%rcx
mov    %ebx,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    1381 <test_3+0x211>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    13f0 <test_3+0x280>
mov    0x28(%rsp),%rdi
mov    0x18(%rsp),%rbp
mov    %rbp,%rsi
mov    0x10(%rsp),%r15
mov    %r15,%rdx
mov    %r12,%rcx
mov    0x20(%rsp),%r8
mov    0xc(%rsp),%r9d
call   1070 <thomas_alg_block@plt>
xorpd  %xmm0,%xmm0
jmp    142b <test_3+0x2bb>
and    $0xfffffffc,%ebx
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rcx,8),%xmm2
movsd  0x8(%r12,%rcx,8),%xmm1
subsd  0x0(%r13,%rcx,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
subsd  0x8(%r13,%rcx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%r12,%rcx,8),%xmm2
subsd  0x10(%r13,%rcx,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x18(%r12,%rcx,8),%xmm0
subsd  0x18(%r13,%rcx,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
add    $0x4,%rcx
cmp    %rcx,%rbx
jne    1390 <test_3+0x220>
test   %rax,%rax
je     142b <test_3+0x2bb>
lea    0x0(,%rcx,8),%rdx
add    %r13,%rdx
lea    (%r12,%rcx,8),%rcx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm1
subsd  (%rdx,%rsi,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1410 <test_3+0x2a0>
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
divsd  %xmm1,%xmm0
movsd  0xbc1(%rip),%xmm1
call   1090 <pow@plt>
lea    0xbd2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"input.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c"%lg\0A\00"
@.str.3 = [9 x i8] c"%lg\09%lg\0A\00"
@.str.4 = [15 x i8] c"Error is %.5e\0A\00"
define void @test_3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %5
%17 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %6
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = mul i64 8, %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = mul i64 %20, %22
%24 = trunc i64 %23 to i32
%25 = call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to double*
store double* %26, double** %7
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = mul i64 8, %29
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = mul i64 %30, %32
%34 = trunc i64 %33 to i32
%35 = call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to double*
store double* %36, double** %8
%37 = load i32, i32* %3
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = mul i64 8, %39
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = mul i64 %40, %42
%44 = trunc i64 %43 to i32
%45 = call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to double*
store double* %46, double** %9
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = mul i64 8, %48
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = mul i64 %49, %51
%53 = trunc i64 %52 to i32
%54 = call i64 @malloc(i32 %53)
%55 = inttoptr i64 %54 to double*
store double* %55, double** %10
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = mul i64 8, %57
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = mul i64 %58, %60
%62 = trunc i64 %61 to i32
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to double*
store double* %64, double** %11
%65 = load double*, double** %7
%66 = load i32, i32* %3
%67 = load i32, i32* %5
%68 = mul nsw i32 %66, %67
%69 = load i32*, i32** %6
%70 = call i32 @fread(double* %65, i32 8, i32 %68, i32* %69)
%71 = load double*, double** %8
%72 = load i32, i32* %3
%73 = sub nsw i32 %72, 1
%74 = load i32, i32* %5
%75 = mul nsw i32 %73, %74
%76 = load i32*, i32** %6
%77 = call i32 @fread(double* %71, i32 8, i32 %75, i32* %76)
%78 = load double*, double** %9
%79 = load i32, i32* %3
%80 = sub nsw i32 %79, 1
%81 = load i32, i32* %5
%82 = mul nsw i32 %80, %81
%83 = load i32*, i32** %6
%84 = call i32 @fread(double* %78, i32 8, i32 %82, i32* %83)
%85 = load double*, double** %10
%86 = load i32, i32* %3
%87 = load i32, i32* %4
%88 = mul nsw i32 %86, %87
%89 = load i32*, i32** %6
%90 = call i32 @fread(double* %85, i32 8, i32 %88, i32* %89)
%91 = load double*, double** %11
%92 = load i32, i32* %3
%93 = load i32, i32* %4
%94 = mul nsw i32 %92, %93
%95 = load i32*, i32** %6
%96 = call i32 @fread(double* %91, i32 8, i32 %94, i32* %95)
store i32 0, i32* %12
br label %97
97: ; preds = %110, %2
%98 = load i32, i32* %12
%99 = load i32, i32* %3
%100 = load i32, i32* %4
%101 = mul nsw i32 %99, %100
%102 = icmp slt i32 %98, %101
br i1 %102, label %103, label %113
103: ; preds = %97
%104 = load double*, double** %10
%105 = load i32, i32* %12
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
%108 = load double, double* %107
%109 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %108)
br label %110
110: ; preds = %103
%111 = load i32, i32* %12
%112 = add nsw i32 %111, 1
store i32 %112, i32* %12
br label %97
113: ; preds = %97
%114 = load double*, double** %9
%115 = load double*, double** %7
%116 = load double*, double** %8
%117 = load double*, double** %10
%118 = load i32, i32* %3
%119 = load i32, i32* %4
%120 = call i32 @thomas_alg_block(double* %114, double* %115, double* %116, double* %117, i32 %118, i32 %119)
store i32 0, i32* %12
br label %121
121: ; preds = %139, %113
%122 = load i32, i32* %12
%123 = load i32, i32* %3
%124 = load i32, i32* %4
%125 = mul nsw i32 %123, %124
%126 = icmp slt i32 %122, %125
br i1 %126, label %127, label %142
127: ; preds = %121
%128 = load double*, double** %10
%129 = load i32, i32* %12
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
%133 = load double*, double** %11
%134 = load i32, i32* %12
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %132, double %137)
br label %139
139: ; preds = %127
%140 = load i32, i32* %12
%141 = add nsw i32 %140, 1
store i32 %141, i32* %12
br label %121
142: ; preds = %121
store double 0.000000e+00, double* %13
store i32 0, i32* %12
br label %143
143: ; preds = %174, %142
%144 = load i32, i32* %12
%145 = load i32, i32* %3
%146 = load i32, i32* %4
%147 = mul nsw i32 %145, %146
%148 = icmp slt i32 %144, %147
br i1 %148, label %149, label %177
149: ; preds = %143
%150 = load double*, double** %10
%151 = load i32, i32* %12
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
%154 = load double, double* %153
%155 = load double*, double** %11
%156 = load i32, i32* %12
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = fsub double %154, %159
%161 = load double*, double** %10
%162 = load i32, i32* %12
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
%165 = load double, double* %164
%166 = load double*, double** %11
%167 = load i32, i32* %12
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %166, i64 %168
%170 = load double, double* %169
%171 = fsub double %165, %170
%172 = load double, double* %13
%173 = call double @llvm.fmuladd.f64(double %160, double %171, double %172)
store double %173, double* %13
br label %174
174: ; preds = %149
%175 = load i32, i32* %12
%176 = add nsw i32 %175, 1
store i32 %176, i32* %12
br label %143
177: ; preds = %143
%178 = load double, double* %13
%179 = load i32, i32* %3
%180 = load i32, i32* %4
%181 = mul nsw i32 %179, %180
%182 = sitofp i32 %181 to double
%183 = fdiv double %178, %182
%184 = call double @pow(double %183, double 5.000000e-01)
store double %184, double* %13
%185 = load double, double* %13
%186 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %185)
%187 = load double*, double** %7
%188 = call i32 @free(double* %187)
%189 = load double*, double** %8
%190 = call i32 @free(double* %189)
%191 = load double*, double** %9
%192 = call i32 @free(double* %191)
%193 = load double*, double** %10
%194 = call i32 @free(double* %193)
%195 = load double*, double** %11
%196 = call i32 @free(double* %195)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.dat\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c"%lg\0A\00"
@.str.3 = [9 x i8] c"%lg\09%lg\0A\00"
@.str.4 = [15 x i8] c"Error is %.5e\0A\00"
define void @test_3(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %1
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = shl i32 %0, 3
%6 = mul i32 %3, %5
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to double*
%9 = add nsw i32 %0, -1
%10 = shl i32 %9, 3
%11 = mul i32 %10, %3
%12 = tail call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to double*
%14 = tail call i64 @malloc(i32 %11)
%15 = inttoptr i64 %14 to double*
%16 = mul i32 %5, %1
%17 = tail call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to double*
%19 = tail call i64 @malloc(i32 %16)
%20 = inttoptr i64 %19 to double*
%21 = mul nsw i32 %3, %0
%22 = tail call i32 @fread(double* %8, i32 8, i32 %21, i32* %4)
%23 = mul nsw i32 %3, %9
%24 = tail call i32 @fread(double* %13, i32 8, i32 %23, i32* %4)
%25 = tail call i32 @fread(double* %15, i32 8, i32 %23, i32* %4)
%26 = mul nsw i32 %1, %0
%27 = tail call i32 @fread(double* %18, i32 8, i32 %26, i32* %4)
%28 = tail call i32 @fread(double* %20, i32 8, i32 %26, i32* %4)
%29 = icmp sgt i32 %26, 0
br i1 %29, label %32, label %30
30: ; preds = %2
%31 = tail call i32 @thomas_alg_block(double* %15, double* %8, double* %13, double* %18, i32 %0, i32 %1)
br label %114
32: ; preds = %2
%33 = zext i32 %26 to i64
br label %34
34: ; preds = %32, %34
%35 = phi i64 [ 0, %32 ], [ %39, %34 ]
%36 = getelementptr inbounds double, double* %18, i64 %35
%37 = load double, double* %36
%38 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %37)
%39 = add nuw nsw i64 %35, 1
%40 = icmp eq i64 %39, %33
br i1 %40, label %41, label %34
41: ; preds = %34
%42 = tail call i32 @thomas_alg_block(double* %15, double* %8, double* %13, double* %18, i32 %0, i32 %1)
br i1 %29, label %43, label %114
43: ; preds = %41
%44 = zext i32 %26 to i64
br label %53
45: ; preds = %53
br i1 %29, label %46, label %114
46: ; preds = %45
%47 = zext i32 %26 to i64
%48 = add nsw i64 %47, -1
%49 = and i64 %47, 3
%50 = icmp ult i64 %48, 3
br i1 %50, label %96, label %51
51: ; preds = %46
%52 = and i64 %47, 4294967292
br label %62
53: ; preds = %43, %53
%54 = phi i64 [ 0, %43 ], [ %60, %53 ]
%55 = getelementptr inbounds double, double* %18, i64 %54
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %20, i64 %54
%58 = load double, double* %57
%59 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %56, double %58)
%60 = add nuw nsw i64 %54, 1
%61 = icmp eq i64 %60, %44
br i1 %61, label %45, label %53
62: ; preds = %62, %51
%63 = phi i64 [ 0, %51 ], [ %93, %62 ]
%64 = phi double [ 0.000000e+00, %51 ], [ %92, %62 ]
%65 = phi i64 [ 0, %51 ], [ %94, %62 ]
%66 = getelementptr inbounds double, double* %18, i64 %63
%67 = load double, double* %66
%68 = getelementptr inbounds double, double* %20, i64 %63
%69 = load double, double* %68
%70 = fsub double %67, %69
%71 = tail call double @llvm.fmuladd.f64(double %70, double %70, double %64)
%72 = or i64 %63, 1
%73 = getelementptr inbounds double, double* %18, i64 %72
%74 = load double, double* %73
%75 = getelementptr inbounds double, double* %20, i64 %72
%76 = load double, double* %75
%77 = fsub double %74, %76
%78 = tail call double @llvm.fmuladd.f64(double %77, double %77, double %71)
%79 = or i64 %63, 2
%80 = getelementptr inbounds double, double* %18, i64 %79
%81 = load double, double* %80
%82 = getelementptr inbounds double, double* %20, i64 %79
%83 = load double, double* %82
%84 = fsub double %81, %83
%85 = tail call double @llvm.fmuladd.f64(double %84, double %84, double %78)
%86 = or i64 %63, 3
%87 = getelementptr inbounds double, double* %18, i64 %86
%88 = load double, double* %87
%89 = getelementptr inbounds double, double* %20, i64 %86
%90 = load double, double* %89
%91 = fsub double %88, %90
%92 = tail call double @llvm.fmuladd.f64(double %91, double %91, double %85)
%93 = add nuw nsw i64 %63, 4
%94 = add i64 %65, 4
%95 = icmp eq i64 %94, %52
br i1 %95, label %96, label %62
96: ; preds = %62, %46
%97 = phi double [ undef, %46 ], [ %92, %62 ]
%98 = phi i64 [ 0, %46 ], [ %93, %62 ]
%99 = phi double [ 0.000000e+00, %46 ], [ %92, %62 ]
%100 = icmp eq i64 %49, 0
br i1 %100, label %114, label %101
101: ; preds = %96, %101
%102 = phi i64 [ %111, %101 ], [ %98, %96 ]
%103 = phi double [ %110, %101 ], [ %99, %96 ]
%104 = phi i64 [ %112, %101 ], [ 0, %96 ]
%105 = getelementptr inbounds double, double* %18, i64 %102
%106 = load double, double* %105
%107 = getelementptr inbounds double, double* %20, i64 %102
%108 = load double, double* %107
%109 = fsub double %106, %108
%110 = tail call double @llvm.fmuladd.f64(double %109, double %109, double %103)
%111 = add nuw nsw i64 %102, 1
%112 = add i64 %104, 1
%113 = icmp eq i64 %112, %49
br i1 %113, label %114, label %101
114: ; preds = %96, %101, %41, %30, %45
%115 = phi double [ 0.000000e+00, %45 ], [ 0.000000e+00, %30 ], [ 0.000000e+00, %41 ], [ %97, %96 ], [ %110, %101 ]
%116 = sitofp i32 %26 to double
%117 = fdiv double %115, %116
%118 = tail call double @pow(double %117, double 5.000000e-01)
%119 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %118)
%120 = tail call i32 @free(double* %8)
%121 = tail call i32 @free(double* %13)
%122 = tail call i32 @free(double* %15)
%123 = tail call i32 @free(double* %18)
%124 = tail call i32 @free(double* %20)
ret void
}