#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, unsigned long long);
int /*<<< orphan*/ scanf(char *, unsigned long long *, unsigned long long *);
int main(void) {
  unsigned long long int a, b, maxNumIntersection;
  int caseId = 1;
  while (1) {
    scanf("%llu %llu", &a, &b);
    if (a == 0 && b == 0)
      break;
    maxNumIntersection = ((a * (a - 1)) >> 1) * ((b * (b - 1)) >> 1);
    printf("Case %d: %llu\n", caseId, maxNumIntersection);
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1165 <main+0x45>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <main+0x45>
jmp    11b6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
shr    $0x1,%rax
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
imul   %rdx,%rcx
shr    $0x1,%rcx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
mov    %rcx,%rdx
or     %rax,%rdx
je     11b6 <main+0x96>
mov    $0x1,%ebx
lea    0xeac(%rip),%r14
lea    0xe9b(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%r13
nopl   (%rax)
lea    -0x1(%rcx),%rsi
imul   %rcx,%rsi
shr    %rsi
lea    -0x1(%rax),%rdx
imul   %rax,%rdx
shr    %rdx
imul   %rsi,%rdx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
mov    %rcx,%rdx
or     %rax,%rdx
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%llu %llu\00"
@.str.1 = [15 x i8] c"Case %d: %llu\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 i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = icmp eq i64 %6, 0
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %30, label %11
11: ; preds = %0, %11
%12 = phi i64 [ %27, %11 ], [ %8, %0 ]
%13 = phi i64 [ %25, %11 ], [ %6, %0 ]
%14 = phi i32 [ %23, %11 ], [ 1, %0 ]
%15 = add i64 %13, -1
%16 = mul i64 %15, %13
%17 = lshr i64 %16, 1
%18 = add i64 %12, -1
%19 = mul i64 %18, %12
%20 = lshr i64 %19, 1
%21 = mul i64 %20, %17
%22 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %14, i64 %21)
%23 = add nuw nsw i32 %14, 1
%24 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%25 = load i64, i64* %1
%26 = icmp eq i64 %25, 0
%27 = load i64, i64* %2
%28 = icmp eq i64 %27, 0
%29 = select i1 %26, i1 %28, i1 false
br i1 %29, label %30, label %11
30: ; preds = %11, %0
ret i32 0
}