// File: readmapping[P]alfalfa/src/qsufsort.c
// Function: choose_pivot
static int choose_pivot(int *p, int n) {
   int *pl, *pm, *pn;
   int 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=MED3(pl, pl+s, pl+s+s);
         pm=MED3(pm-s, pm, pm+s);
         pn=MED3(pn-s-s, pn-s, pn);
      }
      pm=MED3(pl, pm, pn);      /* midsize arrays, median of 3.*/
   }
   return KEY(pm);
}

// Assembly:
subq $0x50, %rsp
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movq 0x48(%rsp), %rax
movl 0x44(%rsp), %ecx
sarl %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
cmpl $0x7, 0x44(%rsp)
jle 0x7395c
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
movslq 0x44(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x28(%rsp)
cmpl $0x28, 0x44(%rsp)
jle 0x737cf
movl 0x44(%rsp), %eax
sarl $0x3, %eax
movl %eax, 0x24(%rsp)
movq 0x243cd(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x243d0(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x243b3(%rip), %rcx     # 0x97500
movq 0x38(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x243b0(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x73264
movq 0x2438d(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movslq 0x24(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x2438a(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x2436d(%rip), %rcx     # 0x97500
movq 0x38(%rsp), %rdx
movslq 0x24(%rsp), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x2435e(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x731d5
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
jmp 0x73255
movq 0x24324(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x24327(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x2430a(%rip), %rcx     # 0x97500
movq 0x38(%rsp), %rdx
movslq 0x24(%rsp), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x242fb(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x73241
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
jmp 0x7324b
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x73351
movq 0x24295(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movslq 0x24(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x24292(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x24275(%rip), %rcx     # 0x97500
movq 0x38(%rsp), %rdx
movslq 0x24(%rsp), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x24266(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x732c9
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
jmp 0x73348
movq 0x24230(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x24233(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x24216(%rip), %rcx     # 0x97500
movq 0x38(%rsp), %rdx
movslq 0x24(%rsp), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x24207(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x73335
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rsp)
jmp 0x7333f
movq 0x38(%rsp), %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x2419e(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x24196(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x24179(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movl (%rdx), %edx
addl 0x2417c(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x7347e
movq 0x24159(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
addl 0x2415c(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x2413f(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x2413c(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x733eb
movq 0x30(%rsp), %rax
movq %rax, -0x10(%rsp)
jmp 0x7346f
movq 0x2410e(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x24106(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x240e9(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x240e6(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x7344a
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rsp)
jmp 0x73465
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
jmp 0x73557
movq 0x2407b(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
addl 0x2407e(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x24061(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x2405e(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x734c9
movq 0x30(%rsp), %rax
movq %rax, -0x28(%rsp)
jmp 0x7354d
movq 0x24030(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x24028(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x2400b(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movslq 0x24(%rsp), %rsi
movl (%rdx,%rsi,4), %edx
addl 0x24008(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x73528
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rsp)
jmp 0x73543
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x23f98(%rip), %rax     # 0x97500
movq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x23f7f(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23f62(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movslq 0x24(%rsp), %rdi
xorl %esi, %esi
subq %rdi, %rsi
movl (%rdx,%rsi,4), %edx
addl 0x23f5a(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x736c6
movq 0x23f37(%rip), %rax     # 0x97500
movq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x23f2f(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23f12(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23f15(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x73623
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rsp)
jmp 0x736b7
movq 0x23ed6(%rip), %rax     # 0x97500
movq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x23ebd(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23ea0(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23ea3(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x73681
movq 0x28(%rsp), %rax
movq %rax, -0x40(%rsp)
jmp 0x736ad
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rsp)
movq -0x40(%rsp), %rax
movq %rax, -0x38(%rsp)
movq -0x38(%rsp), %rax
movq %rax, -0x48(%rsp)
jmp 0x737c5
movq 0x23e33(%rip), %rax     # 0x97500
movq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x23e2b(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23e0e(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23e11(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x73727
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rsp)
jmp 0x737bb
movq 0x23dd2(%rip), %rax     # 0x97500
movq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movslq 0x24(%rsp), %rsi
xorl %edx, %edx
subq %rsi, %rdx
movl (%rcx,%rdx,4), %ecx
addl 0x23db9(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23d9c(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23d9f(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x73785
movq 0x28(%rsp), %rax
movq %rax, -0x58(%rsp)
jmp 0x737b1
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rsp)
movq -0x58(%rsp), %rax
movq %rax, -0x50(%rsp)
movq -0x50(%rsp), %rax
movq %rax, -0x48(%rsp)
movq -0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x23d2a(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23d2d(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23d10(%rip), %rcx     # 0x97500
movq 0x30(%rsp), %rdx
movl (%rdx), %edx
addl 0x23d13(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x738b0
movq 0x23cf0(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23cf3(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23cd6(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23cd9(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x7384b
movq 0x30(%rsp), %rax
movq %rax, -0x60(%rsp)
jmp 0x738a1
movq 0x23cae(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23cb1(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23c94(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23c97(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x7388d
movq 0x28(%rsp), %rax
movq %rax, -0x68(%rsp)
jmp 0x73897
movq 0x38(%rsp), %rax
movq %rax, -0x68(%rsp)
movq -0x68(%rsp), %rax
movq %rax, -0x60(%rsp)
movq -0x60(%rsp), %rax
movq %rax, -0x70(%rsp)
jmp 0x73952
movq 0x23c49(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23c4c(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23c2f(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23c32(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x738f2
movq 0x30(%rsp), %rax
movq %rax, -0x78(%rsp)
jmp 0x73948
movq 0x23c07(%rip), %rax     # 0x97500
movq 0x38(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23c0a(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq 0x23bed(%rip), %rcx     # 0x97500
movq 0x28(%rsp), %rdx
movl (%rdx), %edx
addl 0x23bf0(%rip), %edx     # 0x97510
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x73934
movq 0x28(%rsp), %rax
movq %rax, -0x80(%rsp)
jmp 0x7393e
movq 0x38(%rsp), %rax
movq %rax, -0x80(%rsp)
movq -0x80(%rsp), %rax
movq %rax, -0x78(%rsp)
movq -0x78(%rsp), %rax
movq %rax, -0x70(%rsp)
movq -0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x23b9d(%rip), %rax     # 0x97500
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
addl 0x23ba0(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addq $0x50, %rsp
retq
nopl (%rax,%rax)