#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 calc_sum(int, int);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int t, i = 1;
  int a, b;
  freopen("./sample.txt", "r", stdin);
  scanf("%d", &t);
  getchar();
  if ((t < 1) || (t > 100))
    return 0;
  while (i <= t) {
    scanf("%d", &a);
    getchar();
    scanf("%d", &b);
    getchar();
    if ((a < 0) || (a > 100))
      continue;
    if ((b < 0) || (b > 100))
      continue;
    if (a > b) {
      printf("Case %d: 0\n", i);
    } else {
      printf("Case %d: %d\n", i, calc_sum(a, b));
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
lea    0xe8a(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe86(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
cmpl   $0x1,-0x8(%rbp)
jl     11ad <main+0x5d>
cmpl   $0x64,-0x8(%rbp)
jle    11b9 <main+0x69>
movl   $0x0,-0x4(%rbp)
jmp    1285 <main+0x135>
jmp    11be <main+0x6e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     127e <main+0x12e>
lea    0xe3e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
lea    0xe27(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
cmpl   $0x0,-0x10(%rbp)
jl     120c <main+0xbc>
cmpl   $0x64,-0x10(%rbp)
jle    1211 <main+0xc1>
jmp    11be <main+0x6e>
cmpl   $0x0,-0x14(%rbp)
jl     1225 <main+0xd5>
cmpl   $0x64,-0x14(%rbp)
jle    122a <main+0xda>
jmp    11be <main+0x6e>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    124c <main+0xfc>
mov    -0xc(%rbp),%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1270 <main+0x120>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <calc_sum@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <main+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
lea    0xe92(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe8e(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0xc(%rsp),%eax
add    $0xffffff9b,%eax
cmp    $0xffffff9c,%eax
jae    11af <main+0x5f>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
lea    0xe54(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe46(%rip),%r13
lea    0xe4b(%rip),%rbp
jmp    11e6 <main+0x96>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    0xc(%rsp),%ebx
jg     119e <main+0x4e>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x14(%rsp),%edi
cmp    $0x64,%edi
ja     11e0 <main+0x90>
mov    0x10(%rsp),%esi
cmp    $0x65,%esi
jae    11e0 <main+0x90>
cmp    %esi,%edi
jbe    122e <main+0xde>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1241 <main+0xf1>
call   1050 <calc_sum@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
jl     11e6 <main+0x96>
jmp    119e <main+0x4e>

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

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