#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 EXIT_SUCCESS;
int /*<<< orphan*/ insertion_sort2(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int N, number;
  scanf("%d", &N);
  int arr[N], i = 0;
  for (; i < N; i++) {
    scanf("%d", &number);
    arr[i] = number;
  }
  insertion_sort2(arr, 0, N - 1);
  printf("%d", arr[N / 2]);
  printf("\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11bc <main+0x8c>
lea    0xe69(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x38(%rbp),%rax
mov    -0x18(%rbp),%edx
movslq -0x2c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1184 <main+0x54>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <insertion_sort2@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeab(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1060 <scanf@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
mov    %rsp,%r13
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    -0x2c(%rbp),%edx
test   %edx,%edx
jle    11b0 <main+0x70>
xor    %ebx,%ebx
lea    0xe77(%rip),%r14
lea    -0x30(%rbp),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,0x0(%r13,%rbx,4)
add    $0x1,%rbx
movslq -0x2c(%rbp),%rdx
cmp    %rdx,%rbx
jl     1190 <main+0x50>
add    $0xffffffff,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1050 <insertion_sort2@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
mov    0x0(%r13,%rax,4),%esi
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%eax
mov    %r12,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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