#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_inv(const float xyta[3], float xytr[3]) {
  float s = sin(xyta[2]), c = cos(xyta[2]);
  xytr[0] = -s * xyta[1] - c * xyta[0];
  xytr[1] = -c * xyta[1] + s * xyta[0];
  xytr[2] = -xyta[2];
}


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

x86 assembly (clang, -O2):
<floats_xyt_inv>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  0x8(%rdi),%xmm0
call   1030 <sin@plt>
movaps %xmm0,(%rsp)
movss  0x8(%rbx),%xmm0
call   1040 <cos@plt>
movaps 0xeb4(%rip),%xmm1
movaps (%rsp),%xmm4
movaps %xmm4,%xmm2
xorps  %xmm1,%xmm2
movss  (%rbx),%xmm3
mulss  %xmm0,%xmm3
mulss  0x4(%rbx),%xmm2
subss  %xmm3,%xmm2
movss  %xmm2,(%r14)
movaps %xmm4,%xmm2
mulss  (%rbx),%xmm2
mulss  0x4(%rbx),%xmm0
subss  %xmm0,%xmm2
movss  %xmm2,0x4(%r14)
movss  0x8(%rbx),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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