#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_inv_mul(const double xyta[3], const double xytb[3],
                         double xytr[3]) {
  double theta = xyta[2];
  double ca = (double)cos(theta);
  double sa = (double)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>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
cvtsi2sd %rax,%xmm0
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    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%r15),%xmm1
movsd  0x8(%r15),%xmm2
subsd  (%rbx),%xmm1
subsd  0x8(%rbx),%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
movsd  0x8(%rsp),%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,(%r14)
mulsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%r14)
movsd  0x10(%r15),%xmm0
subsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x10,%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 i64 @cos(double %15)
%17 = sitofp i64 %16 to double
store double %17, double* %8
%18 = load double, double* %7
%19 = call i64 @sin(double %18)
%20 = sitofp i64 %19 to double
store double %20, double* %9
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fsub double %23, %26
store double %27, double* %10
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = fsub double %30, %33
store double %34, double* %11
%35 = load double, double* %8
%36 = load double, double* %10
%37 = load double, double* %9
%38 = load double, double* %11
%39 = fmul double %37, %38
%40 = call double @llvm.fmuladd.f64(double %35, double %36, double %39)
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 0
store double %40, double* %42
%43 = load double, double* %9
%44 = fneg double %43
%45 = load double, double* %10
%46 = load double, double* %8
%47 = load double, double* %11
%48 = fmul double %46, %47
%49 = call double @llvm.fmuladd.f64(double %44, double %45, double %48)
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 1
store double %49, double* %51
%52 = load double*, double** %5
%53 = getelementptr inbounds double, double* %52, i64 2
%54 = load double, double* %53
%55 = load double*, double** %4
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = fsub 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_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 i64 @cos(double %5)
%7 = sitofp i64 %6 to double
%8 = tail call i64 @sin(double %5)
%9 = sitofp i64 %8 to double
%10 = load double, double* %1
%11 = load double, double* %0
%12 = fsub double %10, %11
%13 = getelementptr inbounds double, double* %1, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 1
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = fmul double %17, %9
%19 = tail call double @llvm.fmuladd.f64(double %7, double %12, double %18)
store double %19, double* %2
%20 = fneg double %9
%21 = fmul double %17, %7
%22 = tail call double @llvm.fmuladd.f64(double %20, double %12, double %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 = load double, double* %4
%27 = fsub double %25, %26
%28 = getelementptr inbounds double, double* %2, i64 2
store double %27, double* %28
ret void
}