#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 */
scalar_t__ cos(double);
scalar_t__ sin(double);
void doubles_xyt_mul(const double xyta[3], const double xytb[3],
                     double xytr[3]) {
  double xa = xyta[0], ya = xyta[1], ta = xyta[2];
  double s = (double)sin(ta), c = (double)cos(ta);
  xytr[0] = c * xytb[0] - s * xytb[1] + xa;
  xytr[1] = s * xytb[0] + c * xytb[1] + ya;
  xytr[2] = ta + xytb[2];
}


x86 assembly (clang, -O0):
<doubles_xyt_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_xyt_mul>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movsd  (%rbx),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
addsd  0x18(%rsp),%xmm2
movsd  %xmm2,(%r14)
mulsd  0x8(%rbx),%xmm0
movapd %xmm3,%xmm1
mulsd  (%rbx),%xmm1
addsd  %xmm0,%xmm1
addsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_xyt_mul(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
store double %14, double* %7
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
store double %17, double* %8
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
store double %20, double* %9
%21 = load double, double* %9
%22 = call i64 @sin(double %21)
%23 = sitofp i64 %22 to double
store double %23, double* %10
%24 = load double, double* %9
%25 = call i64 @cos(double %24)
%26 = sitofp i64 %25 to double
store double %26, double* %11
%27 = load double, double* %11
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = load double, double* %10
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = fmul double %31, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %27, double %30, double %36)
%38 = load double, double* %7
%39 = fadd double %37, %38
%40 = load double*, double** %6
%41 = getelementptr inbounds double, double* %40, i64 0
store double %39, double* %41
%42 = load double, double* %10
%43 = load double*, double** %5
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
%46 = load double, double* %11
%47 = load double*, double** %5
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
%50 = fmul double %46, %49
%51 = call double @llvm.fmuladd.f64(double %42, double %45, double %50)
%52 = load double, double* %8
%53 = fadd double %51, %52
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 1
store double %53, double* %55
%56 = load double, double* %9
%57 = load double*, double** %5
%58 = getelementptr inbounds double, double* %57, i64 2
%59 = load double, double* %58
%60 = fadd double %56, %59
%61 = load double*, double** %6
%62 = getelementptr inbounds double, double* %61, i64 2
store double %60, double* %62
ret void
}

LLVM IR (-O2):
define void @doubles_xyt_mul(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call i64 @sin(double %8)
%10 = sitofp i64 %9 to double
%11 = tail call i64 @cos(double %8)
%12 = sitofp i64 %11 to double
%13 = load double, double* %1
%14 = getelementptr inbounds double, double* %1, i64 1
%15 = load double, double* %14
%16 = fneg double %15
%17 = fmul double %10, %16
%18 = tail call double @llvm.fmuladd.f64(double %12, double %13, double %17)
%19 = fadd double %4, %18
store double %19, double* %2
%20 = load double, double* %1
%21 = load double, double* %14
%22 = fmul double %21, %12
%23 = tail call double @llvm.fmuladd.f64(double %10, double %20, double %22)
%24 = fadd double %6, %23
%25 = getelementptr inbounds double, double* %2, i64 1
store double %24, double* %25
%26 = getelementptr inbounds double, double* %1, i64 2
%27 = load double, double* %26
%28 = fadd double %8, %27
%29 = getelementptr inbounds double, double* %2, i64 2
store double %28, double* %29
ret void
}