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