#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);
double sin(double);
char ellipse(double xcen, double ycen, double xrad, double yrad, double rot,
             double xcol, double ycol) {
  double x, y, xprime, yprime, dx, dy, dlen, theta;
  theta = (rot / 180.0) * 3.1415926535897932385;
  xprime = xcol - xcen;
  yprime = ycol - ycen;
  x = xprime * cos(theta) + yprime * sin(theta);
  y = -xprime * sin(theta) + yprime * cos(theta);
  dx = x / xrad;
  dy = y / yrad;
  dx *= dx;
  dy *= dy;
  dlen = dx + dy;
  if (dlen <= 1.0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ellipse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xd44(%rip),%xmm0
ucomisd -0x78(%rbp),%xmm0
jb     12d0 <ellipse+0x1b0>
movb   $0x1,-0x1(%rbp)
jmp    12d4 <ellipse+0x1b4>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellipse>:
sub    $0x98,%rsp
movaps %xmm3,0x80(%rsp)
movaps %xmm2,0x70(%rsp)
divsd  0xec4(%rip),%xmm4
mulsd  0xec4(%rip),%xmm4
movsd  %xmm4,0x8(%rsp)
subsd  %xmm0,%xmm5
movapd %xmm5,0x10(%rsp)
subsd  %xmm1,%xmm6
movapd %xmm6,0x50(%rsp)
movapd %xmm4,%xmm0
call   1040 <cos@plt>
movapd %xmm0,0x60(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x30(%rsp)
movaps 0xe9c(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x50(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movapd 0x30(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movapd 0x10(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
movapd 0x60(%rsp),%xmm1
unpcklpd 0x20(%rsp),%xmm1
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
movapd 0x70(%rsp),%xmm0
unpcklpd 0x80(%rsp),%xmm0
divpd  %xmm0,%xmm1
mulpd  %xmm1,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe04(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
add    $0x98,%rsp
ret

LLVM IR (-O0):
define signext i8 @ellipse(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca i8
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
%24 = load double, double* %13
%25 = fdiv double %24, 1.800000e+02
%26 = fmul double %25, 0x400921FB54442D18
store double %26, double* %23
%27 = load double, double* %14
%28 = load double, double* %9
%29 = fsub double %27, %28
store double %29, double* %18
%30 = load double, double* %15
%31 = load double, double* %10
%32 = fsub double %30, %31
store double %32, double* %19
%33 = load double, double* %18
%34 = load double, double* %23
%35 = call double @cos(double %34)
%36 = load double, double* %19
%37 = load double, double* %23
%38 = call double @sin(double %37)
%39 = fmul double %36, %38
%40 = call double @llvm.fmuladd.f64(double %33, double %35, double %39)
store double %40, double* %16
%41 = load double, double* %18
%42 = fneg double %41
%43 = load double, double* %23
%44 = call double @sin(double %43)
%45 = load double, double* %19
%46 = load double, double* %23
%47 = call double @cos(double %46)
%48 = fmul double %45, %47
%49 = call double @llvm.fmuladd.f64(double %42, double %44, double %48)
store double %49, double* %17
%50 = load double, double* %16
%51 = load double, double* %11
%52 = fdiv double %50, %51
store double %52, double* %20
%53 = load double, double* %17
%54 = load double, double* %12
%55 = fdiv double %53, %54
store double %55, double* %21
%56 = load double, double* %20
%57 = load double, double* %20
%58 = fmul double %57, %56
store double %58, double* %20
%59 = load double, double* %21
%60 = load double, double* %21
%61 = fmul double %60, %59
store double %61, double* %21
%62 = load double, double* %20
%63 = load double, double* %21
%64 = fadd double %62, %63
store double %64, double* %22
%65 = load double, double* %22
%66 = fcmp ole double %65, 1.000000e+00
br i1 %66, label %67, label %68
67: ; preds = %7
store i8 1, i8* %8
br label %69
68: ; preds = %7
store i8 0, i8* %8
br label %69
69: ; preds = %68, %67
%70 = load i8, i8* %8
ret i8 %70
}

LLVM IR (-O2):
define signext i8 @ellipse(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fdiv double %4, 1.800000e+02
%9 = fmul double %8, 0x400921FB54442D18
%10 = fsub double %5, %0
%11 = fsub double %6, %1
%12 = tail call double @cos(double %9)
%13 = tail call double @sin(double %9)
%14 = fneg double %10
%15 = tail call double @sin(double %9)
%16 = tail call double @cos(double %9)
%17 = insertelement <2 x double> poison, double %11, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = insertelement <2 x double> poison, double %13, i64 0
%20 = insertelement <2 x double> %19, double %16, i64 1
%21 = fmul <2 x double> %18, %20
%22 = insertelement <2 x double> poison, double %10, i64 0
%23 = insertelement <2 x double> %22, double %14, i64 1
%24 = insertelement <2 x double> poison, double %12, i64 0
%25 = insertelement <2 x double> %24, double %15, i64 1
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %23, <2 x double> %25, <2 x double> %21)
%27 = insertelement <2 x double> poison, double %2, i64 0
%28 = insertelement <2 x double> %27, double %3, i64 1
%29 = fdiv <2 x double> %26, %28
%30 = fmul <2 x double> %29, %29
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%32 = fadd <2 x double> %30, %31
%33 = extractelement <2 x double> %32, i64 0
%34 = fcmp ole double %33, 1.000000e+00
%35 = zext i1 %34 to i8
ret i8 %35
}