#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 M_PI;
double cos(double);
double sin(double);
void degRot(double *horiP, double *vertP, double degrees) {
  double h, v;
  double hUc;
  double vUc;
  double hLine1, vLine1;
  double hLine2, vLine2;
  if (degrees != degrees)
    return;
  hUc = cos(degrees * (M_PI * 2.0 / 360.0));
  vUc = sin(degrees * (M_PI * 2.0 / 360.0));
  hLine1 = hUc;
  vLine1 = vUc;
  hLine2 = -vUc;
  vLine2 = hUc;
  h = *vertP * hLine2 + *horiP * vLine2;
  v = *horiP * vLine1 + *vertP * hLine1;
  *horiP = h;
  *vertP = v;
}


x86 assembly (clang, -O0):
<degRot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1150 <degRot+0x30>
jp     1150 <degRot+0x30>
jmp    1155 <degRot+0x35>
jmp    1260 <degRot+0x140>
movsd  -0x18(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
mov    0x2e7f(%rip),%rax
mulsd  (%rax),%xmm1
movsd  0xe8b(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
mov    0x2e4d(%rip),%rax
mulsd  (%rax),%xmm1
movsd  0xe59(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<degRot>:
ucomisd %xmm0,%xmm0
jp     11c1 <degRot+0xa1>
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea4(%rip),%r15
movsd  (%r15),%xmm0
addsd  %xmm0,%xmm0
divsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%r15),%xmm0
addsd  %xmm0,%xmm0
divsd  0xe86(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  (%r14),%xmm1
movsd  (%rbx),%xmm2
movsd  0x8(%rsp),%xmm4
movapd %xmm4,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm1
subsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm2
addsd  %xmm4,%xmm2
movsd  %xmm3,(%rbx)
movsd  %xmm2,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @degRot(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%15 = load double, double* %6
%16 = load double, double* %6
%17 = fcmp une double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %3
br label %57
19: ; preds = %3
%20 = load double, double* %6
%21 = load double, double* @M_PI
%22 = fmul double %21, 2.000000e+00
%23 = fdiv double %22, 3.600000e+02
%24 = fmul double %20, %23
%25 = call double @cos(double %24)
store double %25, double* %9
%26 = load double, double* %6
%27 = load double, double* @M_PI
%28 = fmul double %27, 2.000000e+00
%29 = fdiv double %28, 3.600000e+02
%30 = fmul double %26, %29
%31 = call double @sin(double %30)
store double %31, double* %10
%32 = load double, double* %9
store double %32, double* %11
%33 = load double, double* %10
store double %33, double* %12
%34 = load double, double* %10
%35 = fneg double %34
store double %35, double* %13
%36 = load double, double* %9
store double %36, double* %14
%37 = load double*, double** %5
%38 = load double, double* %37
%39 = load double, double* %13
%40 = load double*, double** %4
%41 = load double, double* %40
%42 = load double, double* %14
%43 = fmul double %41, %42
%44 = call double @llvm.fmuladd.f64(double %38, double %39, double %43)
store double %44, double* %7
%45 = load double*, double** %4
%46 = load double, double* %45
%47 = load double, double* %12
%48 = load double*, double** %5
%49 = load double, double* %48
%50 = load double, double* %11
%51 = fmul double %49, %50
%52 = call double @llvm.fmuladd.f64(double %46, double %47, double %51)
store double %52, double* %8
%53 = load double, double* %7
%54 = load double*, double** %4
store double %53, double* %54
%55 = load double, double* %8
%56 = load double*, double** %5
store double %55, double* %56
br label %57
57: ; preds = %19, %18
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @degRot(double* nocapture %0, double* nocapture %1, double %2) {
%4 = fcmp uno double %2, 0.000000e+00
br i1 %4, label %23, label %5
5: ; preds = %3
%6 = load double, double* @M_PI
%7 = fmul double %6, 2.000000e+00
%8 = fdiv double %7, 3.600000e+02
%9 = fmul double %8, %2
%10 = tail call double @cos(double %9)
%11 = load double, double* @M_PI
%12 = fmul double %11, 2.000000e+00
%13 = fdiv double %12, 3.600000e+02
%14 = fmul double %13, %2
%15 = tail call double @sin(double %14)
%16 = fneg double %15
%17 = load double, double* %1
%18 = load double, double* %0
%19 = fmul double %10, %18
%20 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %19)
%21 = fmul double %10, %17
%22 = tail call double @llvm.fmuladd.f64(double %18, double %15, double %21)
store double %20, double* %0
store double %22, double* %1
br label %23
23: ; preds = %3, %5
ret void
}