#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 *);
int main() {
  int x = 1, y = 1;
  while (x != 0 && y != 0) {
    scanf("%d%d", &x, &y);
    if (x != 0 && y != 0) {
      if (x > 0 && y > 0)
        printf("primeiro\n");
      else if (x < 0 && y > 0)
        printf("segundo\n");
      else if (x < 0 && y < 0)
        printf("terceiro\n");
      else if (x > 0 && y < 0)
        printf("quarto\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1156 <main+0x36>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1166 <main+0x46>
jmp    1236 <main+0x116>
lea    0xe93(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1231 <main+0x111>
cmpl   $0x0,-0xc(%rbp)
je     1231 <main+0x111>
cmpl   $0x0,-0x8(%rbp)
jle    11b3 <main+0x93>
cmpl   $0x0,-0xc(%rbp)
jle    11b3 <main+0x93>
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
jmp    122c <main+0x10c>
cmpl   $0x0,-0x8(%rbp)
jge    11d8 <main+0xb8>
cmpl   $0x0,-0xc(%rbp)
jle    11d8 <main+0xb8>
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
jmp    1227 <main+0x107>
cmpl   $0x0,-0x8(%rbp)
jge    11fd <main+0xdd>
cmpl   $0x0,-0xc(%rbp)
jge    11fd <main+0xdd>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    1222 <main+0x102>
cmpl   $0x0,-0x8(%rbp)
jle    121d <main+0xfd>
cmpl   $0x0,-0xc(%rbp)
jge    121d <main+0xfd>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    1222 <main+0x102>
jmp    1227 <main+0x107>
jmp    122c <main+0x10c>
jmp    1231 <main+0x111>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0xebf(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
lea    0xecd(%rip),%r12
lea    0xebe(%rip),%r13
lea    0xeae(%rip),%rbp
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
je     11b5 <main+0x95>
mov    (%rsp),%eax
test   %eax,%eax
je     11b5 <main+0x95>
test   %ecx,%ecx
jle    1188 <main+0x68>
mov    %r12,%rdi
test   %eax,%eax
jg     11b0 <main+0x90>
test   %ecx,%ecx
jns    1193 <main+0x73>
mov    %r13,%rdi
test   %eax,%eax
jg     11b0 <main+0x90>
test   %ecx,%ecx
jns    119e <main+0x7e>
mov    %rbp,%rdi
test   %eax,%eax
js     11b0 <main+0x90>
test   %ecx,%ecx
jle    11b5 <main+0x95>
lea    0xe5c(%rip),%rdi
test   %eax,%eax
jns    11b5 <main+0x95>
nopl   (%rax)
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
je     11c2 <main+0xa2>
cmpl   $0x0,(%rsp)
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@str = [7 x i8] c"quarto\00"
@str.5 = [9 x i8] c"terceiro\00"
@str.6 = [8 x i8] c"segundo\00"
@str.7 = [9 x i8] c"primeiro\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
br label %5
5: ; preds = %0, %27
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %12, label %27
12: ; preds = %5
%13 = icmp sgt i32 %7, 0
%14 = icmp sgt i32 %9, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %24, label %16
16: ; preds = %12
%17 = icmp slt i32 %7, 0
%18 = select i1 %17, i1 %14, i1 false
br i1 %18, label %24, label %19
19: ; preds = %16
%20 = icmp slt i32 %9, 0
%21 = select i1 %17, i1 %20, i1 false
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = select i1 %13, i1 %20, i1 false
br i1 %23, label %24, label %27
24: ; preds = %22, %19, %16, %12
%25 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0), %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), %16 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0), %19 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), %22 ]
%26 = call i32 @puts(i8* dereferenceable(1) %25)
br label %27
27: ; preds = %24, %22, %5
%28 = load i32, i32* %1
%29 = icmp ne i32 %28, 0
%30 = load i32, i32* %2
%31 = icmp ne i32 %30, 0
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %5, label %33
33: ; preds = %27
ret i32 0
}