#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int RecTL[2], RecBR[2], pnt[2];
  printf("Enter x,y for top left: ");
  scanf("%d %d", &RecTL[0], &RecTL[1]);
  printf("Enter x,y for bottom right: ");
  scanf("%d %d", &RecBR[0], &RecBR[1]);
  printf("Enter x,y for a point: ");
  scanf("%d %d", &pnt[0], &pnt[1]);
  if (pnt[0] > RecTL[0] && pnt[0] < RecBR[0] && pnt[1] > RecTL[1] &&
      pnt[1] < RecBR[1]) {
    printf("\n(%d,%d) is inside the rectange\n", pnt[0], pnt[1]);
  } else {
    printf("\n(%d,%d) is outside the rectange\n", pnt[0], pnt[1]);
  }
  printf("\n[Press ENTER to close]");
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rsi
lea    -0xc(%rbp),%rdx
add    $0x4,%rdx
lea    0xeb9(%rip),%rdi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rsi
lea    -0x14(%rbp),%rdx
add    $0x4,%rdx
lea    0xe93(%rip),%rdi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
add    $0x4,%rdx
lea    0xe6d(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11fa <main+0xca>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11fa <main+0xca>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11fa <main+0xca>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11fa <main+0xca>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120e <main+0xde>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%rdx
lea    0xeca(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
cmp    0x18(%rsp),%esi
jle    11c5 <main+0x95>
cmp    0x10(%rsp),%esi
jge    11c5 <main+0x95>
cmp    0x1c(%rsp),%edx
jle    11c5 <main+0x95>
cmp    0x14(%rsp),%edx
jge    11c5 <main+0x95>
lea    0xe91(%rip),%rdi
jmp    11cc <main+0x9c>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter x,y for top left: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [29 x i8] c"Enter x,y for bottom right: \00"
@.str.3 = [24 x i8] c"Enter x,y for a point: \00"
@.str.4 = [33 x i8] c"\0A(%d,%d) is inside the rectange\0A\00"
@.str.5 = [34 x i8] c"\0A(%d,%d) is outside the rectange\0A\00"
@.str.6 = [24 x i8] c"\0A[Press ENTER to close]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %10, i32* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %14, i32* %15)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%18 = load i32, i32* %17
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%20 = load i32, i32* %19
%21 = icmp sgt i32 %18, %20
br i1 %21, label %22, label %46
22: ; preds = %0
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%24 = load i32, i32* %23
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%26 = load i32, i32* %25
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %46
28: ; preds = %22
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%30 = load i32, i32* %29
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%32 = load i32, i32* %31
%33 = icmp sgt i32 %30, %32
br i1 %33, label %34, label %46
34: ; preds = %28
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%38 = load i32, i32* %37
%39 = icmp slt i32 %36, %38
br i1 %39, label %40, label %46
40: ; preds = %34
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%42 = load i32, i32* %41
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %42, i32 %44)
br label %52
46: ; preds = %34, %28, %22, %0
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%48 = load i32, i32* %47
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %48, i32 %50)
br label %52
52: ; preds = %46, %40
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%54 = call i32 (...) @getchar()
%55 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter x,y for top left: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [29 x i8] c"Enter x,y for bottom right: \00"
@.str.3 = [24 x i8] c"Enter x,y for a point: \00"
@.str.4 = [33 x i8] c"\0A(%d,%d) is inside the rectange\0A\00"
@.str.5 = [34 x i8] c"\0A(%d,%d) is outside the rectange\0A\00"
@.str.6 = [24 x i8] c"\0A[Press ENTER to close]\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %1 to i8*
%5 = bitcast [2 x i32]* %2 to i8*
%6 = bitcast [2 x i32]* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %12, i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%18 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %16, i32* %17)
%19 = load i32, i32* %16
%20 = load i32, i32* %8
%21 = icmp sgt i32 %19, %20
%22 = load i32, i32* %12
%23 = icmp slt i32 %19, %22
%24 = select i1 %21, i1 %23, i1 false
%25 = load i32, i32* %17
br i1 %24, label %26, label %32
26: ; preds = %0
%27 = load i32, i32* %9
%28 = icmp sgt i32 %25, %27
%29 = load i32, i32* %13
%30 = icmp slt i32 %25, %29
%31 = select i1 %28, i1 %30, i1 false
br i1 %31, label %33, label %32
32: ; preds = %0, %26
br label %33
33: ; preds = %26, %32
%34 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), %32 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), %26 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %34, i32 %19, i32 %25)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%37 = call i32 (...) @getchar()
%38 = call i32 (...) @getchar()
ret i32 0
}