#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 aTb_inv(float aP[2], float bP[2], float b[3]) {
  bP[0] = (aP[0] - b[0]) * cos(b[2]) + (aP[1] - b[1]) * sin(b[2]);
  bP[1] = -(aP[0] - b[0]) * sin(b[2]) + (aP[1] - b[1]) * cos(b[2]);
}


x86 assembly (clang, -O0):
<aTb_inv>:
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  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <sin@plt>
movss  -0x30(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x28(%rbp),%xmm0
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1040 <cos@plt>
movss  -0x24(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x1c(%rbp),%xmm0
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x30,%rsp
pop    %rbp
ret

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

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

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