#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__ asin(float);
scalar_t__ atan2(float, float);
void rotation_matrix_get_eulers(float r[][3], float eulers[3]) {
  eulers[0] = (float)atan2(r[2][1], r[2][2]);
  eulers[1] = (float)asin(r[2][0]);
  eulers[2] = (float)atan2(r[0][1], r[0][0]);
}


x86 assembly (clang, -O0):
<rotation_matrix_get_eulers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x20(%rax),%xmm1
call   1030 <atan2@plt>
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm0
call   1040 <asin@plt>
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <atan2@plt>
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotation_matrix_get_eulers>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  0x1c(%rdi),%xmm0
movss  0x20(%rdi),%xmm1
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r14)
movss  0x18(%rbx),%xmm0
call   1040 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x4(%r14)
movss  (%rbx),%xmm1
movss  0x4(%rbx),%xmm0
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rotation_matrix_get_eulers([3 x float]* %0, float* %1) {
%3 = alloca [3 x float]*
%4 = alloca float*
store [3 x float]* %0, [3 x float]** %3
store float* %1, float** %4
%5 = load [3 x float]*, [3 x float]** %3
%6 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 2
%7 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
%8 = load float, float* %7
%9 = load [3 x float]*, [3 x float]** %3
%10 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 2
%11 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 2
%12 = load float, float* %11
%13 = call i64 @atan2(float %8, float %12)
%14 = sitofp i64 %13 to float
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 0
store float %14, float* %16
%17 = load [3 x float]*, [3 x float]** %3
%18 = getelementptr inbounds [3 x float], [3 x float]* %17, i64 2
%19 = getelementptr inbounds [3 x float], [3 x float]* %18, i64 0, i64 0
%20 = load float, float* %19
%21 = call i64 @asin(float %20)
%22 = sitofp i64 %21 to float
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load [3 x float]*, [3 x float]** %3
%26 = getelementptr inbounds [3 x float], [3 x float]* %25, i64 0
%27 = getelementptr inbounds [3 x float], [3 x float]* %26, i64 0, i64 1
%28 = load float, float* %27
%29 = load [3 x float]*, [3 x float]** %3
%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
%32 = load float, float* %31
%33 = call i64 @atan2(float %28, float %32)
%34 = sitofp i64 %33 to float
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 2
store float %34, float* %36
ret void
}

LLVM IR (-O2):
define void @rotation_matrix_get_eulers([3 x float]* nocapture %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 2
%6 = load float, float* %5
%7 = tail call i64 @atan2(float %4, float %6)
%8 = sitofp i64 %7 to float
store float %8, float* %1
%9 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 0
%10 = load float, float* %9
%11 = tail call i64 @asin(float %10)
%12 = sitofp i64 %11 to float
%13 = getelementptr inbounds float, float* %1, i64 1
store float %12, float* %13
%14 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 1
%15 = load float, float* %14
%16 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 0
%17 = load float, float* %16
%18 = tail call i64 @atan2(float %15, float %17)
%19 = sitofp i64 %18 to float
%20 = getelementptr inbounds float, float* %1, i64 2
store float %19, float* %20
ret void
}