#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 abs(int);
int checkPoint(int x, int y) {
  int point = 0;
  if (abs(x) <= 3 && abs(y) <= 5) {
    point = 1;
  } else if (abs(x) <= 4 && abs(y) <= 3) {
    point = 1;
  } else if (abs(x) <= 5 && abs(y) <= 1) {
    point = 1;
  }
  return point;
}


x86 assembly (clang, -O0):
<checkPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x3,%eax
jg     1153 <checkPoint+0x43>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x5,%eax
jg     1153 <checkPoint+0x43>
movl   $0x1,-0xc(%rbp)
jmp    11b4 <checkPoint+0xa4>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x4,%eax
jg     1181 <checkPoint+0x71>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x3,%eax
jg     1181 <checkPoint+0x71>
movl   $0x1,-0xc(%rbp)
jmp    11af <checkPoint+0x9f>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x5,%eax
jg     11aa <checkPoint+0x9a>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
jg     11aa <checkPoint+0x9a>
movl   $0x1,-0xc(%rbp)
jmp    11af <checkPoint+0x9f>
jmp    11b4 <checkPoint+0xa4>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPoint>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
mov    $0x1,%eax
cmp    $0x3,%ecx
ja     111e <checkPoint+0x1e>
cmp    $0x6,%edx
jae    111e <checkPoint+0x1e>
ret
cmp    $0x4,%ecx
ja     1128 <checkPoint+0x28>
cmp    $0x4,%edx
jb     111d <checkPoint+0x1d>
cmp    $0x6,%ecx
setb   %al
cmp    $0x2,%edx
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @checkPoint(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp ult i32 %3, 4
%5 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%6 = icmp ult i32 %5, 6
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %17, label %8
8: ; preds = %2
%9 = icmp ult i32 %3, 5
%10 = icmp ult i32 %5, 4
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = icmp ult i32 %3, 6
%14 = icmp ult i32 %5, 2
%15 = select i1 %13, i1 %14, i1 false
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %8, %2
%18 = phi i32 [ 1, %2 ], [ 1, %8 ], [ %16, %12 ]
ret i32 %18
}