#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 teste = 0;
  int rodadas = 1;
  int aldo, beto;
  int a, b;
  int i;
  scanf("%d", &rodadas);
  while (rodadas) {
    printf("Teste %d\n", ++teste);
    aldo = 0;
    beto = 0;
    for (i = 0; i < rodadas; i++) {
      scanf("%d %d", &a, &b);
      aldo += a;
      beto += b;
    }
    if (aldo > beto)
      printf("Aldo\n\n");
    else
      printf("Beto\n\n");
    scanf("%d", &rodadas);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec9(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     120b <main+0xeb>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c7 <main+0xa7>
lea    0xe72(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1185 <main+0x65>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11e6 <main+0xc6>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <main+0xd4>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe12(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    114f <main+0x2f>
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   $0x1,0x8(%rsp)
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
je     120c <main+0xdc>
lea    0xe9f(%rip),%r15
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
jmp    11a6 <main+0x76>
nopl   0x0(%rax)
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7a(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
je     120c <main+0xdc>
add    $0x1,%ebp
lea    0xe50(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1180 <main+0x50>
mov    %ebp,0xc(%rsp)
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
add    0x14(%rsp),%r14d
add    0x10(%rsp),%r13d
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11d0 <main+0xa0>
lea    0xe1c(%rip),%rdi
cmp    %r13d,%r14d
mov    0xc(%rsp),%ebp
jle    1180 <main+0x50>
jmp    1187 <main+0x57>
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 = [10 x i8] c"Teste %d\0A\00"
@.str.2 = [6 x i8] c"%d %d\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 1, i32* %3
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %10
10: ; preds = %40, %0
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %42
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15)
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %8
br label %17
17: ; preds = %29, %13
%18 = load i32, i32* %8
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %6, i32* %7)
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = add nsw i32 %24, %23
store i32 %25, i32* %4
%26 = load i32, i32* %7
%27 = load i32, i32* %5
%28 = add nsw i32 %27, %26
store i32 %28, i32* %5
br label %29
29: ; preds = %21
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %17
32: ; preds = %17
%33 = load i32, i32* %4
%34 = load i32, i32* %5
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %40
38: ; preds = %32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
%41 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %10
42: ; preds = %10
ret i32 0
}

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