#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*/ sla_dcs2c_(double *, double *, double *);
void slaDcs2c(double a, double b, double v[3]) {
  double A;
  double B;
  double V[3];
  int i;
  A = a;
  B = b;
  sla_dcs2c_(&A, &B, (double *)V);
  for (i = 0; i < 3; i++)
    v[i] = V[i];
}


x86 assembly (clang, -O0):
<slaDcs2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x40(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <sla_dcs2c_@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    1181 <slaDcs2c+0x71>
movslq -0x44(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1152 <slaDcs2c+0x42>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDcs2c>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
lea    0x10(%rsp),%rdx
call   1030 <sla_dcs2c_@plt>
movaps 0x10(%rsp),%xmm0
movups %xmm0,(%rbx)
mov    0x20(%rsp),%rax
mov    %rax,0x10(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @slaDcs2c(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca [3 x double]
%10 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%11 = load double, double* %4
store double %11, double* %7
%12 = load double, double* %5
store double %12, double* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%14 = call i32 @sla_dcs2c_(double* %7, double* %8, double* %13)
store i32 0, i32* %10
br label %15
15: ; preds = %27, %3
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %30
18: ; preds = %15
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %6
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
br label %27
27: ; preds = %18
%28 = load i32, i32* %10
%29 = add nsw i32 %28, 1
store i32 %29, i32* %10
br label %15
30: ; preds = %15
ret void
}

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