#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(void) {
  int i, x, y;
  for (i = 1; i <= 99; i++) {
    scanf("%d%d", &x, &y);
    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");
    } else if (x == 0 || y == 0) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jg     1228 <main+0x108>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    1179 <main+0x59>
cmpl   $0x0,-0x10(%rbp)
jle    1179 <main+0x59>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <main+0xf5>
cmpl   $0x0,-0xc(%rbp)
jge    119e <main+0x7e>
cmpl   $0x0,-0x10(%rbp)
jle    119e <main+0x7e>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
cmpl   $0x0,-0xc(%rbp)
jge    11c3 <main+0xa3>
cmpl   $0x0,-0x10(%rbp)
jge    11c3 <main+0xa3>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
cmpl   $0x0,-0xc(%rbp)
jle    11e8 <main+0xc8>
cmpl   $0x0,-0x10(%rbp)
jge    11e8 <main+0xc8>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
cmpl   $0x0,-0xc(%rbp)
je     11fc <main+0xdc>
cmpl   $0x0,-0x10(%rbp)
jne    1201 <main+0xe1>
jmp    1228 <main+0x108>
jmp    1206 <main+0xe6>
jmp    120b <main+0xeb>
jmp    1210 <main+0xf0>
jmp    1215 <main+0xf5>
jmp    121a <main+0xfa>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
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
mov    $0x1,%ebp
lea    0xec9(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%rbx
lea    0xed7(%rip),%r12
lea    0xec8(%rip),%r13
jmp    115d <main+0x3d>
nop
call   1030 <puts@plt>
cmp    $0x62,%ebp
ja     11b3 <main+0x93>
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
test   %ecx,%ecx
jle    117d <main+0x5d>
mov    %r12,%rdi
test   %eax,%eax
jg     1150 <main+0x30>
test   %ecx,%ecx
jns    1188 <main+0x68>
mov    %r13,%rdi
test   %eax,%eax
jg     1150 <main+0x30>
test   %ecx,%ecx
jns    1197 <main+0x77>
lea    0xe79(%rip),%rdi
test   %eax,%eax
js     1150 <main+0x30>
test   %ecx,%ecx
jle    11a6 <main+0x86>
lea    0xe63(%rip),%rdi
test   %eax,%eax
js     1150 <main+0x30>
test   %ecx,%ecx
je     11b3 <main+0x93>
test   %eax,%eax
je     11b3 <main+0x93>
cmp    $0x63,%ebp
jb     115a <main+0x3a>
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
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %5
5: ; preds = %53, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 99
br i1 %7, label %8, label %56
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %52
17: ; preds = %12, %8
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %51
25: ; preds = %20, %17
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %50
33: ; preds = %28, %25
%34 = load i32, i32* %3
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* %4
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %49
41: ; preds = %36, %33
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = load i32, i32* %4
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %44, %41
br label %56
48: ; preds = %44
br label %49
49: ; preds = %48, %39
br label %50
50: ; preds = %49, %31
br label %51
51: ; preds = %50, %23
br label %52
52: ; preds = %51, %15
br label %53
53: ; preds = %52
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %5
56: ; preds = %47, %5
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*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %31, %0
%6 = phi i32 [ 1, %0 ], [ %32, %31 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %27, label %13
13: ; preds = %5
%14 = icmp slt i32 %8, 0
%15 = select i1 %14, i1 %11, i1 false
br i1 %15, label %27, label %16
16: ; preds = %13
%17 = icmp slt i32 %10, 0
%18 = select i1 %14, i1 %17, i1 false
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = select i1 %9, i1 %17, i1 false
br i1 %20, label %27, label %21
21: ; preds = %19
%22 = icmp ne i32 %8, 0
%23 = icmp ne i32 %10, 0
%24 = select i1 %22, i1 %23, i1 false
%25 = icmp ult i32 %6, 99
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %31, label %33
27: ; preds = %19, %16, %13, %5
%28 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0), %16 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), %19 ]
%29 = call i32 @puts(i8* dereferenceable(1) %28)
%30 = icmp ult i32 %6, 99
br i1 %30, label %31, label %33
31: ; preds = %27, %21
%32 = add nuw nsw i32 %6, 1
br label %5
33: ; preds = %21, %27
ret i32 0
}