#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 MaxAbsDiff(int, int, double *, int, double *, int);
int /*<<< orphan*/ MyGemv(int, int, double *, int, double *, int, double *,
                          int);
int /*<<< orphan*/ RandomMatrix(int, int, double *, int);
int /*<<< orphan*/ dgemv_(char *, int *, int *, double *, double *, int *,
                          double *, int *, double *, double *, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(int argc, char *argv[]) {
  int m, n, ldA, size, first, last, inc, i_one = 1, AllCorrect;
  double d_one = 1.0, diff, maxdiff;
  double *A, *x, *y, *yold, *yref;
  printf("%% enter first, last, inc:");
  scanf("%d%d%d", &first, &last, &inc);
  last = (last / inc) * inc;
  first = (first / inc) * inc;
  first = (first == 0 ? inc : first);
  printf("%% %d %d %d \n", first, last, inc);
  AllCorrect = 1;
  for (size = last; size >= first; size -= inc) {
    m = n = size;
    ldA = size;
    A = (double *)malloc(ldA * n * sizeof(double));
    x = (double *)malloc(n * sizeof(double));
    y = (double *)malloc(m * sizeof(double));
    yold = (double *)malloc(m * sizeof(double));
    yref = (double *)malloc(m * sizeof(double));
    RandomMatrix(m, n, A, ldA);
    RandomMatrix(n, 1, x, n);
    RandomMatrix(m, 1, yold, m);
    memcpy(yref, yold, m * sizeof(double));
    dgemv_("No transpose", &m, &n, &d_one, A, &ldA, x, &i_one, &d_one, yref,
           &i_one);
    memcpy(y, yold, m * sizeof(double));
    MyGemv(m, n, A, ldA, x, 1, y, 1);
    diff = MaxAbsDiff(m, 1, y, m, yref, m);
    maxdiff = (diff > maxdiff ? diff : maxdiff);
    if (maxdiff > 1.0e-8)
      AllCorrect = 0;
    free(A);
    free(x);
    free(y);
    free(yold);
    free(yref);
  }
  if (AllCorrect)
    printf("It appears all is well\n");
  else
    printf("At least one test is suspicious\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xb8,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x38(%rbp)
movsd  0xe37(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe48(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   10b0 <scanf@plt>
mov    -0x30(%rbp),%eax
cltd
idivl  -0x34(%rbp)
imul   -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cltd
idivl  -0x34(%rbp)
imul   -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1228 <main+0x88>
mov    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    1231 <main+0x91>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jl     1470 <main+0x2d0>
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x68(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x70(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x78(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x60(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1070 <RandomMatrix@plt>
mov    -0x20(%rbp),%edi
mov    -0x68(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    $0x1,%esi
call   1070 <RandomMatrix@plt>
mov    -0x1c(%rbp),%edi
mov    -0x78(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%esi
call   1070 <RandomMatrix@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1080 <memcpy@plt>
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%rbx
mov    -0x80(%rbp),%r10
lea    0xcff(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x48(%rbp),%r11
lea    -0x24(%rbp),%r9
lea    -0x38(%rbp),%rax
mov    %r11,%rcx
mov    %rbx,(%rsp)
mov    %rax,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   10a0 <dgemv_@plt>
mov    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1080 <memcpy@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x60(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x68(%rbp),%r8
mov    -0x70(%rbp),%rax
mov    $0x1,%r9d
mov    %rax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1030 <MyGemv@plt>
mov    -0x1c(%rbp),%edi
mov    -0x70(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x80(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x1,%esi
call   1060 <MaxAbsDiff@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    13fb <main+0x25b>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    1408 <main+0x268>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xbe6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1433 <main+0x293>
movl   $0x0,-0x3c(%rbp)
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
mov    -0x68(%rbp),%rdi
call   1040 <free@plt>
mov    -0x70(%rbp),%rdi
call   1040 <free@plt>
mov    -0x78(%rbp),%rdi
call   1040 <free@plt>
mov    -0x80(%rbp),%rdi
call   1040 <free@plt>
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
jmp    125e <main+0xbe>
cmpl   $0x0,-0x3c(%rbp)
je     148d <main+0x2ed>
lea    0xbcc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    149b <main+0x2fb>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movl   $0x1,0x24(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x30(%rsp)
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe39(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   10c0 <scanf@plt>
mov    0x18(%rsp),%ebp
mov    0x20(%rsp),%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
sub    %edx,%ebp
mov    %ebp,0x18(%rsp)
mov    0x10(%rsp),%esi
mov    %esi,%eax
cltd
idiv   %ecx
sub    %edx,%esi
cmove  %ecx,%esi
mov    %esi,0x10(%rsp)
lea    0xe00(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%ebx
cmp    0x10(%rsp),%ebx
jge    1249 <main+0x99>
lea    0xe21(%rip),%rdi
jmp    13fc <main+0x24c>
movl   $0x1,0x14(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,0xc(%rsp)
mov    %ebx,0x8(%rsp)
mov    %ebx,0x1c(%rsp)
mov    %ebx,%edi
imul   %ebx,%edi
shl    $0x3,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    0xc(%rsp),%edi
shl    $0x3,%edi
call   10a0 <malloc@plt>
mov    %rax,%r14
mov    0x8(%rsp),%edi
shl    $0x3,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    0x8(%rsp),%edi
shl    $0x3,%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    0x8(%rsp),%edi
shl    $0x3,%edi
call   10a0 <malloc@plt>
mov    %rax,%r13
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x1c(%rsp),%ecx
mov    %rbp,%rdx
call   1080 <RandomMatrix@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,%edi
mov    $0x1,%esi
mov    %r14,%rdx
call   1080 <RandomMatrix@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,%edi
mov    $0x1,%esi
mov    %r12,%rdx
call   1080 <RandomMatrix@plt>
mov    0x8(%rsp),%edx
shl    $0x3,%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   1090 <memcpy@plt>
sub    $0x8,%rsp
lea    0xd29(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x38(%rsp),%rcx
mov    %rbp,%r8
lea    0x24(%rsp),%r9
lea    0x2c(%rsp),%rax
push   %rax
push   %r13
push   %rcx
push   %rax
push   %r14
call   10b0 <dgemv_@plt>
add    $0x30,%rsp
mov    0x8(%rsp),%edx
shl    $0x3,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1090 <memcpy@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x1c(%rsp),%ecx
mov    %rbp,%rdx
mov    %r14,%r8
mov    $0x1,%r9d
push   $0x1
push   %r15
call   1030 <MyGemv@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%ecx
mov    %ecx,%edi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r13,%r8
mov    %ecx,%r9d
call   1070 <MaxAbsDiff@plt>
maxsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
ucomisd 0xc61(%rip),%xmm0
mov    0x14(%rsp),%eax
mov    $0x0,%ecx
cmova  %ecx,%eax
mov    %eax,0x14(%rsp)
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
sub    0x20(%rsp),%ebx
cmp    0x10(%rsp),%ebx
jge    1260 <main+0xb0>
cmpl   $0x0,0x14(%rsp)
lea    0xc54(%rip),%rax
lea    0xc6d(%rip),%rdi
cmove  %rax,%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%% enter first, last, inc:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [14 x i8] c"%% %d %d %d \0A\00"
@.str.3 = [13 x i8] c"No transpose\00"
@.str.4 = [24 x i8] c"It appears all is well\0A\00"
@.str.5 = [33 x i8] c"At least one test is suspicious\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %13
store double 1.000000e+00, double* %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %10, i32* %11, i32* %12)
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = sdiv i32 %25, %26
%28 = load i32, i32* %12
%29 = mul nsw i32 %27, %28
store i32 %29, i32* %11
%30 = load i32, i32* %10
%31 = load i32, i32* %12
%32 = sdiv i32 %30, %31
%33 = load i32, i32* %12
%34 = mul nsw i32 %32, %33
store i32 %34, i32* %10
%35 = load i32, i32* %10
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %2
%38 = load i32, i32* %12
br label %41
39: ; preds = %2
%40 = load i32, i32* %10
br label %41
41: ; preds = %39, %37
%42 = phi i32 [ %38, %37 ], [ %40, %39 ]
store i32 %42, i32* %10
%43 = load i32, i32* %10
%44 = load i32, i32* %11
%45 = load i32, i32* %12
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
store i32 1, i32* %14
%47 = load i32, i32* %11
store i32 %47, i32* %9
br label %48
48: ; preds = %154, %41
%49 = load i32, i32* %9
%50 = load i32, i32* %10
%51 = icmp sge i32 %49, %50
br i1 %51, label %52, label %158
52: ; preds = %48
%53 = load i32, i32* %9
store i32 %53, i32* %7
store i32 %53, i32* %6
%54 = load i32, i32* %9
store i32 %54, i32* %8
%55 = load i32, i32* %8
%56 = load i32, i32* %7
%57 = mul nsw i32 %55, %56
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 8
%60 = trunc i64 %59 to i32
%61 = call i64 @malloc(i32 %60)
%62 = inttoptr i64 %61 to double*
store double* %62, double** %18
%63 = load i32, i32* %7
%64 = sext i32 %63 to i64
%65 = mul i64 %64, 8
%66 = trunc i64 %65 to i32
%67 = call i64 @malloc(i32 %66)
%68 = inttoptr i64 %67 to double*
store double* %68, double** %19
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = mul i64 %70, 8
%72 = trunc i64 %71 to i32
%73 = call i64 @malloc(i32 %72)
%74 = inttoptr i64 %73 to double*
store double* %74, double** %20
%75 = load i32, i32* %6
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 8
%78 = trunc i64 %77 to i32
%79 = call i64 @malloc(i32 %78)
%80 = inttoptr i64 %79 to double*
store double* %80, double** %21
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = mul i64 %82, 8
%84 = trunc i64 %83 to i32
%85 = call i64 @malloc(i32 %84)
%86 = inttoptr i64 %85 to double*
store double* %86, double** %22
%87 = load i32, i32* %6
%88 = load i32, i32* %7
%89 = load double*, double** %18
%90 = load i32, i32* %8
%91 = call i32 @RandomMatrix(i32 %87, i32 %88, double* %89, i32 %90)
%92 = load i32, i32* %7
%93 = load double*, double** %19
%94 = load i32, i32* %7
%95 = call i32 @RandomMatrix(i32 %92, i32 1, double* %93, i32 %94)
%96 = load i32, i32* %6
%97 = load double*, double** %21
%98 = load i32, i32* %6
%99 = call i32 @RandomMatrix(i32 %96, i32 1, double* %97, i32 %98)
%100 = load double*, double** %22
%101 = load double*, double** %21
%102 = load i32, i32* %6
%103 = sext i32 %102 to i64
%104 = mul i64 %103, 8
%105 = trunc i64 %104 to i32
%106 = call i32 @memcpy(double* %100, double* %101, i32 %105)
%107 = load double*, double** %18
%108 = load double*, double** %19
%109 = load double*, double** %22
%110 = call i32 @dgemv_(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %6, i32* %7, double* %15, double* %107, i32* %8, double* %108, i32* %13, double* %15, double* %109, i32* %13)
%111 = load double*, double** %20
%112 = load double*, double** %21
%113 = load i32, i32* %6
%114 = sext i32 %113 to i64
%115 = mul i64 %114, 8
%116 = trunc i64 %115 to i32
%117 = call i32 @memcpy(double* %111, double* %112, i32 %116)
%118 = load i32, i32* %6
%119 = load i32, i32* %7
%120 = load double*, double** %18
%121 = load i32, i32* %8
%122 = load double*, double** %19
%123 = load double*, double** %20
%124 = call i32 @MyGemv(i32 %118, i32 %119, double* %120, i32 %121, double* %122, i32 1, double* %123, i32 1)
%125 = load i32, i32* %6
%126 = load double*, double** %20
%127 = load i32, i32* %6
%128 = load double*, double** %22
%129 = load i32, i32* %6
%130 = call double @MaxAbsDiff(i32 %125, i32 1, double* %126, i32 %127, double* %128, i32 %129)
store double %130, double* %16
%131 = load double, double* %16
%132 = load double, double* %17
%133 = fcmp ogt double %131, %132
br i1 %133, label %134, label %136
134: ; preds = %52
%135 = load double, double* %16
br label %138
136: ; preds = %52
%137 = load double, double* %17
br label %138
138: ; preds = %136, %134
%139 = phi double [ %135, %134 ], [ %137, %136 ]
store double %139, double* %17
%140 = load double, double* %17
%141 = fcmp ogt double %140, 1.000000e-08
br i1 %141, label %142, label %143
142: ; preds = %138
store i32 0, i32* %14
br label %143
143: ; preds = %142, %138
%144 = load double*, double** %18
%145 = call i32 @free(double* %144)
%146 = load double*, double** %19
%147 = call i32 @free(double* %146)
%148 = load double*, double** %20
%149 = call i32 @free(double* %148)
%150 = load double*, double** %21
%151 = call i32 @free(double* %150)
%152 = load double*, double** %22
%153 = call i32 @free(double* %152)
br label %154
154: ; preds = %143
%155 = load i32, i32* %12
%156 = load i32, i32* %9
%157 = sub nsw i32 %156, %155
store i32 %157, i32* %9
br label %48
158: ; preds = %48
%159 = load i32, i32* %14
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %158
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %165
163: ; preds = %158
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %165
165: ; preds = %163, %161
%166 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"%% enter first, last, inc:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [14 x i8] c"%% %d %d %d \0A\00"
@.str.3 = [13 x i8] c"No transpose\00"
@str = [32 x i8] c"At least one test is suspicious\00"
@str.6 = [23 x i8] c"It appears all is well\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
store i32 1, i32* %9
%18 = bitcast double* %10 to i8*
store double 1.000000e+00, double* %10
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = srem i32 %21, %22
%24 = sub i32 %21, %23
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = srem i32 %25, %22
%27 = sub i32 %25, %26
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 %22, i32 %27
store i32 %29, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %24, i32 %22)
%31 = load i32, i32* %7
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %95, label %34
34: ; preds = %2, %34
%35 = phi i32 [ %89, %34 ], [ %31, %2 ]
%36 = phi i32 [ %82, %34 ], [ 1, %2 ]
%37 = phi double [ %80, %34 ], [ undef, %2 ]
store i32 %35, i32* %4
store i32 %35, i32* %3
store i32 %35, i32* %5
%38 = shl i32 %35, 3
%39 = mul i32 %38, %35
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to double*
%42 = load i32, i32* %4
%43 = shl i32 %42, 3
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to double*
%46 = load i32, i32* %3
%47 = shl i32 %46, 3
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to double*
%50 = load i32, i32* %3
%51 = shl i32 %50, 3
%52 = call i64 @malloc(i32 %51)
%53 = inttoptr i64 %52 to double*
%54 = load i32, i32* %3
%55 = shl i32 %54, 3
%56 = call i64 @malloc(i32 %55)
%57 = inttoptr i64 %56 to double*
%58 = load i32, i32* %3
%59 = load i32, i32* %4
%60 = load i32, i32* %5
%61 = call i32 @RandomMatrix(i32 %58, i32 %59, double* %41, i32 %60)
%62 = load i32, i32* %4
%63 = call i32 @RandomMatrix(i32 %62, i32 1, double* %45, i32 %62)
%64 = load i32, i32* %3
%65 = call i32 @RandomMatrix(i32 %64, i32 1, double* %53, i32 %64)
%66 = load i32, i32* %3
%67 = shl i32 %66, 3
%68 = call i32 @memcpy(double* %57, double* %53, i32 %67)
%69 = call i32 @dgemv_(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %3, i32* %4, double* %10, double* %41, i32* %5, double* %45, i32* %9, double* %10, double* %57, i32* %9)
%70 = load i32, i32* %3
%71 = shl i32 %70, 3
%72 = call i32 @memcpy(double* %49, double* %53, i32 %71)
%73 = load i32, i32* %3
%74 = load i32, i32* %4
%75 = load i32, i32* %5
%76 = call i32 @MyGemv(i32 %73, i32 %74, double* %41, i32 %75, double* %45, i32 1, double* %49, i32 1)
%77 = load i32, i32* %3
%78 = call double @MaxAbsDiff(i32 %77, i32 1, double* %49, i32 %77, double* %57, i32 %77)
%79 = fcmp ogt double %78, %37
%80 = select i1 %79, double %78, double %37
%81 = fcmp ogt double %80, 1.000000e-08
%82 = select i1 %81, i32 0, i32 %36
%83 = call i32 @free(double* %41)
%84 = call i32 @free(double* %45)
%85 = call i32 @free(double* %49)
%86 = call i32 @free(double* %53)
%87 = call i32 @free(double* %57)
%88 = load i32, i32* %8
%89 = sub nsw i32 %35, %88
%90 = load i32, i32* %6
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %34
92: ; preds = %34
%93 = icmp eq i32 %82, 0
%94 = select i1 %93, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0)
br label %95
95: ; preds = %92, %2
%96 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0), %2 ], [ %94, %92 ]
%97 = call i32 @puts(i8* dereferenceable(1) %96)
%98 = call i32 @exit(i32 0)
unreachable
}