#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*/ get_racetrack_params(int *, int *, int *, int *, int *,
                                        int *, double *);
scalar_t__ inside_ellipse(int, int, int, int, int, int, double);
bool on_racetrack(int x, int y) {
  int x0, y0, xr_outer, yr_outer, xr_inner, yr_inner;
  double p;
  get_racetrack_params(&x0, &xr_outer, &xr_inner, &y0, &yr_outer, &yr_inner,
                       &p);
  return (inside_ellipse(x, y, x0, y0, xr_outer, yr_outer, p) &&
          !inside_ellipse(x, y, x0, y0, xr_inner, yr_inner, p));
}


x86 assembly (clang, -O0):
<on_racetrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <get_racetrack_params@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
movsd  -0x28(%rbp),%xmm0
call   1040 <inside_ellipse@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
je     11ad <on_racetrack+0x8d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
movsd  -0x28(%rbp),%xmm0
call   1040 <inside_ellipse@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_racetrack>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x10(%rsp),%r9
call   1030 <get_racetrack_params@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
movsd  0x20(%rsp),%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <inside_ellipse@plt>
test   %rax,%rax
je     11aa <on_racetrack+0x8a>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
movsd  0x20(%rsp),%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <inside_ellipse@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    11ac <on_racetrack+0x8c>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @on_racetrack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%12 = call i32 @get_racetrack_params(i32* %5, i32* %7, i32* %9, i32* %6, i32* %8, i32* %10, double* %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load double, double* %11
%20 = call i64 @inside_ellipse(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18, double %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = load double, double* %11
%30 = call i64 @inside_ellipse(i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28, double %29)
%31 = icmp ne i64 %30, 0
%32 = xor i1 %31, true
br label %33
33: ; preds = %22, %2
%34 = phi i1 [ false, %2 ], [ %32, %22 ]
%35 = zext i1 %34 to i32
ret i32 %35
}

LLVM IR (-O2):
define i32 @on_racetrack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast double* %9 to i8*
%17 = call i32 @get_racetrack_params(i32* %3, i32* %5, i32* %7, i32* %4, i32* %6, i32* %8, double* %9)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load double, double* %9
%23 = call i64 @inside_ellipse(i32 %0, i32 %1, i32 %18, i32 %19, i32 %20, i32 %21, double %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %34, label %25
25: ; preds = %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load double, double* %9
%31 = call i64 @inside_ellipse(i32 %0, i32 %1, i32 %26, i32 %27, i32 %28, i32 %29, double %30)
%32 = icmp eq i64 %31, 0
%33 = zext i1 %32 to i32
br label %34
34: ; preds = %25, %2
%35 = phi i32 [ 0, %2 ], [ %33, %25 ]
ret i32 %35
}