#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 /*<<< orphan*/ selection(int *, int);
int main() {
  int T, x, i, N[12], j;
  scanf(" %d", &T);
  j = 0;
  while (j < T) {
    scanf(" %d", &x);
    for (i = 0; i < x; i++)
      scanf(" %d", &N[i]);
    selection(N, x);
    printf("Case %d: %d\n", j + 1, N[x / 2]);
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11eb <main+0xbb>
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ae <main+0x7e>
movslq -0x10(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe65(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1179 <main+0x49>
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <selection@plt>
mov    -0x44(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
mov    -0x40(%rbp,%rax,4),%edx
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ef <main+0xbf>
xor    %r14d,%r14d
lea    0xe9c(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0xe94(%rip),%r13
jmp    11b2 <main+0x82>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <selection@plt>
add    $0x1,%r14d
mov    0x8(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
mov    0x10(%rsp,%rax,4),%edx
mov    %r13,%rdi
mov    %r14d,%esi
call   1040 <printf@plt>
cmp    0xc(%rsp),%r14d
jge    11ef <main+0xbf>
mov    %rbx,%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
test   %esi,%esi
jle    1180 <main+0x50>
mov    %r12,%rbp
xor    %r15d,%r15d
nopl   (%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
add    $0x1,%r15
movslq 0x8(%rsp),%rsi
add    $0x4,%rbp
cmp    %rsi,%r15
jl     11d0 <main+0xa0>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [12 x i32]* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 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 %37
10: ; preds = %0
%11 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
br label %12
12: ; preds = %10, %25
%13 = phi i32 [ 0, %10 ], [ %28, %25 ]
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %12, %17
%18 = phi i64 [ %21, %17 ], [ 0, %12 ]
%19 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = add nuw nsw i64 %18, 1
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %17, label %25
25: ; preds = %17, %12
%26 = phi i32 [ %15, %12 ], [ %22, %17 ]
%27 = call i32 @selection(i32* %11, i32 %26)
%28 = add nuw nsw i32 %13, 1
%29 = load i32, i32* %2
%30 = sdiv i32 %29, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %33)
%35 = load i32, i32* %1
%36 = icmp slt i32 %28, %35
br i1 %36, label %12, label %37
37: ; preds = %25, %0
ret i32 0
}