#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*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int cor_x, cor_y, x, y;
  int case_num, i;
  int result;
  if (argc != 2) {
    printf("Usage: %s INPUT_FILE\n\n", argv[0]);
    exit(-1);
  }
  if (access(argv[1], F_OK)) {
    printf("Error: INPUT_FILE %s does not exist\n\n", argv[1]);
    exit(-1);
  }
  freopen(argv[1], "r", stdin);
  while (scanf("%d", &case_num) && case_num) {
    scanf("%d %d", &cor_x, &cor_y);
    for (i = 0; i < case_num; ++i) {
      scanf("%d %d", &x, &y);
      result = 0;
      if (x == cor_x || y == cor_y) {
        printf("divisa\n");
      } else {
        if (x > cor_x)
          result = 1;
        if (y > cor_y)
          result |= 2;
        switch (result) {
        case 0:
          printf("SO\n");
          break;
        case 1:
          printf("SE\n");
          break;
        case 2:
          printf("NO\n");
          break;
        case 3:
          printf("NE\n");
          break;
        }
      }
    }
  }
  fclose(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
cmp    $0x0,%rax
je     11df <main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dfa(%rip),%rax
mov    (%rax),%edx
lea    0xe56(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe4f(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2d(%rbp)
je     122a <main+0xca>
cmpl   $0x0,-0x24(%rbp)
setne  %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    123a <main+0xda>
jmp    135c <main+0x1fc>
lea    0xe0e(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1357 <main+0x1f7>
lea    0xde5(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1298 <main+0x138>
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    12ab <main+0x14b>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1344 <main+0x1e4>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    12be <main+0x15e>
movl   $0x1,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    12d3 <main+0x173>
mov    -0x2c(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rax,-0x38(%rbp)
sub    $0x3,%rax
ja     133f <main+0x1df>
mov    -0x38(%rbp),%rax
lea    0xd11(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133f <main+0x1df>
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133f <main+0x1df>
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133f <main+0x1df>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1344 <main+0x1e4>
jmp    1349 <main+0x1e9>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1257 <main+0xf7>
jmp    11fc <main+0x9c>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    12d2 <main+0x162>
mov    0x8(%rbx),%rdi
mov    0x2e3b(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
mov    0x8(%rbx),%rcx
test   %rax,%rax
jne    12de <main+0x16e>
mov    0x2e38(%rip),%rax
mov    (%rax),%edx
lea    0xe84(%rip),%rsi
mov    %rcx,%rdi
call   1060 <freopen@plt>
lea    0xe7a(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
test   %rax,%rax
je     12b3 <main+0x143>
cmpl   $0x0,0x4(%rsp)
je     12b3 <main+0x143>
lea    0xe50(%rip),%rbx
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
lea    0xe51(%rip),%r15
lea    0xe51(%rip),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1290 <main+0x120>
xor    %r14d,%r14d
jmp    1240 <main+0xd0>
call   1030 <puts@plt>
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
jge    1290 <main+0x120>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x14(%rsp),%ecx
mov    %r15,%rdi
cmp    %ecx,%eax
je     1230 <main+0xc0>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%esi
mov    %r15,%rdi
cmp    %esi,%edx
je     1230 <main+0xc0>
xor    %edi,%edi
cmp    %ecx,%eax
setg   %dil
lea    0x2(%rdi),%eax
cmp    %esi,%edx
cmovle %edi,%eax
movslq 0x0(%rbp,%rax,4),%rdi
add    %rbp,%rdi
jmp    1230 <main+0xc0>
nopl   0x0(%rax,%rax,1)
lea    0xdab(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
test   %rax,%rax
je     12b3 <main+0x143>
cmpl   $0x0,0x4(%rsp)
jne    1210 <main+0xa0>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xd24(%rip),%rdi
jmp    12e8 <main+0x178>
lea    0xd32(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [6 x i8] c"%d %d\00"
@.str.5 = [8 x i8] c"divisa\0A\00"
@.str.6 = [4 x i8] c"SO\0A\00"
@.str.7 = [4 x i8] c"SE\0A\00"
@.str.8 = [4 x i8] c"NO\0A\00"
@.str.9 = [4 x i8] c"NE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i32, i32* @F_OK
%26 = call i64 @access(i8* %24, i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = call i32 @exit(i32 -1)
unreachable
34: ; preds = %21
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = load i32, i32* @stdin
%39 = call i32 @freopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %92, %34
%41 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %10
%45 = icmp ne i32 %44, 0
br label %46
46: ; preds = %43, %40
%47 = phi i1 [ false, %40 ], [ %45, %43 ]
br i1 %47, label %48, label %93
48: ; preds = %46
%49 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7)
store i32 0, i32* %11
br label %50
50: ; preds = %89, %48
%51 = load i32, i32* %11
%52 = load i32, i32* %10
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %92
54: ; preds = %50
%55 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %8, i32* %9)
store i32 0, i32* %12
%56 = load i32, i32* %8
%57 = load i32, i32* %6
%58 = icmp eq i32 %56, %57
br i1 %58, label %63, label %59
59: ; preds = %54
%60 = load i32, i32* %9
%61 = load i32, i32* %7
%62 = icmp eq i32 %60, %61
br i1 %62, label %63, label %65
63: ; preds = %59, %54
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %88
65: ; preds = %59
%66 = load i32, i32* %8
%67 = load i32, i32* %6
%68 = icmp sgt i32 %66, %67
br i1 %68, label %69, label %70
69: ; preds = %65
store i32 1, i32* %12
br label %70
70: ; preds = %69, %65
%71 = load i32, i32* %9
%72 = load i32, i32* %7
%73 = icmp sgt i32 %71, %72
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = load i32, i32* %12
%76 = or i32 %75, 2
store i32 %76, i32* %12
br label %77
77: ; preds = %74, %70
%78 = load i32, i32* %12
switch i32 %78, label %87 [
i32 0, label %79
i32 1, label %81
i32 2, label %83
i32 3, label %85
]
79: ; preds = %77
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %87
81: ; preds = %77
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %87
83: ; preds = %77
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %87
85: ; preds = %77
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %87
87: ; preds = %77, %85, %83, %81, %79
br label %88
88: ; preds = %87, %63
br label %89
89: ; preds = %88
%90 = load i32, i32* %11
%91 = add nsw i32 %90, 1
store i32 %91, i32* %11
br label %50
92: ; preds = %50
br label %40
93: ; preds = %46
%94 = load i32, i32* @stdin
%95 = call i32 @fclose(i32 %94)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [6 x i8] c"%d %d\00"
@str = [3 x i8] c"NE\00"
@str.10 = [3 x i8] c"NO\00"
@str.11 = [3 x i8] c"SE\00"
@str.12 = [3 x i8] c"SO\00"
@str.13 = [7 x i8] c"divisa\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.12 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.11 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str.10 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @str to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = icmp eq i32 %0, 2
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i8*, i8** %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = load i32, i32* @F_OK
%22 = tail call i64 @access(i8* %20, i32 %21)
%23 = icmp eq i64 %22, 0
%24 = load i8*, i8** %19
br i1 %23, label %28, label %25
25: ; preds = %18
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%27 = tail call i32 @exit(i32 -1)
unreachable
28: ; preds = %18
%29 = load i32, i32* @stdin
%30 = tail call i32 @freopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%32 = icmp ne i64 %31, 0
%33 = load i32, i32* %7
%34 = icmp ne i32 %33, 0
%35 = select i1 %32, i1 %34, i1 false
br i1 %35, label %42, label %71
36: ; preds = %65, %42
%37 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%38 = icmp ne i64 %37, 0
%39 = load i32, i32* %7
%40 = icmp ne i32 %39, 0
%41 = select i1 %38, i1 %40, i1 false
br i1 %41, label %42, label %71
42: ; preds = %28, %36
%43 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4)
%44 = load i32, i32* %7
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %36
46: ; preds = %42, %65
%47 = phi i32 [ %68, %65 ], [ 0, %42 ]
%48 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32* %5, i32* %6)
%49 = load i32, i32* %5
%50 = load i32, i32* %3
%51 = icmp eq i32 %49, %50
br i1 %51, label %65, label %52
52: ; preds = %46
%53 = load i32, i32* %6
%54 = load i32, i32* %4
%55 = icmp eq i32 %53, %54
br i1 %55, label %65, label %56
56: ; preds = %52
%57 = icmp sgt i32 %49, %50
%58 = zext i1 %57 to i32
%59 = icmp sgt i32 %53, %54
%60 = or i32 %58, 2
%61 = select i1 %59, i32 %60, i32 %58
%62 = zext i32 %61 to i64
%63 = shl i64 %62, 2
%64 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %63)
br label %65
65: ; preds = %56, %46, %52
%66 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.13, i64 0, i64 0), %52 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.13, i64 0, i64 0), %46 ], [ %64, %56 ]
%67 = call i32 @puts(i8* dereferenceable(1) %66)
%68 = add nuw nsw i32 %47, 1
%69 = load i32, i32* %7
%70 = icmp slt i32 %68, %69
br i1 %70, label %46, label %36
71: ; preds = %36, %28
%72 = load i32, i32* @stdin
%73 = call i32 @fclose(i32 %72)
ret i32 0
}