#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*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, i, a, b;
  int j = 1;
  char p1[11], p2[11];
  scanf("%d", &n);
  while (n != 0) {
    scanf("%s", p1);
    scanf("%s", p2);
    printf("Teste %d\n", j++);
    for (i = 0; i < n; i++) {
      scanf("%d %d", &a, &b);
      ((a + b) % 2 == 0) ? puts(p1) : puts(p2);
    }
    puts("");
    scanf("%d", &n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1225 <main+0xf5>
lea    -0x23(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x2e(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1202 <main+0xd2>
lea    0xe56(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11eb <main+0xbb>
lea    -0x23(%rbp),%rdi
call   1030 <puts@plt>
jmp    11f4 <main+0xc4>
lea    -0x2e(%rbp),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a4 <main+0x74>
lea    0xe03(%rip),%rdi
call   1030 <puts@plt>
lea    0xdfb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
jmp    1158 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1236 <main+0xf6>
mov    $0x1,%r13d
lea    0x1d(%rsp),%rbx
lea    0xe8f(%rip),%rbp
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r14
jmp    11b8 <main+0x78>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe6b(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1236 <main+0xf6>
lea    0xe41(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r15,%rdi
lea    0x12(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe21(%rip),%rdi
mov    %r13d,%esi
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1190 <main+0x50>
xor    %r15d,%r15d
jmp    1210 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
call   1040 <puts@plt>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jge    1190 <main+0x50>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
mov    %rbx,%rdi
test   $0x1,%al
je     1200 <main+0xc0>
lea    0x12(%rsp),%rdi
jmp    1200 <main+0xc0>
xor    %eax,%eax
add    $0x28,%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 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"Teste %d\0A\00"
@.str.3 = [6 x i8] c"%d %d\00"
@.str.4 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [11 x i8]
%8 = alloca [11 x i8]
store i32 0, i32* %1
store i32 1, i32* %6
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %43, %0
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %46
13: ; preds = %10
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 0, i32* %3
br label %21
21: ; preds = %40, %13
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %43
25: ; preds = %21
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %4, i32* %5)
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = add nsw i32 %27, %28
%30 = srem i32 %29, 2
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %25
%33 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%34 = call i32 @puts(i8* %33)
br label %38
35: ; preds = %25
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%37 = call i32 @puts(i8* %36)
br label %38
38: ; preds = %35, %32
%39 = phi i32 [ %34, %32 ], [ %37, %35 ]
br label %40
40: ; preds = %38
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %21
43: ; preds = %21
%44 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %10
46: ; preds = %10
%47 = load i32, i32* %1
ret i32 %47
}

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