#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 cosf(float);
int /*<<< orphan*/ m3f_copy_m3fo(float *, float *);
int sinf(float);
void m3f_fill_rotx_m3fo(float rx, float *result) {
  float m[] = {
      1, 0, 0, 0, cosf(rx), -sinf(rx), 0, sinf(rx), cosf(rx),
  };
  m3f_copy_m3fo(m, result);
}


x86 assembly (clang, -O0):
<m3f_fill_rotx_m3fo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <m3f_copy_m3fo@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3f_fill_rotx_m3fo>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
movss  0xeba(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x24(%rsp)
movl   $0x0,0x28(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x30(%rsp)
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <m3f_copy_m3fo@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @m3f_fill_rotx_m3fo(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca [9 x float]
store float %0, float* %3
store float* %1, float** %4
%6 = getelementptr inbounds [9 x float], [9 x float]* %5, i64 0, i64 0
store float 1.000000e+00, float* %6
%7 = getelementptr inbounds float, float* %6, i64 1
store float 0.000000e+00, float* %7
%8 = getelementptr inbounds float, float* %7, i64 1
store float 0.000000e+00, float* %8
%9 = getelementptr inbounds float, float* %8, i64 1
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %3
%12 = call i32 @cosf(float %11)
%13 = sitofp i32 %12 to float
store float %13, float* %10
%14 = getelementptr inbounds float, float* %10, i64 1
%15 = load float, float* %3
%16 = call i32 @sinf(float %15)
%17 = sub nsw i32 0, %16
%18 = sitofp i32 %17 to float
store float %18, float* %14
%19 = getelementptr inbounds float, float* %14, i64 1
store float 0.000000e+00, float* %19
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %3
%22 = call i32 @sinf(float %21)
%23 = sitofp i32 %22 to float
store float %23, float* %20
%24 = getelementptr inbounds float, float* %20, i64 1
%25 = load float, float* %3
%26 = call i32 @cosf(float %25)
%27 = sitofp i32 %26 to float
store float %27, float* %24
%28 = getelementptr inbounds [9 x float], [9 x float]* %5, i64 0, i64 0
%29 = load float*, float** %4
%30 = call i32 @m3f_copy_m3fo(float* %28, float* %29)
ret void
}

LLVM IR (-O2):
define void @m3f_fill_rotx_m3fo(float %0, float* %1) {
%3 = alloca [9 x float]
%4 = bitcast [9 x float]* %3 to i8*
%5 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 0
%6 = bitcast [9 x float]* %3 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %6
%7 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 4
%8 = tail call i32 @cosf(float %0)
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 5
%11 = tail call i32 @sinf(float %0)
%12 = sub nsw i32 0, %11
%13 = sitofp i32 %12 to float
store float %13, float* %10
%14 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 6
store float 0.000000e+00, float* %14
%15 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 7
%16 = tail call i32 @sinf(float %0)
%17 = sitofp i32 %16 to float
store float %17, float* %15
%18 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 8
%19 = tail call i32 @cosf(float %0)
%20 = sitofp i32 %19 to float
store float %20, float* %18
%21 = call i32 @m3f_copy_m3fo(float* %5, float* %1)
ret void
}