#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);
float sin(float);
void floats_xyt_inv_mul(const float xyta[3], const float xytb[3],
                        float xytr[3]) {
  float theta = xyta[2];
  float ca = cos(theta);
  float sa = 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>
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <sin@plt>
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>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movss  (%r15),%xmm1
movss  0x4(%r15),%xmm2
subss  (%rbx),%xmm1
subss  0x4(%rbx),%xmm2
movss  0xc(%rsp),%xmm4
movaps %xmm4,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm0,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm0,%xmm3
movss  %xmm3,(%r14)
mulss  %xmm4,%xmm2
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 float @cos(float %15)
store float %16, float* %8
%17 = load float, float* %7
%18 = call float @sin(float %17)
store float %18, float* %9
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 0
%24 = load float, float* %23
%25 = fsub float %21, %24
store float %25, float* %10
%26 = load float*, float** %5
%27 = getelementptr inbounds float, float* %26, i64 1
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 1
%31 = load float, float* %30
%32 = fsub float %28, %31
store float %32, float* %11
%33 = load float, float* %8
%34 = load float, float* %10
%35 = load float, float* %9
%36 = load float, float* %11
%37 = fmul float %35, %36
%38 = call float @llvm.fmuladd.f32(float %33, float %34, float %37)
%39 = load float*, float** %6
%40 = getelementptr inbounds float, float* %39, i64 0
store float %38, float* %40
%41 = load float, float* %9
%42 = fneg float %41
%43 = load float, float* %10
%44 = load float, float* %8
%45 = load float, float* %11
%46 = fmul float %44, %45
%47 = call float @llvm.fmuladd.f32(float %42, float %43, float %46)
%48 = load float*, float** %6
%49 = getelementptr inbounds float, float* %48, i64 1
store float %47, float* %49
%50 = load float*, float** %5
%51 = getelementptr inbounds float, float* %50, i64 2
%52 = load float, float* %51
%53 = load float*, float** %4
%54 = getelementptr inbounds float, float* %53, i64 2
%55 = load float, float* %54
%56 = fsub float %52, %55
%57 = load float*, float** %6
%58 = getelementptr inbounds float, float* %57, i64 2
store float %56, float* %58
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 float @cos(float %5)
%7 = tail call float @sin(float %5)
%8 = load float, float* %1
%9 = load float, float* %0
%10 = fsub float %8, %9
%11 = getelementptr inbounds float, float* %1, i64 1
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 1
%14 = load float, float* %13
%15 = fsub float %12, %14
%16 = fmul float %7, %15
%17 = tail call float @llvm.fmuladd.f32(float %6, float %10, float %16)
store float %17, float* %2
%18 = fneg float %7
%19 = fmul float %6, %15
%20 = tail call float @llvm.fmuladd.f32(float %18, float %10, float %19)
%21 = getelementptr inbounds float, float* %2, i64 1
store float %20, float* %21
%22 = getelementptr inbounds float, float* %1, i64 2
%23 = load float, float* %22
%24 = load float, float* %4
%25 = fsub float %23, %24
%26 = getelementptr inbounds float, float* %2, i64 2
store float %25, float* %26
ret void
}