#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*/ assert(int);
int median(int, int, ...);
int mode(int, int, ...);
int main() {
  assert(median(1, 1) == 1);
  assert(median(2, 1, 2) == 1.5);
  assert(median(3, 1, 2, 3) == 2);
  assert(median(3, 3, 2, 1) == 2);
  assert(median(3, 3, 3, 3) == 3);
  assert(median(6, 9, -10, -1, 8, 3, 5) == 4);
  assert(median(7, 5, 6, 4, 1, 2, 3, 7) == 4);
  assert(mode(1, 1) == 1);
  assert(mode(3, 2, 1, 1) == 1);
  assert(mode(7, 1, 1, 1, 2, 2, 2, 2) == 2);
  assert(mode(6, 3, 3, 3, 2, 2, 2) == 2);
  assert(mode(6, 2, 3, 2, 3, 2, 3) == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edx
mov    $0x1,%esi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <median@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe84(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    %esi,%edi
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6,%edi
mov    $0x9,%esi
mov    $0xfffffff6,%edx
mov    $0xffffffff,%ecx
mov    $0x8,%r8d
mov    $0x3,%r9d
movl   $0x5,(%rsp)
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x4,%ecx
mov    $0x1,%r8d
mov    $0x2,%r9d
movl   $0x3,(%rsp)
movl   $0x7,0x8(%rsp)
mov    $0x0,%al
call   1030 <median@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1050 <mode@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1050 <mode@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7,%edi
mov    $0x1,%ecx
mov    $0x2,%r9d
mov    %ecx,%esi
mov    %ecx,%edx
mov    %r9d,%r8d
movl   $0x2,(%rsp)
movl   $0x2,0x8(%rsp)
mov    $0x0,%al
call   1050 <mode@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6,%edi
mov    $0x3,%ecx
mov    $0x2,%r9d
mov    %ecx,%esi
mov    %ecx,%edx
mov    %r9d,%r8d
movl   $0x2,(%rsp)
mov    $0x0,%al
call   1050 <mode@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6,%edi
mov    $0x2,%r9d
mov    $0x3,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0x3,(%rsp)
mov    $0x0,%al
call   1050 <mode@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
movl   $0x5,(%rsp)
mov    $0x6,%edi
mov    $0x9,%esi
mov    $0xfffffff6,%edx
mov    $0xffffffff,%ecx
mov    $0x8,%r8d
mov    $0x3,%r9d
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
movl   $0x7,0x8(%rsp)
movl   $0x3,(%rsp)
mov    $0x7,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x4,%ecx
mov    $0x1,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
call   1030 <median@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <mode@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <mode@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
movl   $0x2,0x8(%rsp)
movl   $0x2,(%rsp)
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
call   1050 <mode@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
movl   $0x2,(%rsp)
mov    $0x6,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
mov    $0x2,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
call   1050 <mode@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
movl   $0x3,(%rsp)
mov    $0x6,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
call   1050 <mode@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, ...) @median(i32 1, i32 1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 (i32, i32, ...) @median(i32 2, i32 1, i32 2)
%7 = sitofp i32 %6 to double
%8 = fcmp oeq double %7, 1.500000e+00
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 (i32, i32, ...) @median(i32 3, i32 1, i32 2, i32 3)
%12 = icmp eq i32 %11, 2
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 (i32, i32, ...) @median(i32 3, i32 3, i32 2, i32 1)
%16 = icmp eq i32 %15, 2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i32 (i32, i32, ...) @median(i32 3, i32 3, i32 3, i32 3)
%20 = icmp eq i32 %19, 3
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 (i32, i32, ...) @median(i32 6, i32 9, i32 -10, i32 -1, i32 8, i32 3, i32 5)
%24 = icmp eq i32 %23, 4
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i32 (i32, i32, ...) @median(i32 7, i32 5, i32 6, i32 4, i32 1, i32 2, i32 3, i32 7)
%28 = icmp eq i32 %27, 4
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 (i32, i32, ...) @mode(i32 1, i32 1)
%32 = icmp eq i32 %31, 1
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i32 (i32, i32, ...) @mode(i32 3, i32 2, i32 1, i32 1)
%36 = icmp eq i32 %35, 1
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = call i32 (i32, i32, ...) @mode(i32 7, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2)
%40 = icmp eq i32 %39, 2
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i32 (i32, i32, ...) @mode(i32 6, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2)
%44 = icmp eq i32 %43, 2
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i32 (i32, i32, ...) @mode(i32 6, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3)
%48 = icmp eq i32 %47, 2
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @median(i32 1, i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (i32, i32, ...) @median(i32 2, i32 1, i32 2)
%6 = tail call i32 @assert(i32 0)
%7 = tail call i32 (i32, i32, ...) @median(i32 3, i32 1, i32 2, i32 3)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 (i32, i32, ...) @median(i32 3, i32 3, i32 2, i32 1)
%12 = icmp eq i32 %11, 2
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 (i32, i32, ...) @median(i32 3, i32 3, i32 3, i32 3)
%16 = icmp eq i32 %15, 3
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 (i32, i32, ...) @median(i32 6, i32 9, i32 -10, i32 -1, i32 8, i32 3, i32 5)
%20 = icmp eq i32 %19, 4
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = tail call i32 (i32, i32, ...) @median(i32 7, i32 5, i32 6, i32 4, i32 1, i32 2, i32 3, i32 7)
%24 = icmp eq i32 %23, 4
%25 = zext i1 %24 to i32
%26 = tail call i32 @assert(i32 %25)
%27 = tail call i32 (i32, i32, ...) @mode(i32 1, i32 1)
%28 = icmp eq i32 %27, 1
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = tail call i32 (i32, i32, ...) @mode(i32 3, i32 2, i32 1, i32 1)
%32 = icmp eq i32 %31, 1
%33 = zext i1 %32 to i32
%34 = tail call i32 @assert(i32 %33)
%35 = tail call i32 (i32, i32, ...) @mode(i32 7, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2)
%36 = icmp eq i32 %35, 2
%37 = zext i1 %36 to i32
%38 = tail call i32 @assert(i32 %37)
%39 = tail call i32 (i32, i32, ...) @mode(i32 6, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2)
%40 = icmp eq i32 %39, 2
%41 = zext i1 %40 to i32
%42 = tail call i32 @assert(i32 %41)
%43 = tail call i32 (i32, i32, ...) @mode(i32 6, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3)
%44 = icmp eq i32 %43, 2
%45 = zext i1 %44 to i32
%46 = tail call i32 @assert(i32 %45)
ret i32 0
}