#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);
float RotateScalePointX(float x, float y, float centerX, float centerY,
                        float degrees, float scaleX, float scaleY) {
  float dx = (x - centerX) * scaleX;
  float dy = (y - centerY) * scaleY;
  return (Cos(degrees) * dx) - (Sin(degrees) * dy) + centerX;
}


x86 assembly (clang, -O0):
<RotateScalePointX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Cos@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <Sin@plt>
movss  -0x2c(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotateScalePointX>:
sub    $0x18,%rsp
movss  %xmm4,0x4(%rsp)
movss  %xmm2,0x14(%rsp)
subss  %xmm2,%xmm0
mulss  %xmm5,%xmm0
movss  %xmm0,0x10(%rsp)
subss  %xmm3,%xmm1
mulss  %xmm6,%xmm1
movss  %xmm1,0xc(%rsp)
movaps %xmm4,%xmm0
call   1040 <Cos@plt>
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <Sin@plt>
mulss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
addss  0x14(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float @RotateScalePointX(float %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = fsub float %0, %2
%9 = fmul float %8, %5
%10 = fsub float %1, %3
%11 = fmul float %10, %6
%12 = tail call float @Cos(float %4)
%13 = tail call float @Sin(float %4)
%14 = fneg float %13
%15 = fmul float %11, %14
%16 = tail call float @llvm.fmuladd.f32(float %12, float %9, float %15)
%17 = fadd float %16, %2
ret float %17
}