#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 M_PI;
double atan2(float, float);
double cos(double);
double sin(double);
double sqrt(float);
void stl_rotate(float *x, float *y, float angle) {
  double r;
  double theta;
  double radian_angle;
  radian_angle = (angle / 180.0) * M_PI;
  r = sqrt((*x * *x) + (*y * *y));
  theta = atan2(*y, *x);
  *x = r * cos(theta + radian_angle);
  *y = r * sin(theta + radian_angle);
}


x86 assembly (clang, -O0):
<stl_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2e77(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stl_rotate>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
cvtss2sd %xmm0,%xmm0
divsd  0xea7(%rip),%xmm0
mov    0x2e88(%rip),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movss  (%r14),%xmm0
movss  (%rbx),%xmm1
call   1030 <atan2@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define void @stl_rotate(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca double
%8 = alloca double
%9 = alloca double
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = fdiv double %11, 1.800000e+02
%13 = load float, float* @M_PI
%14 = fpext float %13 to double
%15 = fmul double %12, %14
store double %15, double* %9
%16 = load float*, float** %4
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = load float, float* %18
%20 = load float*, float** %5
%21 = load float, float* %20
%22 = load float*, float** %5
%23 = load float, float* %22
%24 = fmul float %21, %23
%25 = call float @llvm.fmuladd.f32(float %17, float %19, float %24)
%26 = call double @sqrt(float %25)
store double %26, double* %7
%27 = load float*, float** %5
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = load float, float* %29
%31 = call double @atan2(float %28, float %30)
store double %31, double* %8
%32 = load double, double* %7
%33 = load double, double* %8
%34 = load double, double* %9
%35 = fadd double %33, %34
%36 = call double @cos(double %35)
%37 = fmul double %32, %36
%38 = fptrunc double %37 to float
%39 = load float*, float** %4
store float %38, float* %39
%40 = load double, double* %7
%41 = load double, double* %8
%42 = load double, double* %9
%43 = fadd double %41, %42
%44 = call double @sin(double %43)
%45 = fmul double %40, %44
%46 = fptrunc double %45 to float
%47 = load float*, float** %5
store float %46, float* %47
ret void
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define void @stl_rotate(float* nocapture %0, float* nocapture %1, float %2) {
%4 = fpext float %2 to double
%5 = fdiv double %4, 1.800000e+02
%6 = load float, float* @M_PI
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = load float, float* %0
%10 = load float, float* %1
%11 = fmul float %10, %10
%12 = tail call float @llvm.fmuladd.f32(float %9, float %9, float %11)
%13 = tail call double @sqrt(float %12)
%14 = load float, float* %1
%15 = load float, float* %0
%16 = tail call double @atan2(float %14, float %15)
%17 = fadd double %8, %16
%18 = tail call double @cos(double %17)
%19 = fmul double %13, %18
%20 = fptrunc double %19 to float
store float %20, float* %0
%21 = tail call double @sin(double %17)
%22 = fmul double %13, %21
%23 = fptrunc double %22 to float
store float %23, float* %1
ret void
}