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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11cc <main+0xac>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1172 <main+0x52>
cmpq   $0x0,-0x18(%rbp)
jne    1172 <main+0x52>
jmp    11cc <main+0xac>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
shr    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
shr    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
imul   -0x28(%rbp),%rdx
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <main+0x17>
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>
cmp    $0x2,%eax
jne    11bd <main+0x9d>
mov    $0x1,%ebx
lea    0xeb7(%rip),%r14
lea    0xea7(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
mov    %rax,%rdx
or     %rcx,%rdx
je     11bd <main+0x9d>
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    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
add    $0x1,%rbx
cmp    $0x2,%eax
je     1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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