#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*/ AxisAng6(double *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
void test_AxisAng6() {
  double expc6[6] = {0, 0, 0, 0, 0, 0};
  double S[6];
  double theta;
  AxisAng6(expc6, S, &theta);
  printf("S:\n");
  int i;
  for (i = 0; i < 6; i++) {
    printf("%lf\n", S[i]);
  }
  printf("theta:\n");
  printf("%lf\n", theta);
  return;
}


x86 assembly (clang, -O0):
<test_AxisAng6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x68(%rbp),%rdx
call   1030 <AxisAng6@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x6,-0x6c(%rbp)
jge    119e <test_AxisAng6+0x6e>
movslq -0x6c(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    116e <test_AxisAng6+0x3e>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x68(%rbp),%xmm0
lea    0xe4c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_AxisAng6>:
push   %rbx
sub    $0x70,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <AxisAng6@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
movsd  0x10(%rsp),%xmm0
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe33(%rip),%rdi
call   1040 <puts@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"S:\0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
@.str.2 = [8 x i8] c"theta:\0A\00"
define void @test_AxisAng6() {
%1 = alloca [6 x double]
%2 = alloca [6 x double]
%3 = alloca double
%4 = alloca i32
%5 = bitcast [6 x double]* %1 to i8*
%6 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 0
%7 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 0
%8 = call i32 @AxisAng6(double* %6, double* %7, double* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 6
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 %15
%17 = load double, double* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %10
22: ; preds = %10
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%24 = load double, double* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %24)
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%lf\0A\00"
@str = [3 x i8] c"S:\00"
@str.3 = [7 x i8] c"theta:\00"
define void @test_AxisAng6() {
%1 = alloca [6 x double]
%2 = alloca [6 x double]
%3 = alloca double
%4 = bitcast [6 x double]* %1 to i8*
%5 = bitcast [6 x double]* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 0
%9 = call i32 @AxisAng6(double* %7, double* %8, double* %3)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%11 = load double, double* %8
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 1
%14 = load double, double* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 2
%17 = load double, double* %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %17)
%19 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 3
%20 = load double, double* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 4
%23 = load double, double* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = getelementptr inbounds [6 x double], [6 x double]* %2, i64 0, i64 5
%26 = load double, double* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%29 = load double, double* %3
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %29)
ret void
}