#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_mul(const float xyta[3], const float xytb[3], float xytr[3]) {
  float xa = xyta[0], ya = xyta[1], ta = xyta[2];
  float s = (float)sin(ta), c = (float)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>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
call   1040 <cos@plt>
cvtsi2ss %rax,%xmm0
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>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
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 i64 @sin(float %21)
%23 = sitofp i64 %22 to float
store float %23, float* %10
%24 = load float, float* %9
%25 = call i64 @cos(float %24)
%26 = sitofp i64 %25 to float
store float %26, float* %11
%27 = load float, float* %11
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 0
%30 = load float, float* %29
%31 = load float, float* %10
%32 = load float*, float** %5
%33 = getelementptr inbounds float, float* %32, i64 1
%34 = load float, float* %33
%35 = fmul float %31, %34
%36 = fneg float %35
%37 = call float @llvm.fmuladd.f32(float %27, float %30, float %36)
%38 = load float, float* %7
%39 = fadd float %37, %38
%40 = load float*, float** %6
%41 = getelementptr inbounds float, float* %40, i64 0
store float %39, float* %41
%42 = load float, float* %10
%43 = load float*, float** %5
%44 = getelementptr inbounds float, float* %43, i64 0
%45 = load float, float* %44
%46 = load float, float* %11
%47 = load float*, float** %5
%48 = getelementptr inbounds float, float* %47, i64 1
%49 = load float, float* %48
%50 = fmul float %46, %49
%51 = call float @llvm.fmuladd.f32(float %42, float %45, float %50)
%52 = load float, float* %8
%53 = fadd float %51, %52
%54 = load float*, float** %6
%55 = getelementptr inbounds float, float* %54, i64 1
store float %53, float* %55
%56 = load float, float* %9
%57 = load float*, float** %5
%58 = getelementptr inbounds float, float* %57, i64 2
%59 = load float, float* %58
%60 = fadd float %56, %59
%61 = load float*, float** %6
%62 = getelementptr inbounds float, float* %61, i64 2
store float %60, float* %62
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 i64 @sin(float %8)
%10 = sitofp i64 %9 to float
%11 = tail call i64 @cos(float %8)
%12 = sitofp i64 %11 to float
%13 = load float, float* %1
%14 = getelementptr inbounds float, float* %1, i64 1
%15 = load float, float* %14
%16 = fneg float %15
%17 = fmul float %10, %16
%18 = tail call float @llvm.fmuladd.f32(float %12, float %13, float %17)
%19 = fadd float %4, %18
store float %19, float* %2
%20 = load float, float* %1
%21 = load float, float* %14
%22 = fmul float %21, %12
%23 = tail call float @llvm.fmuladd.f32(float %10, float %20, float %22)
%24 = fadd float %6, %23
%25 = getelementptr inbounds float, float* %2, i64 1
store float %24, float* %25
%26 = getelementptr inbounds float, float* %1, i64 2
%27 = load float, float* %26
%28 = fadd float %8, %27
%29 = getelementptr inbounds float, float* %2, i64 2
store float %28, float* %29
ret void
}