#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*/ Vec3MultValue(double *, double, double *);
double Vec3Norm2(double *);
void AxisAng6(double expc6[6], double S[6], double *theta) {
  *theta = Vec3Norm2(expc6);
  if (*theta < 1.0E-6) {
    *theta = Vec3Norm2(&expc6[3]);
    if (*theta < 1.0E-6) {
      *theta = 0.0;
      S[0] = 0.0;
      S[1] = 0.0;
      S[2] = 0.0;
      S[3] = 0.0;
      S[4] = 0.0;
      S[5] = 0.0;
      return;
    }
  }
  Vec3MultValue(expc6, 1.0 / (*theta), S);
  Vec3MultValue(&expc6[3], 1.0 / (*theta), &S[3]);
  return;
}


x86 assembly (clang, -O0):
<AxisAng6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Vec3Norm2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xeaf(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    11e2 <AxisAng6+0xc2>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
call   1030 <Vec3Norm2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xe84(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    11dd <AxisAng6+0xbd>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
jmp    1224 <AxisAng6+0x104>
jmp    11e2 <AxisAng6+0xc2>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsd  0xe16(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rsi
call   1040 <Vec3MultValue@plt>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x18(%rbp),%rax
movsd  0xdf5(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
call   1040 <Vec3MultValue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AxisAng6>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <Vec3Norm2@plt>
movsd  %xmm0,(%r14)
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1184 <AxisAng6+0x64>
lea    0x18(%rbx),%rdi
call   1030 <Vec3Norm2@plt>
movsd  %xmm0,(%r14)
movsd  0xea4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1184 <AxisAng6+0x64>
movq   $0x0,(%r14)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x20(%r15)
movupd %xmm0,0x10(%r15)
movupd %xmm0,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret
movsd  0xe7c(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    %rbx,%rdi
movapd %xmm1,%xmm0
mov    %r15,%rsi
call   1040 <Vec3MultValue@plt>
add    $0x18,%rbx
movsd  0xe5d(%rip),%xmm0
divsd  (%r14),%xmm0
add    $0x18,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <Vec3MultValue@plt>

LLVM IR (-O0):
define void @AxisAng6(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = call double @Vec3Norm2(double* %7)
%9 = load double*, double** %6
store double %8, double* %9
%10 = load double*, double** %6
%11 = load double, double* %10
%12 = fcmp olt double %11, 0x3EB0C6F7A0B5ED8D
br i1 %12, label %13, label %36
13: ; preds = %3
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 3
%16 = call double @Vec3Norm2(double* %15)
%17 = load double*, double** %6
store double %16, double* %17
%18 = load double*, double** %6
%19 = load double, double* %18
%20 = fcmp olt double %19, 0x3EB0C6F7A0B5ED8D
br i1 %20, label %21, label %35
21: ; preds = %13
%22 = load double*, double** %6
store double 0.000000e+00, double* %22
%23 = load double*, double** %5
%24 = getelementptr inbounds double, double* %23, i64 0
store double 0.000000e+00, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 1
store double 0.000000e+00, double* %26
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 2
store double 0.000000e+00, double* %28
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 3
store double 0.000000e+00, double* %30
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 4
store double 0.000000e+00, double* %32
%33 = load double*, double** %5
%34 = getelementptr inbounds double, double* %33, i64 5
store double 0.000000e+00, double* %34
br label %51
35: ; preds = %13
br label %36
36: ; preds = %35, %3
%37 = load double*, double** %4
%38 = load double*, double** %6
%39 = load double, double* %38
%40 = fdiv double 1.000000e+00, %39
%41 = load double*, double** %5
%42 = call i32 @Vec3MultValue(double* %37, double %40, double* %41)
%43 = load double*, double** %4
%44 = getelementptr inbounds double, double* %43, i64 3
%45 = load double*, double** %6
%46 = load double, double* %45
%47 = fdiv double 1.000000e+00, %46
%48 = load double*, double** %5
%49 = getelementptr inbounds double, double* %48, i64 3
%50 = call i32 @Vec3MultValue(double* %44, double %47, double* %49)
br label %51
51: ; preds = %36, %21
ret void
}

LLVM IR (-O2):
define void @AxisAng6(double* %0, double* %1, double* nocapture %2) {
%4 = tail call double @Vec3Norm2(double* %0)
store double %4, double* %2
%5 = fcmp olt double %4, 0x3EB0C6F7A0B5ED8D
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = getelementptr inbounds double, double* %0, i64 3
%8 = tail call double @Vec3Norm2(double* %7)
store double %8, double* %2
%9 = fcmp olt double %8, 0x3EB0C6F7A0B5ED8D
br i1 %9, label %10, label %12
10: ; preds = %6
store double 0.000000e+00, double* %2
%11 = bitcast double* %1 to i8*
br label %21
12: ; preds = %6, %3
%13 = phi double [ %8, %6 ], [ %4, %3 ]
%14 = fdiv double 1.000000e+00, %13
%15 = tail call i32 @Vec3MultValue(double* %0, double %14, double* %1)
%16 = getelementptr inbounds double, double* %0, i64 3
%17 = load double, double* %2
%18 = fdiv double 1.000000e+00, %17
%19 = getelementptr inbounds double, double* %1, i64 3
%20 = tail call i32 @Vec3MultValue(double* %16, double %18, double* %19)
br label %21
21: ; preds = %12, %10
ret void
}