int VertLineToArc(x, y1, y2, rx, ry, start, extent)
double x;
double y1, y2;
double rx, ry;
double start, extent;
{
  double tmp;
  double tx, ty;
  double y;
  tx = x / rx;
  tmp = 1 - tx * tx;
  if (tmp < 0) {
    return 0;
  }
  ty = sqrt(tmp);
  y = ty * ry;
  if ((y > y1) && (y < y2) && AngleInRange(tx, ty, start, extent)) {
    return 1;
  }
  if ((-y > y1) && (-y < y2) && AngleInRange(tx, -ty, start, extent)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<VertLineToArc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    11aa <VertLineToArc+0x8a>
movl   $0x0,-0x4(%rbp)
jmp    12bc <VertLineToArc+0x19c>
movsd  -0x48(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    121c <VertLineToArc+0xfc>
movsd  -0x60(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    121c <VertLineToArc+0xfc>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mov    $0x4,%al
call   1030 <AngleInRange@plt>
cmp    $0x0,%eax
je     121c <VertLineToArc+0xfc>
movl   $0x1,-0x4(%rbp)
jmp    12bc <VertLineToArc+0x19c>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12b5 <VertLineToArc+0x195>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12b5 <VertLineToArc+0x195>
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mov    $0x4,%al
call   1030 <AngleInRange@plt>
cmp    $0x0,%eax
je     12b5 <VertLineToArc+0x195>
movl   $0x1,-0x4(%rbp)
jmp    12bc <VertLineToArc+0x19c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VertLineToArc>:
sub    $0x58,%rsp
movapd %xmm2,%xmm8
movapd %xmm1,%xmm7
movapd %xmm0,%xmm2
divsd  %xmm3,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xebb(%rip),%xmm0
subsd  %xmm1,%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1225 <VertLineToArc+0x105>
ucomisd %xmm1,%xmm0
movsd  %xmm6,0x28(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm8,0x10(%rsp)
movsd  %xmm7,0x8(%rsp)
jb     1187 <VertLineToArc+0x67>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    11ba <VertLineToArc+0x9a>
movaps %xmm4,0x30(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm7
movsd  0x10(%rsp),%xmm8
movapd 0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm5
movsd  0x28(%rsp),%xmm6
movapd %xmm0,%xmm1
mulsd  %xmm1,%xmm4
ucomisd %xmm7,%xmm4
jbe    122a <VertLineToArc+0x10a>
ucomisd %xmm4,%xmm8
jbe    122a <VertLineToArc+0x10a>
movapd %xmm2,%xmm0
movapd %xmm1,0x40(%rsp)
movaps 0x40(%rsp),%xmm1
movapd %xmm5,%xmm2
movapd %xmm6,%xmm3
mov    $0x4,%al
movapd %xmm4,0x30(%rsp)
call   1030 <AngleInRange@plt>
movapd 0x40(%rsp),%xmm1
movsd  0x8(%rsp),%xmm7
movsd  0x10(%rsp),%xmm8
movapd 0x30(%rsp),%xmm4
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm5
movsd  0x28(%rsp),%xmm6
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     122a <VertLineToArc+0x10a>
add    $0x58,%rsp
ret
xorpd  0xdde(%rip),%xmm4
ucomisd %xmm7,%xmm4
jbe    1265 <VertLineToArc+0x145>
ucomisd %xmm4,%xmm8
jbe    1265 <VertLineToArc+0x145>
xorpd  0xdc9(%rip),%xmm1
movapd %xmm2,%xmm0
movapd %xmm5,%xmm2
movapd %xmm6,%xmm3
mov    $0x4,%al
call   1030 <AngleInRange@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1225 <VertLineToArc+0x105>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @VertLineToArc(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca i32
%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
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
%20 = load double, double* %9
%21 = load double, double* %12
%22 = fdiv double %20, %21
store double %22, double* %17
%23 = load double, double* %17
%24 = load double, double* %17
%25 = fneg double %23
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double 1.000000e+00)
store double %26, double* %16
%27 = load double, double* %16
%28 = fcmp olt double %27, 0.000000e+00
br i1 %28, label %29, label %30
29: ; preds = %7
store i32 0, i32* %8
br label %71
30: ; preds = %7
%31 = load double, double* %16
%32 = call double @sqrt(double %31)
store double %32, double* %18
%33 = load double, double* %18
%34 = load double, double* %13
%35 = fmul double %33, %34
store double %35, double* %19
%36 = load double, double* %19
%37 = load double, double* %10
%38 = fcmp ogt double %36, %37
br i1 %38, label %39, label %51
39: ; preds = %30
%40 = load double, double* %19
%41 = load double, double* %11
%42 = fcmp olt double %40, %41
br i1 %42, label %43, label %51
43: ; preds = %39
%44 = load double, double* %17
%45 = load double, double* %18
%46 = load double, double* %14
%47 = load double, double* %15
%48 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @AngleInRange to i32 (double, double, double, double, ...)*)(double %44, double %45, double %46, double %47)
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %43
store i32 1, i32* %8
br label %71
51: ; preds = %43, %39, %30
%52 = load double, double* %19
%53 = fneg double %52
%54 = load double, double* %10
%55 = fcmp ogt double %53, %54
br i1 %55, label %56, label %70
56: ; preds = %51
%57 = load double, double* %19
%58 = fneg double %57
%59 = load double, double* %11
%60 = fcmp olt double %58, %59
br i1 %60, label %61, label %70
61: ; preds = %56
%62 = load double, double* %17
%63 = load double, double* %18
%64 = fneg double %63
%65 = load double, double* %14
%66 = load double, double* %15
%67 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @AngleInRange to i32 (double, double, double, double, ...)*)(double %62, double %64, double %65, double %66)
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %61
store i32 1, i32* %8
br label %71
70: ; preds = %61, %56, %51
store i32 0, i32* %8
br label %71
71: ; preds = %70, %69, %50, %29
%72 = load i32, i32* %8
ret i32 %72
}

LLVM IR (-O2):
define i32 @VertLineToArc(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fdiv double %0, %3
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 1.000000e+00)
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %31, label %12
12: ; preds = %7
%13 = tail call double @sqrt(double %10)
%14 = fmul double %13, %4
%15 = fcmp ogt double %14, %1
%16 = fcmp olt double %14, %2
%17 = and i1 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @AngleInRange to i32 (double, double, double, double, ...)*)(double %8, double %13, double %5, double %6)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %18, %12
%22 = fneg double %14
%23 = fcmp ogt double %22, %1
%24 = fcmp olt double %22, %2
%25 = and i1 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = fneg double %13
%28 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @AngleInRange to i32 (double, double, double, double, ...)*)(double %8, double %27, double %5, double %6)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %26, %21
br label %31
31: ; preds = %26, %18, %7, %30
%32 = phi i32 [ 0, %30 ], [ 0, %7 ], [ 1, %18 ], [ 1, %26 ]
ret i32 %32
}