#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 j1 = 0, j2 = 0, r1 = 0, r2 = 0, rodadas = 0, i = 0, partida = 0;
  while (1 == 1) {
    j1 = 0;
    j2 = 0;
    rodadas = 0;
    i = 0;
    r1 = 0;
    r2 = 0;
    scanf("%d", &rodadas);
    if (rodadas == 0)
      break;
    for (i; i < rodadas; i++) {
      scanf("%d %d", &j1, &j2);
      r1 += j1;
      r2 += j2;
    }
    partida++;
    printf("Teste %d\n", partida);
    if (r1 > r2)
      printf("Aldo\n\n");
    else
      printf("Beto\n\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe72(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    11ab <main+0x8b>
jmp    1239 <main+0x119>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11ed <main+0xcd>
lea    0xe42(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ab <main+0x8b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1226 <main+0x106>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1234 <main+0x114>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <main+0x40>
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
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xea6(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     1253 <main+0x123>
lea    0xe84(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%rbx
xor    %r12d,%r12d
jmp    11e4 <main+0xb4>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
lea    0xe6b(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe33(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     1253 <main+0x123>
test   %eax,%eax
jle    1190 <main+0x60>
mov    %r12d,0x14(%rsp)
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
add    0x10(%rsp),%ebp
add    0xc(%rsp),%r13d
add    $0x1,%r12d
cmp    0x8(%rsp),%r12d
jl     1200 <main+0xd0>
mov    0x14(%rsp),%r12d
add    $0x1,%r12d
lea    0xdd2(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd1(%rip),%rdi
cmp    %r13d,%ebp
jle    11a5 <main+0x75>
jmp    11ac <main+0x7c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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