#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 */
float cos(float const);
float sin(float const);
void floats_xyt_transform_xy(const float xyt[3], const float xy[2],
                             float r[2]) {
  float 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):
<floats_xyt_transform_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
movss  -0x1c(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
movss  -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_xyt_transform_xy>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movss  0x8(%rdi),%xmm0
call   1030 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%r15),%xmm0
call   1040 <cos@plt>
movss  0x4(%rbx),%xmm1
movss  0xc(%rsp),%xmm3
mulss  %xmm3,%xmm1
movss  (%rbx),%xmm2
mulss  %xmm0,%xmm2
subss  %xmm1,%xmm2
addss  (%r15),%xmm2
movss  %xmm2,(%r14)
mulss  0x4(%rbx),%xmm0
movaps %xmm3,%xmm1
mulss  (%rbx),%xmm1
addss  %xmm0,%xmm1
addss  0x4(%r15),%xmm1
movss  %xmm1,0x4(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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