#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*/ dscal_(int *, double *, double *, int *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int i, n, one;
  double coefficient;
  double x[] = {1, 1, 1};
  coefficient = 4.323;
  one = 1;
  n = 3;
  dscal_(&n, &coefficient, &x[0], &one);
  for (i = 0; i < 3; ++i)
    printf("%f\n", x[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
lea    -0x30(%rbp),%rdx
lea    -0xc(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rcx
call   1040 <dscal_@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11b5 <main+0x95>
movslq -0x8(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1187 <main+0x67>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x40114ac083126e98,%rax
4a 11 40
mov    %rax,0x28(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x3,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x28(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <dscal_@plt>
movsd  0x10(%rsp),%xmm0
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [3 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca [3 x double]
store i32 0, i32* %1
%7 = bitcast [3 x double]* %6 to i8*
store double 4.323000e+00, double* %5
store i32 1, i32* %4
store i32 3, i32* %3
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%9 = call i32 @dscal_(i32* %3, double* %5, double* %8, i32* %4)
store i32 0, i32* %2
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %15
%17 = load double, double* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %10
22: ; preds = %10
ret i32 0
}

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