#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_inv_mul(const double xyta[3], const double xytb[3],
                         double xytr[3]) {
  double theta = xyta[2];
  double ca = cos(theta);
  double sa = sin(theta);
  double dx = xytb[0] - xyta[0];
  double dy = xytb[1] - xyta[1];
  xytr[0] = ca * dx + sa * dy;
  xytr[1] = -sa * dx + ca * dy;
  xytr[2] = xytb[2] - xyta[2];
}


x86 assembly (clang, -O0):
<doubles_xyt_inv_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  0x10(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_xyt_inv_mul>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  (%r15),%xmm1
movsd  0x8(%r15),%xmm2
subsd  (%rbx),%xmm1
subsd  0x8(%rbx),%xmm2
movapd 0xe92(%rip),%xmm3
xorpd  %xmm0,%xmm3
movapd 0x10(%rsp),%xmm4
unpcklpd %xmm4,%xmm0
unpcklpd %xmm2,%xmm2
mulpd  %xmm0,%xmm2
unpcklpd %xmm3,%xmm4
unpcklpd %xmm1,%xmm1
mulpd  %xmm4,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,(%r14)
movsd  0x10(%r15),%xmm0
subsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @doubles_xyt_inv_mul(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = load double, double* %4
%6 = tail call double @cos(double %5)
%7 = tail call double @sin(double %5)
%8 = load double, double* %1
%9 = load double, double* %0
%10 = fsub double %8, %9
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = fsub double %12, %14
%16 = fneg double %7
%17 = insertelement <2 x double> poison, double %7, i64 0
%18 = insertelement <2 x double> %17, double %6, i64 1
%19 = insertelement <2 x double> poison, double %15, i64 0
%20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
%21 = fmul <2 x double> %18, %20
%22 = insertelement <2 x double> poison, double %6, i64 0
%23 = insertelement <2 x double> %22, double %16, i64 1
%24 = insertelement <2 x double> poison, double %10, i64 0
%25 = shufflevector <2 x double> %24, <2 x double> poison, <2 x i32> zeroinitializer
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %25, <2 x double> %21)
%27 = bitcast double* %2 to <2 x double>*
store <2 x double> %26, <2 x double>* %27
%28 = getelementptr inbounds double, double* %1, i64 2
%29 = load double, double* %28
%30 = load double, double* %4
%31 = fsub double %29, %30
%32 = getelementptr inbounds double, double* %2, i64 2
store double %31, double* %32
ret void
}