#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int x, y;
  printf("Insira coordenadas: ");
  scanf("%d %d", &x, &y);
  if (x >= 0 && y >= 0) {
    puts("1");
  } else if (x < 0 && y >= 0) {
    puts("2");
  } else if (x < 0 && y < 0) {
    puts("3");
  } else if (x >= 0 && y < 0) {
    puts("4");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jl     118b <main+0x5b>
cmpl   $0x0,-0x18(%rbp)
jl     118b <main+0x5b>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
jmp    1204 <main+0xd4>
cmpl   $0x0,-0x14(%rbp)
jge    11b0 <main+0x80>
cmpl   $0x0,-0x18(%rbp)
jl     11b0 <main+0x80>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
jmp    11ff <main+0xcf>
cmpl   $0x0,-0x14(%rbp)
jge    11d5 <main+0xa5>
cmpl   $0x0,-0x18(%rbp)
jge    11d5 <main+0xa5>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
jmp    11fa <main+0xca>
cmpl   $0x0,-0x14(%rbp)
jl     11f5 <main+0xc5>
cmpl   $0x0,-0x18(%rbp)
jge    11f5 <main+0xc5>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
jmp    11fa <main+0xca>
jmp    11ff <main+0xcf>
jmp    1204 <main+0xd4>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
test   %ecx,%ecx
js     1169 <main+0x39>
test   %eax,%eax
js     1169 <main+0x39>
lea    0xeb4(%rip),%rdi
jmp    119a <main+0x6a>
test   %ecx,%ecx
jns    117a <main+0x4a>
test   %eax,%eax
js     117a <main+0x4a>
lea    0xea5(%rip),%rdi
jmp    119a <main+0x6a>
test   %ecx,%ecx
jns    118b <main+0x5b>
test   %eax,%eax
jns    118b <main+0x5b>
lea    0xe96(%rip),%rdi
jmp    119a <main+0x6a>
test   %ecx,%ecx
js     119f <main+0x6f>
test   %eax,%eax
jns    119f <main+0x6f>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Insira coordenadas: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [2 x i8] c"3\00"
@.str.5 = [2 x i8] c"4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, -1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, -1
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %22, label %14
14: ; preds = %2
%15 = icmp slt i32 %9, 0
%16 = select i1 %15, i1 %12, i1 false
br i1 %16, label %22, label %17
17: ; preds = %14
%18 = icmp slt i32 %11, 0
%19 = select i1 %15, i1 %18, i1 false
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = select i1 %10, i1 %18, i1 false
br i1 %21, label %22, label %25
22: ; preds = %20, %17, %14, %2
%23 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %14 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %17 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %20 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
br label %25
25: ; preds = %22, %20
ret i32 0
}