#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 */
double cos(double const);
double sin(double const);
void __cc_rot_rad(double *x, double *y, const double rad, double *temp) {
  *temp = *x;
  *x = *x * cos(rad) - *y * sin(rad);
  *y = *temp * sin(rad) + *y * cos(rad);
}


x86 assembly (clang, -O0):
<__cc_rot_rad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cc_rot_rad>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
movsd  %xmm0,0x18(%rsp)
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  %xmm1,(%rdx)
movsd  (%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r15),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r15),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__cc_rot_rad(double* nocapture %0, double* nocapture %1, double %2, double* nocapture %3) {
%5 = load double, double* %0
store double %5, double* %3
%6 = load double, double* %0
%7 = tail call double @cos(double %2)
%8 = load double, double* %1
%9 = tail call double @sin(double %2)
%10 = fneg double %8
%11 = fmul double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %11)
store double %12, double* %0
%13 = load double, double* %3
%14 = tail call double @sin(double %2)
%15 = load double, double* %1
%16 = tail call double @cos(double %2)
%17 = fmul double %15, %16
%18 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %17)
store double %18, double* %1
ret void
}