#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);
int scanf(char *, int *);
int main() {
  int n, n1, i, given, notgiven, j = 1;
  while (scanf("%d", &n) == 1) {
    if (n == 0)
      break;
    given = 0;
    notgiven = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &n1);
      if (n1 == 0)
        given++;
      else
        notgiven++;
    }
    given = notgiven - given;
    printf("Case %d: %d\n", j, given);
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11ec <main+0xcc>
cmpl   $0x0,-0x8(%rbp)
jne    115e <main+0x3e>
jmp    11ec <main+0xcc>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c3 <main+0xa3>
lea    0xe7a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11a7 <main+0x87>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b0 <main+0x90>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b5 <main+0x95>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <main+0x53>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <main+0x16>
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
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11c8 <main+0xa8>
mov    (%rsp),%eax
test   %eax,%eax
je     11c8 <main+0xa8>
mov    $0x1,%r14d
lea    0xea5(%rip),%rbx
lea    0x4(%rsp),%r13
xor    %ebp,%ebp
test   %eax,%eax
jle    119c <main+0x7c>
xor    %r15d,%r15d
xor    %r12d,%r12d
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmpl   $0x0,0x4(%rsp)
setne  %al
sete   %cl
add    %ecx,%r15d
add    %eax,%ebp
add    $0x1,%r12d
cmp    (%rsp),%r12d
jl     1170 <main+0x50>
sub    %r15d,%ebp
lea    0xe60(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11c8 <main+0xa8>
add    $0x1,%r14d
mov    (%rsp),%eax
test   %eax,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%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 = [13 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 i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %7
br label %8
8: ; preds = %34, %0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %43
15: ; preds = %11
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %4
br label %16
16: ; preds = %31, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %30
27: ; preds = %20
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %16
34: ; preds = %16
%35 = load i32, i32* %6
%36 = load i32, i32* %5
%37 = sub nsw i32 %35, %36
store i32 %37, i32* %5
%38 = load i32, i32* %7
%39 = load i32, i32* %5
%40 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %39)
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %8
43: ; preds = %14, %8
ret i32 0
}

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