#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*/ hamilton_product(double *, double, double, double, double,
                                    double, double, double, double);
void rotate(double *pt, double *quart) {
  double step1[4], step2[4];
  hamilton_product(step1, quart[0], quart[1], quart[2], quart[3], 0, pt[0],
                   pt[1], pt[2]);
  hamilton_product(step2, step1[0], step1[1], step1[2], step1[3], quart[0],
                   -quart[1], -quart[2], -quart[3]);
  pt[0] = step2[1];
  pt[1] = step2[2];
  pt[2] = step2[3];
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm5
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm6
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm7
xorps  %xmm4,%xmm4
call   1030 <hamilton_product@plt>
lea    -0x50(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm4
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm5
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm6
movq   %xmm6,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm6
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm7
movq   %xmm7,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm7
call   1030 <hamilton_product@plt>
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
movsd  0x18(%rsi),%xmm3
movsd  (%rdi),%xmm5
movsd  0x8(%rdi),%xmm6
movsd  0x10(%rdi),%xmm7
mov    %rsp,%rdi
xorps  %xmm4,%xmm4
call   1030 <hamilton_product@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  (%rbx),%xmm4
movsd  0x8(%rbx),%xmm5
movaps 0xe8f(%rip),%xmm8
xorps  %xmm8,%xmm5
movsd  0x10(%rbx),%xmm6
xorps  %xmm8,%xmm6
movsd  0x18(%rbx),%xmm7
xorps  %xmm8,%xmm7
lea    0x20(%rsp),%rdi
call   1030 <hamilton_product@plt>
movups 0x28(%rsp),%xmm0
movups %xmm0,(%r14)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rotate(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [4 x double]
%6 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%7 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 3
%19 = load double, double* %18
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 2
%28 = load double, double* %27
%29 = call i32 @hamilton_product(double* %7, double %10, double %13, double %16, double %19, double 0.000000e+00, double %22, double %25, double %28)
%30 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%31 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%32 = load double, double* %31
%33 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%34 = load double, double* %33
%35 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
%36 = load double, double* %35
%37 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
%38 = load double, double* %37
%39 = load double*, double** %4
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = fneg double %44
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 2
%48 = load double, double* %47
%49 = fneg double %48
%50 = load double*, double** %4
%51 = getelementptr inbounds double, double* %50, i64 3
%52 = load double, double* %51
%53 = fneg double %52
%54 = call i32 @hamilton_product(double* %30, double %32, double %34, double %36, double %38, double %41, double %45, double %49, double %53)
%55 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 1
%56 = load double, double* %55
%57 = load double*, double** %3
%58 = getelementptr inbounds double, double* %57, i64 0
store double %56, double* %58
%59 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 2
%60 = load double, double* %59
%61 = load double*, double** %3
%62 = getelementptr inbounds double, double* %61, i64 1
store double %60, double* %62
%63 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 3
%64 = load double, double* %63
%65 = load double*, double** %3
%66 = getelementptr inbounds double, double* %65, i64 2
store double %64, double* %66
ret void
}

LLVM IR (-O2):
define void @rotate(double* nocapture %0, double* nocapture %1) {
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %3 to i8*
%6 = bitcast [4 x double]* %4 to i8*
%7 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%8 = load double, double* %1
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 3
%14 = load double, double* %13
%15 = load double, double* %0
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %0, i64 2
%19 = load double, double* %18
%20 = call i32 @hamilton_product(double* %7, double %8, double %10, double %12, double %14, double 0.000000e+00, double %15, double %17, double %19)
%21 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%22 = load double, double* %7
%23 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%24 = load double, double* %23
%25 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%26 = load double, double* %25
%27 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%28 = load double, double* %27
%29 = load double, double* %1
%30 = load double, double* %9
%31 = fneg double %30
%32 = load double, double* %11
%33 = fneg double %32
%34 = load double, double* %13
%35 = fneg double %34
%36 = call i32 @hamilton_product(double* %21, double %22, double %24, double %26, double %28, double %29, double %31, double %33, double %35)
%37 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = bitcast double* %0 to <2 x double>*
store <2 x double> %39, <2 x double>* %40
%41 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
%42 = load double, double* %41
store double %42, double* %18
ret void
}