#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, int);
int scanf(char *, int *, ...);
int main(void) {
  int casos, jogadaA, jogadaB, pontosA, pontosB;
  while (scanf("%d\n", &casos), casos != 0) {
    pontosA = pontosB = 0;
    while (casos-- > 0) {
      scanf("%d %d\n", &jogadaA, &jogadaB);
      if (jogadaA > jogadaB) {
        pontosA++;
      } else if (jogadaB > jogadaA) {
        pontosB++;
      }
    }
    printf("%d %d\n", pontosA, pontosB);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     11d3 <main+0xb3>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    11bc <main+0x9c>
lea    0xe8c(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    119d <main+0x7d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b7 <main+0x97>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b2 <main+0x92>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b7 <main+0x97>
jmp    1159 <main+0x39>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%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
lea    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11fe <main+0xde>
lea    0xeac(%rip),%rbx
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r13
jmp    1196 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11fe <main+0xde>
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
mov    $0x0,%r12d
mov    $0x0,%ebp
test   %eax,%eax
jle    1170 <main+0x50>
xor    %ebp,%ebp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
xor    %edx,%edx
xor    %esi,%esi
cmp    %ecx,%eax
setg   %dl
setl   %sil
add    %edx,%r12d
add    %esi,%ebp
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jg     11c0 <main+0xa0>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\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*
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %38, label %10
10: ; preds = %0, %31
%11 = phi i32 [ %36, %31 ], [ %8, %0 ]
%12 = add nsw i32 %11, -1
store i32 %12, i32* %1
%13 = icmp sgt i32 %11, 0
br i1 %13, label %14, label %31
14: ; preds = %10, %14
%15 = phi i32 [ %27, %14 ], [ 0, %10 ]
%16 = phi i32 [ %23, %14 ], [ 0, %10 ]
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp sgt i32 %18, %19
%21 = icmp sgt i32 %19, %18
%22 = zext i1 %20 to i32
%23 = add nuw nsw i32 %16, %22
%24 = xor i1 %20, true
%25 = and i1 %21, %24
%26 = zext i1 %25 to i32
%27 = add nuw nsw i32 %15, %26
%28 = load i32, i32* %1
%29 = add nsw i32 %28, -1
store i32 %29, i32* %1
%30 = icmp sgt i32 %28, 0
br i1 %30, label %14, label %31
31: ; preds = %14, %10
%32 = phi i32 [ 0, %10 ], [ %23, %14 ]
%33 = phi i32 [ 0, %10 ], [ %27, %14 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %33)
%35 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%36 = load i32, i32* %1
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %10
38: ; preds = %31, %0
ret i32 0
}