#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 */
double cos(double const);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
double sin(double const);
void doubles_xyt_to_mat44(const double xyt[3], double r[16]) {
  double s = sin(xyt[2]), c = cos(xyt[2]);
  memset(r, 0, sizeof(double) * 16);
  r[0] = c;
  r[1] = -s;
  r[3] = xyt[0];
  r[4] = s;
  r[5] = c;
  r[7] = xyt[1];
  r[10] = 1;
  r[15] = 1;
}


x86 assembly (clang, -O0):
<doubles_xyt_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe0d(%rip),%xmm0
movsd  %xmm0,0x50(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdfc(%rip),%xmm0
movsd  %xmm0,0x78(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_xyt_to_mat44>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  0x10(%rdi),%xmm0
call   1040 <sin@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x10(%r14),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm2,(%rbx)
movaps 0xe83(%rip),%xmm0
movaps 0x10(%rsp),%xmm1
xorps  %xmm1,%xmm0
movlps %xmm0,0x8(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  %xmm1,0x20(%rbx)
movsd  %xmm2,0x28(%rbx)
movsd  0x8(%r14),%xmm0
movsd  %xmm0,0x38(%rbx)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x50(%rbx)
mov    %rax,0x78(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @doubles_xyt_to_mat44(double* nocapture %0, double* %1) {
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = load double, double* %3
%5 = tail call double @sin(double %4)
%6 = load double, double* %3
%7 = tail call double @cos(double %6)
%8 = tail call i32 @memset(double* %1, i32 0, i32 128)
store double %7, double* %1
%9 = fneg double %5
%10 = getelementptr inbounds double, double* %1, i64 1
store double %9, double* %10
%11 = load double, double* %0
%12 = getelementptr inbounds double, double* %1, i64 3
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 4
store double %5, double* %13
%14 = getelementptr inbounds double, double* %1, i64 5
store double %7, double* %14
%15 = getelementptr inbounds double, double* %0, i64 1
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %1, i64 7
store double %16, double* %17
%18 = getelementptr inbounds double, double* %1, i64 10
store double 1.000000e+00, double* %18
%19 = getelementptr inbounds double, double* %1, i64 15
store double 1.000000e+00, double* %19
ret void
}