#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*/ calculate_treshold(double *, int);
void update_search_speed(double sensor_value[8], int distance_threshold) {
  double sensors[4] = {sensor_value[6], sensor_value[7], sensor_value[0],
                       sensor_value[1]};
  calculate_treshold(sensors, distance_threshold);
}


x86 assembly (clang, -O0):
<update_search_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <calculate_treshold@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_search_speed>:
sub    $0x28,%rsp
movups 0x30(%rdi),%xmm0
movaps %xmm0,(%rsp)
movups (%rdi),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <calculate_treshold@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @update_search_speed(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca [4 x double]
store double* %0, double** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 6
%9 = load double, double* %8
store double %9, double* %6
%10 = getelementptr inbounds double, double* %6, i64 1
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 7
%13 = load double, double* %12
store double %13, double* %10
%14 = getelementptr inbounds double, double* %10, i64 1
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
store double %17, double* %14
%18 = getelementptr inbounds double, double* %14, i64 1
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
store double %21, double* %18
%22 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%23 = load i32, i32* %4
%24 = call i32 @calculate_treshold(double* %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @update_search_speed(double* nocapture %0, i32 %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = getelementptr inbounds double, double* %0, i64 6
%7 = bitcast double* %6 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = bitcast [4 x double]* %3 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%11 = bitcast double* %0 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = bitcast double* %10 to <2 x double>*
store <2 x double> %12, <2 x double>* %13
%14 = call i32 @calculate_treshold(double* %5, i32 %1)
ret void
}