#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);
scalar_t__ sin(float);
void floats_xyt_inv_mul(const float xyta[3], const float xytb[3],
                        float xytr[3]) {
  float theta = xyta[2];
  float ca = (float)cos(theta);
  float sa = (float)sin(theta);
  float dx = xytb[0] - xyta[0];
  float dy = xytb[1] - xyta[1];
  xytr[0] = ca * dx + sa * dy;
  xytr[1] = -sa * dx + ca * dy;
  xytr[2] = xytb[2] - xyta[2];
}


x86 assembly (clang, -O0):
<floats_xyt_inv_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1040 <cos@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x28(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x28(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

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

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

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