#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*/ normvec3i(double *, int, int, int, double *);
void normvec(double *vertex, int v1, int v2, int v3, double *px, double *py,
             double *pz) {
  double v[3];
  normvec3i(vertex, v1, v2, v3, v);
  *px = v[0];
  *py = v[1];
  *pz = v[2];
}


x86 assembly (clang, -O0):
<normvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    -0x40(%rbp),%r8
call   1030 <normvec3i@plt>
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normvec>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    0x40(%rsp),%r15
mov    %rsp,%r8
call   1030 <normvec3i@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r15)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @normvec(double* %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, double* %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca [3 x double]
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%16 = load double*, double** %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%21 = call i32 @normvec3i(double* %16, i32 %17, i32 %18, i32 %19, double* %20)
%22 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%23 = load double, double* %22
%24 = load double*, double** %12
store double %23, double* %24
%25 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 1
%26 = load double, double* %25
%27 = load double*, double** %13
store double %26, double* %27
%28 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 2
%29 = load double, double* %28
%30 = load double*, double** %14
store double %29, double* %30
ret void
}

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