// File: BenLangmead[P]bowtie/./ls.h
// Function: LarssonSadakane<int>::choose_pivot(int*, int)
inline T choose_pivot(T *p, T n) {
	   T *pl, *pm, *pn;
	   T s;

	   pm=p+(n>>1);                 /* small arrays, middle element.*/
	   if (n>7) {
		  pl=p;
		  pn=p+n-1;
		  if (n>40) {               /* big arrays, pseudomedian of 9.*/
			 s=n>>3;
			 pl=LS_SMED3(pl, pl+s, pl+s+s);
			 pm=LS_SMED3(pm-s, pm, pm+s);
			 pn=LS_SMED3(pn-s-s, pn-s, pn);
		  }
		  pm=LS_SMED3(pl, pm, pn);      /* midsize arrays, median of 3.*/
	   }
	   return LS_KEY(pm);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpl $0x7, -0x14(%rbp)
jle 0x2e009
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, -0x30(%rbp)
cmpl $0x28, -0x14(%rbp)
jle 0x2de97
movq -0x40(%rbp), %rsi
movl -0x14(%rbp), %eax
sarl $0x3, %eax
movl %eax, -0x34(%rbp)
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x20(%rbp), %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2d9c2
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x20(%rbp), %rdx
movslq -0x34(%rbp), %rdi
shlq $0x2, %rdi
addq %rdi, %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2d949
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d9b5
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x20(%rbp), %rdx
movslq -0x34(%rbp), %rdi
shlq $0x2, %rdi
addq %rdi, %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2d9a5
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x2d9ad
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2da8c
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x20(%rbp), %rdx
movslq -0x34(%rbp), %rdi
shlq $0x2, %rdi
addq %rdi, %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2da18
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
jmp 0x2da84
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x20(%rbp), %rdx
movslq -0x34(%rbp), %rdi
shlq $0x2, %rdi
addq %rdi, %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2da74
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
jmp 0x2da7c
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2db86
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2db09
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x2db79
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2db59
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
jmp 0x2db71
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x2dc4b
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2dbc4
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x2dc40
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movslq -0x34(%rbp), %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2dc17
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
jmp 0x2dc32
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rsi
movq -0x80(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x8(%rsi), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movslq -0x34(%rbp), %r8
xorl %edi, %edi
subq %r8, %rdi
movl (%rdx,%rdi,4), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2dd9c
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2dcfd
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
jmp 0x2dd89
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2dd50
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x2dd7b
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x2de8c
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2ddf2
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
jmp 0x2de7e
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x30(%rbp), %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq -0x34(%rbp), %rdi
xorl %edx, %edx
subq %rdi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2de45
movq -0x30(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x2de70
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x34(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x28(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2df65
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2df00
movq -0x28(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x2df52
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2df39
movq -0x30(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x2df44
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0x2dffe
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2df9e
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
jmp 0x2dff0
movq -0x40(%rbp), %rsi
movq 0x8(%rsi), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rsi), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x8(%rsi), %rcx
movq -0x30(%rbp), %rdx
movl (%rdx), %edx
addl 0x14(%rsi), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x2dfd7
movq -0x30(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x2dfe2
movq -0x20(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rdx
movq 0x8(%rdx), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)