#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 */
float cos(double);
float sin(double);
void Rx(float theta, float out[4][4]) {
  double theta_rads = theta * (3.14159265 / 180.0);
  out[0][0] = 1;
  out[0][1] = 0;
  out[0][2] = 0;
  out[0][3] = 0;
  out[1][0] = 0;
  out[1][1] = cos(theta_rads);
  out[1][2] = -sin(theta_rads);
  out[1][3] = 0;
  out[2][0] = 0;
  out[2][1] = sin(theta_rads);
  out[2][2] = cos(theta_rads);
  out[2][3] = 0;
  out[3][0] = 0;
  out[3][1] = 0;
  out[3][2] = 0;
  out[3][3] = 1;
}


x86 assembly (clang, -O0):
<Rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  0xea9(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x24(%rax)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x34(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movss  0xdc8(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rx>:
push   %rbx
sub    $0x10,%rsp
cvtss2sd %xmm0,%xmm0
mulsd  0xecf(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
movl   $0x3f800000,(%rdi)
xorps  %xmm1,%xmm1
movups %xmm1,0x4(%rdi)
call   1040 <cos@plt>
movss  %xmm0,0x14(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
xorps  0xead(%rip),%xmm0
movss  %xmm0,0x18(%rbx)
movq   $0x0,0x1c(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,0x24(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0x28(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rbx)
movl   $0x3f800000,0x3c(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Rx(float %0, [4 x float]* nocapture writeonly %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x3F91DF46A1FAE712
%5 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 0
store float 1.000000e+00, float* %5
%6 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 1
%7 = bitcast float* %6 to i8*
%8 = tail call float @cos(double %4)
%9 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 1, i64 1
store float %8, float* %9
%10 = tail call float @sin(double %4)
%11 = fneg float %10
%12 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 1, i64 2
store float %11, float* %12
%13 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 1, i64 3
store float 0.000000e+00, float* %13
%14 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 2, i64 0
store float 0.000000e+00, float* %14
%15 = tail call float @sin(double %4)
%16 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 2, i64 1
store float %15, float* %16
%17 = tail call float @cos(double %4)
%18 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 2, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 2, i64 3
%20 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 3, i64 3
%21 = bitcast float* %19 to i8*
store float 1.000000e+00, float* %20
ret void
}