#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int case_no, no = 1;
  int x1, y1, x2, y2, cow;
  int x, y;
  scanf("%d", &case_no);
  while (no <= case_no) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    scanf("%d", &cow);
    printf("Case %d:\n", no);
    while (cow != 0) {
      scanf("%d %d", &x, &y);
      if (x >= x1 && x <= x2 && y >= y1 && y <= y2) {
        printf("Yes\n");
      } else
        printf("No\n");
      cow--;
    }
    no++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1222 <main+0x102>
lea    0xea5(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe90(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1214 <main+0xf4>
lea    0xe60(%rip),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11f8 <main+0xd8>
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11f8 <main+0xd8>
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11f8 <main+0xd8>
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11f8 <main+0xd8>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1195 <main+0x75>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1234 <main+0x104>
mov    $0x1,%ebx
lea    0xe9e(%rip),%r13
lea    0x14(%rsp),%rbp
lea    0x10(%rsp),%r14
lea    0xe9d(%rip),%r15
lea    0xe99(%rip),%r12
jmp    119f <main+0x6f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
jge    1234 <main+0x104>
lea    0xe5a(%rip),%rdi
lea    0x24(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r8
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe41(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe31(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jne    11ff <main+0xcf>
jmp    1190 <main+0x60>
nopl   (%rax)
mov    %r15,%rdi
call   1030 <puts@plt>
addl   $0xffffffff,0x8(%rsp)
je     1190 <main+0x60>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    0x24(%rsp),%eax
jl     11f0 <main+0xc0>
cmp    0x1c(%rsp),%eax
jg     11f0 <main+0xc0>
mov    0x10(%rsp),%eax
cmp    0x20(%rsp),%eax
jl     11f0 <main+0xc0>
mov    %r12,%rdi
cmp    0x18(%rsp),%eax
jle    11f3 <main+0xc3>
jmp    11f0 <main+0xc0>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [10 x i8] c"Case %d:\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [5 x i8] c"Yes\0A\00"
@.str.5 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %12
12: ; preds = %48, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %51
16: ; preds = %12
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %45, %16
%22 = load i32, i32* %8
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %48
24: ; preds = %21
%25 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %9, i32* %10)
%26 = load i32, i32* %9
%27 = load i32, i32* %4
%28 = icmp sge i32 %26, %27
br i1 %28, label %29, label %43
29: ; preds = %24
%30 = load i32, i32* %9
%31 = load i32, i32* %6
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %43
33: ; preds = %29
%34 = load i32, i32* %10
%35 = load i32, i32* %5
%36 = icmp sge i32 %34, %35
br i1 %36, label %37, label %43
37: ; preds = %33
%38 = load i32, i32* %10
%39 = load i32, i32* %7
%40 = icmp sle i32 %38, %39
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %45
43: ; preds = %37, %33, %29, %24
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
%46 = load i32, i32* %8
%47 = add nsw i32 %46, -1
store i32 %47, i32* %8
br label %21
48: ; preds = %21
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %12
51: ; preds = %12
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [10 x i8] c"Case %d:\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@str = [3 x i8] c"No\00"
@str.6 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %1 to i8*
%10 = bitcast i32* %2 to i8*
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 1
br i1 %19, label %53, label %20
20: ; preds = %0, %49
%21 = phi i32 [ %50, %49 ], [ 1, %0 ]
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 0
br i1 %26, label %49, label %27
27: ; preds = %20, %43
%28 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %7, i32* %8)
%29 = load i32, i32* %7
%30 = load i32, i32* %2
%31 = icmp slt i32 %29, %30
%32 = load i32, i32* %4
%33 = icmp sgt i32 %29, %32
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %42, label %35
35: ; preds = %27
%36 = load i32, i32* %8
%37 = load i32, i32* %3
%38 = icmp slt i32 %36, %37
%39 = load i32, i32* %5
%40 = icmp sgt i32 %36, %39
%41 = select i1 %38, i1 true, i1 %40
br i1 %41, label %42, label %43
42: ; preds = %35, %27
br label %43
43: ; preds = %35, %42
%44 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %42 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0), %35 ]
%45 = call i32 @puts(i8* dereferenceable(1) %44)
%46 = load i32, i32* %6
%47 = add nsw i32 %46, -1
store i32 %47, i32* %6
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %27
49: ; preds = %43, %20
%50 = add nuw nsw i32 %21, 1
%51 = load i32, i32* %1
%52 = icmp slt i32 %21, %51
br i1 %52, label %20, label %53
53: ; preds = %49, %0
ret i32 0
}