#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 const *, double *, int,
                          int, char *);
void minusVectorDoub(const double *va, const double *vb, double *ret,
                     int numDim) {
  int index = 0;
  if ((va != NULL) && (vb != NULL) && (ret != NULL) && (numDim > 0)) {
    for (index = 0; index < numDim; index++) {
      ret[index] = va[index] - vb[index];
    }
  } else {
    printf("Error va:%p, vb:%p, ret:%p numDim:%d , ln:%d file:%s \n", va, vb,
           ret, numDim, 35,
           "/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):
<minusVectorDoub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11a6 <minusVectorDoub+0x96>
cmpq   $0x0,-0x10(%rbp)
je     11a6 <minusVectorDoub+0x96>
cmpq   $0x0,-0x18(%rbp)
je     11a6 <minusVectorDoub+0x96>
cmpl   $0x0,-0x1c(%rbp)
jle    11a6 <minusVectorDoub+0x96>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11a1 <minusVectorDoub+0x91>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%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    1160 <minusVectorDoub+0x50>
jmp    11d3 <minusVectorDoub+0xc3>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xe43(%rip),%rdi
mov    $0x23,%r9d
lea    0xe6d(%rip),%rax
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minusVectorDoub>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,%r10
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdi,%rdi
je     11e4 <minusVectorDoub+0xd4>
test   %rdx,%rdx
je     11e4 <minusVectorDoub+0xd4>
test   %r10,%r10
je     11e4 <minusVectorDoub+0xd4>
test   %r8d,%r8d
jle    11e4 <minusVectorDoub+0xd4>
mov    %r8d,%r9d
cmp    $0x4,%r8d
jae    1206 <minusVectorDoub+0xf6>
xor    %edi,%edi
mov    %rdi,%rax
not    %rax
add    %r9,%rax
mov    %r9,%rcx
and    $0x3,%rcx
je     118a <minusVectorDoub+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsi,%rdi,8),%xmm0
subsd  (%rdx,%rdi,8),%xmm0
movsd  %xmm0,(%r10,%rdi,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rcx
jne    1170 <minusVectorDoub+0x60>
cmp    $0x3,%rax
jb     11e2 <minusVectorDoub+0xd2>
movsd  (%rsi,%rdi,8),%xmm0
subsd  (%rdx,%rdi,8),%xmm0
movsd  %xmm0,(%r10,%rdi,8)
movsd  0x8(%rsi,%rdi,8),%xmm0
subsd  0x8(%rdx,%rdi,8),%xmm0
movsd  %xmm0,0x8(%r10,%rdi,8)
movsd  0x10(%rsi,%rdi,8),%xmm0
subsd  0x10(%rdx,%rdi,8),%xmm0
movsd  %xmm0,0x10(%r10,%rdi,8)
movsd  0x18(%rsi,%rdi,8),%xmm0
subsd  0x18(%rdx,%rdi,8),%xmm0
movsd  %xmm0,0x18(%r10,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r9
jne    1190 <minusVectorDoub+0x80>
pop    %rax
ret
lea    0xe4c(%rip),%rax
mov    %rax,(%rsp)
lea    0xe0a(%rip),%rdi
mov    %r10,%rcx
mov    $0x23,%r9d
call   1030 <printf@plt>
pop    %rax
ret
lea    (%r10,%r9,8),%rcx
lea    (%rsi,%r9,8),%rax
cmp    %r10,%rax
seta   %r8b
lea    (%rdx,%r9,8),%rax
cmp    %rsi,%rcx
seta   %r11b
cmp    %r10,%rax
seta   %al
cmp    %rdx,%rcx
seta   %cl
xor    %edi,%edi
test   %r11b,%r8b
jne    1150 <minusVectorDoub+0x40>
and    %cl,%al
jne    1150 <minusVectorDoub+0x40>
mov    %r9d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rax
mov    %rax,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rax,%rax
je     1312 <minusVectorDoub+0x202>
mov    %r8,%rcx
and    $0xfffffffffffffffe,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movupd (%rsi,%rax,8),%xmm0
movupd 0x10(%rsi,%rax,8),%xmm1
movupd (%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%r10,%rax,8)
movupd %xmm1,0x10(%r10,%rax,8)
movupd 0x20(%rsi,%rax,8),%xmm0
movupd 0x30(%rsi,%rax,8),%xmm1
movupd 0x20(%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x30(%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,0x20(%r10,%rax,8)
movupd %xmm1,0x30(%r10,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    1270 <minusVectorDoub+0x160>
test   $0x1,%r8b
je     1304 <minusVectorDoub+0x1f4>
movupd (%rsi,%rax,8),%xmm0
movupd 0x10(%rsi,%rax,8),%xmm1
movupd (%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%rdx,%rax,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%r10,%rax,8)
movupd %xmm1,0x10(%r10,%rax,8)
cmp    %r9,%rdi
jne    1150 <minusVectorDoub+0x40>
jmp    11e2 <minusVectorDoub+0xd2>
xor    %eax,%eax
test   $0x1,%r8b
jne    12d9 <minusVectorDoub+0x1c9>
jmp    1304 <minusVectorDoub+0x1f4>

LLVM IR (-O0):
@.str = [55 x i8] c"Error va:%p, vb:%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 @minusVectorDoub(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 %46
12: ; preds = %4
%13 = load double*, double** %6
%14 = icmp ne double* %13, null
br i1 %14, label %15, label %46
15: ; preds = %12
%16 = load double*, double** %7
%17 = icmp ne double* %16, null
br i1 %17, label %18, label %46
18: ; preds = %15
%19 = load i32, i32* %8
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %46
21: ; preds = %18
store i32 0, i32* %9
br label %22
22: ; preds = %42, %21
%23 = load i32, i32* %9
%24 = load i32, i32* %8
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %45
26: ; preds = %22
%27 = load double*, double** %5
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %6
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = fsub double %31, %36
%38 = load double*, double** %7
%39 = load i32, i32* %9
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double %37, double* %41
br label %42
42: ; preds = %26
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %22
45: ; preds = %22
br label %52
46: ; preds = %18, %15, %12, %4
%47 = load double*, double** %5
%48 = load double*, double** %6
%49 = load double*, double** %7
%50 = load i32, i32* %8
%51 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), double* %47, double* %48, double* %49, i32 %50, i32 35, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %52
52: ; preds = %46, %45
ret void
}

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