#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ _pthread_my_matvec_mul(double *, double *, int, int,
                                          double *, int);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, j, dim;
  double *mat_a, *vec_b, *vec_x;
  printf("Dim = ");
  scanf("%d", &dim);
  int num_threads;
  printf("Max.Num.threads = ");
  scanf("%d", &num_threads);
  if (dim <= 0) {
    printf("Illegal dimension! (dim = %d)\n", dim);
    return EXIT_FAILURE;
  }
  mat_a = (double *)calloc(dim * dim, sizeof(double));
  vec_x = (double *)calloc(dim, sizeof(double));
  vec_b = (double *)calloc(dim, sizeof(double));
  for (i = 0; i < dim; i++) {
    for (j = 0; j < dim; j++) {
      mat_a[i * dim + j] = (double)(i + j + 1);
      if ((i + j + 1) % 2 != 0)
        mat_a[i * dim + j] *= -1.0;
    }
    vec_x[i] = 1.0 / (double)(i + 1);
  }
  _pthread_my_matvec_mul(vec_b, mat_a, dim, dim, vec_x, num_threads);
  for (i = 0; i < dim; i++) {
    printf("[");
    for (j = 0; j < dim; j++)
      printf("%10.3lf ", mat_a[i * dim + j]);
    printf("]  %10.3lf = %10.3lf\n", vec_x[i], vec_b[i]);
  }
  free(mat_a);
  free(vec_x);
  free(vec_b);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jg     11c7 <main+0x77>
mov    -0x10(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13a6 <main+0x256>
mov    -0x10(%rbp),%edi
imul   -0x10(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12c8 <main+0x178>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1297 <main+0x147>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1284 <main+0x134>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xd8e(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1289 <main+0x139>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1218 <main+0xc8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xd57(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1205 <main+0xb5>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1060 <_pthread_my_matvec_mul@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    137f <main+0x22f>
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1349 <main+0x1f9>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd1a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130b <main+0x1bb>
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xced(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12ea <main+0x19a>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    0x2c37(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%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
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecc(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    145a <main+0x2fa>
imul   %esi,%esi
mov    %esi,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%r12
mov    0x4(%rsp),%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
mov    0x4(%rsp),%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,0x8(%rsp)
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    1399 <main+0x239>
mov    %ecx,%r8d
and    $0xfffffffc,%r8d
mov    %r12,%rdx
add    $0x10,%rdx
lea    0x0(,%rcx,8),%r9
mov    %r9,%rdi
and    $0xffffffffffffffe0,%rdi
mov    $0x1,%ebx
xor    %r11d,%r11d
movdqa 0xdf9(%rip),%xmm13
movsd  0xe10(%rip),%xmm9
movdqa 0xdc7(%rip),%xmm8
movdqa 0xdce(%rip),%xmm11
pxor   %xmm12,%xmm12
movdqa 0xde0(%rip),%xmm10
mov    %r12,%rax
jmp    128d <main+0x12d>
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %r10d,%xmm0
movapd %xmm9,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%r11,8)
add    %r9,%rdx
add    %r9,%rax
add    $0x1,%rbx
mov    %r10,%r11
cmp    %rcx,%r10
je     1399 <main+0x239>
lea    0x1(%r11),%r10
cmp    $0x4,%ecx
jae    12a0 <main+0x140>
xor    %ebp,%ebp
jmp    1382 <main+0x222>
nopl   (%rax)
movq   %r10,%xmm1
pshufd $0x44,%xmm1,%xmm14
lea    0x3(%r11),%rbp
movq   %rbp,%xmm1
pshufd $0x44,%xmm1,%xmm7
xor    %ebp,%ebp
movdqa %xmm8,%xmm2
movdqa %xmm14,%xmm1
paddq  %xmm2,%xmm1
movdqa %xmm7,%xmm5
paddq  %xmm2,%xmm5
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm5,%xmm5
cvtdq2pd %xmm1,%xmm3
cvtdq2pd %xmm5,%xmm6
pand   %xmm11,%xmm1
pand   %xmm11,%xmm5
pcmpeqd %xmm12,%xmm1
pxor   %xmm0,%xmm0
pcmpgtd %xmm1,%xmm0
punpckldq %xmm0,%xmm1
pcmpeqd %xmm12,%xmm5
pxor   %xmm0,%xmm0
pcmpgtd %xmm5,%xmm0
punpckldq %xmm0,%xmm5
movdqa %xmm3,%xmm0
pxor   %xmm13,%xmm0
movdqa %xmm6,%xmm4
pxor   %xmm13,%xmm4
pand   %xmm1,%xmm3
pandn  %xmm0,%xmm1
por    %xmm3,%xmm1
pand   %xmm5,%xmm6
pandn  %xmm4,%xmm5
por    %xmm6,%xmm5
movdqu %xmm1,-0x10(%rdx,%rbp,1)
movdqu %xmm5,(%rdx,%rbp,1)
paddq  %xmm10,%xmm2
add    $0x20,%rbp
cmp    %rbp,%rdi
jne    12c0 <main+0x160>
mov    %r8,%rbp
cmp    %rcx,%r8
jne    1382 <main+0x222>
jmp    1260 <main+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm1,(%rax,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rcx
je     1260 <main+0x100>
lea    (%rbx,%rbp,1),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
test   $0x1,%sil
je     1370 <main+0x210>
xorpd  %xmm13,%xmm1
jmp    1370 <main+0x210>
mov    0x14(%rsp),%r9d
mov    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    %ecx,%edx
mov    %r14,%r8
call   1070 <_pthread_my_matvec_mul@plt>
cmpl   $0x0,0x4(%rsp)
jle    1437 <main+0x2d7>
xor    %ebp,%ebp
lea    0xcc0(%rip),%rbx
lea    0xcc2(%rip),%r13
jmp    13f8 <main+0x298>
nopl   (%rax)
movsd  (%r14,%rbp,8),%xmm0
mov    0x8(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm1
mov    %r13,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jge    1437 <main+0x2d7>
mov    $0x5b,%edi
call   1040 <putchar@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    13d0 <main+0x270>
xor    %r15d,%r15d
nopl   (%rax)
imul   %ebp,%eax
cltq
add    %r15,%rax
movsd  (%r12,%rax,8),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%r15
cmp    %eax,%r15d
jl     1410 <main+0x2b0>
jmp    13d0 <main+0x270>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2b80(%rip),%rax
jmp    146f <main+0x30f>
lea    0xc04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2b71(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Dim = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Max.Num.threads = \00"
@.str.3 = [31 x i8] c"Illegal dimension! (dim = %d)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [2 x i8] c"[\00"
@.str.5 = [9 x i8] c"%10.3lf \00"
@.str.6 = [22 x i8] c"] %10.3lf = %10.3lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%13 = load i32, i32* %4
%14 = icmp sle i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @EXIT_FAILURE
store i32 %18, i32* %1
br label %142
19: ; preds = %0
%20 = load i32, i32* %4
%21 = load i32, i32* %4
%22 = mul nsw i32 %20, %21
%23 = call i64 @calloc(i32 %22, i32 8)
%24 = inttoptr i64 %23 to double*
store double* %24, double** %5
%25 = load i32, i32* %4
%26 = call i64 @calloc(i32 %25, i32 8)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %7
%28 = load i32, i32* %4
%29 = call i64 @calloc(i32 %28, i32 8)
%30 = inttoptr i64 %29 to double*
store double* %30, double** %6
store i32 0, i32* %2
br label %31
31: ; preds = %84, %19
%32 = load i32, i32* %2
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %87
35: ; preds = %31
store i32 0, i32* %3
br label %36
36: ; preds = %72, %35
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %75
40: ; preds = %36
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = add nsw i32 %41, %42
%44 = add nsw i32 %43, 1
%45 = sitofp i32 %44 to double
%46 = load double*, double** %5
%47 = load i32, i32* %2
%48 = load i32, i32* %4
%49 = mul nsw i32 %47, %48
%50 = load i32, i32* %3
%51 = add nsw i32 %49, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %46, i64 %52
store double %45, double* %53
%54 = load i32, i32* %2
%55 = load i32, i32* %3
%56 = add nsw i32 %54, %55
%57 = add nsw i32 %56, 1
%58 = srem i32 %57, 2
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %71
60: ; preds = %40
%61 = load double*, double** %5
%62 = load i32, i32* %2
%63 = load i32, i32* %4
%64 = mul nsw i32 %62, %63
%65 = load i32, i32* %3
%66 = add nsw i32 %64, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %61, i64 %67
%69 = load double, double* %68
%70 = fmul double %69, -1.000000e+00
store double %70, double* %68
br label %71
71: ; preds = %60, %40
br label %72
72: ; preds = %71
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %36
75: ; preds = %36
%76 = load i32, i32* %2
%77 = add nsw i32 %76, 1
%78 = sitofp i32 %77 to double
%79 = fdiv double 1.000000e+00, %78
%80 = load double*, double** %7
%81 = load i32, i32* %2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
store double %79, double* %83
br label %84
84: ; preds = %75
%85 = load i32, i32* %2
%86 = add nsw i32 %85, 1
store i32 %86, i32* %2
br label %31
87: ; preds = %31
%88 = load double*, double** %6
%89 = load double*, double** %5
%90 = load i32, i32* %4
%91 = load i32, i32* %4
%92 = load double*, double** %7
%93 = load i32, i32* %8
%94 = call i32 @_pthread_my_matvec_mul(double* %88, double* %89, i32 %90, i32 %91, double* %92, i32 %93)
store i32 0, i32* %2
br label %95
95: ; preds = %131, %87
%96 = load i32, i32* %2
%97 = load i32, i32* %4
%98 = icmp slt i32 %96, %97
br i1 %98, label %99, label %134
99: ; preds = %95
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %101
101: ; preds = %116, %99
%102 = load i32, i32* %3
%103 = load i32, i32* %4
%104 = icmp slt i32 %102, %103
br i1 %104, label %105, label %119
105: ; preds = %101
%106 = load double*, double** %5
%107 = load i32, i32* %2
%108 = load i32, i32* %4
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %3
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %106, i64 %112
%114 = load double, double* %113
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double %114)
br label %116
116: ; preds = %105
%117 = load i32, i32* %3
%118 = add nsw i32 %117, 1
store i32 %118, i32* %3
br label %101
119: ; preds = %101
%120 = load double*, double** %7
%121 = load i32, i32* %2
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = load double, double* %123
%125 = load double*, double** %6
%126 = load i32, i32* %2
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
%129 = load double, double* %128
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %124, double %129)
br label %131
131: ; preds = %119
%132 = load i32, i32* %2
%133 = add nsw i32 %132, 1
store i32 %133, i32* %2
br label %95
134: ; preds = %95
%135 = load double*, double** %5
%136 = call i32 @free(double* %135)
%137 = load double*, double** %7
%138 = call i32 @free(double* %137)
%139 = load double*, double** %6
%140 = call i32 @free(double* %139)
%141 = load i32, i32* @EXIT_SUCCESS
store i32 %141, i32* %1
br label %142
142: ; preds = %134, %15
%143 = load i32, i32* %1
ret i32 %143
}

LLVM IR (-O2):
@.str = [7 x i8] c"Dim = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Max.Num.threads = \00"
@.str.3 = [31 x i8] c"Illegal dimension! (dim = %d)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.5 = [9 x i8] c"%10.3lf \00"
@.str.6 = [22 x i8] c"] %10.3lf = %10.3lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = bitcast i32* %2 to i8*
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %126
13: ; preds = %0
%14 = mul nsw i32 %9, %9
%15 = call i64 @calloc(i32 %14, i32 8)
%16 = inttoptr i64 %15 to double*
%17 = load i32, i32* %1
%18 = call i64 @calloc(i32 %17, i32 8)
%19 = inttoptr i64 %18 to double*
%20 = load i32, i32* %1
%21 = call i64 @calloc(i32 %20, i32 8)
%22 = inttoptr i64 %21 to double*
%23 = load i32, i32* %1
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %88
25: ; preds = %13
%26 = zext i32 %23 to i64
%27 = zext i32 %23 to i64
%28 = icmp ult i32 %23, 4
%29 = and i64 %27, 4294967292
%30 = icmp eq i64 %29, %27
br label %31
31: ; preds = %82, %25
%32 = phi i64 [ 0, %25 ], [ %33, %82 ]
%33 = add nuw nsw i64 %32, 1
%34 = mul nsw i64 %32, %26
br i1 %28, label %67, label %35
35: ; preds = %31
%36 = insertelement <2 x i64> poison, i64 %33, i64 0
%37 = shufflevector <2 x i64> %36, <2 x i64> poison, <2 x i32> zeroinitializer
%38 = add nuw i64 %32, 3
%39 = insertelement <2 x i64> poison, i64 %38, i64 0
%40 = shufflevector <2 x i64> %39, <2 x i64> poison, <2 x i32> zeroinitializer
br label %41
41: ; preds = %41, %35
%42 = phi i64 [ 0, %35 ], [ %63, %41 ]
%43 = phi <2 x i64> [ <i64 0, i64 1>, %35 ], [ %64, %41 ]
%44 = add nuw nsw <2 x i64> %37, %43
%45 = add <2 x i64> %40, %43
%46 = trunc <2 x i64> %44 to <2 x i32>
%47 = trunc <2 x i64> %45 to <2 x i32>
%48 = sitofp <2 x i32> %46 to <2 x double>
%49 = sitofp <2 x i32> %47 to <2 x double>
%50 = add nuw nsw i64 %42, %34
%51 = getelementptr inbounds double, double* %16, i64 %50
%52 = and <2 x i32> %46, <i32 1, i32 1>
%53 = and <2 x i32> %47, <i32 1, i32 1>
%54 = icmp eq <2 x i32> %52, zeroinitializer
%55 = icmp eq <2 x i32> %53, zeroinitializer
%56 = fneg <2 x double> %48
%57 = fneg <2 x double> %49
%58 = select <2 x i1> %54, <2 x double> %48, <2 x double> %56
%59 = select <2 x i1> %55, <2 x double> %49, <2 x double> %57
%60 = bitcast double* %51 to <2 x double>*
store <2 x double> %58, <2 x double>* %60
%61 = getelementptr inbounds double, double* %51, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %59, <2 x double>* %62
%63 = add nuw i64 %42, 4
%64 = add <2 x i64> %43, <i64 4, i64 4>
%65 = icmp eq i64 %63, %29
br i1 %65, label %66, label %41
66: ; preds = %41
br i1 %30, label %82, label %67
67: ; preds = %31, %66
%68 = phi i64 [ 0, %31 ], [ %29, %66 ]
br label %69
69: ; preds = %67, %69
%70 = phi i64 [ %80, %69 ], [ %68, %67 ]
%71 = add nuw nsw i64 %33, %70
%72 = trunc i64 %71 to i32
%73 = sitofp i32 %72 to double
%74 = add nuw nsw i64 %70, %34
%75 = getelementptr inbounds double, double* %16, i64 %74
%76 = and i32 %72, 1
%77 = icmp eq i32 %76, 0
%78 = fneg double %73
%79 = select i1 %77, double %73, double %78
store double %79, double* %75
%80 = add nuw nsw i64 %70, 1
%81 = icmp eq i64 %80, %27
br i1 %81, label %82, label %69
82: ; preds = %69, %66
%83 = trunc i64 %33 to i32
%84 = sitofp i32 %83 to double
%85 = fdiv double 1.000000e+00, %84
%86 = getelementptr inbounds double, double* %19, i64 %32
store double %85, double* %86
%87 = icmp eq i64 %33, %27
br i1 %87, label %88, label %31
88: ; preds = %82, %13
%89 = load i32, i32* %2
%90 = call i32 @_pthread_my_matvec_mul(double* %22, double* %16, i32 %23, i32 %23, double* %19, i32 %89)
%91 = load i32, i32* %1
%92 = icmp sgt i32 %91, 0
br i1 %92, label %93, label %122
93: ; preds = %88, %112
%94 = phi i64 [ %118, %112 ], [ 0, %88 ]
%95 = call i32 @putchar(i32 91)
%96 = load i32, i32* %1
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %112
98: ; preds = %93
%99 = trunc i64 %94 to i32
br label %100
100: ; preds = %98, %100
%101 = phi i32 [ %110, %100 ], [ %96, %98 ]
%102 = phi i32 [ %109, %100 ], [ 0, %98 ]
%103 = mul nsw i32 %101, %99
%104 = add nsw i32 %103, %102
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %16, i64 %105
%107 = load double, double* %106
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double %107)
%109 = add nuw nsw i32 %102, 1
%110 = load i32, i32* %1
%111 = icmp slt i32 %109, %110
br i1 %111, label %100, label %112
112: ; preds = %100, %93
%113 = getelementptr inbounds double, double* %19, i64 %94
%114 = load double, double* %113
%115 = getelementptr inbounds double, double* %22, i64 %94
%116 = load double, double* %115
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %114, double %116)
%118 = add nuw nsw i64 %94, 1
%119 = load i32, i32* %1
%120 = sext i32 %119 to i64
%121 = icmp slt i64 %118, %120
br i1 %121, label %93, label %122
122: ; preds = %112, %88
%123 = call i32 @free(double* %16)
%124 = call i32 @free(double* %19)
%125 = call i32 @free(double* %22)
br label %126
126: ; preds = %122, %11
%127 = phi i32* [ @EXIT_FAILURE, %11 ], [ @EXIT_SUCCESS, %122 ]
%128 = load i32, i32* %127
ret i32 %128
}