#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 */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int i, t, length, width, height;
  fflush(stdin);
  while (scanf("%d", &t) != EOF) {
    if (t > 100)
      exit(1);
    for (i = 1; i <= t; i++) {
      scanf("%d %d %d", &length, &width, &height);
      if (length < 1 || height > 50) {
        printf("Case %d: bad\n", i);
        continue;
      }
      if (length <= 20 && width <= 20 && height <= 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    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe9b(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e63(%rip),%rcx
cmp    (%rcx),%rax
je     1248 <main+0x108>
cmpl   $0x64,-0x18(%rbp)
jle    119a <main+0x5a>
mov    $0x1,%edi
call   1060 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1243 <main+0x103>
lea    0xe4c(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x1,-0x1c(%rbp)
jl     11db <main+0x9b>
cmpl   $0x32,-0x24(%rbp)
jle    11ef <main+0xaf>
mov    -0x14(%rbp),%esi
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    1235 <main+0xf5>
cmpl   $0x14,-0x1c(%rbp)
jg     1221 <main+0xe1>
cmpl   $0x14,-0x20(%rbp)
jg     1221 <main+0xe1>
cmpl   $0x14,-0x24(%rbp)
jg     1221 <main+0xe1>
mov    -0x14(%rbp),%esi
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
jmp    1230 <main+0xf0>
mov    -0x14(%rbp),%esi
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
jmp    1235 <main+0xf5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a1 <main+0x61>
jmp    1164 <main+0x24>
xor    %eax,%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    $0x18,%rsp
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%rax
jne    118c <main+0x4c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe6d(%rip),%r12
lea    0x14(%rsp),%r13
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rbp
lea    0xe60(%rip),%r15
jmp    11cf <main+0x8f>
nopl   0x0(%rax,%rax,1)
lea    0xe4f(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e16(%rip),%rcx
cmp    (%rcx),%rax
je     117b <main+0x3b>
mov    0x8(%rsp),%eax
cmp    $0x64,%eax
jg     1251 <main+0x111>
test   %eax,%eax
jle    11b0 <main+0x70>
mov    $0x1,%r14d
jmp    1216 <main+0xd6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpl   $0x15,0x10(%rsp)
cmovge %r15,%rdi
cmp    $0x15,%eax
cmovae %r15,%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    0x8(%rsp),%r14d
mov    %eax,%r14d
jge    11b0 <main+0x70>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
mov    %r15,%rdi
test   %eax,%eax
jle    1200 <main+0xc0>
mov    0xc(%rsp),%ecx
mov    %r15,%rdi
cmp    $0x32,%ecx
jg     1200 <main+0xc0>
lea    0xdd0(%rip),%rdi
cmp    $0x15,%ecx
jl     11f0 <main+0xb0>
mov    %r15,%rdi
jmp    11f0 <main+0xb0>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [14 x i8] c"Case %d: bad\0A\00"
@.str.3 = [15 x i8] c"Case %d: good\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* @stdin
%12 = call i32 @fflush(i32 %11)
br label %13
13: ; preds = %56, %2
%14 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%15 = load i64, i64* @EOF
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %57
17: ; preds = %13
%18 = load i32, i32* %7
%19 = icmp sgt i32 %18, 100
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %17
store i32 1, i32* %6
br label %23
23: ; preds = %53, %22
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %56
27: ; preds = %23
%28 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
%29 = load i32, i32* %8
%30 = icmp slt i32 %29, 1
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = load i32, i32* %10
%33 = icmp sgt i32 %32, 50
br i1 %33, label %34, label %37
34: ; preds = %31, %27
%35 = load i32, i32* %6
%36 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %53
37: ; preds = %31
%38 = load i32, i32* %8
%39 = icmp sle i32 %38, 20
br i1 %39, label %40, label %49
40: ; preds = %37
%41 = load i32, i32* %9
%42 = icmp sle i32 %41, 20
br i1 %42, label %43, label %49
43: ; preds = %40
%44 = load i32, i32* %10
%45 = icmp sle i32 %44, 20
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* %6
%48 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %47)
br label %52
49: ; preds = %43, %40, %37
%50 = load i32, i32* %6
%51 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %49, %46
br label %53
53: ; preds = %52, %34
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %23
56: ; preds = %23
br label %13
57: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [14 x i8] c"Case %d: bad\0A\00"
@.str.3 = [15 x i8] c"Case %d: good\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = load i32, i32* @stdin
%12 = tail call i32 @fflush(i32 %11)
%13 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %49, label %20
16: ; preds = %43, %23
%17 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %49, label %20
20: ; preds = %2, %16
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 100
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = icmp slt i32 %21, 1
br i1 %24, label %16, label %27
25: ; preds = %20
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %23, %43
%28 = phi i32 [ %46, %43 ], [ 1, %23 ]
%29 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 1
%32 = load i32, i32* %6
%33 = icmp sgt i32 %32, 50
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %43, label %35
35: ; preds = %27
%36 = icmp ult i32 %30, 21
%37 = load i32, i32* %5
%38 = icmp slt i32 %37, 21
%39 = select i1 %36, i1 %38, i1 false
%40 = icmp slt i32 %32, 21
%41 = select i1 %39, i1 %40, i1 false
%42 = select i1 %41, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
br label %43
43: ; preds = %35, %27
%44 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %27 ], [ %42, %35 ]
%45 = call i32 @printf(i8* %44, i32 %28)
%46 = add nuw nsw i32 %28, 1
%47 = load i32, i32* %3
%48 = icmp slt i32 %28, %47
br i1 %48, label %27, label %16
49: ; preds = %16, %2
ret i32 0
}