#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 /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int a, b, c, n, i = 0;
  scanf("%d", &n);
  while (n--) {
    i++;
    scanf("%d %d %d", &a, &b, &c);
    if (a <= 20 && b <= 20 && c <= 20)
      printf("Case %d: good\n", i);
    else
      printf("Case %d: bad\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     11c5 <main+0xa5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe94(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x14,-0x8(%rbp)
jg     11b1 <main+0x91>
cmpl   $0x14,-0xc(%rbp)
jg     11b1 <main+0x91>
cmpl   $0x14,-0x10(%rbp)
jg     11b1 <main+0x91>
mov    -0x18(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
mov    -0x18(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <main+0x28>
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    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    1159 <main+0x39>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0xe95(%rip),%rbp
lea    0xe9d(%rip),%r14
jmp    11a3 <main+0x83>
nopl   (%rax)
cmpl   $0x15,0x10(%rsp)
cmovge %r14,%rdi
cmpl   $0x15,0x14(%rsp)
cmovge %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
subl   $0x1,0x8(%rsp)
jb     1148 <main+0x28>
lea    0xe56(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x15,0xc(%rsp)
mov    %rbp,%rdi
jl     1180 <main+0x60>
mov    %r14,%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [15 x i8] c"Case %d: good\0A\00"
@.str.3 = [14 x i8] c"Case %d: bad\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
store i32 0, i32* %6
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
br label %8
8: ; preds = %30, %0
%9 = load i32, i32* %5
%10 = add nsw i32 %9, -1
store i32 %10, i32* %5
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 20
br i1 %17, label %18, label %27
18: ; preds = %12
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 20
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp sle i32 %22, 20
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %30
27: ; preds = %21, %18, %12
%28 = load i32, i32* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
br label %8
31: ; preds = %8
ret i32 0
}

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