#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*/ printf(char *, double, double, double, double, double);
int /*<<< orphan*/ ranvec_(double *, int *);
int main() {
  int n = 5;
  double a[5];
  ranvec_(a, &n);
  printf("a = %f, %f, %f, %f, %f\n", a[0], a[1], a[2], a[3], a[4]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <ranvec_@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movl   $0x5,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <ranvec_@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"a = %f, %f, %f, %f, %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x double]
store i32 0, i32* %1
store i32 5, i32* %2
%4 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%5 = call i32 @ranvec_(double* %4, i32* %2)
%6 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%7 = load double, double* %6
%8 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 3
%13 = load double, double* %12
%14 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %7, double %9, double %11, double %13, double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"a = %f, %f, %f, %f, %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x double]
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast [5 x double]* %2 to i8*
%5 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%6 = call i32 @ranvec_(double* %5, i32* %1)
%7 = load double, double* %5
%8 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 3
%13 = load double, double* %12
%14 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 4
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %7, double %9, double %11, double %13, double %15)
ret i32 0
}