#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 x_left(double);
double x_right(double);
double y_bottom(double);
double y_top(double);
bool is_internal(int i, int j) {
  double x = (-1.0) + i * ((2.0) / (128));
  double y = (-1.0) + j * ((2.0) / (128));
  if (y >= y_top(x))
    return false;
  if (y <= y_bottom(x))
    return false;
  if (x >= x_right(y))
    return false;
  if (x <= x_left(y))
    return false;
  return true;
}


x86 assembly (clang, -O0):
<is_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <y_top@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11c4 <is_internal+0x84>
movl   $0x0,-0x4(%rbp)
jmp    125b <is_internal+0x11b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <y_bottom@plt>
movsd  -0x30(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     11f3 <is_internal+0xb3>
movl   $0x0,-0x4(%rbp)
jmp    125b <is_internal+0x11b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <x_right@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1225 <is_internal+0xe5>
movl   $0x0,-0x4(%rbp)
jmp    125b <is_internal+0x11b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <x_left@plt>
movsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     1254 <is_internal+0x114>
movl   $0x0,-0x4(%rbp)
jmp    125b <is_internal+0x11b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_internal>:
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %edi,%xmm0
movsd  0xeaf(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sd %esi,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1050 <y_top@plt>
xor    %ebx,%ebx
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    11c7 <is_internal+0x87>
movsd  0x8(%rsp),%xmm0
call   1040 <y_bottom@plt>
ucomisd (%rsp),%xmm0
jae    11c7 <is_internal+0x87>
movsd  (%rsp),%xmm0
call   1030 <x_right@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    11c7 <is_internal+0x87>
movsd  (%rsp),%xmm0
call   1060 <x_left@plt>
xor    %ebx,%ebx
ucomisd 0x8(%rsp),%xmm0
setb   %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_internal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.562500e-02, double -1.000000e+00)
store double %10, double* %6
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 1.562500e-02, double -1.000000e+00)
store double %13, double* %7
%14 = load double, double* %7
%15 = load double, double* %6
%16 = call double @y_top(double %15)
%17 = fcmp oge double %14, %16
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 0, i32* %3
br label %38
19: ; preds = %2
%20 = load double, double* %7
%21 = load double, double* %6
%22 = call double @y_bottom(double %21)
%23 = fcmp ole double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 0, i32* %3
br label %38
25: ; preds = %19
%26 = load double, double* %6
%27 = load double, double* %7
%28 = call double @x_right(double %27)
%29 = fcmp oge double %26, %28
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 0, i32* %3
br label %38
31: ; preds = %25
%32 = load double, double* %6
%33 = load double, double* %7
%34 = call double @x_left(double %33)
%35 = fcmp ole double %32, %34
br i1 %35, label %36, label %37
36: ; preds = %31
store i32 0, i32* %3
br label %38
37: ; preds = %31
store i32 1, i32* %3
br label %38
38: ; preds = %37, %36, %30, %24, %18
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
define i32 @is_internal(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.562500e-02, double -1.000000e+00)
%5 = sitofp i32 %1 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.562500e-02, double -1.000000e+00)
%7 = tail call double @y_top(double %4)
%8 = fcmp ult double %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = tail call double @y_bottom(double %4)
%11 = fcmp ugt double %6, %10
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = tail call double @x_right(double %6)
%14 = fcmp ult double %4, %13
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = tail call double @x_left(double %6)
%17 = fcmp ugt double %4, %16
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %12, %9, %2
%20 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 0, %12 ], [ %18, %15 ]
ret i32 %20
}