#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*/, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(void) {
  int num, x, y;
  int x1, y1, x2, y2;
  int i, total;
  int n = 1;
  while (1) {
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (x1 == 0 && y1 == 0)
      break;
    scanf("%d", &num);
    total = 0;
    for (i = 0; i < num; i++) {
      scanf("%d %d", &x, &y);
      if (x >= x1 && x <= x2 && y <= y1 && y >= y2)
        total++;
    }
    printf("Teste %d\n%d\n\n", n++, total);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x2c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    116d <main+0x4d>
cmpl   $0x0,-0x18(%rbp)
jne    116d <main+0x4d>
jmp    121a <main+0xfa>
lea    0xe95(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11fb <main+0xdb>
lea    0xe66(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11e8 <main+0xc8>
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11e8 <main+0xc8>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11e8 <main+0xc8>
mov    -0x10(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     11e8 <main+0xc8>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ed <main+0xcd>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <main+0x6d>
mov    -0x2c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%edx
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%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    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
or     0xc(%rsp),%eax
jne    116b <main+0x4b>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
lea    0xe8f(%rip),%r12
lea    0x24(%rsp),%r13
lea    0x20(%rsp),%rbx
jmp    11d4 <main+0xb4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rbp),%r15d
lea    0xe71(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
or     0xc(%rsp),%eax
mov    %r15d,%ebp
je     115a <main+0x3a>
lea    0xe2e(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x1c(%rsp)
mov    $0x0,%r14d
jle    1190 <main+0x70>
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    120b <main+0xeb>
nopl   0x0(%rax)
add    $0x1,%r15d
cmp    0x1c(%rsp),%r15d
jge    1190 <main+0x70>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x24(%rsp),%eax
cmp    0x10(%rsp),%eax
jl     1200 <main+0xe0>
cmp    0x18(%rsp),%eax
jg     1200 <main+0xe0>
mov    0x20(%rsp),%eax
cmp    0xc(%rsp),%eax
setle  %cl
cmp    0x14(%rsp),%eax
setge  %al
and    %cl,%al
movzbl %al,%eax
add    %eax,%r14d
jmp    1200 <main+0xe0>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [14 x i8] c"Teste %d\0A%d\0A\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 = bitcast i32* %1 to i8*
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 0
%20 = select i1 %17, i1 %19, i1 false
br i1 %20, label %60, label %21
21: ; preds = %0, %50
%22 = phi i32 [ %52, %50 ], [ 1, %0 ]
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%24 = load i32, i32* %1
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %50
26: ; preds = %21, %45
%27 = phi i32 [ %46, %45 ], [ 0, %21 ]
%28 = phi i32 [ %47, %45 ], [ 0, %21 ]
%29 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
%33 = load i32, i32* %6
%34 = icmp sgt i32 %30, %33
%35 = select i1 %32, i1 true, i1 %34
br i1 %35, label %45, label %36
36: ; preds = %26
%37 = load i32, i32* %3
%38 = load i32, i32* %5
%39 = icmp sle i32 %37, %38
%40 = load i32, i32* %7
%41 = icmp sge i32 %37, %40
%42 = select i1 %39, i1 %41, i1 false
%43 = zext i1 %42 to i32
%44 = add nsw i32 %27, %43
br label %45
45: ; preds = %36, %26
%46 = phi i32 [ %27, %26 ], [ %44, %36 ]
%47 = add nuw nsw i32 %28, 1
%48 = load i32, i32* %1
%49 = icmp slt i32 %47, %48
br i1 %49, label %26, label %50
50: ; preds = %45, %21
%51 = phi i32 [ 0, %21 ], [ %46, %45 ]
%52 = add nuw nsw i32 %22, 1
%53 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %51)
%54 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
%55 = load i32, i32* %4
%56 = icmp eq i32 %55, 0
%57 = load i32, i32* %5
%58 = icmp eq i32 %57, 0
%59 = select i1 %56, i1 %58, i1 false
br i1 %59, label %60, label %21
60: ; preds = %50, %0
ret i32 0
}