#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);
int pow(double, int);
double sin(double);
double sqrt(int);
int in_ellip_bound(double pos_x, double pos_y, double sensi, double center_x,
                   double center_y, double axis, double ratio, double rot) {
  double cosine = cos(rot);
  double sine = sin(rot);
  double x =
      sqrt(pow(axis, 2) * pow(cosine, 2) + pow(axis * ratio, 2) * pow(sine, 2));
  double y =
      sqrt(pow(axis, 2) * pow(sine, 2) + pow(axis * ratio, 2) * pow(cosine, 2));
  double tr_x = center_x + x + sensi;
  double tr_y = center_y + y + sensi;
  double bl_x = center_x - x - sensi;
  double bl_y = center_y - y - sensi;
  if ((pos_x >= bl_x) && (pos_x <= tr_x) && (pos_y >= bl_y) &&
      (pos_y <= tr_y)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<in_ellip_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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  %xmm7,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0xa0(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x9c(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x98(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    -0x9c(%rbp),%edi
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x94(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x90(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x8c(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    -0x90(%rbp),%edi
mov    %eax,%ecx
mov    -0x8c(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jb     1331 <in_ellip_bound+0x1f1>
movsd  -0x10(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1331 <in_ellip_bound+0x1f1>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jb     1331 <in_ellip_bound+0x1f1>
movsd  -0x18(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1331 <in_ellip_bound+0x1f1>
movl   $0x1,-0x4(%rbp)
jmp    1338 <in_ellip_bound+0x1f8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_ellip_bound>:
push   %rbp
push   %rbx
sub    $0x58,%rsp
movsd  %xmm7,0x8(%rsp)
movsd  %xmm6,0x10(%rsp)
movsd  %xmm5,0x18(%rsp)
movsd  %xmm4,0x48(%rsp)
movsd  %xmm3,0x40(%rsp)
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x50(%rsp)
movaps %xmm7,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebx
movsd  0x20(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
imul   %eax,%ebx
movsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
imul   %eax,%ebp
add    %ebx,%ebp
mov    %ebp,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
imul   %eax,%ebx
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ebp
movsd  0x20(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
imul   %eax,%ebp
add    %ebx,%ebp
mov    %ebp,%edi
call   1060 <sqrt@plt>
movsd  0x28(%rsp),%xmm7
movsd  0x40(%rsp),%xmm5
movsd  0x48(%rsp),%xmm4
movsd  0x38(%rsp),%xmm3
movsd  0x30(%rsp),%xmm2
movapd %xmm5,%xmm1
subsd  %xmm7,%xmm1
subsd  %xmm3,%xmm1
movsd  0x50(%rsp),%xmm6
ucomisd %xmm1,%xmm6
jae    1287 <in_ellip_bound+0x147>
xor    %eax,%eax
jmp    12be <in_ellip_bound+0x17e>
movapd %xmm6,%xmm1
addsd  %xmm5,%xmm7
addsd  %xmm3,%xmm7
ucomisd %xmm6,%xmm7
jb     1283 <in_ellip_bound+0x143>
movapd %xmm4,%xmm1
subsd  %xmm0,%xmm1
subsd  %xmm3,%xmm1
ucomisd %xmm1,%xmm2
jb     1283 <in_ellip_bound+0x143>
addsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
mov    $0x1,%eax
ucomisd %xmm2,%xmm0
jb     1283 <in_ellip_bound+0x143>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @in_ellip_bound(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca i32
%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
%24 = alloca double
%25 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
%26 = load double, double* %17
%27 = call double @cos(double %26)
store double %27, double* %18
%28 = load double, double* %17
%29 = call double @sin(double %28)
store double %29, double* %19
%30 = load double, double* %15
%31 = call i32 @pow(double %30, i32 2)
%32 = load double, double* %18
%33 = call i32 @pow(double %32, i32 2)
%34 = mul nsw i32 %31, %33
%35 = load double, double* %15
%36 = load double, double* %16
%37 = fmul double %35, %36
%38 = call i32 @pow(double %37, i32 2)
%39 = load double, double* %19
%40 = call i32 @pow(double %39, i32 2)
%41 = mul nsw i32 %38, %40
%42 = add nsw i32 %34, %41
%43 = call double @sqrt(i32 %42)
store double %43, double* %20
%44 = load double, double* %15
%45 = call i32 @pow(double %44, i32 2)
%46 = load double, double* %19
%47 = call i32 @pow(double %46, i32 2)
%48 = mul nsw i32 %45, %47
%49 = load double, double* %15
%50 = load double, double* %16
%51 = fmul double %49, %50
%52 = call i32 @pow(double %51, i32 2)
%53 = load double, double* %18
%54 = call i32 @pow(double %53, i32 2)
%55 = mul nsw i32 %52, %54
%56 = add nsw i32 %48, %55
%57 = call double @sqrt(i32 %56)
store double %57, double* %21
%58 = load double, double* %13
%59 = load double, double* %20
%60 = fadd double %58, %59
%61 = load double, double* %12
%62 = fadd double %60, %61
store double %62, double* %22
%63 = load double, double* %14
%64 = load double, double* %21
%65 = fadd double %63, %64
%66 = load double, double* %12
%67 = fadd double %65, %66
store double %67, double* %23
%68 = load double, double* %13
%69 = load double, double* %20
%70 = fsub double %68, %69
%71 = load double, double* %12
%72 = fsub double %70, %71
store double %72, double* %24
%73 = load double, double* %14
%74 = load double, double* %21
%75 = fsub double %73, %74
%76 = load double, double* %12
%77 = fsub double %75, %76
store double %77, double* %25
%78 = load double, double* %10
%79 = load double, double* %24
%80 = fcmp oge double %78, %79
br i1 %80, label %81, label %94
81: ; preds = %8
%82 = load double, double* %10
%83 = load double, double* %22
%84 = fcmp ole double %82, %83
br i1 %84, label %85, label %94
85: ; preds = %81
%86 = load double, double* %11
%87 = load double, double* %25
%88 = fcmp oge double %86, %87
br i1 %88, label %89, label %94
89: ; preds = %85
%90 = load double, double* %11
%91 = load double, double* %23
%92 = fcmp ole double %90, %91
br i1 %92, label %93, label %94
93: ; preds = %89
store i32 1, i32* %9
br label %95
94: ; preds = %89, %85, %81, %8
store i32 0, i32* %9
br label %95
95: ; preds = %94, %93
%96 = load i32, i32* %9
ret i32 %96
}

LLVM IR (-O2):
define i32 @in_ellip_bound(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = tail call double @cos(double %7)
%10 = tail call double @sin(double %7)
%11 = tail call i32 @pow(double %5, i32 2)
%12 = tail call i32 @pow(double %9, i32 2)
%13 = mul nsw i32 %12, %11
%14 = fmul double %5, %6
%15 = tail call i32 @pow(double %14, i32 2)
%16 = tail call i32 @pow(double %10, i32 2)
%17 = mul nsw i32 %16, %15
%18 = add nsw i32 %17, %13
%19 = tail call double @sqrt(i32 %18)
%20 = tail call i32 @pow(double %5, i32 2)
%21 = tail call i32 @pow(double %10, i32 2)
%22 = mul nsw i32 %21, %20
%23 = tail call i32 @pow(double %14, i32 2)
%24 = tail call i32 @pow(double %9, i32 2)
%25 = mul nsw i32 %24, %23
%26 = add nsw i32 %25, %22
%27 = tail call double @sqrt(i32 %26)
%28 = fsub double %3, %19
%29 = fsub double %28, %2
%30 = fcmp ugt double %29, %0
br i1 %30, label %43, label %31
31: ; preds = %8
%32 = fsub double %4, %27
%33 = fsub double %32, %2
%34 = fadd double %27, %4
%35 = fadd double %34, %2
%36 = fadd double %19, %3
%37 = fadd double %36, %2
%38 = fcmp ult double %37, %0
%39 = fcmp ugt double %33, %1
%40 = select i1 %38, i1 true, i1 %39
%41 = fcmp ult double %35, %1
%42 = select i1 %40, i1 true, i1 %41
br i1 %42, label %43, label %44
43: ; preds = %31, %8
br label %44
44: ; preds = %31, %43
%45 = phi i32 [ 0, %43 ], [ 1, %31 ]
ret i32 %45
}