#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__ cosf(float);
scalar_t__ sinf(float);
void RneFromLLA(float LLA[3], float Rne[3][3]) {
  float sinLat, sinLon, cosLat, cosLon;
  sinLat = (float)sinf((3.14159265358979323846f / 180.0f) * LLA[0]);
  sinLon = (float)sinf((3.14159265358979323846f / 180.0f) * LLA[1]);
  cosLat = (float)cosf((3.14159265358979323846f / 180.0f) * LLA[0]);
  cosLon = (float)cosf((3.14159265358979323846f / 180.0f) * LLA[1]);
  Rne[0][0] = -sinLat * cosLon;
  Rne[0][1] = -sinLat * sinLon;
  Rne[0][2] = cosLat;
  Rne[1][0] = -sinLon;
  Rne[1][1] = cosLon;
  Rne[1][2] = 0;
  Rne[2][0] = -cosLat * cosLon;
  Rne[2][1] = -cosLat * sinLon;
  Rne[2][2] = -sinLat;
}


x86 assembly (clang, -O0):
<RneFromLLA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0xec4(%rip),%xmm0
mulss  (%rax),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0xea5(%rip),%xmm0
mulss  0x4(%rax),%xmm0
call   1030 <sinf@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0xe85(%rip),%xmm0
mulss  (%rax),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  0xe66(%rip),%xmm0
mulss  0x4(%rax),%xmm0
call   1040 <cosf@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x1c(%rax)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x20(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RneFromLLA>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rdi),%xmm0
mulss  0xec7(%rip),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps %xmm0,0x20(%rsp)
movss  0x4(%r14),%xmm0
mulss  0xea7(%rip),%xmm0
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps %xmm0,0x10(%rsp)
movss  (%r14),%xmm0
mulss  0xe88(%rip),%xmm0
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps %xmm0,(%rsp)
movss  0xe6f(%rip),%xmm0
mulss  0x4(%r14),%xmm0
call   1040 <cosf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps 0xe65(%rip),%xmm1
movaps 0x20(%rsp),%xmm3
xorps  %xmm1,%xmm3
movaps %xmm3,%xmm2
mulss  %xmm0,%xmm2
movss  %xmm2,(%rbx)
movaps %xmm3,%xmm2
movaps 0x10(%rsp),%xmm4
mulss  %xmm4,%xmm2
movss  %xmm2,0x4(%rbx)
movaps (%rsp),%xmm5
movss  %xmm5,0x8(%rbx)
movaps %xmm4,%xmm2
xorps  %xmm1,%xmm2
movss  %xmm2,0xc(%rbx)
movss  %xmm0,0x10(%rbx)
movl   $0x0,0x14(%rbx)
movaps %xmm5,%xmm2
xorps  %xmm1,%xmm2
mulss  %xmm2,%xmm0
movss  %xmm0,0x18(%rbx)
mulss  %xmm4,%xmm2
movss  %xmm2,0x1c(%rbx)
movss  %xmm3,0x20(%rbx)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @RneFromLLA(float* %0, [3 x float]* %1) {
%3 = alloca float*
%4 = alloca [3 x float]*
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %3
store [3 x float]* %1, [3 x float]** %4
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = fmul float 0x3F91DF46A0000000, %11
%13 = call i64 @sinf(float %12)
%14 = sitofp i64 %13 to float
store float %14, float* %5
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fmul float 0x3F91DF46A0000000, %17
%19 = call i64 @sinf(float %18)
%20 = sitofp i64 %19 to float
store float %20, float* %6
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 0
%23 = load float, float* %22
%24 = fmul float 0x3F91DF46A0000000, %23
%25 = call i64 @cosf(float %24)
%26 = sitofp i64 %25 to float
store float %26, float* %7
%27 = load float*, float** %3
%28 = getelementptr inbounds float, float* %27, i64 1
%29 = load float, float* %28
%30 = fmul float 0x3F91DF46A0000000, %29
%31 = call i64 @cosf(float %30)
%32 = sitofp i64 %31 to float
store float %32, float* %8
%33 = load float, float* %5
%34 = fneg float %33
%35 = load float, float* %8
%36 = fmul float %34, %35
%37 = load [3 x float]*, [3 x float]** %4
%38 = getelementptr inbounds [3 x float], [3 x float]* %37, i64 0
%39 = getelementptr inbounds [3 x float], [3 x float]* %38, i64 0, i64 0
store float %36, float* %39
%40 = load float, float* %5
%41 = fneg float %40
%42 = load float, float* %6
%43 = fmul float %41, %42
%44 = load [3 x float]*, [3 x float]** %4
%45 = getelementptr inbounds [3 x float], [3 x float]* %44, i64 0
%46 = getelementptr inbounds [3 x float], [3 x float]* %45, i64 0, i64 1
store float %43, float* %46
%47 = load float, float* %7
%48 = load [3 x float]*, [3 x float]** %4
%49 = getelementptr inbounds [3 x float], [3 x float]* %48, i64 0
%50 = getelementptr inbounds [3 x float], [3 x float]* %49, i64 0, i64 2
store float %47, float* %50
%51 = load float, float* %6
%52 = fneg float %51
%53 = load [3 x float]*, [3 x float]** %4
%54 = getelementptr inbounds [3 x float], [3 x float]* %53, i64 1
%55 = getelementptr inbounds [3 x float], [3 x float]* %54, i64 0, i64 0
store float %52, float* %55
%56 = load float, float* %8
%57 = load [3 x float]*, [3 x float]** %4
%58 = getelementptr inbounds [3 x float], [3 x float]* %57, i64 1
%59 = getelementptr inbounds [3 x float], [3 x float]* %58, i64 0, i64 1
store float %56, float* %59
%60 = load [3 x float]*, [3 x float]** %4
%61 = getelementptr inbounds [3 x float], [3 x float]* %60, i64 1
%62 = getelementptr inbounds [3 x float], [3 x float]* %61, i64 0, i64 2
store float 0.000000e+00, float* %62
%63 = load float, float* %7
%64 = fneg float %63
%65 = load float, float* %8
%66 = fmul float %64, %65
%67 = load [3 x float]*, [3 x float]** %4
%68 = getelementptr inbounds [3 x float], [3 x float]* %67, i64 2
%69 = getelementptr inbounds [3 x float], [3 x float]* %68, i64 0, i64 0
store float %66, float* %69
%70 = load float, float* %7
%71 = fneg float %70
%72 = load float, float* %6
%73 = fmul float %71, %72
%74 = load [3 x float]*, [3 x float]** %4
%75 = getelementptr inbounds [3 x float], [3 x float]* %74, i64 2
%76 = getelementptr inbounds [3 x float], [3 x float]* %75, i64 0, i64 1
store float %73, float* %76
%77 = load float, float* %5
%78 = fneg float %77
%79 = load [3 x float]*, [3 x float]** %4
%80 = getelementptr inbounds [3 x float], [3 x float]* %79, i64 2
%81 = getelementptr inbounds [3 x float], [3 x float]* %80, i64 0, i64 2
store float %78, float* %81
ret void
}

LLVM IR (-O2):
define void @RneFromLLA(float* nocapture %0, [3 x float]* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fmul float %3, 0x3F91DF46A0000000
%5 = tail call i64 @sinf(float %4)
%6 = sitofp i64 %5 to float
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = fmul float %8, 0x3F91DF46A0000000
%10 = tail call i64 @sinf(float %9)
%11 = sitofp i64 %10 to float
%12 = load float, float* %0
%13 = fmul float %12, 0x3F91DF46A0000000
%14 = tail call i64 @cosf(float %13)
%15 = sitofp i64 %14 to float
%16 = load float, float* %7
%17 = fmul float %16, 0x3F91DF46A0000000
%18 = tail call i64 @cosf(float %17)
%19 = sitofp i64 %18 to float
%20 = fneg float %6
%21 = fmul float %20, %19
%22 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
store float %21, float* %22
%23 = fmul float %20, %11
%24 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
store float %23, float* %24
%25 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
store float %15, float* %25
%26 = fneg float %11
%27 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 1, i64 0
store float %26, float* %27
%28 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 1, i64 1
store float %19, float* %28
%29 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 1, i64 2
store float 0.000000e+00, float* %29
%30 = fneg float %15
%31 = fmul float %30, %19
%32 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 2, i64 0
store float %31, float* %32
%33 = fmul float %11, %30
%34 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 2, i64 1
store float %33, float* %34
%35 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 2, i64 2
store float %20, float* %35
ret void
}