#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 */
void x2y(double **yvecs, int ndims, int nmyvtxs, double *wsqrt) {
  double *wptr;
  double *yptr;
  int i, j;
  if (wsqrt == NULL) {
    return;
  }
  for (i = 1; i <= ndims; i++) {
    yptr = yvecs[i];
    wptr = wsqrt;
    for (j = nmyvtxs; j; j--) {
      *(++yptr) *= *(++wptr);
    }
  }
}


x86 assembly (clang, -O0):
<x2y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1122 <x2y+0x22>
jmp    11ab <x2y+0xab>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11ab <x2y+0xab>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     1198 <x2y+0x98>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
movsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    1153 <x2y+0x53>
jmp    119d <x2y+0x9d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1129 <x2y+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2y>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rcx,%rcx
je     136b <x2y+0x26b>
test   %esi,%esi
jle    136b <x2y+0x26b>
mov    %rcx,%rbp
mov    %edx,%r8d
add    $0x1,%esi
lea    -0x1(%r8),%eax
lea    0x2(%rax),%rcx
mov    %rcx,-0x10(%rsp)
lea    0x8(%rbp),%rcx
mov    %rcx,-0x18(%rsp)
lea    0x10(%rbp,%rax,8),%rcx
mov    %rcx,-0x8(%rsp)
lea    0x1(%rax),%r10
mov    %r10,-0x20(%rsp)
and    $0xfffffffffffffffc,%r10
lea    -0x4(%r10),%r15
mov    %r15,-0x28(%rsp)
shr    $0x2,%r15
add    $0x1,%r15
mov    %edx,%ecx
sub    %r10d,%ecx
mov    %ecx,-0x3c(%rsp)
lea    0x0(,%r10,8),%rcx
add    %rbp,%rcx
mov    %rcx,-0x38(%rsp)
mov    %r15,%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x30(%rsp)
mov    $0x1,%r12d
jmp    119d <x2y+0x9d>
nop
add    $0x1,%r12
cmp    %rsi,%r12
je     136b <x2y+0x26b>
test   %r8d,%r8d
je     1190 <x2y+0x90>
mov    (%rdi,%r12,8),%r13
cmp    $0x3,%eax
jb     11d5 <x2y+0xd5>
lea    0x8(%r13),%rcx
cmp    -0x8(%rsp),%rcx
jae    128d <x2y+0x18d>
mov    -0x10(%rsp),%rcx
lea    0x0(,%rcx,8),%rcx
add    %r13,%rcx
cmp    %rcx,-0x18(%rsp)
jae    128d <x2y+0x18d>
mov    %r8d,%r11d
mov    %rbp,%rcx
lea    -0x1(%r11),%r14d
test   $0x3,%r11b
je     1215 <x2y+0x115>
mov    %r11d,%edx
and    $0x3,%edx
xor    %r9d,%r9d
xchg   %ax,%ax
movsd  0x8(%rcx),%xmm0
add    $0x8,%rcx
mulsd  0x8(%r13),%xmm0
movsd  %xmm0,0x8(%r13)
add    $0x8,%r13
add    $0x1,%r9
cmp    %r9d,%edx
jne    11f0 <x2y+0xf0>
sub    %r9d,%r11d
cmp    $0x3,%r14d
jb     1190 <x2y+0x90>
mov    %r11d,%edx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x8(%rcx,%rbx,8),%xmm0
mulsd  0x8(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x8(%r13,%rbx,8)
movsd  0x10(%rcx,%rbx,8),%xmm0
mulsd  0x10(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x10(%r13,%rbx,8)
movsd  0x18(%rcx,%rbx,8),%xmm0
mulsd  0x18(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x18(%r13,%rbx,8)
movsd  0x20(%rcx,%rbx,8),%xmm0
mulsd  0x20(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x20(%r13,%rbx,8)
add    $0x4,%rbx
cmp    %ebx,%edx
jne    1230 <x2y+0x130>
jmp    1190 <x2y+0x90>
cmpq   $0x0,-0x28(%rsp)
je     1361 <x2y+0x261>
mov    -0x30(%rsp),%rdx
xor    %ecx,%ecx
movupd 0x8(%rbp,%rcx,8),%xmm0
movupd 0x18(%rbp,%rcx,8),%xmm1
movupd 0x8(%r13,%rcx,8),%xmm2
mulpd  %xmm0,%xmm2
movupd 0x18(%r13,%rcx,8),%xmm0
mulpd  %xmm1,%xmm0
movupd 0x28(%r13,%rcx,8),%xmm1
movupd 0x38(%r13,%rcx,8),%xmm3
movupd %xmm2,0x8(%r13,%rcx,8)
movupd %xmm0,0x18(%r13,%rcx,8)
movupd 0x28(%rbp,%rcx,8),%xmm0
mulpd  %xmm1,%xmm0
movupd 0x38(%rbp,%rcx,8),%xmm1
mulpd  %xmm3,%xmm1
movupd %xmm0,0x28(%r13,%rcx,8)
movupd %xmm1,0x38(%r13,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rdx
jne    12a0 <x2y+0x1a0>
test   $0x1,%r15b
je     1340 <x2y+0x240>
movupd 0x8(%rbp,%rcx,8),%xmm0
movupd 0x18(%rbp,%rcx,8),%xmm1
movupd 0x8(%r13,%rcx,8),%xmm2
mulpd  %xmm0,%xmm2
movupd 0x18(%r13,%rcx,8),%xmm0
mulpd  %xmm1,%xmm0
movupd %xmm2,0x8(%r13,%rcx,8)
movupd %xmm0,0x18(%r13,%rcx,8)
cmp    %r10,-0x20(%rsp)
je     1190 <x2y+0x90>
lea    0x0(%r13,%r10,8),%r13
mov    -0x3c(%rsp),%ecx
mov    %ecx,%r11d
mov    -0x38(%rsp),%rcx
jmp    11db <x2y+0xdb>
xor    %ecx,%ecx
test   $0x1,%r15b
jne    1310 <x2y+0x210>
jmp    1340 <x2y+0x240>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @x2y(double** %0, i32 %1, i32 %2, double* %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%13 = load double*, double** %8
%14 = icmp eq double* %13, null
br i1 %14, label %15, label %16
15: ; preds = %4
br label %47
16: ; preds = %4
store i32 1, i32* %11
br label %17
17: ; preds = %44, %16
%18 = load i32, i32* %11
%19 = load i32, i32* %6
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %47
21: ; preds = %17
%22 = load double**, double*** %5
%23 = load i32, i32* %11
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
store double* %26, double** %10
%27 = load double*, double** %8
store double* %27, double** %9
%28 = load i32, i32* %7
store i32 %28, i32* %12
br label %29
29: ; preds = %40, %21
%30 = load i32, i32* %12
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %43
32: ; preds = %29
%33 = load double*, double** %9
%34 = getelementptr inbounds double, double* %33, i32 1
store double* %34, double** %9
%35 = load double, double* %34
%36 = load double*, double** %10
%37 = getelementptr inbounds double, double* %36, i32 1
store double* %37, double** %10
%38 = load double, double* %37
%39 = fmul double %38, %35
store double %39, double* %37
br label %40
40: ; preds = %32
%41 = load i32, i32* %12
%42 = add nsw i32 %41, -1
store i32 %42, i32* %12
br label %29
43: ; preds = %29
br label %44
44: ; preds = %43
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %17
47: ; preds = %15, %17
ret void
}

LLVM IR (-O2):
define void @x2y(double** nocapture %0, i32 %1, i32 %2, double* %3) {
%5 = icmp eq double* %3, null
%6 = icmp slt i32 %1, 1
%7 = or i1 %5, %6
br i1 %7, label %167, label %8
8: ; preds = %4
%9 = icmp eq i32 %2, 0
%10 = add nuw i32 %1, 1
%11 = zext i32 %10 to i64
%12 = add i32 %2, -1
%13 = zext i32 %12 to i64
%14 = add nuw nsw i64 %13, 2
%15 = getelementptr double, double* %3, i64 1
%16 = getelementptr double, double* %3, i64 %14
%17 = add i32 %2, -1
%18 = zext i32 %17 to i64
%19 = add nuw nsw i64 %18, 1
%20 = and i64 %19, 8589934588
%21 = add nsw i64 %20, -4
%22 = lshr exact i64 %21, 2
%23 = add nuw nsw i64 %22, 1
%24 = icmp ult i32 %17, 3
%25 = and i64 %19, 8589934588
%26 = trunc i64 %25 to i32
%27 = sub i32 %2, %26
%28 = getelementptr double, double* %3, i64 %25
%29 = and i64 %23, 1
%30 = icmp eq i64 %21, 0
%31 = and i64 %23, 9223372036854775806
%32 = getelementptr double, double* %3, i64 1
%33 = getelementptr double, double* %3, i64 1
%34 = icmp eq i64 %29, 0
%35 = getelementptr double, double* %3, i64 1
%36 = icmp eq i64 %19, %25
br label %37
37: ; preds = %8, %164
%38 = phi i64 [ 1, %8 ], [ %165, %164 ]
br i1 %9, label %164, label %39
39: ; preds = %37
%40 = getelementptr inbounds double*, double** %0, i64 %38
%41 = load double*, double** %40
br i1 %24, label %113, label %42
42: ; preds = %39
%43 = getelementptr double, double* %41, i64 1
%44 = getelementptr double, double* %41, i64 %14
%45 = icmp ult double* %43, %16
%46 = icmp ult double* %15, %44
%47 = and i1 %45, %46
br i1 %47, label %113, label %48
48: ; preds = %42
%49 = getelementptr double, double* %41, i64 %25
br i1 %30, label %92, label %50
50: ; preds = %48
%51 = getelementptr double, double* %41, i64 1
%52 = getelementptr double, double* %41, i64 1
br label %53
53: ; preds = %53, %50
%54 = phi i64 [ 0, %50 ], [ %89, %53 ]
%55 = phi i64 [ 0, %50 ], [ %90, %53 ]
%56 = getelementptr inbounds double, double* %32, i64 %54
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = getelementptr inbounds double, double* %56, i64 2
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = getelementptr inbounds double, double* %51, i64 %54
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = getelementptr inbounds double, double* %62, i64 2
%66 = bitcast double* %65 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = fmul <2 x double> %58, %64
%69 = fmul <2 x double> %61, %67
%70 = bitcast double* %62 to <2 x double>*
store <2 x double> %68, <2 x double>* %70
%71 = bitcast double* %65 to <2 x double>*
store <2 x double> %69, <2 x double>* %71
%72 = or i64 %54, 4
%73 = getelementptr inbounds double, double* %33, i64 %72
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %73, i64 2
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = getelementptr inbounds double, double* %52, i64 %72
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = getelementptr inbounds double, double* %79, i64 2
%83 = bitcast double* %82 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = fmul <2 x double> %75, %81
%86 = fmul <2 x double> %78, %84
%87 = bitcast double* %79 to <2 x double>*
store <2 x double> %85, <2 x double>* %87
%88 = bitcast double* %82 to <2 x double>*
store <2 x double> %86, <2 x double>* %88
%89 = add nuw i64 %54, 8
%90 = add i64 %55, 2
%91 = icmp eq i64 %90, %31
br i1 %91, label %92, label %53
92: ; preds = %53, %48
%93 = phi i64 [ 0, %48 ], [ %89, %53 ]
br i1 %34, label %112, label %94
94: ; preds = %92
%95 = getelementptr double, double* %41, i64 1
%96 = getelementptr inbounds double, double* %35, i64 %93
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = getelementptr inbounds double, double* %96, i64 2
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %95, i64 %93
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = getelementptr inbounds double, double* %102, i64 2
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = fmul <2 x double> %98, %104
%109 = fmul <2 x double> %101, %107
%110 = bitcast double* %102 to <2 x double>*
store <2 x double> %108, <2 x double>* %110
%111 = bitcast double* %105 to <2 x double>*
store <2 x double> %109, <2 x double>* %111
br label %112
112: ; preds = %92, %94
br i1 %36, label %164, label %113
113: ; preds = %42, %39, %112
%114 = phi i32 [ %2, %42 ], [ %2, %39 ], [ %27, %112 ]
%115 = phi double* [ %41, %42 ], [ %41, %39 ], [ %49, %112 ]
%116 = phi double* [ %3, %42 ], [ %3, %39 ], [ %28, %112 ]
%117 = add i32 %114, -1
%118 = and i32 %114, 3
%119 = icmp eq i32 %118, 0
br i1 %119, label %133, label %120
120: ; preds = %113, %120
%121 = phi i32 [ %130, %120 ], [ %114, %113 ]
%122 = phi double* [ %127, %120 ], [ %115, %113 ]
%123 = phi double* [ %125, %120 ], [ %116, %113 ]
%124 = phi i32 [ %131, %120 ], [ 0, %113 ]
%125 = getelementptr inbounds double, double* %123, i64 1
%126 = load double, double* %125
%127 = getelementptr inbounds double, double* %122, i64 1
%128 = load double, double* %127
%129 = fmul double %126, %128
store double %129, double* %127
%130 = add nsw i32 %121, -1
%131 = add i32 %124, 1
%132 = icmp eq i32 %131, %118
br i1 %132, label %133, label %120
133: ; preds = %120, %113
%134 = phi i32 [ %114, %113 ], [ %130, %120 ]
%135 = phi double* [ %115, %113 ], [ %127, %120 ]
%136 = phi double* [ %116, %113 ], [ %125, %120 ]
%137 = icmp ult i32 %117, 3
br i1 %137, label %164, label %138
138: ; preds = %133, %138
%139 = phi i32 [ %162, %138 ], [ %134, %133 ]
%140 = phi double* [ %159, %138 ], [ %135, %133 ]
%141 = phi double* [ %157, %138 ], [ %136, %133 ]
%142 = getelementptr inbounds double, double* %141, i64 1
%143 = load double, double* %142
%144 = getelementptr inbounds double, double* %140, i64 1
%145 = load double, double* %144
%146 = fmul double %143, %145
store double %146, double* %144
%147 = getelementptr inbounds double, double* %141, i64 2
%148 = load double, double* %147
%149 = getelementptr inbounds double, double* %140, i64 2
%150 = load double, double* %149
%151 = fmul double %148, %150
store double %151, double* %149
%152 = getelementptr inbounds double, double* %141, i64 3
%153 = load double, double* %152
%154 = getelementptr inbounds double, double* %140, i64 3
%155 = load double, double* %154
%156 = fmul double %153, %155
store double %156, double* %154
%157 = getelementptr inbounds double, double* %141, i64 4
%158 = load double, double* %157
%159 = getelementptr inbounds double, double* %140, i64 4
%160 = load double, double* %159
%161 = fmul double %158, %160
store double %161, double* %159
%162 = add nsw i32 %139, -4
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %138
164: ; preds = %133, %138, %112, %37
%165 = add nuw nsw i64 %38, 1
%166 = icmp eq i64 %165, %11
br i1 %166, label %167, label %37
167: ; preds = %164, %4
ret void
}