// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h
// Function: sssort64(unsigned char const*, long long const*, long long*, long long*, long long*, long long, long long, long long, int)
void
sssort(const sauchar_t *T, const sastore_t*PA,
       sastore_t *first, sastore_t*last,
       sastore_t *buf, saidx_t bufsize,
       saidx_t depth, saidx_t n, saint_t lastsuffix) {
  sastore_t *a;
#if SS_BLOCKSIZE != 0
  sastore_t *b, *middle, *curbuf;
  saidx_t j, k, curbufsize, limit;
#endif
  saidx_t i;

  if(lastsuffix != 0) { ++first; }

#if SS_BLOCKSIZE == 0
  ss_mintrosort(T, PA, first, last, depth);
#else
  if((bufsize < SS_BLOCKSIZE) &&
      (bufsize < (last - first)) &&
      (bufsize < (limit = ss_isqrt((saidx_t)(last - first))))) {
    if(SS_BLOCKSIZE < limit) { limit = SS_BLOCKSIZE; }
    buf = middle = last - limit, bufsize = limit;
  } else {
    middle = last, limit = 0;
  }
  for(a = first, i = 0; SS_BLOCKSIZE < (middle - a); a += SS_BLOCKSIZE, ++i) {
#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE
    ss_mintrosort(T, PA, a, a + SS_BLOCKSIZE, depth);
#elif 1 < SS_BLOCKSIZE
    ss_insertionsort(T, PA, a, a + SS_BLOCKSIZE, depth);
#endif
    curbufsize = (saidx_t)(last - (a + SS_BLOCKSIZE));
    curbuf = a + SS_BLOCKSIZE;
    if(curbufsize <= bufsize) { curbufsize = bufsize, curbuf = buf; }
    for(b = a, k = SS_BLOCKSIZE, j = i; j & 1; b -= k, k <<= 1, j >>= 1) {
      ss_swapmerge(T, PA, b - k, b, b + k, curbuf, curbufsize, depth);
    }
  }
#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE
  ss_mintrosort(T, PA, a, middle, depth);
#elif 1 < SS_BLOCKSIZE
  ss_insertionsort(T, PA, a, middle, depth);
#endif
  for(k = SS_BLOCKSIZE; i != 0; k <<= 1, i >>= 1) {
    if(i & 1) {
      ss_swapmerge(T, PA, a - k, a, middle, buf, bufsize, depth);
      a -= k;
    }
  }
  if(limit != 0) {
#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE
    ss_mintrosort(T, PA, middle, last, depth);
#elif 1 < SS_BLOCKSIZE
    ss_insertionsort(T, PA, middle, last, depth);
#endif
    ss_inplacemerge(T, PA, first, middle, last, depth);
  }
#endif

  if(lastsuffix != 0) {
    /* Insert last type B* suffix. */
    sastore_t PAi[2]; PAi[0] = PA[*(first - 1)], PAi[1] = n - 2;
    for(a = first, i = *(first - 1);
        (a < last) && ((*a < 0) || (0 < ss_compare(T, &(PAi[0]), PA + *a, depth)));
        ++a) {
      *(a - 1) = *a;
    }
    *(a - 1) = i;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, %rbx
movq %r8, 0x28(%rsp)
movq %rcx, %r8
movq %rsi, %r13
leaq 0x8(%rdx), %r10
cmpl $0x0, 0xb0(%rsp)
movq %r10, 0x50(%rsp)
cmoveq %rdx, %r10
cmpq $0x400, %r9             # imm = 0x400
movq %rdx, 0x58(%rsp)
jge 0x27100
movq %r8, %rcx
subq %r10, %rcx
movq %rbx, %rax
movq %rcx, %rbx
sarq $0x3, %rbx
movb $0x1, %r11b
movq %rax, %rsi
cmpq %rax, %rbx
jle 0x2710b
movl $0x400, %eax            # imm = 0x400
cmpq $0xfffff, %rbx          # imm = 0xFFFFF
jg 0x271f7
movabsq $0x7f8000000, %rax      # imm = 0x7F8000000
leaq 0x7f80000(%rax), %rdx
testq %rdx, %rcx
je 0x27116
testq %rax, %rcx
je 0x27130
movl %ebx, %eax
shrl $0x18, %eax
leaq 0x37808(%rip), %rcx     # 0x5e900
movl (%rcx,%rax,4), %ecx
addl $0x18, %ecx
jmp 0x27156
movb $0x1, %r11b
movq %r8, %rcx
jmp 0x2722b
movq %r8, %rcx
movq %rsi, %rbx
jmp 0x2722b
testl $0x7f800, %ecx          # imm = 0x7F800
je 0x27149
movzbl %bh, %eax
leaq 0x377d8(%rip), %rcx     # 0x5e900
movl (%rcx,%rax,4), %ecx
addl $0x8, %ecx
jmp 0x27156
movl %ebx, %eax
shrl $0xe, %eax
andl $0x3fc, %eax            # imm = 0x3FC
leaq 0x377bf(%rip), %rcx     # 0x5e900
movl (%rax,%rcx), %ecx
addl $0x10, %ecx
jmp 0x27156
movzbl %bl, %eax
leaq 0x377ad(%rip), %rcx     # 0x5e900
movl (%rcx,%rax,4), %ecx
movl %ecx, %eax
cmpl $0x10, %ecx
jl 0x271aa
movl %eax, %ecx
andb $-0x2, %cl
addb $-0x6, %cl
movq %rbx, %rdx
sarq %cl, %rdx
leaq 0x37b8e(%rip), %rcx     # 0x5ed00
movl (%rcx,%rdx,4), %edx
movl %eax, %ecx
shrl %ecx
addb $-0x7, %cl
shll %cl, %edx
movslq %edx, %rcx
cmpl $0x18, %eax
jb 0x27197
movq %rbx, %rax
cqto
idivq %rcx
addq %rax, %rcx
incq %rcx
sarq %rcx
movq %rbx, %rax
cqto
idivq %rcx
addq %rcx, %rax
incq %rax
sarq %rax
jmp 0x271d4
cmpl $0x8, %eax
jl 0x271e8
movl %eax, %ecx
andb $-0x2, %cl
addb $-0x6, %cl
movq %rbx, %rdx
sarq %cl, %rdx
leaq 0x37b3c(%rip), %rcx     # 0x5ed00
movl (%rcx,%rdx,4), %edx
shrl %eax
movb $0x7, %cl
subb %al, %cl
sarl %cl, %edx
incl %edx
movslq %edx, %rax
movq %rax, %rcx
imulq %rax, %rcx
xorl %edx, %edx
cmpq %rbx, %rcx
setg %dl
subq %rdx, %rax
jmp 0x271f7
leaq 0x37b11(%rip), %rax     # 0x5ed00
movl (%rax,%rbx,4), %eax
sarl $0x4, %eax
cltq
movq %r8, %rcx
movq %rsi, %rbx
cmpq %rsi, %rax
jle 0x2722b
movl $0x400, %ebx            # imm = 0x400
cmpq %rbx, %rax
cmovlq %rax, %rbx
leaq (,%rbx,8), %rcx
movq %r8, %rdx
subq %rcx, %rdx
testq %rax, %rax
sete %r11b
movq %rdx, 0x28(%rsp)
movq %rdx, %rcx
movq %r8, 0x30(%rsp)
movq 0xa0(%rsp), %rbp
movq %rcx, %rax
subq %r10, %rax
cmpq $0x2000, %rax           # imm = 0x2000
movq %rdi, 0x10(%rsp)
movq %r10, 0x48(%rsp)
movq %rcx, 0x8(%rsp)
movb %r11b, 0x7(%rsp)
jle 0x273b6
xorl %r15d, %r15d
movq %r10, %r12
movq %rbx, 0x60(%rsp)
leaq 0x2000(%r12), %r14
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0x277dc
movq 0x30(%rsp), %r10
subq %r14, %r10
sarq $0x3, %r10
cmpq %rbx, %r10
movq 0x28(%rsp), %r9
movq %r14, 0x18(%rsp)
cmovgq %r14, %r9
cmovleq %rbx, %r10
movq %r15, 0x38(%rsp)
testb $0x1, %r15b
movq %rbp, %r14
movq %r13, %rbp
je 0x27316
movl $0x400, %ebx            # imm = 0x400
movq 0x38(%rsp), %rax
movq %r12, %r13
movq %rax, %r15
movq %r10, 0x40(%rsp)
movq %rax, 0x20(%rsp)
leaq (,%rbx,8), %rax
subq %rax, %r13
leaq (%r12,%rbx,8), %r8
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %r9, %r12
pushq %r14
pushq %r10
callq 0x28ab5
movq %r12, %r9
movq 0x50(%rsp), %r10
addq $0x10, %rsp
addq %rbx, %rbx
shrq %r15
movq %r13, %r12
testb $0x2, 0x20(%rsp)
movq %r15, %rax
jne 0x272c9
movq 0x38(%rsp), %r15
incq %r15
movq 0x8(%rsp), %rcx
movq %rcx, %rax
movq 0x18(%rsp), %rdx
subq %rdx, %rax
movq %rdx, %r12
cmpq $0x2000, %rax           # imm = 0x2000
movq %rbp, %r13
movq 0x10(%rsp), %rdi
movq 0x60(%rsp), %rbx
movq %r14, %rbp
jg 0x27269
movq %r13, %rsi
movq %rbp, %r8
callq 0x277dc
movl $0x400, %r14d           # imm = 0x400
testb $0x1, %r15b
je 0x273a2
leaq (,%r14,8), %rax
movq %r15, %r12
movq 0x18(%rsp), %rcx
movq %rcx, %r15
subq %rax, %r15
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq 0x8(%rsp), %r8
movq 0x28(%rsp), %r9
pushq %rbp
pushq %rbx
callq 0x28ab5
addq $0x10, %rsp
movq %r15, 0x18(%rsp)
movq %r12, %r15
addq %r14, %r14
movq %r15, %rax
shrq %rax
cmpq $0x1, %r15
movq %rax, %r15
ja 0x2735e
jmp 0x273c4
movq %r13, %rsi
movq %r10, %rdx
movq %rbp, %r8
callq 0x277dc
cmpb $0x0, 0x7(%rsp)
movq %r13, 0x18(%rsp)
jne 0x276b7
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq 0x30(%rsp), %rbx
movq %rbx, %rcx
movq %rbp, %r8
callq 0x277dc
leaq 0x2(%r14), %rax
movq %rax, 0x20(%rsp)
leaq (%r14,%rbp), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%rsp), %rcx
movq 0x48(%rsp), %rdi
movq %rbx, 0x8(%rsp)
movq -0x8(%rbx), %rdx
movq %rcx, %r9
subq %rdi, %r9
movq %r9, %r10
sarq $0x3, %r10
testq %r10, %r10
movq %rcx, %rsi
movq %rdx, 0x28(%rsp)
jle 0x27576
shrq $0x4, %r9
movq %rdx, %rax
sarq $0x3f, %rax
xorq %rdx, %rax
movq (%r13,%rax,8), %r8
movq 0x40(%rsp), %rcx
leaq (%rcx,%r8), %rdx
movq 0x8(%r13,%rax,8), %r15
addq 0x20(%rsp), %r15
cmpq %r15, %rdx
setb %cl
addq 0x10(%rsp), %r8
movq %r8, 0x38(%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rdi, %r8
movq %r8, %rdi
movq (%r8,%r9,8), %rax
movq %rax, %rbx
sarq $0x3f, %rbx
xorq %rax, %rbx
movq (%r13,%rbx,8), %r11
movq 0x40(%rsp), %rax
leaq (%rax,%r11), %r8
movq 0x8(%r13,%rbx,8), %rax
addq 0x20(%rsp), %rax
cmpq %rax, %r8
setb %bl
movq %rdx, %r14
movl %ecx, %r13d
jae 0x274fa
cmpq %r15, %rdx
jae 0x274fa
addq 0x10(%rsp), %r11
movq 0x38(%rsp), %r14
movq %r11, %r8
movb (%r8,%rbp), %r11b
movb (%r14,%rbp), %bl
cmpb %bl, %r11b
jne 0x2750e
leaq (%r8,%rbp), %rbx
incq %rbx
leaq (%r14,%rbp), %r11
incq %r11
cmpq %r15, %r11
setb %r13b
incq %r8
incq %r14
cmpq %rax, %rbx
setb %bl
jae 0x274f4
cmpq %r15, %r11
jb 0x274bf
addq %rbp, %r8
addq %rbp, %r14
testb %bl, %bl
je 0x2751b
movl $0x1, %eax
testb %r13b, %r13b
je 0x27521
movb (%r8), %r11b
movb (%r14), %bl
movzbl %r11b, %eax
movzbl %bl, %r8d
subl %r8d, %eax
jmp 0x27521
movzbl %r13b, %eax
negl %eax
leaq (%rdi,%r9,8), %r8
addq $0x8, %r8
notl %r10d
andl $0x1, %r10d
testl %eax, %eax
cmovnsq %rdi, %r8
movl $0x0, %edi
cmovnsq %rdi, %r10
cmovnsl %eax, %r12d
movq %r9, %rax
subq %r10, %rax
movq %rax, %r9
shrq %r9
movq %rax, %r10
testq %rax, %rax
movq 0x18(%rsp), %r13
jg 0x27476
movq %rsi, %rcx
cmpq %rsi, %r8
jae 0x27645
testl %r12d, %r12d
jne 0x27582
notq (%r8)
jmp 0x27582
movq %rdi, %r8
cmpq %rdi, %rcx
jbe 0x2764a
movq %rcx, %r9
subq %r8, %r9
sarq $0x3, %r9
testq %r9, %r9
jle 0x27673
movq 0x8(%rsp), %r10
subq %rsi, %r10
sarq $0x3, %r10
testq %r10, %r10
jle 0x27673
leaq -0x8(%rsi), %rdi
movq %r9, %r14
movq 0x8(%rsp), %r15
movq %r8, %r11
cmpq %r10, %r14
je 0x27651
jge 0x275ff
addq $-0x8, %r15
movq %r14, %rax
notq %rax
movq (%r15), %rcx
movq %rdi, %rdx
movq (%rdx), %rbx
movq %rbx, (%r15)
movq -0x8(%r15), %rbx
addq $-0x8, %r15
movq %rbx, (%rdx)
addq $-0x8, %rdx
cmpq %r11, %rdx
jae 0x275d4
movq %rcx, (%r15)
addq %rax, %r10
cmpq %r14, %r10
jle 0x27635
addq $-0x8, %r15
jmp 0x275ce
movq %r10, %rax
notq %rax
movq (%r11), %rcx
addq $0x8, %r11
movq %rsi, %rdx
movq (%rdx), %rbx
movq %rbx, -0x8(%r11)
movq (%r11), %rbx
movq %rbx, (%rdx)
addq $0x8, %rdx
addq $0x8, %r11
cmpq %rdx, %r15
ja 0x2760f
movq %rcx, -0x8(%r11)
addq %rax, %r14
cmpq %r10, %r14
jg 0x27605
testq %r14, %r14
jle 0x27673
testq %r10, %r10
jg 0x275b9
jmp 0x27673
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rdx
jmp 0x2768c
incq %r10
xorl %eax, %eax
movq (%r11,%rax), %rcx
movq (%rsi,%rax), %rdx
movq %rdx, (%r11,%rax)
movq %rcx, (%rsi,%rax)
addq $0x8, %rax
decq %r10
cmpq $0x1, %r10
ja 0x27656
movq 0x48(%rsp), %rdi
cmpq %rdi, %r8
movq 0x8(%rsp), %rdx
je 0x276b7
shlq $0x3, %r9
subq %r9, %rdx
movq %r8, %rcx
addq $-0x8, %rdx
cmpq $0x0, 0x28(%rsp)
js 0x2769d
movq %rdx, %rax
jmp 0x276ab
leaq -0x8(%rdx), %rax
cmpq $0x0, -0x8(%rdx)
movq %rax, %rdx
js 0x2769d
movq %rax, %rbx
cmpq %rax, %rcx
jne 0x27410
cmpl $0x0, 0xb0(%rsp)
je 0x277cd
movq 0x58(%rsp), %rax
movq (%rax), %rdx
movq 0x50(%rsp), %rax
cmpq 0x30(%rsp), %rax
movq %rdx, 0x20(%rsp)
jae 0x277c1
movq 0x10(%rsp), %rax
leaq 0x2(%rax), %rcx
movq (%r13,%rdx,8), %rdx
leaq (%rax,%rbp), %rsi
leaq (%rsi,%rdx), %rdi
movq 0xa8(%rsp), %r8
addq %rax, %r8
cmpq %r8, %rdi
setb %r9b
addq %rax, %rdx
movq 0x50(%rsp), %rax
movq (%rax), %r10
testq %r10, %r10
js 0x277ae
movq %r13, %rbx
movq (%r13,%r10,8), %r13
leaq (%rsi,%r13), %r11
movq 0x8(%rbx,%r10,8), %r15
addq %rcx, %r15
cmpq %r15, %r11
setb %r14b
movq %rdi, %rbx
movl %r9d, %r12d
cmpq %r8, %rdi
jae 0x2778d
cmpq %r15, %r11
jae 0x2778d
addq 0x10(%rsp), %r13
movq %r13, %r11
movq %rdx, %rbx
movb (%rbx,%rbp), %r14b
cmpb (%r11,%rbp), %r14b
jne 0x277a1
leaq (%rbx,%rbp), %r12
incq %r12
leaq (%r11,%rbp), %r13
incq %r13
cmpq %r15, %r13
setb %r14b
incq %rbx
incq %r11
cmpq %r8, %r12
setb %r12b
jae 0x27787
cmpq %r15, %r13
jb 0x27754
addq %rbp, %rbx
addq %rbp, %r11
testb %r12b, %r12b
je 0x277c1
testb %r14b, %r14b
movq 0x18(%rsp), %r13
je 0x277ae
movb (%rbx), %r14b
jmp 0x277a9
addq %rbp, %r11
movq 0x18(%rsp), %r13
cmpb (%r11), %r14b
jbe 0x277c1
movq %r10, -0x8(%rax)
addq $0x8, %rax
cmpq 0x30(%rsp), %rax
jb 0x27712
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rax, -0x8(%rcx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq