#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_dvn_(double *, double *, double *);
void slaDvn(double v[3], double uv[3], double *vm) {
  double V[3];
  double UV[3];
  double VM;
  int i;
  for (i = 0; i < 3; i++)
    V[i] = v[i];
  sla_dvn_((double *)V, (double *)UV, &VM);
  for (i = 0; i < 3; i++)
    uv[i] = UV[i];
  *vm = VM;
}


x86 assembly (clang, -O0):
<slaDvn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x3,-0x5c(%rbp)
jge    115a <slaDvn+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x5c(%rbp),%rax
movsd  %xmm0,-0x30(%rbp,%rax,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    112b <slaDvn+0x1b>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1030 <sla_dvn_@plt>
movl   $0x0,-0x5c(%rbp)
cmpl   $0x3,-0x5c(%rbp)
jge    11a1 <slaDvn+0x91>
movslq -0x5c(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1172 <slaDvn+0x62>
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @slaDvn(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = alloca double
%10 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
store i32 0, i32* %10
br label %11
11: ; preds = %23, %3
%12 = load i32, i32* %10
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load double*, double** %4
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 %21
store double %19, double* %22
br label %23
23: ; preds = %14
%24 = load i32, i32* %10
%25 = add nsw i32 %24, 1
store i32 %25, i32* %10
br label %11
26: ; preds = %11
%27 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%28 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%29 = call i32 @sla_dvn_(double* %27, double* %28, double* %9)
store i32 0, i32* %10
br label %30
30: ; preds = %42, %26
%31 = load i32, i32* %10
%32 = icmp slt i32 %31, 3
br i1 %32, label %33, label %45
33: ; preds = %30
%34 = load i32, i32* %10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %5
%39 = load i32, i32* %10
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double %37, double* %41
br label %42
42: ; preds = %33
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %30
45: ; preds = %30
%46 = load double, double* %9
%47 = load double*, double** %6
store double %46, double* %47
ret void
}

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