#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 */
typedef int /*<<< orphan*/ avenrun;

/* Variables and functions */
int /*<<< orphan*/ getloadavg(double *, int);
void get_load_average(float *load_1, float *load_5, float *load_15) {
  double avenrun[3];
  getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
  *load_1 = avenrun[0];
  *load_5 = avenrun[1];
  *load_15 = avenrun[2];
  return;
}


x86 assembly (clang, -O0):
<get_load_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_load_average>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
movsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r15)
movsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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