#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 */
typedef double int16_t;

/* Variables and functions */
int /*<<< orphan*/ acc_read_axis(double *);
int /*<<< orphan*/ gyro_read_axis(double *);
int /*<<< orphan*/ mag_read_axis(double *);
void get_sensor_data(double out_AccGyroMag_raw[3][3]) {
  int16_t axis[3];
  acc_read_axis(axis);
  out_AccGyroMag_raw[0][0] = 1.0 * axis[1];
  out_AccGyroMag_raw[0][1] = 1.0 * axis[0];
  out_AccGyroMag_raw[0][2] = 1.0 * axis[2];
  gyro_read_axis(axis);
  out_AccGyroMag_raw[1][0] = -1.0 * axis[0];
  out_AccGyroMag_raw[1][1] = -1.0 * axis[1];
  out_AccGyroMag_raw[1][2] = 1.0 * axis[2];
  mag_read_axis(axis);
  out_AccGyroMag_raw[2][0] = 1.0 * axis[1];
  out_AccGyroMag_raw[2][1] = 1.0 * axis[0];
  out_AccGyroMag_raw[2][2] = -1.0 * axis[2];
}


x86 assembly (clang, -O0):
<get_sensor_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <acc_read_axis@plt>
movsd  0xebb(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xea6(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  0xe90(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
lea    -0x20(%rbp),%rdi
call   1050 <gyro_read_axis@plt>
movsd  0xe69(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  0xe53(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  0xe45(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
lea    -0x20(%rbp),%rdi
call   1040 <mag_read_axis@plt>
movsd  0xe26(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  0xe10(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  0xdf2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sensor_data>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <acc_read_axis@plt>
movaps (%rsp),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
mov    %r14,%rdi
call   1050 <gyro_read_axis@plt>
movaps (%rsp),%xmm0
xorps  0xe92(%rip),%xmm0
movups %xmm0,0x18(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x28(%rbx)
mov    %r14,%rdi
call   1040 <mag_read_axis@plt>
movaps (%rsp),%xmm0
shufps $0x4e,%xmm0,%xmm0
movups %xmm0,0x30(%rbx)
movsd  0x10(%rsp),%xmm0
xorps  0xe62(%rip),%xmm0
movlps %xmm0,0x40(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @get_sensor_data([3 x double]* nocapture writeonly %0) {
%2 = alloca [3 x double]
%3 = bitcast [3 x double]* %2 to i8*
%4 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%5 = call i32 @acc_read_axis(double* %4)
%6 = bitcast [3 x double]* %2 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%9 = bitcast [3 x double]* %0 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
%10 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
store double %11, double* %12
%13 = call i32 @gyro_read_axis(double* %4)
%14 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%15 = bitcast [3 x double]* %2 to <2 x double>*
%16 = load <2 x double>, <2 x double>* %15
%17 = fneg <2 x double> %16
%18 = bitcast double* %14 to <2 x double>*
store <2 x double> %17, <2 x double>* %18
%19 = load double, double* %10
%20 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
store double %19, double* %20
%21 = call i32 @mag_read_axis(double* %4)
%22 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%23 = bitcast [3 x double]* %2 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = shufflevector <2 x double> %24, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%26 = bitcast double* %22 to <2 x double>*
store <2 x double> %25, <2 x double>* %26
%27 = load double, double* %10
%28 = fneg double %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
store double %28, double* %29
ret void
}