#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 */
scalar_t__ cos(double const);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
scalar_t__ sin(double const);
void doubles_xyt_to_mat44(const double xyt[3], double r[16]) {
  double s = (double)sin(xyt[2]), c = (double)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>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1050 <cos@plt>
cvtsi2sd %rax,%xmm0
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  0xe03(%rip),%xmm0
movsd  %xmm0,0x50(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdf2(%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>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x10(%r14),%xmm0
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
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 0xe72(%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 i64 @sin(double %9)
%11 = sitofp i64 %10 to double
store double %11, double* %5
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i64 @cos(double %14)
%16 = sitofp i64 %15 to double
store double %16, double* %6
%17 = load double*, double** %4
%18 = call i32 @memset(double* %17, i32 0, i32 128)
%19 = load double, double* %6
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 0
store double %19, double* %21
%22 = load double, double* %5
%23 = fneg double %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
store double %23, double* %25
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 3
store double %28, double* %30
%31 = load double, double* %5
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 4
store double %31, double* %33
%34 = load double, double* %6
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i64 5
store double %34, double* %36
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 7
store double %39, double* %41
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 10
store double 1.000000e+00, double* %43
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 15
store double 1.000000e+00, double* %45
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 i64 @sin(double %4)
%6 = sitofp i64 %5 to double
%7 = load double, double* %3
%8 = tail call i64 @cos(double %7)
%9 = sitofp i64 %8 to double
%10 = tail call i32 @memset(double* %1, i32 0, i32 128)
store double %9, double* %1
%11 = fneg double %6
%12 = getelementptr inbounds double, double* %1, i64 1
store double %11, double* %12
%13 = load double, double* %0
%14 = getelementptr inbounds double, double* %1, i64 3
store double %13, double* %14
%15 = getelementptr inbounds double, double* %1, i64 4
store double %6, double* %15
%16 = getelementptr inbounds double, double* %1, i64 5
store double %9, double* %16
%17 = getelementptr inbounds double, double* %0, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %1, i64 7
store double %18, double* %19
%20 = getelementptr inbounds double, double* %1, i64 10
store double 1.000000e+00, double* %20
%21 = getelementptr inbounds double, double* %1, i64 15
store double 1.000000e+00, double* %21
ret void
}