#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*/ printf(char *, ...);
int /*<<< orphan*/ se3ToVec(double **, double *);
void test_se3ToVec() {
  double V[6] = {0};
  double se3Mat[4][4] = {0, -3, 2, 4, 3, 0, -1, 5, -2, 1, 0, 6, 0, 0, 0, 0};
  se3ToVec(se3Mat, V);
  int i;
  printf("V:\n");
  for (i = 0; i < 6; i++) {
    printf("%lf\n", V[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<test_se3ToVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    -0xb0(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x80,%edx
call   1060 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <se3ToVec@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x6,-0xb4(%rbp)
jge    11d7 <test_se3ToVec+0x97>
movslq -0xb4(%rbp),%rax
movsd  -0x30(%rbp,%rax,8),%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    119b <test_se3ToVec+0x5b>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_se3ToVec>:
push   %rbx
sub    $0xb0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movaps 0xf20(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe6f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe53(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <se3ToVec@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
lea    0xea9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_se3ToVec.se3Mat = [4 x [4 x double]] [[4 x double] [double 0.000000e+00, double -3.000000e+00, double 2.000000e+00, double 4.000000e+00], [4 x double] [double 3.000000e+00, double 0.000000e+00, double -1.000000e+00, double 5.000000e+00], [4 x double] [double -2.000000e+00, double 1.000000e+00, double 0.000000e+00, double 6.000000e+00], [4 x double] zeroinitializer]
@.str = [4 x i8] c"V:\0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define void @test_se3ToVec() {
%1 = alloca [6 x double]
%2 = alloca [4 x [4 x double]]
%3 = alloca i32
%4 = bitcast [6 x double]* %1 to i8*
%5 = bitcast [4 x [4 x double]]* %2 to i8*
%6 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %2, i64 0, i64 0
%7 = bitcast [4 x double]* %6 to double**
%8 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 0
%9 = call i32 @se3ToVec(double** %7, double* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %11
11: ; preds = %20, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 6
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [6 x double], [6 x double]* %1, i64 0, i64 %16
%18 = load double, double* %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %18)
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
ret void
}

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