#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_transform_xy(const double xyt[3], const double xy[2],
                              double r[2]) {
  double s = (double)sin(xyt[2]), c = (double)cos(xyt[2]);
  r[0] = c * xy[0] - s * xy[1] + xyt[0];
  r[1] = s * xy[0] + c * xy[1] + xyt[1];
}


x86 assembly (clang, -O0):
<doubles_xyt_transform_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <sin@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1040 <cos@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x20(%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
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_xyt_transform_xy>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsd  0x10(%rdi),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%r15),%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rbx),%xmm1
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movsd  (%rbx),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
addsd  (%r15),%xmm2
movsd  %xmm2,(%r14)
mulsd  0x8(%rbx),%xmm0
movapd %xmm3,%xmm1
mulsd  (%rbx),%xmm1
addsd  %xmm0,%xmm1
addsd  0x8(%r15),%xmm1
movsd  %xmm1,0x8(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @doubles_xyt_transform_xy(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 @sin(double %5)
%7 = sitofp i64 %6 to double
%8 = load double, double* %4
%9 = tail call i64 @cos(double %8)
%10 = sitofp i64 %9 to double
%11 = load double, double* %1
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = fneg double %13
%15 = fmul double %7, %14
%16 = tail call double @llvm.fmuladd.f64(double %10, double %11, double %15)
%17 = load double, double* %0
%18 = fadd double %17, %16
store double %18, double* %2
%19 = load double, double* %1
%20 = load double, double* %12
%21 = fmul double %20, %10
%22 = tail call double @llvm.fmuladd.f64(double %7, double %19, double %21)
%23 = getelementptr inbounds double, double* %0, i64 1
%24 = load double, double* %23
%25 = fadd double %24, %22
%26 = getelementptr inbounds double, double* %2, i64 1
store double %25, double* %26
ret void
}