void get_load_values(double *v1, double *v2, double *v3) {
  double loadavg[3];
  if (getloadavg(loadavg, 3) == -1) {
    error_exit_(
        1, 0,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/utils.c",
        __PRETTY_FUNCTION__, 122, "getloadavg() failed\n");
  }
  *v1 = loadavg[0];
  *v2 = loadavg[1];
  *v3 = loadavg[2];
}


x86 assembly (clang, -O0):
<get_load_values>:
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
mov    $0x0,%al
call   1030 <getloadavg@plt>
cmp    $0xffffffff,%eax
jne    1176 <get_load_values+0x56>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xea5(%rip),%rdx
lea    0xf23(%rip),%rcx
mov    $0x7a,%r8d
lea    0xf49(%rip),%r9
mov    $0x0,%al
call   1040 <error_exit_@plt>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_load_values>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <getloadavg@plt>
cmp    $0xffffffff,%eax
jne    116f <get_load_values+0x4f>
lea    0xeb3(%rip),%rdx
lea    0xf31(%rip),%rcx
lea    0xf5d(%rip),%r9
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x7a,%r8d
xor    %eax,%eax
call   1040 <error_exit_@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/utils.c\00"
@__PRETTY_FUNCTION__.get_load_values = [51 x i8] c"void get_load_values(double *, double *, double *)\00"
@.str.1 = [21 x i8] c"getloadavg() failed\0A\00"
define void @get_load_values(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%9 = call i32 (double*, i32, ...) bitcast (i32 (...)* @getloadavg to i32 (double*, i32, ...)*)(double* %8, i32 3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i32, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error_exit_ to i32 (i32, i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i32 0, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__PRETTY_FUNCTION__.get_load_values, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%15 = load double, double* %14
%16 = load double*, double** %4
store double %15, double* %16
%17 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
store double %18, double* %19
%20 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%21 = load double, double* %20
%22 = load double*, double** %6
store double %21, double* %22
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/flok99/multitail/refs/heads/master/utils.c\00"
@__PRETTY_FUNCTION__.get_load_values = [51 x i8] c"void get_load_values(double *, double *, double *)\00"
@.str.1 = [21 x i8] c"getloadavg() failed\0A\00"
define void @get_load_values(double* nocapture writeonly %0, double* nocapture writeonly %1, double* 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 (double*, i32, ...) bitcast (i32 (...)* @getloadavg to i32 (double*, i32, ...)*)(double* %6, i32 3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (i32, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error_exit_ to i32 (i32, i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i32 0, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__PRETTY_FUNCTION__.get_load_values, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = load double, double* %6
store double %12, double* %0
%13 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%14 = load double, double* %13
store double %14, double* %1
%15 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%16 = load double, double* %15
store double %16, double* %2
ret void
}