#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(float const);
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
scalar_t__ sin(float const);
void floats_xyt_to_mat44(const float xyt[3], float r[16]) {
  float s = (float)sin(xyt[2]), c = (float)cos(xyt[2]);
  memset(r, 0, sizeof(float) * 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):
<floats_xyt_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1040 <sin@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1050 <cos@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x10(%rbp),%rax
movss  0xe0d(%rip),%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
movss  0xdfc(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_xyt_to_mat44>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movss  0x8(%rdi),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps %xmm0,0x10(%rsp)
movss  0x8(%r14),%xmm0
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movss  0xc(%rsp),%xmm2
movss  %xmm2,(%rbx)
movaps 0xe73(%rip),%xmm0
movaps 0x10(%rsp),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rbx)
movss  (%r14),%xmm0
movss  %xmm0,0xc(%rbx)
movss  %xmm1,0x10(%rbx)
movss  %xmm2,0x14(%rbx)
movss  0x4(%r14),%xmm0
movss  %xmm0,0x1c(%rbx)
movl   $0x3f800000,0x28(%rbx)
movl   $0x3f800000,0x3c(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

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