#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 RotatePoint(float *x, float *y, float rotation) {
  float tmpX, tmpY;
  tmpX = *x * Cos(rotation) - *y * Sin(rotation);
  tmpY = *y * Cos(rotation) + *x * Sin(rotation);
  *x = tmpX;
  *y = tmpY;
}


x86 assembly (clang, -O0):
<RotatePoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Cos@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <Sin@plt>
movss  -0x34(%rbp),%xmm1
movss  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x2c(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Cos@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <Sin@plt>
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x20(%rbp),%xmm0
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RotatePoint(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = load float, float* %6
%12 = call float @Cos(float %11)
%13 = load float*, float** %5
%14 = load float, float* %13
%15 = load float, float* %6
%16 = call float @Sin(float %15)
%17 = fmul float %14, %16
%18 = fneg float %17
%19 = call float @llvm.fmuladd.f32(float %10, float %12, float %18)
store float %19, float* %7
%20 = load float*, float** %5
%21 = load float, float* %20
%22 = load float, float* %6
%23 = call float @Cos(float %22)
%24 = load float*, float** %4
%25 = load float, float* %24
%26 = load float, float* %6
%27 = call float @Sin(float %26)
%28 = fmul float %25, %27
%29 = call float @llvm.fmuladd.f32(float %21, float %23, float %28)
store float %29, float* %8
%30 = load float, float* %7
%31 = load float*, float** %4
store float %30, float* %31
%32 = load float, float* %8
%33 = load float*, float** %5
store float %32, float* %33
ret void
}

LLVM IR (-O2):
define void @RotatePoint(float* nocapture %0, float* nocapture %1, float %2) {
%4 = load float, float* %0
%5 = tail call float @Cos(float %2)
%6 = load float, float* %1
%7 = tail call float @Sin(float %2)
%8 = fneg float %6
%9 = fmul float %7, %8
%10 = tail call float @llvm.fmuladd.f32(float %4, float %5, float %9)
%11 = load float, float* %1
%12 = tail call float @Cos(float %2)
%13 = load float, float* %0
%14 = tail call float @Sin(float %2)
%15 = fmul float %13, %14
%16 = tail call float @llvm.fmuladd.f32(float %11, float %12, float %15)
store float %10, float* %0
store float %16, float* %1
ret void
}