#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 countTotalNumTimeType(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int T, caseId, numTimeType;
  char trash[1000 + 1], line[1000 + 1];
  scanf("%d", &T);
  gets(trash);
  caseId = 1;
  while (caseId <= T) {
    gets(line);
    printf("Case #%d: %d\n", caseId, countTotalNumTimeType(line));
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <gets@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11c4 <main+0x84>
lea    -0x7f0(%rbp),%rdi
call   1040 <gets@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x7f4(%rbp)
lea    -0x7f0(%rbp),%rdi
call   1060 <countTotalNumTimeType@plt>
mov    -0x7f4(%rbp),%esi
mov    %eax,%edx
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x35>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7f0,%rsp
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0x400(%rsp),%rdi
call   1040 <gets@plt>
cmpl   $0x0,0xc(%rsp)
jle    11a5 <main+0x65>
xor    %ebx,%ebx
lea    0x10(%rsp),%r14
lea    0xe84(%rip),%r15
nop
add    $0x1,%ebx
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
call   1060 <countTotalNumTimeType@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
cmp    0xc(%rsp),%ebx
jl     1180 <main+0x40>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"Case #%d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1001 x i8]
%6 = alloca [1001 x i8]
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = getelementptr inbounds [1001 x i8], [1001 x i8]* %5, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
store i32 1, i32* %3
br label %10
10: ; preds = %14, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = getelementptr inbounds [1001 x i8], [1001 x i8]* %6, i64 0, i64 0
%16 = call i32 @gets(i8* %15)
%17 = load i32, i32* %3
%18 = getelementptr inbounds [1001 x i8], [1001 x i8]* %6, i64 0, i64 0
%19 = call i32 @countTotalNumTimeType(i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %19)
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %10
23: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"Case #%d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1001 x i8]
%3 = alloca [1001 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @gets(i8* %5)
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1
br i1 %10, label %19, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %16, %11 ], [ 1, %0 ]
%13 = call i32 @gets(i8* %6)
%14 = call i32 @countTotalNumTimeType(i8* %6)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = add nuw nsw i32 %12, 1
%17 = load i32, i32* %1
%18 = icmp slt i32 %12, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %0
ret i32 0
}