#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(float);
float sin(float);
void sf_radiat(float stk, float dip, float rad[4][3]) {
  float sstk, sdip, cstk, cdip;
  stk *= 1.745329252e-2;
  dip *= 1.745329252e-2;
  sstk = sin(stk);
  cstk = cos(stk);
  sdip = sin(dip);
  cdip = cos(dip);
  rad[0][0] = -sdip;
  rad[0][1] = rad[0][0];
  rad[0][2] = 0.;
  rad[1][0] = cdip * cstk;
  rad[1][1] = rad[1][0];
  rad[1][2] = cdip * sstk;
}


x86 assembly (clang, -O0):
<sf_radiat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
movss  -0x20(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x20(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x14(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_radiat>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
cvtss2sd %xmm0,%xmm0
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm3
movss  %xmm3,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movaps %xmm3,%xmm0
call   1030 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0x4(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movaps 0x10(%rsp),%xmm1
xorps  0xe73(%rip),%xmm1
movss  %xmm1,(%rbx)
movss  %xmm1,0x4(%rbx)
movl   $0x0,0x8(%rbx)
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rbx)
movss  %xmm1,0x10(%rbx)
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x14(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

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

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