#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 M_PI;
int /*<<< orphan*/ bot_angle_axis_to_quat(int, double *, double *);
int /*<<< orphan*/ bot_quat_mult(double *, double *, double *);
int /*<<< orphan*/ bot_quat_rotate(double *, double *);
int /*<<< orphan*/ bot_quat_to_angle_axis(double *, double *, double *);
int /*<<< orphan*/ bot_quat_to_roll_pitch_yaw(double *, double *);
int /*<<< orphan*/ feq(double, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ qeq(double *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                       int);
int /*<<< orphan*/ rpyeq(double, double, double, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
int bot_quaternion_test() {
  fprintf(stderr, "running quaternion test\n");
  double theta = 0;
  double rvec[] = {0, 0, 1};
  double q[4];
  double rpy[3];
  double roll, pitch, yaw;
  bot_angle_axis_to_quat(theta, rvec, q);
  if (!qeq(q, 1, 0, 0, 0)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 362);
    return 0;
  };
  bot_quat_to_roll_pitch_yaw(q, rpy);
  roll = rpy[0];
  pitch = rpy[1];
  yaw = rpy[2];
  if (!rpyeq(roll, pitch, yaw, 0, 0, 0)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 367);
    return 0;
  };
  theta = M_PI;
  bot_angle_axis_to_quat(theta, rvec, q);
  fprintf(stderr, "<%.3f, %.3f, %.3f, %.3f>\n", q[0], q[1], q[2], q[3]);
  if (!qeq(q, 0, 0, 0, 1)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 374);
    return 0;
  };
  bot_quat_to_angle_axis(q, &theta, rvec);
  if (!feq(theta, M_PI)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 378);
    return 0;
  };
  if (!feq(rvec[0], 0) || !feq(rvec[1], 0) || !feq(rvec[2], 1)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 379);
    return 0;
  };
  bot_quat_to_roll_pitch_yaw(q, rpy);
  if (!rpyeq(roll, pitch, yaw, 0, 0, M_PI)) {
    fprintf(stderr, "bot_quaternion_test failed at line %d\n", 383);
    return 0;
  };
  double q2[4];
  double q3[4];
  double axis1[] = {0, 1, 0};
  double axis2[] = {0, 0, 1};
  bot_angle_axis_to_quat(M_PI / 2, axis1, q);
  bot_angle_axis_to_quat(M_PI / 2, axis2, q);
  bot_quat_mult(q3, q, q2);
  rvec[0] = 0;
  rvec[1] = 0;
  rvec[2] = 1;
  bot_quat_rotate(q, rvec);
  fprintf(stderr, "by q: [ %.2f, %.2f, %.2f ]\n", rvec[0], rvec[1], rvec[2]);
  rvec[0] = 0;
  rvec[1] = 0;
  rvec[2] = 1;
  bot_quat_rotate(q2, rvec);
  fprintf(stderr, "by q2: [ %.2f, %.2f, %.2f ]\n", rvec[0], rvec[1], rvec[2]);
  rvec[0] = 0;
  rvec[1] = 0;
  rvec[2] = 1;
  bot_quat_rotate(q3, rvec);
  fprintf(stderr, "by q*q2: [ %.2f, %.2f, %.2f ]\n", rvec[0], rvec[1], rvec[2]);
  rvec[0] = 0;
  rvec[1] = 0;
  rvec[2] = 1;
  bot_quat_mult(q3, q2, q);
  bot_quat_rotate(q3, rvec);
  fprintf(stderr, "by q2*q: [ %.2f, %.2f, %.2f ]\n", rvec[0], rvec[1], rvec[2]);
  fprintf(stderr, "bot_quaternion_test complete\n");
  return 1;
}


x86 assembly (clang, -O0):
<bot_quaternion_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xf3f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xf3c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xf39(%rip),%rax
mov    %rax,-0x20(%rbp)
cvttsd2si -0x10(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <bot_angle_axis_to_quat@plt>
lea    -0x50(%rbp),%rdi
mov    $0x1,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   10b0 <qeq@plt>
cmp    $0x0,%eax
jne    1235 <bot_quaternion_test+0xa5>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
lea    0xe04(%rip),%rsi
mov    $0x16a,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <bot_quat_to_roll_pitch_yaw@plt>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1090 <rpyeq@plt>
cmp    $0x0,%eax
jne    12b1 <bot_quaternion_test+0x121>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xd88(%rip),%rsi
mov    $0x16f,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
mov    0x2d30(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <bot_angle_axis_to_quat@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
lea    0xd51(%rip),%rsi
mov    $0x4,%al
call   1060 <fprintf@plt>
lea    -0x50(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   10b0 <qeq@plt>
cmp    $0x0,%eax
jne    1344 <bot_quaternion_test+0x1b4>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
lea    0xcf5(%rip),%rsi
mov    $0x176,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x10(%rbp),%rsi
call   1030 <bot_quat_to_angle_axis@plt>
movsd  -0x10(%rbp),%xmm0
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
call   10a0 <feq@plt>
cmp    $0x0,%eax
jne    1399 <bot_quaternion_test+0x209>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
lea    0xca0(%rip),%rsi
mov    $0x17a,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
movsd  -0x30(%rbp),%xmm0
xor    %edi,%edi
call   10a0 <feq@plt>
cmp    $0x0,%eax
je     13db <bot_quaternion_test+0x24b>
movsd  -0x28(%rbp),%xmm0
xor    %edi,%edi
call   10a0 <feq@plt>
cmp    $0x0,%eax
je     13db <bot_quaternion_test+0x24b>
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%edi
call   10a0 <feq@plt>
cmp    $0x0,%eax
jne    1403 <bot_quaternion_test+0x273>
mov    0x2bf6(%rip),%rax
mov    (%rax),%edi
lea    0xc36(%rip),%rsi
mov    $0x17b,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <bot_quat_to_roll_pitch_yaw@plt>
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
mov    0x2bbf(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1090 <rpyeq@plt>
cmp    $0x0,%eax
jne    1465 <bot_quaternion_test+0x2d5>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
lea    0xbd4(%rip),%rsi
mov    $0x17f,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1694 <bot_quaternion_test+0x504>
mov    0xcb4(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xcae(%rip),%rax
mov    %rax,-0xe8(%rbp)
mov    0xca8(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0xcaa(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xca4(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xc9e(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0x2b28(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
lea    -0xf0(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <bot_angle_axis_to_quat@plt>
mov    0x2b05(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
lea    -0x110(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <bot_angle_axis_to_quat@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
call   1080 <bot_quat_mult@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xad2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x2a91(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xb03(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xa82(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0xb0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x2a3e(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xacc(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xa2f(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0xd0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x29eb(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xa96(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x9dc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0xd0(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1080 <bot_quat_mult@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x2981(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xa4b(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
mov    0x295b(%rip),%rax
mov    (%rax),%edi
lea    0xa53(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_quaternion_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    0x2e30(%rip),%r13
mov    0x0(%r13),%edi
lea    0xe5d(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0xf6d(%rip),%r14
mov    %r14,0x10(%rsp)
movaps 0xf51(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
lea    0x20(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <bot_angle_axis_to_quat@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10b0 <qeq@plt>
test   %eax,%eax
je     1506 <bot_quaternion_test+0x376>
lea    0x20(%rsp),%rdi
lea    0x60(%rsp),%rsi
call   1050 <bot_quat_to_roll_pitch_yaw@plt>
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
movsd  0x70(%rsp),%xmm2
xor    %ebp,%ebp
movsd  %xmm0,0x58(%rsp)
movsd  %xmm1,0x50(%rsp)
movsd  %xmm2,0x48(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <rpyeq@plt>
test   %eax,%eax
je     1518 <bot_quaternion_test+0x388>
mov    0x2d98(%rip),%r15
mov    (%r15),%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rsp,%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <bot_angle_axis_to_quat@plt>
mov    0x0(%r13),%edi
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
lea    0xdbd(%rip),%rsi
mov    $0x4,%al
call   1060 <fprintf@plt>
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   10b0 <qeq@plt>
test   %eax,%eax
je     152a <bot_quaternion_test+0x39a>
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <bot_quat_to_angle_axis@plt>
movsd  0x18(%rsp),%xmm0
mov    (%r15),%edi
call   10a0 <feq@plt>
test   %eax,%eax
je     154e <bot_quaternion_test+0x3be>
movsd  (%rsp),%xmm0
xor    %ebp,%ebp
xor    %edi,%edi
call   10a0 <feq@plt>
test   %eax,%eax
je     153c <bot_quaternion_test+0x3ac>
movsd  0x8(%rsp),%xmm0
xor    %edi,%edi
call   10a0 <feq@plt>
test   %eax,%eax
je     153c <bot_quaternion_test+0x3ac>
movsd  0x10(%rsp),%xmm0
mov    $0x1,%edi
call   10a0 <feq@plt>
test   %eax,%eax
je     153c <bot_quaternion_test+0x3ac>
lea    0x20(%rsp),%rdi
lea    0x60(%rsp),%rsi
call   1050 <bot_quat_to_roll_pitch_yaw@plt>
mov    (%r15),%edx
xor    %ebp,%ebp
movsd  0x58(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  0x48(%rsp),%xmm2
xor    %edi,%edi
xor    %esi,%esi
call   1090 <rpyeq@plt>
test   %eax,%eax
je     157b <bot_quaternion_test+0x3eb>
mov    0xdaf(%rip),%rax
mov    %rax,0xb0(%rsp)
movaps 0xd90(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
mov    %r14,0x90(%rsp)
movaps 0xd99(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
mov    (%r15),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
lea    0xa0(%rsp),%rsi
lea    0x20(%rsp),%r12
mov    %r12,%rdx
call   1040 <bot_angle_axis_to_quat@plt>
mov    (%r15),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
lea    0x80(%rsp),%rsi
mov    %r12,%rdx
call   1040 <bot_angle_axis_to_quat@plt>
lea    0xc0(%rsp),%r14
lea    0xe0(%rsp),%r15
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1080 <bot_quat_mult@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movabs $0x3ff0000000000000,%rbp
mov    %rbp,0x10(%rsp)
mov    %rsp,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x0(%r13),%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xc40(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbp,0x10(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x0(%r13),%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xc22(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbp,0x10(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x0(%r13),%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xc05(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rbp,0x10(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1080 <bot_quat_mult@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <bot_quat_rotate@plt>
mov    0x0(%r13),%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xbdc(%rip),%rsi
mov    $0x3,%al
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xbe9(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%ebp
jmp    1567 <bot_quaternion_test+0x3d7>
mov    0x0(%r13),%edi
lea    0xb18(%rip),%rsi
mov    $0x16a,%edx
jmp    1560 <bot_quaternion_test+0x3d0>
mov    0x0(%r13),%edi
lea    0xb06(%rip),%rsi
mov    $0x16f,%edx
jmp    1560 <bot_quaternion_test+0x3d0>
mov    0x0(%r13),%edi
lea    0xaf4(%rip),%rsi
mov    $0x176,%edx
jmp    1560 <bot_quaternion_test+0x3d0>
mov    0x0(%r13),%edi
lea    0xae2(%rip),%rsi
mov    $0x17b,%edx
jmp    1560 <bot_quaternion_test+0x3d0>
mov    0x0(%r13),%edi
lea    0xad0(%rip),%rsi
xor    %ebp,%ebp
mov    $0x17a,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %ebp,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%r13),%edi
lea    0xaa3(%rip),%rsi
mov    $0x17f,%edx
jmp    1560 <bot_quaternion_test+0x3d0>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"running quaternion test\0A\00"
@__const.bot_quaternion_test.rvec = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@.str.1 = [39 x i8] c"bot_quaternion_test failed at line %d\0A\00"
@M_PI = global i32 0
@.str.2 = [26 x i8] c"<%.3f, %.3f, %.3f, %.3f>\0A\00"
@__const.bot_quaternion_test.axis1 = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.bot_quaternion_test.axis2 = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@.str.3 = [28 x i8] c"by q: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.4 = [29 x i8] c"by q2: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.5 = [31 x i8] c"by q*q2: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.6 = [31 x i8] c"by q2*q: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.7 = [30 x i8] c"bot_quaternion_test complete\0A\00"
define i32 @bot_quaternion_test() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [3 x double]
%4 = alloca [4 x double]
%5 = alloca [3 x double]
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [4 x double]
%10 = alloca [4 x double]
%11 = alloca [3 x double]
%12 = alloca [3 x double]
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %2
%15 = bitcast [3 x double]* %3 to i8*
%16 = load double, double* %2
%17 = fptosi double %16 to i32
%18 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%19 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%20 = call i32 @bot_angle_axis_to_quat(i32 %17, double* %18, double* %19)
%21 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%22 = call i32 @qeq(double* %21, i32 1, i32 0, i32 0, i32 0)
%23 = icmp ne i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %0
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 362)
store i32 0, i32* %1
br label %190
27: ; preds = %0
%28 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%29 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%30 = call i32 @bot_quat_to_roll_pitch_yaw(double* %28, double* %29)
%31 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%32 = load double, double* %31
store double %32, double* %6
%33 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%34 = load double, double* %33
store double %34, double* %7
%35 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%36 = load double, double* %35
store double %36, double* %8
%37 = load double, double* %6
%38 = load double, double* %7
%39 = load double, double* %8
%40 = call i32 @rpyeq(double %37, double %38, double %39, i32 0, i32 0, i32 0)
%41 = icmp ne i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %27
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 367)
store i32 0, i32* %1
br label %190
45: ; preds = %27
%46 = load i32, i32* @M_PI
%47 = sitofp i32 %46 to double
store double %47, double* %2
%48 = load double, double* %2
%49 = fptosi double %48 to i32
%50 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%51 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%52 = call i32 @bot_angle_axis_to_quat(i32 %49, double* %50, double* %51)
%53 = load i32, i32* @stderr
%54 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%55 = load double, double* %54
%56 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%57 = load double, double* %56
%58 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%59 = load double, double* %58
%60 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
%61 = load double, double* %60
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %55, double %57, double %59, double %61)
%63 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%64 = call i32 @qeq(double* %63, i32 0, i32 0, i32 0, i32 1)
%65 = icmp ne i32 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %45
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 374)
store i32 0, i32* %1
br label %190
69: ; preds = %45
%70 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%71 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%72 = call i32 @bot_quat_to_angle_axis(double* %70, double* %2, double* %71)
%73 = load double, double* %2
%74 = load i32, i32* @M_PI
%75 = call i32 @feq(double %73, i32 %74)
%76 = icmp ne i32 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %69
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 378)
store i32 0, i32* %1
br label %190
80: ; preds = %69
%81 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%82 = load double, double* %81
%83 = call i32 @feq(double %82, i32 0)
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %95
85: ; preds = %80
%86 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%87 = load double, double* %86
%88 = call i32 @feq(double %87, i32 0)
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %85
%91 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%92 = load double, double* %91
%93 = call i32 @feq(double %92, i32 1)
%94 = icmp ne i32 %93, 0
br i1 %94, label %98, label %95
95: ; preds = %90, %85, %80
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 379)
store i32 0, i32* %1
br label %190
98: ; preds = %90
%99 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%100 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%101 = call i32 @bot_quat_to_roll_pitch_yaw(double* %99, double* %100)
%102 = load double, double* %6
%103 = load double, double* %7
%104 = load double, double* %8
%105 = load i32, i32* @M_PI
%106 = call i32 @rpyeq(double %102, double %103, double %104, i32 0, i32 0, i32 %105)
%107 = icmp ne i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %98
%109 = load i32, i32* @stderr
%110 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 383)
store i32 0, i32* %1
br label %190
111: ; preds = %98
%112 = bitcast [3 x double]* %11 to i8*
%113 = bitcast [3 x double]* %12 to i8*
%114 = load i32, i32* @M_PI
%115 = sdiv i32 %114, 2
%116 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%117 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%118 = call i32 @bot_angle_axis_to_quat(i32 %115, double* %116, double* %117)
%119 = load i32, i32* @M_PI
%120 = sdiv i32 %119, 2
%121 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%122 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%123 = call i32 @bot_angle_axis_to_quat(i32 %120, double* %121, double* %122)
%124 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%125 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%126 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%127 = call i32 @bot_quat_mult(double* %124, double* %125, double* %126)
%128 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
store double 0.000000e+00, double* %128
%129 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
store double 0.000000e+00, double* %129
%130 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
store double 1.000000e+00, double* %130
%131 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%132 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%133 = call i32 @bot_quat_rotate(double* %131, double* %132)
%134 = load i32, i32* @stderr
%135 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%136 = load double, double* %135
%137 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%138 = load double, double* %137
%139 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%140 = load double, double* %139
%141 = call i32 (i32, i8*, ...) @fprintf(i32 %134, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %136, double %138, double %140)
%142 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
store double 0.000000e+00, double* %142
%143 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
store double 0.000000e+00, double* %143
%144 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
store double 1.000000e+00, double* %144
%145 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%146 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%147 = call i32 @bot_quat_rotate(double* %145, double* %146)
%148 = load i32, i32* @stderr
%149 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%150 = load double, double* %149
%151 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%152 = load double, double* %151
%153 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%154 = load double, double* %153
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %150, double %152, double %154)
%156 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
store double 0.000000e+00, double* %156
%157 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
store double 0.000000e+00, double* %157
%158 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
store double 1.000000e+00, double* %158
%159 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%160 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%161 = call i32 @bot_quat_rotate(double* %159, double* %160)
%162 = load i32, i32* @stderr
%163 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%164 = load double, double* %163
%165 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%166 = load double, double* %165
%167 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%168 = load double, double* %167
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), double %164, double %166, double %168)
%170 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
store double 0.000000e+00, double* %170
%171 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
store double 0.000000e+00, double* %171
%172 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
store double 1.000000e+00, double* %172
%173 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%174 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%175 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%176 = call i32 @bot_quat_mult(double* %173, double* %174, double* %175)
%177 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%178 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%179 = call i32 @bot_quat_rotate(double* %177, double* %178)
%180 = load i32, i32* @stderr
%181 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%182 = load double, double* %181
%183 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%184 = load double, double* %183
%185 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%186 = load double, double* %185
%187 = call i32 (i32, i8*, ...) @fprintf(i32 %180, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), double %182, double %184, double %186)
%188 = load i32, i32* @stderr
%189 = call i32 (i32, i8*, ...) @fprintf(i32 %188, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %1
br label %190
190: ; preds = %111, %108, %95, %77, %66, %42, %24
%191 = load i32, i32* %1
ret i32 %191
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"running quaternion test\0A\00"
@.str.1 = [39 x i8] c"bot_quaternion_test failed at line %d\0A\00"
@M_PI = global i32 0
@.str.2 = [26 x i8] c"<%.3f, %.3f, %.3f, %.3f>\0A\00"
@__const.bot_quaternion_test.axis1 = [3 x double] [double 0.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.bot_quaternion_test.axis2 = [3 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@.str.3 = [28 x i8] c"by q: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.4 = [29 x i8] c"by q2: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.5 = [31 x i8] c"by q*q2: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.6 = [31 x i8] c"by q2*q: [ %.2f, %.2f, %.2f ]\0A\00"
@.str.7 = [30 x i8] c"bot_quaternion_test complete\0A\00"
define i32 @bot_quaternion_test() {
%1 = alloca double
%2 = alloca [3 x double]
%3 = alloca [4 x double]
%4 = alloca [3 x double]
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = alloca [3 x double]
%8 = alloca [3 x double]
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = bitcast double* %1 to i8*
%12 = bitcast [3 x double]* %2 to i8*
%13 = bitcast [4 x double]* %3 to i8*
%14 = bitcast [3 x double]* %4 to i8*
%15 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%16 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%17 = call i32 @bot_angle_axis_to_quat(i32 0, double* %15, double* %16)
%18 = call i32 @qeq(double* %16, i32 1, i32 0, i32 0, i32 0)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 362)
br label %135
23: ; preds = %0
%24 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%25 = call i32 @bot_quat_to_roll_pitch_yaw(double* %16, double* %24)
%26 = load double, double* %24
%27 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%28 = load double, double* %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%30 = load double, double* %29
%31 = call i32 @rpyeq(double %26, double %28, double %30, i32 0, i32 0, i32 0)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %23
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 367)
br label %135
36: ; preds = %23
%37 = load i32, i32* @M_PI
%38 = sitofp i32 %37 to double
store double %38, double* %1
%39 = call i32 @bot_angle_axis_to_quat(i32 %37, double* %15, double* %16)
%40 = load i32, i32* @stderr
%41 = load double, double* %16
%42 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%43 = load double, double* %42
%44 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%45 = load double, double* %44
%46 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%47 = load double, double* %46
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %41, double %43, double %45, double %47)
%49 = call i32 @qeq(double* %16, i32 0, i32 0, i32 0, i32 1)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %36
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 374)
br label %135
54: ; preds = %36
%55 = call i32 @bot_quat_to_angle_axis(double* %16, double* %1, double* %15)
%56 = load double, double* %1
%57 = load i32, i32* @M_PI
%58 = call i32 @feq(double %56, i32 %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %54
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 378)
br label %135
63: ; preds = %54
%64 = load double, double* %15
%65 = call i32 @feq(double %64, i32 0)
%66 = icmp eq i32 %65, 0
br i1 %66, label %77, label %67
67: ; preds = %63
%68 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%69 = load double, double* %68
%70 = call i32 @feq(double %69, i32 0)
%71 = icmp eq i32 %70, 0
br i1 %71, label %77, label %72
72: ; preds = %67
%73 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%74 = load double, double* %73
%75 = call i32 @feq(double %74, i32 1)
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %72, %67, %63
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 379)
br label %135
80: ; preds = %72
%81 = call i32 @bot_quat_to_roll_pitch_yaw(double* %16, double* %24)
%82 = load i32, i32* @M_PI
%83 = call i32 @rpyeq(double %26, double %28, double %30, i32 0, i32 0, i32 %82)
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %80
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 383)
br label %135
88: ; preds = %80
%89 = bitcast [4 x double]* %5 to i8*
%90 = bitcast [4 x double]* %6 to i8*
%91 = bitcast [3 x double]* %7 to i8*
%92 = bitcast [3 x double]* %8 to i8*
%93 = load i32, i32* @M_PI
%94 = sdiv i32 %93, 2
%95 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%96 = call i32 @bot_angle_axis_to_quat(i32 %94, double* %95, double* %16)
%97 = load i32, i32* @M_PI
%98 = sdiv i32 %97, 2
%99 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%100 = call i32 @bot_angle_axis_to_quat(i32 %98, double* %99, double* %16)
%101 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%102 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%103 = call i32 @bot_quat_mult(double* %101, double* %16, double* %102)
%104 = bitcast [3 x double]* %2 to i8*
store double 1.000000e+00, double* %73
%105 = call i32 @bot_quat_rotate(double* %16, double* %15)
%106 = load i32, i32* @stderr
%107 = load double, double* %15
%108 = load double, double* %68
%109 = load double, double* %73
%110 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %107, double %108, double %109)
%111 = bitcast [3 x double]* %2 to i8*
store double 1.000000e+00, double* %73
%112 = call i32 @bot_quat_rotate(double* %102, double* %15)
%113 = load i32, i32* @stderr
%114 = load double, double* %15
%115 = load double, double* %68
%116 = load double, double* %73
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %114, double %115, double %116)
%118 = bitcast [3 x double]* %2 to i8*
store double 1.000000e+00, double* %73
%119 = call i32 @bot_quat_rotate(double* %101, double* %15)
%120 = load i32, i32* @stderr
%121 = load double, double* %15
%122 = load double, double* %68
%123 = load double, double* %73
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), double %121, double %122, double %123)
%125 = bitcast [3 x double]* %2 to i8*
store double 1.000000e+00, double* %73
%126 = call i32 @bot_quat_mult(double* %101, double* %102, double* %16)
%127 = call i32 @bot_quat_rotate(double* %101, double* %15)
%128 = load i32, i32* @stderr
%129 = load double, double* %15
%130 = load double, double* %68
%131 = load double, double* %73
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), double %129, double %130, double %131)
%133 = load i32, i32* @stderr
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
br label %135
135: ; preds = %88, %85, %77, %60, %51, %33, %20
%136 = phi i32 [ 1, %88 ], [ 0, %85 ], [ 0, %77 ], [ 0, %60 ], [ 0, %51 ], [ 0, %33 ], [ 0, %20 ]
ret i32 %136
}