#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 *);
void main() {
  int x, y;
  printf("Informe o valor do X: ");
  scanf("%d", &x);
  printf("Informe o valor do Y: ");
  scanf("%d", &y);
  if (x > 0 && y > 0) {
    printf("Primeiro quadrante!\n");
  } else if (x > 0 && y < 0) {
    printf("Segundo quadrante!\n");
  } else if (x < 0 && y < 0) {
    printf("Terceiro quadrante!\n");
  } else {
    printf("Quarto quadrante!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1185 <main+0x65>
cmpl   $0x0,-0x8(%rbp)
jle    1185 <main+0x65>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    11e5 <main+0xc5>
cmpl   $0x0,-0x4(%rbp)
jle    11aa <main+0x8a>
cmpl   $0x0,-0x8(%rbp)
jge    11aa <main+0x8a>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
cmpl   $0x0,-0x4(%rbp)
jge    11cf <main+0xaf>
cmpl   $0x0,-0x8(%rbp)
jge    11cf <main+0xaf>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
jmp    11e5 <main+0xc5>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
test   %eax,%eax
jle    1187 <main+0x57>
test   %ecx,%ecx
jle    1187 <main+0x57>
lea    0xee5(%rip),%rdi
jmp    11ac <main+0x7c>
test   %eax,%eax
jle    1198 <main+0x68>
test   %ecx,%ecx
jns    1198 <main+0x68>
lea    0xec1(%rip),%rdi
jmp    11ac <main+0x7c>
lea    0xea4(%rip),%rdx
lea    0xe8b(%rip),%rdi
test   %ecx,%eax
cmovs  %rdx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Informe o valor do X: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Informe o valor do Y: \00"
@.str.3 = [21 x i8] c"Primeiro quadrante!\0A\00"
@.str.4 = [20 x i8] c"Segundo quadrante!\0A\00"
@.str.5 = [21 x i8] c"Terceiro quadrante!\0A\00"
@.str.6 = [19 x i8] c"Quarto quadrante!\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %34
14: ; preds = %9, %0
%15 = load i32, i32* %1
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %33
22: ; preds = %17, %14
%23 = load i32, i32* %1
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %32
30: ; preds = %25, %22
%31 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32, %20
br label %34
34: ; preds = %33, %12
ret void
}

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