#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*/ mat4d_lookatVec_new(double *, double *, double *, double *);
int /*<<< orphan*/ vec3d_set(double *, double, double, double);
void mat4d_lookat_new(double result[16], double eyeX, double eyeY, double eyeZ,
                      double centerX, double centerY, double centerZ,
                      double upX, double upY, double upZ) {
  double eye[3], center[3], up[3];
  vec3d_set(eye, eyeX, eyeY, eyeZ);
  vec3d_set(center, centerX, centerY, centerZ);
  vec3d_set(up, upX, upY, upZ);
  mat4d_lookatVec_new(result, eye, center, up);
}


x86 assembly (clang, -O0):
<mat4d_lookat_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  0x10(%rbp),%xmm8
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
lea    -0x60(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <vec3d_set@plt>
lea    -0x80(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1040 <vec3d_set@plt>
lea    -0xa0(%rbp),%rdi
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0x10(%rbp),%xmm2
call   1040 <vec3d_set@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
call   1030 <mat4d_lookatVec_new@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_lookat_new>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
movsd  %xmm7,0x28(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
mov    %rdi,%r12
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1040 <vec3d_set@plt>
lea    0x50(%rsp),%r15
mov    %r15,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1040 <vec3d_set@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0xb0(%rsp),%xmm2
call   1040 <vec3d_set@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1030 <mat4d_lookatVec_new@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mat4d_lookat_new(double* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = alloca double*
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca [3 x double]
%22 = alloca [3 x double]
%23 = alloca [3 x double]
store double* %0, double** %11
store double %1, double* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store double %7, double* %18
store double %8, double* %19
store double %9, double* %20
%24 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 0
%25 = load double, double* %12
%26 = load double, double* %13
%27 = load double, double* %14
%28 = call i32 @vec3d_set(double* %24, double %25, double %26, double %27)
%29 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%30 = load double, double* %15
%31 = load double, double* %16
%32 = load double, double* %17
%33 = call i32 @vec3d_set(double* %29, double %30, double %31, double %32)
%34 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 0
%35 = load double, double* %18
%36 = load double, double* %19
%37 = load double, double* %20
%38 = call i32 @vec3d_set(double* %34, double %35, double %36, double %37)
%39 = load double*, double** %11
%40 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 0
%41 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%42 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 0
%43 = call i32 @mat4d_lookatVec_new(double* %39, double* %40, double* %41, double* %42)
ret void
}

LLVM IR (-O2):
define void @mat4d_lookat_new(double* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) {
%11 = alloca [3 x double]
%12 = alloca [3 x double]
%13 = alloca [3 x double]
%14 = bitcast [3 x double]* %11 to i8*
%15 = bitcast [3 x double]* %12 to i8*
%16 = bitcast [3 x double]* %13 to i8*
%17 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%18 = call i32 @vec3d_set(double* %17, double %1, double %2, double %3)
%19 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%20 = call i32 @vec3d_set(double* %19, double %4, double %5, double %6)
%21 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%22 = call i32 @vec3d_set(double* %21, double %7, double %8, double %9)
%23 = call i32 @mat4d_lookatVec_new(double* %0, double* %17, double* %19, double* %21)
ret void
}