#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 main() {
  int X, Y, cont = 0, op = 1, resu[3] = {0, 0, 0};
  while (op == 1) {
    scanf(" %d %d", &X, &Y);
    if (X > Y)
      resu[0]++;
    else if (X < Y)
      resu[1]++;
    else
      resu[2]++;
    cont++;
    printf("Novo grenal (1-sim 2-nao)\n");
    scanf(" %d", &op);
  }
  printf("%d grenais\n", cont);
  printf("Inter:%d\n", resu[0]);
  printf("Gremio:%d\n", resu[1]);
  printf("Empates:%d\n", resu[2]);
  if (resu[0] > resu[1])
    printf("Inter venceu mais\n");
  else if (resu[1] > resu[0])
    printf("Gremio venceu mais\n");
  else
    printf("Nao houve vencedor\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
cmpl   $0x1,-0x14(%rbp)
jne    11ed <main+0xbd>
lea    0xe92(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1197 <main+0x67>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11bf <main+0x8f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b1 <main+0x81>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ba <main+0x8a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bf <main+0x8f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe26(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1250 <main+0x120>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1282 <main+0x152>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    126f <main+0x13f>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127d <main+0x14d>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1282 <main+0x152>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x1,0xc(%rsp)
lea    0x10(%rsp),%rbx
lea    0xf1a(%rip),%r15
lea    0xeaa(%rip),%r12
lea    0xc(%rsp),%r13
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
xor    %ebp,%ebp
xor    %r14d,%r14d
jmp    11a3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
add    $0x1,%r14d
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x1,0xc(%rsp)
jne    11d7 <main+0xa7>
lea    0xe56(%rip),%rdi
lea    0x14(%rsp),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    %eax,0x14(%rsp)
jg     1180 <main+0x50>
jge    11d0 <main+0xa0>
addl   $0x1,0x8(%rsp)
jmp    1183 <main+0x53>
nopl   0x0(%rax)
addl   $0x1,0x4(%rsp)
jmp    1183 <main+0x53>
lea    0xe29(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe24(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    0x8(%rsp),%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe15(%rip),%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebp,%ebx
lea    0xe20(%rip),%rax
lea    0xe06(%rip),%rcx
cmovg  %rax,%rcx
lea    0xe21(%rip),%rdi
cmovge %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [27 x i8] c"Novo grenal (1-sim 2-nao)\0A\00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [12 x i8] c"%d grenais\0A\00"
@.str.4 = [10 x i8] c"Inter:%d\0A\00"
@.str.5 = [11 x i8] c"Gremio:%d\0A\00"
@.str.6 = [12 x i8] c"Empates:%d\0A\00"
@.str.7 = [19 x i8] c"Inter venceu mais\0A\00"
@.str.8 = [20 x i8] c"Gremio venceu mais\0A\00"
@.str.9 = [20 x i8] c"Nao houve vencedor\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i32]
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %5
%7 = bitcast [3 x i32]* %6 to i8*
br label %8
8: ; preds = %33, %0
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %38
11: ; preds = %8
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
br label %33
20: ; preds = %11
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
store i32 %27, i32* %25
br label %32
28: ; preds = %20
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %29
br label %32
32: ; preds = %28, %24
br label %33
33: ; preds = %32, %16
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%37 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %5)
br label %8
38: ; preds = %8
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%51 = load i32, i32* %50
%52 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%53 = load i32, i32* %52
%54 = icmp sgt i32 %51, %53
br i1 %54, label %55, label %57
55: ; preds = %38
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
br label %68
57: ; preds = %38
%58 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%59 = load i32, i32* %58
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%61 = load i32, i32* %60
%62 = icmp sgt i32 %59, %61
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %67
65: ; preds = %57
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67, %55
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@.str = [7 x i8] c" %d %d\00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [12 x i8] c"%d grenais\0A\00"
@.str.4 = [10 x i8] c"Inter:%d\0A\00"
@.str.5 = [11 x i8] c"Gremio:%d\0A\00"
@.str.6 = [12 x i8] c"Empates:%d\0A\00"
@str = [19 x i8] c"Nao houve vencedor\00"
@str.10 = [19 x i8] c"Gremio venceu mais\00"
@str.11 = [18 x i8] c"Inter venceu mais\00"
@str.12 = [26 x i8] c"Novo grenal (1-sim 2-nao)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 1, i32* %3
br label %7
7: ; preds = %0, %24
%8 = phi i32 [ 0, %0 ], [ %27, %24 ]
%9 = phi i32 [ 0, %0 ], [ %26, %24 ]
%10 = phi i32 [ 0, %0 ], [ %25, %24 ]
%11 = phi i32 [ 0, %0 ], [ %28, %24 ]
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %7
%17 = add nsw i32 %10, 1
br label %24
18: ; preds = %7
%19 = icmp slt i32 %13, %14
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = add nsw i32 %9, 1
br label %24
22: ; preds = %18
%23 = add nsw i32 %8, 1
br label %24
24: ; preds = %20, %22, %16
%25 = phi i32 [ %17, %16 ], [ %10, %20 ], [ %10, %22 ]
%26 = phi i32 [ %9, %16 ], [ %21, %20 ], [ %9, %22 ]
%27 = phi i32 [ %8, %16 ], [ %8, %20 ], [ %23, %22 ]
%28 = add nuw nsw i32 %11, 1
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 1
br i1 %32, label %7, label %33
33: ; preds = %24
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%38 = icmp sgt i32 %25, %26
%39 = icmp sgt i32 %26, %25
%40 = select i1 %39, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%41 = select i1 %38, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0), i8* %40
%42 = call i32 @puts(i8* dereferenceable(1) %41)
ret i32 0
}