#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_boundaries(int /*<<< orphan*/, long *, long *, long *,
                                  long *);
int isInRange(long, long, long);
int /*<<< orphan*/ lastrec(int);
int isInArea(long x, long y, int ccode) {
  if (ccode < 0)
    return 0;
  {
    extern int iso_end;
    long minx, miny, maxx, maxy;
    get_boundaries(lastrec(ccode), &(minx), &(miny), &(maxx), &(maxy));
    if (y < miny)
      return 0;
    if (y >= maxy)
      return 0;
    return isInRange(x, minx, maxx);
  }
}


x86 assembly (clang, -O0):
<isInArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1159 <isInArea+0x29>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <isInArea+0x90>
mov    -0x1c(%rbp),%edi
call   1040 <lastrec@plt>
mov    %eax,%edi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x40(%rbp),%r8
call   1050 <get_boundaries@plt>
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1192 <isInArea+0x62>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <isInArea+0x90>
mov    -0x18(%rbp),%rax
cmp    -0x40(%rbp),%rax
jl     11ac <isInArea+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <isInArea+0x90>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <isInRange@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInArea>:
test   %edx,%edx
js     118d <isInArea+0x5d>
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%edi
call   1040 <lastrec@plt>
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %eax,%edi
call   1050 <get_boundaries@plt>
xor    %eax,%eax
cmp    %rbx,0x18(%rsp)
jg     1185 <isInArea+0x55>
cmp    %rbx,0x8(%rsp)
jle    1185 <isInArea+0x55>
mov    0x20(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    %r14,%rdi
call   1030 <isInRange@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isInArea(i64 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %33
15: ; preds = %3
%16 = load i32, i32* %7
%17 = call i32 @lastrec(i32 %16)
%18 = call i32 @get_boundaries(i32 %17, i64* %8, i64* %9, i64* %10, i64* %11)
%19 = load i64, i64* %6
%20 = load i64, i64* %9
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 0, i32* %4
br label %33
23: ; preds = %15
%24 = load i64, i64* %6
%25 = load i64, i64* %11
%26 = icmp sge i64 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 0, i32* %4
br label %33
28: ; preds = %23
%29 = load i64, i64* %5
%30 = load i64, i64* %8
%31 = load i64, i64* %10
%32 = call i32 @isInRange(i64 %29, i64 %30, i64 %31)
store i32 %32, i32* %4
br label %33
33: ; preds = %28, %27, %22, %14
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @isInArea(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = icmp slt i32 %2, 0
br i1 %8, label %27, label %9
9: ; preds = %3
%10 = bitcast i64* %4 to i8*
%11 = bitcast i64* %5 to i8*
%12 = bitcast i64* %6 to i8*
%13 = bitcast i64* %7 to i8*
%14 = tail call i32 @lastrec(i32 %2)
%15 = call i32 @get_boundaries(i32 %14, i64* %4, i64* %5, i64* %6, i64* %7)
%16 = load i64, i64* %5
%17 = icmp sle i64 %16, %1
%18 = load i64, i64* %7
%19 = icmp sgt i64 %18, %1
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %21, label %25
21: ; preds = %9
%22 = load i64, i64* %4
%23 = load i64, i64* %6
%24 = call i32 @isInRange(i64 %0, i64 %22, i64 %23)
br label %25
25: ; preds = %9, %21
%26 = phi i32 [ %24, %21 ], [ 0, %9 ]
br label %27
27: ; preds = %3, %25
%28 = phi i32 [ %26, %25 ], [ 0, %3 ]
ret i32 %28
}