#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*/ bot_quat_to_matrix(double const *, double *);
int bot_quat_pos_to_matrix(const double quat[4], const double pos[3],
                           double mat[16]) {
  double rot[9];
  bot_quat_to_matrix(quat, rot);
  mat[0] = rot[0];
  mat[1] = rot[1];
  mat[2] = rot[2];
  mat[3] = pos[0];
  mat[4] = rot[3];
  mat[5] = rot[4];
  mat[6] = rot[5];
  mat[7] = pos[1];
  mat[8] = rot[6];
  mat[9] = rot[7];
  mat[10] = rot[8];
  mat[11] = pos[2];
  mat[12] = 0;
  mat[13] = 0;
  mat[14] = 0;
  mat[15] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<bot_quat_pos_to_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <bot_quat_to_matrix@plt>
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x58(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x68(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x70(%rax)
mov    -0x18(%rbp),%rax
movsd  0xded(%rip),%xmm0
movsd  %xmm0,0x78(%rax)
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_quat_pos_to_matrix>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rsp,%rsi
call   1030 <bot_quat_to_matrix@plt>
movaps (%rsp),%xmm0
movups %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,0x18(%rbx)
movups 0x18(%rsp),%xmm0
movups %xmm0,0x20(%rbx)
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x30(%rbx)
movsd  0x8(%r14),%xmm0
movsd  %xmm0,0x38(%rbx)
movaps 0x30(%rsp),%xmm0
movups %xmm0,0x40(%rbx)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x50(%rbx)
movsd  0x10(%r14),%xmm0
movsd  %xmm0,0x58(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x60(%rbx)
movq   $0x0,0x70(%rbx)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x78(%rbx)
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @bot_quat_pos_to_matrix(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [9 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%10 = call i32 @bot_quat_to_matrix(double* %8, double* %9)
%11 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
store double %12, double* %14
%15 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 1
%16 = load double, double* %15
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 2
%20 = load double, double* %19
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
%23 = load double*, double** %5
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 3
store double %25, double* %27
%28 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 3
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 4
store double %29, double* %31
%32 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 4
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 5
store double %33, double* %35
%36 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 5
%37 = load double, double* %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 6
store double %37, double* %39
%40 = load double*, double** %5
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = load double*, double** %6
%44 = getelementptr inbounds double, double* %43, i64 7
store double %42, double* %44
%45 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 6
%46 = load double, double* %45
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i64 8
store double %46, double* %48
%49 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 7
%50 = load double, double* %49
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 9
store double %50, double* %52
%53 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 8
%54 = load double, double* %53
%55 = load double*, double** %6
%56 = getelementptr inbounds double, double* %55, i64 10
store double %54, double* %56
%57 = load double*, double** %5
%58 = getelementptr inbounds double, double* %57, i64 2
%59 = load double, double* %58
%60 = load double*, double** %6
%61 = getelementptr inbounds double, double* %60, i64 11
store double %59, double* %61
%62 = load double*, double** %6
%63 = getelementptr inbounds double, double* %62, i64 12
store double 0.000000e+00, double* %63
%64 = load double*, double** %6
%65 = getelementptr inbounds double, double* %64, i64 13
store double 0.000000e+00, double* %65
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 14
store double 0.000000e+00, double* %67
%68 = load double*, double** %6
%69 = getelementptr inbounds double, double* %68, i64 15
store double 1.000000e+00, double* %69
ret i32 0
}

LLVM IR (-O2):
define i32 @bot_quat_pos_to_matrix(double* %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @bot_quat_to_matrix(double* %0, double* %6)
%8 = bitcast [9 x double]* %4 to <2 x double>*
%9 = load <2 x double>, <2 x double>* %8
%10 = bitcast double* %2 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
%11 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %2, i64 2
store double %12, double* %13
%14 = load double, double* %1
%15 = getelementptr inbounds double, double* %2, i64 3
store double %14, double* %15
%16 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 3
%17 = getelementptr inbounds double, double* %2, i64 4
%18 = bitcast double* %16 to <2 x double>*
%19 = load <2 x double>, <2 x double>* %18
%20 = bitcast double* %17 to <2 x double>*
store <2 x double> %19, <2 x double>* %20
%21 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 5
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %2, i64 6
store double %22, double* %23
%24 = getelementptr inbounds double, double* %1, i64 1
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %2, i64 7
store double %25, double* %26
%27 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 6
%28 = getelementptr inbounds double, double* %2, i64 8
%29 = bitcast double* %27 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = bitcast double* %28 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 8
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %2, i64 10
store double %33, double* %34
%35 = getelementptr inbounds double, double* %1, i64 2
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %2, i64 11
store double %36, double* %37
%38 = getelementptr inbounds double, double* %2, i64 12
%39 = getelementptr inbounds double, double* %2, i64 15
%40 = bitcast double* %38 to i8*
store double 1.000000e+00, double* %39
ret i32 0
}