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