#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 const);
scalar_t__ sin(double const);
void doubles_xyt_inv(const double xyta[3], double xytr[3]) {
  double s = (double)sin(xyta[2]), c = (double)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>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1040 <cos@plt>
cvtsi2sd %rax,%xmm0
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>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd 0xea2(%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 i64 @sin(double %9)
%11 = sitofp i64 %10 to double
store double %11, double* %5
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i64 @cos(double %14)
%16 = sitofp i64 %15 to double
store double %16, double* %6
%17 = load double, double* %5
%18 = fneg double %17
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double, double* %6
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = fmul double %22, %25
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %18, double %21, double %27)
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 0
store double %28, double* %30
%31 = load double, double* %6
%32 = fneg double %31
%33 = load double*, double** %3
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = load double, double* %5
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = fmul double %36, %39
%41 = call double @llvm.fmuladd.f64(double %32, double %35, double %40)
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 1
store double %41, double* %43
%44 = load double*, double** %3
%45 = getelementptr inbounds double, double* %44, i64 2
%46 = load double, double* %45
%47 = fneg double %46
%48 = load double*, double** %4
%49 = getelementptr inbounds double, double* %48, i64 2
store double %47, double* %49
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 i64 @sin(double %4)
%6 = sitofp i64 %5 to double
%7 = load double, double* %3
%8 = tail call i64 @cos(double %7)
%9 = sitofp i64 %8 to double
%10 = fneg double %6
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = load double, double* %0
%14 = fneg double %13
%15 = fmul double %9, %14
%16 = tail call double @llvm.fmuladd.f64(double %10, double %12, double %15)
store double %16, double* %1
%17 = fneg double %9
%18 = load double, double* %11
%19 = load double, double* %0
%20 = fmul double %19, %6
%21 = tail call double @llvm.fmuladd.f64(double %17, double %18, double %20)
%22 = getelementptr inbounds double, double* %1, i64 1
store double %21, double* %22
%23 = load double, double* %3
%24 = fneg double %23
%25 = getelementptr inbounds double, double* %1, i64 2
store double %24, double* %25
ret void
}