#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*/ printf(char *, double const *, double *, int, int, char *);
void scaleVectorDoub(const double *va, const double val, double *ret,
                     int numDim) {
  int index = 0;
  if ((va != NULL) && (ret != NULL) && (numDim > 0)) {
    for (index = 0; index < numDim; index++) {
      ret[index] = va[index] * val;
    }
  } else {
    printf("Error va:%p,  ret:%p numDim:%d , ln:%d file:%s \n", va, ret, numDim,
           65,
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/"
           "master/mProject/library_jui/dataStruct/src/basicVarArea.c");
  }
}


x86 assembly (clang, -O0):
<scaleVectorDoub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1194 <scaleVectorDoub+0x84>
cmpq   $0x0,-0x18(%rbp)
je     1194 <scaleVectorDoub+0x84>
cmpl   $0x0,-0x1c(%rbp)
jle    1194 <scaleVectorDoub+0x84>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    118f <scaleVectorDoub+0x7f>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1156 <scaleVectorDoub+0x46>
jmp    11b8 <scaleVectorDoub+0xa8>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe5a(%rip),%rdi
mov    $0x41,%r8d
lea    0xe7e(%rip),%r9
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleVectorDoub>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdi,%rdi
je     11ec <scaleVectorDoub+0xdc>
test   %rdx,%rdx
je     11ec <scaleVectorDoub+0xdc>
test   %ecx,%ecx
jle    11ec <scaleVectorDoub+0xdc>
mov    %ecx,%r9d
cmp    $0x4,%ecx
jb     1154 <scaleVectorDoub+0x44>
lea    (%rsi,%r9,8),%rax
cmp    %rdx,%rax
jbe    1205 <scaleVectorDoub+0xf5>
lea    (%rdx,%r9,8),%rax
cmp    %rsi,%rax
jbe    1205 <scaleVectorDoub+0xf5>
xor    %ecx,%ecx
mov    %rcx,%rax
not    %rax
add    %r9,%rax
mov    %r9,%rdi
and    $0x3,%rdi
je     1188 <scaleVectorDoub+0x78>
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rdi
jne    1170 <scaleVectorDoub+0x60>
cmp    $0x3,%rax
jb     12b5 <scaleVectorDoub+0x1a5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%rcx,8)
movsd  0x8(%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdx,%rcx,8)
movsd  0x10(%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdx,%rcx,8)
movsd  0x18(%rsi,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rdx,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%r9
jne    11a0 <scaleVectorDoub+0x90>
jmp    12b5 <scaleVectorDoub+0x1a5>
lea    0xe0d(%rip),%rdi
lea    0xe37(%rip),%r9
mov    $0x41,%r8d
jmp    1030 <printf@plt>
mov    %r9d,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rax
mov    %rax,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rax,%rax
je     12b6 <scaleVectorDoub+0x1a6>
mov    %r8,%rax
and    $0xfffffffffffffffe,%rax
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd (%rsi,%rdi,8),%xmm2
movupd 0x10(%rsi,%rdi,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rdx,%rdi,8)
movupd %xmm3,0x10(%rdx,%rdi,8)
movupd 0x20(%rsi,%rdi,8),%xmm2
movupd 0x30(%rsi,%rdi,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,0x20(%rdx,%rdi,8)
movupd %xmm3,0x30(%rdx,%rdi,8)
add    $0x8,%rdi
add    $0xfffffffffffffffe,%rax
jne    1240 <scaleVectorDoub+0x130>
test   $0x1,%r8b
je     12ac <scaleVectorDoub+0x19c>
movupd (%rsi,%rdi,8),%xmm2
movupd 0x10(%rsi,%rdi,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rdx,%rdi,8)
movupd %xmm3,0x10(%rdx,%rdi,8)
cmp    %r9,%rcx
jne    1156 <scaleVectorDoub+0x46>
ret
xor    %edi,%edi
test   $0x1,%r8b
jne    128e <scaleVectorDoub+0x17e>
jmp    12ac <scaleVectorDoub+0x19c>

LLVM IR (-O0):
@.str = [49 x i8] c"Error va:%p, ret:%p numDim:%d , ln:%d file:%s \0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
define void @scaleVectorDoub(double* %0, double %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load double*, double** %5
%11 = icmp ne double* %10, null
br i1 %11, label %12, label %39
12: ; preds = %4
%13 = load double*, double** %7
%14 = icmp ne double* %13, null
br i1 %14, label %15, label %39
15: ; preds = %12
%16 = load i32, i32* %8
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %39
18: ; preds = %15
store i32 0, i32* %9
br label %19
19: ; preds = %35, %18
%20 = load i32, i32* %9
%21 = load i32, i32* %8
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %38
23: ; preds = %19
%24 = load double*, double** %5
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = load double, double* %6
%30 = fmul double %28, %29
%31 = load double*, double** %7
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
store double %30, double* %34
br label %35
35: ; preds = %23
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %19
38: ; preds = %19
br label %44
39: ; preds = %15, %12, %4
%40 = load double*, double** %5
%41 = load double*, double** %7
%42 = load i32, i32* %8
%43 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double* %40, double* %41, i32 %42, i32 65, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %44
44: ; preds = %39, %38
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Error va:%p, ret:%p numDim:%d , ln:%d file:%s \0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
define void @scaleVectorDoub(double* %0, double %1, double* %2, i32 %3) {
%5 = icmp ne double* %0, null
%6 = icmp ne double* %2, null
%7 = and i1 %5, %6
%8 = icmp sgt i32 %3, 0
%9 = and i1 %7, %8
br i1 %9, label %10, label %123
10: ; preds = %4
%11 = zext i32 %3 to i64
%12 = icmp ult i32 %3, 4
br i1 %12, label %81, label %13
13: ; preds = %10
%14 = getelementptr double, double* %2, i64 %11
%15 = getelementptr double, double* %0, i64 %11
%16 = icmp ugt double* %15, %2
%17 = icmp ugt double* %14, %0
%18 = and i1 %16, %17
br i1 %18, label %81, label %19
19: ; preds = %13
%20 = and i64 %11, 4294967292
%21 = insertelement <2 x double> poison, double %1, i64 0
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
%23 = insertelement <2 x double> poison, double %1, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = add nsw i64 %20, -4
%26 = lshr exact i64 %25, 2
%27 = add nuw nsw i64 %26, 1
%28 = and i64 %27, 1
%29 = icmp eq i64 %25, 0
br i1 %29, label %63, label %30
30: ; preds = %19
%31 = and i64 %27, 9223372036854775806
br label %32
32: ; preds = %32, %30
%33 = phi i64 [ 0, %30 ], [ %60, %32 ]
%34 = phi i64 [ 0, %30 ], [ %61, %32 ]
%35 = getelementptr inbounds double, double* %0, i64 %33
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds double, double* %35, i64 2
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = fmul <2 x double> %37, %22
%42 = fmul <2 x double> %40, %24
%43 = getelementptr inbounds double, double* %2, i64 %33
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> %41, <2 x double>* %44
%45 = getelementptr inbounds double, double* %43, i64 2
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %42, <2 x double>* %46
%47 = or i64 %33, 4
%48 = getelementptr inbounds double, double* %0, i64 %47
%49 = bitcast double* %48 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = getelementptr inbounds double, double* %48, i64 2
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = fmul <2 x double> %50, %22
%55 = fmul <2 x double> %53, %24
%56 = getelementptr inbounds double, double* %2, i64 %47
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %54, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %55, <2 x double>* %59
%60 = add nuw i64 %33, 8
%61 = add i64 %34, 2
%62 = icmp eq i64 %61, %31
br i1 %62, label %63, label %32
63: ; preds = %32, %19
%64 = phi i64 [ 0, %19 ], [ %60, %32 ]
%65 = icmp eq i64 %28, 0
br i1 %65, label %79, label %66
66: ; preds = %63
%67 = getelementptr inbounds double, double* %0, i64 %64
%68 = bitcast double* %67 to <2 x double>*
%69 = load <2 x double>, <2 x double>* %68
%70 = getelementptr inbounds double, double* %67, i64 2
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = fmul <2 x double> %69, %22
%74 = fmul <2 x double> %72, %24
%75 = getelementptr inbounds double, double* %2, i64 %64
%76 = bitcast double* %75 to <2 x double>*
store <2 x double> %73, <2 x double>* %76
%77 = getelementptr inbounds double, double* %75, i64 2
%78 = bitcast double* %77 to <2 x double>*
store <2 x double> %74, <2 x double>* %78
br label %79
79: ; preds = %63, %66
%80 = icmp eq i64 %20, %11
br i1 %80, label %125, label %81
81: ; preds = %13, %10, %79
%82 = phi i64 [ 0, %13 ], [ 0, %10 ], [ %20, %79 ]
%83 = xor i64 %82, -1
%84 = add nsw i64 %83, %11
%85 = and i64 %11, 3
%86 = icmp eq i64 %85, 0
br i1 %86, label %97, label %87
87: ; preds = %81, %87
%88 = phi i64 [ %94, %87 ], [ %82, %81 ]
%89 = phi i64 [ %95, %87 ], [ 0, %81 ]
%90 = getelementptr inbounds double, double* %0, i64 %88
%91 = load double, double* %90
%92 = fmul double %91, %1
%93 = getelementptr inbounds double, double* %2, i64 %88
store double %92, double* %93
%94 = add nuw nsw i64 %88, 1
%95 = add i64 %89, 1
%96 = icmp eq i64 %95, %85
br i1 %96, label %97, label %87
97: ; preds = %87, %81
%98 = phi i64 [ %82, %81 ], [ %94, %87 ]
%99 = icmp ult i64 %84, 3
br i1 %99, label %125, label %100
100: ; preds = %97, %100
%101 = phi i64 [ %121, %100 ], [ %98, %97 ]
%102 = getelementptr inbounds double, double* %0, i64 %101
%103 = load double, double* %102
%104 = fmul double %103, %1
%105 = getelementptr inbounds double, double* %2, i64 %101
store double %104, double* %105
%106 = add nuw nsw i64 %101, 1
%107 = getelementptr inbounds double, double* %0, i64 %106
%108 = load double, double* %107
%109 = fmul double %108, %1
%110 = getelementptr inbounds double, double* %2, i64 %106
store double %109, double* %110
%111 = add nuw nsw i64 %101, 2
%112 = getelementptr inbounds double, double* %0, i64 %111
%113 = load double, double* %112
%114 = fmul double %113, %1
%115 = getelementptr inbounds double, double* %2, i64 %111
store double %114, double* %115
%116 = add nuw nsw i64 %101, 3
%117 = getelementptr inbounds double, double* %0, i64 %116
%118 = load double, double* %117
%119 = fmul double %118, %1
%120 = getelementptr inbounds double, double* %2, i64 %116
store double %119, double* %120
%121 = add nuw nsw i64 %101, 4
%122 = icmp eq i64 %121, %11
br i1 %122, label %125, label %100
123: ; preds = %4
%124 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double* %0, double* %2, i32 %3, i32 65, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %125
125: ; preds = %97, %100, %79, %123
ret void
}