#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*/ pow(double const, int);
scalar_t__ sqrt(int /*<<< orphan*/);
void liefere_double_array_statistik_2(const double array[], int laenge,
                                      double *min_abstand,
                                      unsigned int *min_abstand_index,
                                      double *max_abstand,
                                      unsigned int *max_abstand_index) {
  int i = 0;
  *min_abstand = (double)sqrt(pow((array[i] - array[i + 1]), 2));
  *min_abstand_index = 0;
  *max_abstand = *min_abstand;
  *max_abstand_index = 0;
  double vergleich = 0;
  for (int i = 0; i < laenge; i++) {
    vergleich = (double)sqrt(pow((array[i] - array[i + 1]), 2));
    if (i + 1 < laenge) {
      if (vergleich < *min_abstand && vergleich > 0) {
        *min_abstand = vergleich;
        *min_abstand_index = i;
      }
      if (vergleich > *max_abstand && vergleich > 0) {
        *max_abstand = vergleich;
        *max_abstand_index = i;
      }
    }
  }
}


x86 assembly (clang, -O0):
<liefere_double_array_statistik_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    129d <liefere_double_array_statistik_2+0x17d>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
cmp    -0xc(%rbp),%eax
jge    128a <liefere_double_array_statistik_2+0x16a>
movsd  -0x40(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    124a <liefere_double_array_statistik_2+0x12a>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    124a <liefere_double_array_statistik_2+0x12a>
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x44(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1285 <liefere_double_array_statistik_2+0x165>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1285 <liefere_double_array_statistik_2+0x165>
movsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x44(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
jmp    128a <liefere_double_array_statistik_2+0x16a>
jmp    128f <liefere_double_array_statistik_2+0x16f>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11b6 <liefere_double_array_statistik_2+0x96>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liefere_double_array_statistik_2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%rbp
mov    %rdx,%r13
mov    %esi,%r14d
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
subsd  0x8(%rdi),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x0(%r13)
mov    %rbp,0x8(%rsp)
movl   $0x0,0x0(%rbp)
movsd  %xmm0,(%r12)
mov    %r15,0x10(%rsp)
movl   $0x0,(%r15)
test   %r14d,%r14d
jle    1213 <liefere_double_array_statistik_2+0xf3>
mov    %r14d,%ebp
xor    %r15d,%r15d
jmp    11a5 <liefere_double_array_statistik_2+0x85>
nopw   0x0(%rax,%rax,1)
cmp    %r15,%rbp
je     1213 <liefere_double_array_statistik_2+0xf3>
mov    %r15,%r14
movsd  (%rbx,%r15,8),%xmm0
add    $0x1,%r15
subsd  0x8(%rbx,%r14,8),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cmp    %rbp,%r15
jae    11a0 <liefere_double_array_statistik_2+0x80>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
test   %rax,%rax
jle    11f6 <liefere_double_array_statistik_2+0xd6>
movsd  0x0(%r13),%xmm1
ucomisd %xmm0,%xmm1
jbe    11f6 <liefere_double_array_statistik_2+0xd6>
movsd  %xmm0,0x0(%r13)
mov    0x8(%rsp),%rcx
mov    %r14d,(%rcx)
test   %rax,%rax
jle    11a0 <liefere_double_array_statistik_2+0x80>
ucomisd (%r12),%xmm0
jbe    11a0 <liefere_double_array_statistik_2+0x80>
movsd  %xmm0,(%r12)
mov    0x10(%rsp),%rax
mov    %r14d,(%rax)
jmp    11a0 <liefere_double_array_statistik_2+0x80>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @liefere_double_array_statistik_2(double* %0, i32 %1, double* %2, i32* %3, double* %4, i32* %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca double
%15 = alloca i32
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32* %3, i32** %10
store double* %4, double** %11
store i32* %5, i32** %12
store i32 0, i32* %13
%16 = load double*, double** %7
%17 = load i32, i32* %13
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load i32, i32* %13
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %21, i64 %24
%26 = load double, double* %25
%27 = fsub double %20, %26
%28 = call i32 @pow(double %27, i32 2)
%29 = call i64 @sqrt(i32 %28)
%30 = sitofp i64 %29 to double
%31 = load double*, double** %9
store double %30, double* %31
%32 = load i32*, i32** %10
store i32 0, i32* %32
%33 = load double*, double** %9
%34 = load double, double* %33
%35 = load double*, double** %11
store double %34, double* %35
%36 = load i32*, i32** %12
store i32 0, i32* %36
store double 0.000000e+00, double* %14
store i32 0, i32* %15
br label %37
37: ; preds = %89, %6
%38 = load i32, i32* %15
%39 = load i32, i32* %8
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %92
41: ; preds = %37
%42 = load double*, double** %7
%43 = load i32, i32* %15
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = load double*, double** %7
%48 = load i32, i32* %15
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %47, i64 %50
%52 = load double, double* %51
%53 = fsub double %46, %52
%54 = call i32 @pow(double %53, i32 2)
%55 = call i64 @sqrt(i32 %54)
%56 = sitofp i64 %55 to double
store double %56, double* %14
%57 = load i32, i32* %15
%58 = add nsw i32 %57, 1
%59 = load i32, i32* %8
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %88
61: ; preds = %41
%62 = load double, double* %14
%63 = load double*, double** %9
%64 = load double, double* %63
%65 = fcmp olt double %62, %64
br i1 %65, label %66, label %74
66: ; preds = %61
%67 = load double, double* %14
%68 = fcmp ogt double %67, 0.000000e+00
br i1 %68, label %69, label %74
69: ; preds = %66
%70 = load double, double* %14
%71 = load double*, double** %9
store double %70, double* %71
%72 = load i32, i32* %15
%73 = load i32*, i32** %10
store i32 %72, i32* %73
br label %74
74: ; preds = %69, %66, %61
%75 = load double, double* %14
%76 = load double*, double** %11
%77 = load double, double* %76
%78 = fcmp ogt double %75, %77
br i1 %78, label %79, label %87
79: ; preds = %74
%80 = load double, double* %14
%81 = fcmp ogt double %80, 0.000000e+00
br i1 %81, label %82, label %87
82: ; preds = %79
%83 = load double, double* %14
%84 = load double*, double** %11
store double %83, double* %84
%85 = load i32, i32* %15
%86 = load i32*, i32** %12
store i32 %85, i32* %86
br label %87
87: ; preds = %82, %79, %74
br label %88
88: ; preds = %87, %41
br label %89
89: ; preds = %88
%90 = load i32, i32* %15
%91 = add nsw i32 %90, 1
store i32 %91, i32* %15
br label %37
92: ; preds = %37
ret void
}

LLVM IR (-O2):
define void @liefere_double_array_statistik_2(double* nocapture %0, i32 %1, double* nocapture %2, i32* nocapture writeonly %3, double* nocapture %4, i32* nocapture writeonly %5) {
%7 = load double, double* %0
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fsub double %7, %9
%11 = tail call i32 @pow(double %10, i32 2)
%12 = tail call i64 @sqrt(i32 %11)
%13 = sitofp i64 %12 to double
store double %13, double* %2
store i32 0, i32* %3
store double %13, double* %4
store i32 0, i32* %5
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %18
15: ; preds = %6
%16 = zext i32 %1 to i64
%17 = zext i32 %1 to i64
br label %19
18: ; preds = %44, %6
ret void
19: ; preds = %15, %44
%20 = phi i64 [ 0, %15 ], [ %23, %44 ]
%21 = getelementptr inbounds double, double* %0, i64 %20
%22 = load double, double* %21
%23 = add nuw nsw i64 %20, 1
%24 = getelementptr inbounds double, double* %0, i64 %23
%25 = load double, double* %24
%26 = fsub double %22, %25
%27 = tail call i32 @pow(double %26, i32 2)
%28 = tail call i64 @sqrt(i32 %27)
%29 = sitofp i64 %28 to double
%30 = icmp ult i64 %23, %16
br i1 %30, label %31, label %44
31: ; preds = %19
%32 = load double, double* %2
%33 = fcmp ogt double %32, %29
%34 = icmp sgt i64 %28, 0
%35 = and i1 %34, %33
br i1 %35, label %36, label %38
36: ; preds = %31
store double %29, double* %2
%37 = trunc i64 %20 to i32
store i32 %37, i32* %3
br label %38
38: ; preds = %36, %31
%39 = load double, double* %4
%40 = fcmp olt double %39, %29
%41 = and i1 %34, %40
br i1 %41, label %42, label %44
42: ; preds = %38
store double %29, double* %4
%43 = trunc i64 %20 to i32
store i32 %43, i32* %5
br label %44
44: ; preds = %19, %42, %38
%45 = icmp eq i64 %23, %17
br i1 %45, label %18, label %19
}