#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 /*<<< orphan*/ AxisAng3(double *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
void test_AxisAng3() {
  double expc3[3] = {1, 2, 3};
  double omghat[3] = {0};
  double theta = 0;
  AxisAng3(expc3, omghat, &theta);
  printf("expc3:\n");
  printf("%lf %lf %lf\n", expc3[0], expc3[1], expc3[2]);
  printf("omg:\n");
  printf("%lf %lf %lf\n", omghat[0], omghat[1], omghat[2]);
  printf("theta:\n");
  printf("%lf\n", theta);
  return;
}


x86 assembly (clang, -O0):
<test_AxisAng3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <AxisAng3@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xe7a(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    0xe4f(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xe36(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_AxisAng3>:
push   %rbx
sub    $0x50,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x30(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <AxisAng3@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
lea    0xe78(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
mov    %rbx,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xe58(%rip),%rdi
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm0
lea    0xe35(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_AxisAng3.expc3 = [3 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
@.str = [8 x i8] c"expc3:\0A\00"
@.str.1 = [13 x i8] c"%lf %lf %lf\0A\00"
@.str.2 = [6 x i8] c"omg:\0A\00"
@.str.3 = [8 x i8] c"theta:\0A\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define void @test_AxisAng3() {
%1 = alloca [3 x double]
%2 = alloca [3 x double]
%3 = alloca double
%4 = bitcast [3 x double]* %1 to i8*
%5 = bitcast [3 x double]* %2 to i8*
store double 0.000000e+00, double* %3
%6 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%7 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%8 = call i32 @AxisAng3(double* %6, double* %7, double* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%11 = load double, double* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%15 = load double, double* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %11, double %13, double %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%19 = load double, double* %18
%20 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%21 = load double, double* %20
%22 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%23 = load double, double* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %19, double %21, double %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%26 = load double, double* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %26)
ret void
}

LLVM IR (-O2):
@__const.test_AxisAng3.expc3 = [3 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
@.str.1 = [13 x i8] c"%lf %lf %lf\0A\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
@str = [7 x i8] c"expc3:\00"
@str.5 = [5 x i8] c"omg:\00"
@str.6 = [7 x i8] c"theta:\00"
define void @test_AxisAng3() {
%1 = alloca [3 x double]
%2 = alloca [3 x double]
%3 = alloca double
%4 = bitcast [3 x double]* %1 to i8*
%5 = bitcast [3 x double]* %2 to i8*
%6 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%9 = call i32 @AxisAng3(double* %7, double* %8, double* %3)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%11 = load double, double* %7
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%15 = load double, double* %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %11, double %13, double %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
%18 = load double, double* %8
%19 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%20 = load double, double* %19
%21 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%22 = load double, double* %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %18, double %20, double %22)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
%25 = load double, double* %3
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %25)
ret void
}