#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, max, min, sum, x, i = 0, j;
  scanf("%i", &n);
  while (i++ < n) {
    j = 2;
    scanf("%i", &min);
    sum = max = min;
    while (j--) {
      scanf("%i", &x);
      x > max ? max = x : x < min ? min = x : 1;
      sum += x;
    }
    printf("Case %i: %i\n", i, sum - max - min);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    -0x8(%rbp),%eax
jge    120a <main+0xea>
movl   $0x2,-0x20(%rbp)
lea    0xe98(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0x0,%eax
je     11ed <main+0xcd>
lea    0xe6b(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b5 <main+0x95>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11df <main+0xbf>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11cf <main+0xaf>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0x24(%rbp)
jmp    11dc <main+0xbc>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11dc <main+0xbc>
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    117a <main+0x5a>
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x30,%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    0x14(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x14(%rsp)
jle    11e1 <main+0xc1>
xor    %ebx,%ebx
lea    0xead(%rip),%r14
lea    0x10(%rsp),%r12
jmp    117e <main+0x5e>
nopw   0x0(%rax,%rax,1)
mov    %edx,%r13d
add    %r13d,%eax
add    %ebp,%edx
sub    %eax,%edx
lea    0xe92(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    0x14(%rsp),%ebx
jge    11e1 <main+0xc1>
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r15d
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%ebp
mov    %ebp,%r13d
cmp    %r15d,%ebp
jg     11b7 <main+0x97>
mov    %r15d,%r13d
cmp    0xc(%rsp),%ebp
jge    11b7 <main+0x97>
mov    %ebp,0xc(%rsp)
mov    %r15d,%r13d
add    $0x1,%ebx
add    %r15d,%ebp
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%eax
cmp    %r13d,%edx
jg     1160 <main+0x40>
cmp    %eax,%edx
jge    1163 <main+0x43>
mov    %edx,0xc(%rsp)
mov    %edx,%eax
jmp    1163 <main+0x43>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [13 x i8] c"Case %i: %i\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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %41
10: ; preds = %0, %31
%11 = phi i32 [ %38, %31 ], [ 1, %0 ]
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, %13
br i1 %16, label %21, label %17
17: ; preds = %10
%18 = load i32, i32* %2
%19 = icmp slt i32 %15, %18
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 %15, i32* %2
br label %21
21: ; preds = %10, %20, %17
%22 = phi i32 [ %13, %20 ], [ %13, %17 ], [ %15, %10 ]
%23 = add nsw i32 %15, %13
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%25 = load i32, i32* %3
%26 = icmp sgt i32 %25, %22
%27 = load i32, i32* %2
br i1 %26, label %31, label %28
28: ; preds = %21
%29 = icmp slt i32 %25, %27
br i1 %29, label %30, label %31
30: ; preds = %28
store i32 %25, i32* %2
br label %31
31: ; preds = %21, %30, %28
%32 = phi i32 [ %25, %30 ], [ %27, %28 ], [ %27, %21 ]
%33 = phi i32 [ %22, %30 ], [ %22, %28 ], [ %25, %21 ]
%34 = add nsw i32 %25, %23
%35 = add i32 %33, %32
%36 = sub i32 %34, %35
%37 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %36)
%38 = add nuw nsw i32 %11, 1
%39 = load i32, i32* %1
%40 = icmp slt i32 %11, %39
br i1 %40, label %10, label %41
41: ; preds = %31, %0
ret i32 0
}