#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 pow(double const, double);
int /*<<< orphan*/ printf(char *, double const *, int, int, char *);
double diffVAbsoluateValDoub(const double *va, const double *vb, int numDim) {
  double ret = 0.0;
  int index = 0;
  if ((va != NULL) && (vb != NULL) && (numDim > 0)) {
    for (index = 0; index < numDim; index++) {
      ret = pow(va[index] - vb[index], 2.0) + ret;
    }
    ret = pow(ret, 0.5);
  } else {
    printf(" Error in diffVAbsoluateValDoub, va:%p,numDim:%d ln:%d, file:%s\n",
           va, numDim, 101,
           "/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");
  }
  return ret;
}


x86 assembly (clang, -O0):
<diffVAbsoluateValDoub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11d0 <diffVAbsoluateValDoub+0xb0>
cmpq   $0x0,-0x10(%rbp)
je     11d0 <diffVAbsoluateValDoub+0xb0>
cmpl   $0x0,-0x14(%rbp)
jle    11d0 <diffVAbsoluateValDoub+0xb0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b4 <diffVAbsoluateValDoub+0x94>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe71(%rip),%xmm1
call   1040 <pow@plt>
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1169 <diffVAbsoluateValDoub+0x49>
movsd  -0x20(%rbp),%xmm0
movsd  0xe3f(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
jmp    11ef <diffVAbsoluateValDoub+0xcf>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe32(%rip),%rdi
mov    $0x65,%ecx
lea    0xe67(%rip),%r8
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffVAbsoluateValDoub>:
push   %rax
mov    %rdi,%rax
test   %rdi,%rdi
je     114e <diffVAbsoluateValDoub+0x2e>
test   %rsi,%rsi
je     114e <diffVAbsoluateValDoub+0x2e>
test   %edx,%edx
jle    114e <diffVAbsoluateValDoub+0x2e>
mov    %edx,%edi
lea    -0x1(%rdi),%rdx
mov    %edi,%ecx
and    $0x3,%ecx
cmp    $0x3,%rdx
jae    116e <diffVAbsoluateValDoub+0x4e>
xorpd  %xmm0,%xmm0
xor    %edx,%edx
jmp    11d7 <diffVAbsoluateValDoub+0xb7>
lea    0xeb3(%rip),%rdi
lea    0xeed(%rip),%r8
mov    %rax,%rsi
mov    $0x65,%ecx
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret
and    $0xfffffffc,%edi
xorpd  %xmm0,%xmm0
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movsd  (%rax,%rdx,8),%xmm1
movsd  0x8(%rax,%rdx,8),%xmm2
subsd  (%rsi,%rdx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
subsd  0x8(%rsi,%rdx,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rax,%rdx,8),%xmm1
subsd  0x10(%rsi,%rdx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rax,%rdx,8),%xmm0
subsd  0x18(%rsi,%rdx,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x4,%rdx
cmp    %rdx,%rdi
jne    1180 <diffVAbsoluateValDoub+0x60>
test   %rcx,%rcx
je     120b <diffVAbsoluateValDoub+0xeb>
lea    (%rsi,%rdx,8),%rsi
lea    (%rax,%rdx,8),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rdx,8),%xmm1
subsd  (%rsi,%rdx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    11f0 <diffVAbsoluateValDoub+0xd0>
movsd  0xded(%rip),%xmm1
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
@.str = [65 x i8] c" Error in diffVAbsoluateValDoub, va:%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 double @diffVAbsoluateValDoub(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %7
store i32 0, i32* %8
%9 = load double*, double** %4
%10 = icmp ne double* %9, null
br i1 %10, label %11, label %43
11: ; preds = %3
%12 = load double*, double** %5
%13 = icmp ne double* %12, null
br i1 %13, label %14, label %43
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %43
17: ; preds = %14
store i32 0, i32* %8
br label %18
18: ; preds = %37, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = load double*, double** %4
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = fsub double %27, %32
%34 = call double @pow(double %33, double 2.000000e+00)
%35 = load double, double* %7
%36 = fadd double %34, %35
store double %36, double* %7
br label %37
37: ; preds = %22
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %18
40: ; preds = %18
%41 = load double, double* %7
%42 = call double @pow(double %41, double 5.000000e-01)
store double %42, double* %7
br label %47
43: ; preds = %14, %11, %3
%44 = load double*, double** %4
%45 = load i32, i32* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), double* %44, i32 %45, i32 101, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %43, %40
%48 = load double, double* %7
ret double %48
}

LLVM IR (-O2):
@.str = [65 x i8] c" Error in diffVAbsoluateValDoub, va:%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 double @diffVAbsoluateValDoub(double* %0, double* %1, i32 %2) {
%4 = icmp ne double* %0, null
%5 = icmp ne double* %1, null
%6 = and i1 %4, %5
%7 = icmp sgt i32 %2, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %76
9: ; preds = %3
%10 = zext i32 %2 to i64
%11 = add nsw i64 %10, -1
%12 = and i64 %10, 3
%13 = icmp ult i64 %11, 3
br i1 %13, label %54, label %14
14: ; preds = %9
%15 = and i64 %10, 4294967292
br label %16
16: ; preds = %16, %14
%17 = phi i64 [ 0, %14 ], [ %51, %16 ]
%18 = phi double [ 0.000000e+00, %14 ], [ %50, %16 ]
%19 = phi i64 [ 0, %14 ], [ %52, %16 ]
%20 = getelementptr inbounds double, double* %0, i64 %17
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %1, i64 %17
%23 = load double, double* %22
%24 = fsub double %21, %23
%25 = fmul double %24, %24
%26 = fadd double %18, %25
%27 = or i64 %17, 1
%28 = getelementptr inbounds double, double* %0, i64 %27
%29 = load double, double* %28
%30 = getelementptr inbounds double, double* %1, i64 %27
%31 = load double, double* %30
%32 = fsub double %29, %31
%33 = fmul double %32, %32
%34 = fadd double %26, %33
%35 = or i64 %17, 2
%36 = getelementptr inbounds double, double* %0, i64 %35
%37 = load double, double* %36
%38 = getelementptr inbounds double, double* %1, i64 %35
%39 = load double, double* %38
%40 = fsub double %37, %39
%41 = fmul double %40, %40
%42 = fadd double %34, %41
%43 = or i64 %17, 3
%44 = getelementptr inbounds double, double* %0, i64 %43
%45 = load double, double* %44
%46 = getelementptr inbounds double, double* %1, i64 %43
%47 = load double, double* %46
%48 = fsub double %45, %47
%49 = fmul double %48, %48
%50 = fadd double %42, %49
%51 = add nuw nsw i64 %17, 4
%52 = add i64 %19, 4
%53 = icmp eq i64 %52, %15
br i1 %53, label %54, label %16
54: ; preds = %16, %9
%55 = phi double [ undef, %9 ], [ %50, %16 ]
%56 = phi i64 [ 0, %9 ], [ %51, %16 ]
%57 = phi double [ 0.000000e+00, %9 ], [ %50, %16 ]
%58 = icmp eq i64 %12, 0
br i1 %58, label %73, label %59
59: ; preds = %54, %59
%60 = phi i64 [ %70, %59 ], [ %56, %54 ]
%61 = phi double [ %69, %59 ], [ %57, %54 ]
%62 = phi i64 [ %71, %59 ], [ 0, %54 ]
%63 = getelementptr inbounds double, double* %0, i64 %60
%64 = load double, double* %63
%65 = getelementptr inbounds double, double* %1, i64 %60
%66 = load double, double* %65
%67 = fsub double %64, %66
%68 = fmul double %67, %67
%69 = fadd double %61, %68
%70 = add nuw nsw i64 %60, 1
%71 = add i64 %62, 1
%72 = icmp eq i64 %71, %12
br i1 %72, label %73, label %59
73: ; preds = %59, %54
%74 = phi double [ %55, %54 ], [ %69, %59 ]
%75 = tail call double @pow(double %74, double 5.000000e-01)
br label %78
76: ; preds = %3
%77 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), double* %0, i32 %2, i32 101, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %78
78: ; preds = %76, %73
%79 = phi double [ %75, %73 ], [ 0.000000e+00, %76 ]
ret double %79
}