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


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

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

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