#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*/ printf(char *, int /*<<< orphan*/, long long);
scalar_t__ scanf(char *, long long *, long long *);
int main() {
  long long a, b, r, c;
  long long i, j;
  int times = 1;
  while (scanf("%lld%lld", &a, &b) != EOF) {
    if (a == 0 && b == 0)
      break;
    r = b * (b - 1) / 2;
    c = a * (a - 1) / 2;
    printf("Case %d: %lld\n", times++, r * c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x3c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
je     11d6 <main+0xb6>
cmpq   $0x0,-0x10(%rbp)
jne    1175 <main+0x55>
cmpq   $0x0,-0x18(%rbp)
jne    1175 <main+0x55>
jmp    11d6 <main+0xb6>
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x3c(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rdx
imul   -0x28(%rbp),%rdx
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9d(%rip),%rbx
cmp    (%rbx),%rax
je     11e0 <main+0xc0>
mov    $0x1,%esi
lea    0xea9(%rip),%r14
lea    0xe99(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
je     11e0 <main+0xc0>
lea    -0x1(%rcx),%rdx
imul   %rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
add    %rdx,%rcx
sar    %rcx
lea    -0x1(%rax),%rdi
imul   %rax,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
add    %rdi,%rdx
sar    %rdx
imul   %rcx,%rdx
lea    0x1(%rsi),%ebp
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
mov    %ebp,%esi
cmp    (%rbx),%rax
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%lld%lld\00"
@EOF = global i64 0
@.str.1 = [15 x i8] c"Case %d: %lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %28, label %8
8: ; preds = %0, %15
%9 = phi i32 [ %22, %15 ], [ 1, %0 ]
%10 = load i64, i64* %1
%11 = icmp eq i64 %10, 0
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 0
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %28, label %15
15: ; preds = %8
%16 = add nsw i64 %12, -1
%17 = mul nsw i64 %16, %12
%18 = sdiv i64 %17, 2
%19 = add nsw i64 %10, -1
%20 = mul nsw i64 %19, %10
%21 = sdiv i64 %20, 2
%22 = add nuw nsw i32 %9, 1
%23 = mul nsw i64 %18, %21
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9, i64 %23)
%25 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%26 = load i64, i64* @EOF
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %8
28: ; preds = %15, %8, %0
ret i32 0
}