#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 */
double cos(double);
double 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 = sin(ta), c = 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>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
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>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
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 double @sin(double %21)
store double %22, double* %10
%23 = load double, double* %9
%24 = call double @cos(double %23)
store double %24, double* %11
%25 = load double, double* %11
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double, double* %10
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = fmul double %29, %32
%34 = fneg double %33
%35 = call double @llvm.fmuladd.f64(double %25, double %28, double %34)
%36 = load double, double* %7
%37 = fadd double %35, %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 0
store double %37, double* %39
%40 = load double, double* %10
%41 = load double*, double** %5
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = load double, double* %11
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = fmul double %44, %47
%49 = call double @llvm.fmuladd.f64(double %40, double %43, double %48)
%50 = load double, double* %8
%51 = fadd double %49, %50
%52 = load double*, double** %6
%53 = getelementptr inbounds double, double* %52, i64 1
store double %51, double* %53
%54 = load double, double* %9
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = fadd double %54, %57
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 2
store double %58, double* %60
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 double @sin(double %8)
%10 = tail call double @cos(double %8)
%11 = load double, double* %1
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = fneg double %9
%15 = fmul double %13, %14
%16 = tail call double @llvm.fmuladd.f64(double %10, double %11, double %15)
%17 = fadd double %4, %16
store double %17, double* %2
%18 = load double, double* %1
%19 = load double, double* %12
%20 = fmul double %10, %19
%21 = tail call double @llvm.fmuladd.f64(double %9, double %18, double %20)
%22 = fadd double %6, %21
%23 = getelementptr inbounds double, double* %2, i64 1
store double %22, double* %23
%24 = getelementptr inbounds double, double* %1, i64 2
%25 = load double, double* %24
%26 = fadd double %8, %25
%27 = getelementptr inbounds double, double* %2, i64 2
store double %26, double* %27
ret void
}