#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 getMinNumScarecrow(char *, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  char field[100 + 1];
  int T, len, caseId;
  scanf("%d", &T);
  caseId = 1;
  while (caseId <= T) {
    scanf("%d", &len);
    scanf("%s", field);
    printf("Case %d: %d\n", caseId, getMinNumScarecrow(field, len));
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x74(%rbp),%eax
jg     11bc <main+0x8c>
lea    0xe92(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%esi
call   1030 <getMinNumScarecrow@plt>
mov    -0x80(%rbp),%esi
mov    %eax,%edx
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    115b <main+0x2b>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11bb <main+0x8b>
lea    0xea1(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xe98(%rip),%r12
lea    0x10(%rsp),%rbx
lea    0xe8f(%rip),%r13
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <getMinNumScarecrow@plt>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
cmp    0x8(%rsp),%ebp
jl     1180 <main+0x50>
xor    %eax,%eax
add    $0x78,%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 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %5
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%13 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %5
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @getMinNumScarecrow(i8* %16, i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %18)
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
ret i32 0
}

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