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


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

x86 assembly (clang, -O2):
<doubles_xyt_inv>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  0x10(%rdi),%xmm0
call   1030 <sin@plt>
movaps %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
call   1040 <cos@plt>
movapd 0xeb3(%rip),%xmm1
movapd (%rsp),%xmm4
movapd %xmm4,%xmm2
xorpd  %xmm1,%xmm2
movsd  (%rbx),%xmm3
mulsd  %xmm0,%xmm3
mulsd  0x8(%rbx),%xmm2
subsd  %xmm3,%xmm2
movsd  %xmm2,(%r14)
movapd %xmm4,%xmm2
mulsd  (%rbx),%xmm2
mulsd  0x8(%rbx),%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%r14)
movsd  0x10(%rbx),%xmm0
xorpd  %xmm1,%xmm0
movlpd %xmm0,0x10(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_xyt_inv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 2
%9 = load double, double* %8
%10 = call double @sin(double %9)
store double %10, double* %5
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 2
%13 = load double, double* %12
%14 = call double @cos(double %13)
store double %14, double* %6
%15 = load double, double* %5
%16 = fneg double %15
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double, double* %6
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fmul double %20, %23
%25 = fneg double %24
%26 = call double @llvm.fmuladd.f64(double %16, double %19, double %25)
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 0
store double %26, double* %28
%29 = load double, double* %6
%30 = fneg double %29
%31 = load double*, double** %3
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = load double, double* %5
%35 = load double*, double** %3
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fmul double %34, %37
%39 = call double @llvm.fmuladd.f64(double %30, double %33, double %38)
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 1
store double %39, double* %41
%42 = load double*, double** %3
%43 = getelementptr inbounds double, double* %42, i64 2
%44 = load double, double* %43
%45 = fneg double %44
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 2
store double %45, double* %47
ret void
}

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