#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 */
int /*<<< orphan*/ flyback();
int /*<<< orphan*/ hvflush();
int /*<<< orphan*/ move(double, double);
int /*<<< orphan*/ printf(char *, int, int);
double xsc(double);
double ysc(double);
void ellipse(double x, double y, double r1, double r2) {
  double ir1, ir2;
  move(x - r1, y);
  hvflush();
  ir1 = xsc(r1);
  ir2 = ysc(r2);
  printf("\\D'e%.3fi %.3fi'\n", 2 * ir1, 2 * (ir2 >= 0 ? ir2 : -(ir2)));
  flyback();
}


x86 assembly (clang, -O0):
<ellipse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1080 <move@plt>
mov    $0x0,%al
call   1040 <hvflush@plt>
movsd  -0x18(%rbp),%xmm0
call   1050 <xsc@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1070 <ysc@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe43(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11ea <ellipse+0x8a>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    120b <ellipse+0xab>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%esi
movsd  -0x40(%rbp),%xmm1
movsd  0xde5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <flyback@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellipse>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
subsd  %xmm2,%xmm0
call   1080 <move@plt>
xor    %eax,%eax
call   1040 <hvflush@plt>
movsd  0x8(%rsp),%xmm0
call   1050 <xsc@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <ysc@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%esi
movapd 0xe4e(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
addsd  %xmm2,%xmm2
cvttsd2si %xmm2,%edx
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1060 <flyback@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\\D'e%.3fi %.3fi'\0A\00"
define void @ellipse(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %6
%15 = call i32 @move(double %13, double %14)
%16 = call i32 (...) @hvflush()
%17 = load double, double* %7
%18 = call double @xsc(double %17)
store double %18, double* %9
%19 = load double, double* %8
%20 = call double @ysc(double %19)
store double %20, double* %10
%21 = load double, double* %9
%22 = fmul double 2.000000e+00, %21
%23 = fptosi double %22 to i32
%24 = load double, double* %10
%25 = fcmp oge double %24, 0.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %4
%27 = load double, double* %10
br label %31
28: ; preds = %4
%29 = load double, double* %10
%30 = fneg double %29
br label %31
31: ; preds = %28, %26
%32 = phi double [ %27, %26 ], [ %30, %28 ]
%33 = fmul double 2.000000e+00, %32
%34 = fptosi double %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %34)
%36 = call i32 (...) @flyback()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\\D'e%.3fi %.3fi'\0A\00"
define void @ellipse(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = tail call i32 @move(double %5, double %1)
%7 = tail call i32 (...) @hvflush()
%8 = tail call double @xsc(double %2)
%9 = tail call double @ysc(double %3)
%10 = fmul double %8, 2.000000e+00
%11 = fptosi double %10 to i32
%12 = fcmp oge double %9, 0.000000e+00
%13 = fneg double %9
%14 = select i1 %12, double %9, double %13
%15 = fmul double %14, 2.000000e+00
%16 = fptosi double %15 to i32
%17 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
%18 = tail call i32 (...) @flyback()
ret void
}