// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, %r8
movq %rsi, %r12
movq %rdi, 0x38(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xa0(%rsp)
setne %al
leaq (%rdx,%rax,8), %rbp
movb $0x1, %sil
cmpq $0x3ff, %r9             # imm = 0x3FF
jg 0x274c0
movq %r8, %rcx
subq %rbp, %rcx
movq %rcx, %rbx
sarq $0x3, %rbx
cmpq %r9, %rbx
jle 0x274c0
movl $0x400, %eax            # imm = 0x400
cmpq $0xfffff, %rbx          # imm = 0xFFFFF
jg 0x27b9c
movabsq $0x7f8000000, %rax      # imm = 0x7F8000000
leaq 0x7f80000(%rax), %rdx
testq %rdx, %rcx
je 0x27abb
testq %rax, %rcx
je 0x27ad5
movl %ebx, %eax
shrl $0x18, %eax
leaq 0x3745b(%rip), %rcx     # 0x5e910
movl (%rcx,%rax,4), %ecx
addl $0x18, %ecx
jmp 0x27afb
movq %r8, %rcx
movb %sil, 0x7(%rsp)
movq %r8, 0x10(%rsp)
movq 0x90(%rsp), %rbx
movq %rcx, 0x40(%rsp)
movq %rcx, %rax
subq %rbp, %rax
cmpq $0x2001, %rax           # imm = 0x2001
movq %rbp, 0x48(%rsp)
movq %r9, 0x50(%rsp)
jl 0x275f2
xorl %r15d, %r15d
movq 0x38(%rsp), %r13
leaq 0x2000(%rbp), %r14
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x27bd7
movq 0x10(%rsp), %r11
subq %r14, %r11
sarq $0x3, %r11
movq 0x50(%rsp), %rax
cmpq %rax, %r11
movq 0x18(%rsp), %r9
movq %r14, 0x20(%rsp)
cmovgq %r14, %r9
cmovleq %rax, %r11
movq %r15, 0x8(%rsp)
testb $0x1, %r15b
movq %r12, %rcx
movq %rbx, %r10
je 0x275c6
movl $0x400, %r14d           # imm = 0x400
movq 0x8(%rsp), %rax
movq %rbp, %rbx
movq %rax, %r12
movq %r11, 0x28(%rsp)
movq %rax, 0x30(%rsp)
leaq (,%r14,8), %rax
subq %rax, %rbx
leaq (,%r14,8), %r8
addq %rbp, %r8
movq %r13, %rdi
movq %rcx, %r15
movq %rcx, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq %r9, %rbp
pushq %r10
pushq %r11
callq 0x28f38
movq %rbp, %r9
movq 0x38(%rsp), %r11
movq %r15, %rcx
movq 0xa0(%rsp), %r10
addq $0x10, %rsp
addq %r14, %r14
shrq %r12
movq %rbx, %rbp
testb $0x2, 0x30(%rsp)
movq %r12, %rax
jne 0x27566
movq 0x8(%rsp), %r15
incq %r15
movq 0x40(%rsp), %rax
movq 0x20(%rsp), %rdx
subq %rdx, %rax
movq %rdx, %rbp
cmpq $0x2000, %rax           # imm = 0x2000
movq %rcx, %r12
movq %r10, %rbx
jg 0x274fe
jmp 0x275f8
xorl %r15d, %r15d
movq %rbp, %rdx
movq 0x38(%rsp), %rdi
movq %r12, %rsi
movq %rdx, %r13
movq 0x40(%rsp), %rbp
movq %rbp, %rcx
movq %rbx, %r8
callq 0x27bd7
testq %r15, %r15
movq 0x48(%rsp), %r14
je 0x27684
movq %r15, %r8
movl $0x400, %r15d           # imm = 0x400
testb $0x1, %r8b
je 0x27672
leaq (,%r15,8), %rax
movq %r13, %rcx
movq %r13, %rbx
subq %rax, %rbx
movq 0x38(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r8, %r13
movq %rbp, %r8
movq 0x18(%rsp), %r9
pushq 0x90(%rsp)
pushq 0x58(%rsp)
callq 0x28f38
movq %r13, %r8
movq 0x58(%rsp), %r14
addq $0x10, %rsp
movq %rbx, %r13
addq %r15, %r15
movq %r8, %rax
shrq %rax
cmpq $0x1, %r8
movq %rax, %r8
ja 0x27626
cmpb $0x0, 0x7(%rsp)
movq %r12, 0x8(%rsp)
jne 0x2797a
movq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rcx
movq 0x90(%rsp), %r15
movq %r15, %r8
callq 0x27bd7
leaq 0x2(%r13), %rax
movq %rax, 0x30(%rsp)
leaq (%r15,%r13), %rax
movq %rax, 0x28(%rsp)
leaq 0x1(%r13), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq -0x8(%rdi), %rcx
movq %rbp, %r10
subq %r14, %r10
movq %r10, %r11
sarq $0x3, %r11
testq %r11, %r11
movq %rcx, 0x40(%rsp)
jle 0x27843
sarq $0x4, %r10
movq %rcx, %rax
sarq $0x3f, %rax
xorq %rcx, %rax
movq (%r12,%rax,8), %rdx
movq 0x28(%rsp), %rcx
leaq (%rcx,%rdx), %rsi
movq 0x8(%r12,%rax,8), %r15
addq 0x30(%rsp), %r15
cmpq %r15, %rsi
setb 0x20(%rsp)
addq 0x18(%rsp), %rdx
movq %rdx, 0x50(%rsp)
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %r14, %r9
movq %rbp, %rcx
movq %r9, %rdx
movq (%r9,%r10,8), %rax
movq %rax, %r14
sarq $0x3f, %r14
xorq %rax, %r14
movq (%r12,%r14,8), %rbx
movq 0x28(%rsp), %rax
leaq (%rax,%rbx), %r9
movq 0x8(%r12,%r14,8), %rax
addq 0x30(%rsp), %rax
cmpq %rax, %r9
setb %r13b
jae 0x277cf
cmpq %r15, %rsi
jae 0x277cf
movb (%r9), %r12b
movb $0x1, %r13b
movq %rsi, %r14
movb $0x1, %bpl
cmpb (%rsi), %r12b
movq 0x8(%rsp), %r12
jne 0x277d7
addq 0x18(%rsp), %rbx
movq 0x50(%rsp), %r12
movq 0x90(%rsp), %r14
leaq (%rbx,%r14), %r9
addq %r12, %r14
cmpq %r15, %r14
setb %bpl
cmpq %rax, %r9
setb %r13b
jae 0x277c8
cmpq %r15, %r14
jae 0x277c8
movb (%r9), %bpl
incq %r12
incq %rbx
cmpb (%r14), %bpl
je 0x27790
movb $0x1, %r13b
movb $0x1, %bpl
movq 0x8(%rsp), %r12
jmp 0x277d7
movq %rsi, %r14
movb 0x20(%rsp), %bpl
testb %r13b, %r13b
je 0x277f3
movl $0x1, %eax
testb %bpl, %bpl
je 0x277f9
movzbl (%r9), %eax
movzbl (%r14), %r9d
subl %r9d, %eax
jmp 0x277f9
movzbl %bpl, %eax
negl %eax
leaq (%rdx,%r10,8), %r9
addq $0x8, %r9
notl %r11d
andl $0x1, %r11d
testl %eax, %eax
cmovnsq %rdx, %r9
movl $0x0, %edx
cmovnsq %rdx, %r11
cmovnsl %eax, %r8d
movq %r10, %rax
subq %r11, %rax
movq %rax, %r10
sarq %r10
movq %rax, %r11
testq %rax, %rax
jg 0x2773a
movq %rcx, %rbp
testl %r8d, %r8d
sete %al
movq 0x48(%rsp), %r14
jmp 0x27848
xorl %eax, %eax
movq %r14, %r9
cmpq %rbp, %r9
jae 0x2794f
testb %al, %al
je 0x27858
notq (%r9)
movq %rbp, %r10
subq %r9, %r10
sarq $0x3, %r10
testq %r10, %r10
jle 0x2793b
movq %rdi, %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
testq %rdx, %rdx
jle 0x2793b
leaq -0x8(%rbp), %rbx
movq %r10, %r8
movq %rdi, %r14
movq %r9, %r11
cmpq %rdx, %r8
je 0x27917
jge 0x278d1
addq $-0x8, %r14
movq %r8, %rax
notq %rax
movq (%r14), %rcx
movq %rbx, %rsi
movq (%rsi), %r15
movq %r15, (%r14)
movq -0x8(%r14), %r15
addq $-0x8, %r14
movq %r15, (%rsi)
addq $-0x8, %rsi
cmpq %r11, %rsi
jae 0x278a6
movq %rcx, (%r14)
addq %rax, %rdx
cmpq %r8, %rdx
jle 0x27907
addq $-0x8, %r14
jmp 0x278a0
movq %rdx, %rax
notq %rax
movq (%r11), %rcx
addq $0x8, %r11
movq %rbp, %rsi
movq (%rsi), %r15
movq %r15, -0x8(%r11)
movq (%r11), %r15
movq %r15, (%rsi)
addq $0x8, %rsi
addq $0x8, %r11
cmpq %rsi, %r14
ja 0x278e1
movq %rcx, -0x8(%r11)
addq %rax, %r8
cmpq %rdx, %r8
jg 0x278d7
testq %r8, %r8
jle 0x2793b
testq %rdx, %rdx
jg 0x2788b
jmp 0x2793b
incq %r8
xorl %eax, %eax
movq (%r11,%rax), %rcx
movq (%rbp,%rax), %rdx
movq %rdx, (%r11,%rax)
movq %rcx, (%rbp,%rax)
addq $0x8, %rax
decq %r8
cmpq $0x1, %r8
jg 0x2791c
movq 0x48(%rsp), %r14
cmpq %r14, %r9
je 0x2797a
shlq $0x3, %r10
subq %r10, %rdi
movq %r9, %rbp
addq $-0x8, %rdi
cmpq $0x0, 0x40(%rsp)
js 0x27960
movq %rdi, %rax
jmp 0x2796e
leaq -0x8(%rdi), %rax
cmpq $0x0, -0x8(%rdi)
movq %rax, %rdi
js 0x27960
movq %rax, %rdi
cmpq %rax, %rbp
jne 0x276d8
cmpl $0x0, 0xa0(%rsp)
je 0x27aac
movq -0x8(%r14), %rax
cmpq 0x10(%rsp), %r14
movq %rax, 0x28(%rsp)
jae 0x27aa3
movq 0x38(%rsp), %rcx
leaq 0x2(%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq (%r12,%rax,8), %r9
movq 0x90(%rsp), %rax
leaq (%rcx,%rax), %rdx
leaq (%rdx,%r9), %rsi
movq 0x98(%rsp), %rdi
addq %rcx, %rdi
cmpq %rdi, %rsi
setb %r8b
leaq (%rcx,%r9), %rax
incq %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %r9
incq %rcx
movq (%r14), %r10
testq %r10, %r10
js 0x27a8d
movq %r14, %rax
movq (%r12,%r10,8), %r14
leaq (%rdx,%r14), %r11
movq 0x8(%r12,%r10,8), %r13
addq 0x30(%rsp), %r13
cmpq %r13, %r11
setb %bl
cmpq %rdi, %rsi
jae 0x27a6e
cmpq %r13, %r11
jae 0x27a6e
movb (%rsi), %r12b
movq %rsi, %r15
movl %r8d, %ebp
cmpb (%r11), %r12b
movq 0x8(%rsp), %r12
jne 0x27a74
addq %rcx, %r14
movq 0x20(%rsp), %r12
movq 0x90(%rsp), %r9
leaq (%r12,%r9), %r15
leaq (%r14,%r9), %r11
cmpq %r13, %r11
setb %bl
cmpq %rdi, %r15
setb %bpl
jae 0x27a62
cmpq %r13, %r11
jae 0x27a62
movb (%r15), %r9b
incq %r14
incq %r12
cmpb (%r11), %r9b
je 0x27a30
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r12
jmp 0x27a74
movq %rsi, %r15
movl %r8d, %ebp
testb %bpl, %bpl
je 0x27aa0
testb %bl, %bl
movq %rax, %r14
je 0x27a8d
movb (%r15), %r9b
cmpb (%r11), %r9b
movq 0x10(%rsp), %r9
jbe 0x27aa3
movq %r10, -0x8(%r14)
addq $0x8, %r14
cmpq %r9, %r14
jb 0x279e4
jmp 0x27aa3
movq %rax, %r14
movq 0x28(%rsp), %rax
movq %rax, -0x8(%r14)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl $0x7f800, %ecx          # imm = 0x7F800
je 0x27aee
movzbl %bh, %eax
leaq 0x36e43(%rip), %rcx     # 0x5e910
movl (%rcx,%rax,4), %ecx
addl $0x8, %ecx
jmp 0x27afb
movl %ebx, %eax
shrl $0xe, %eax
andl $0x3fc, %eax            # imm = 0x3FC
leaq 0x36e2a(%rip), %rcx     # 0x5e910
movl (%rax,%rcx), %ecx
addl $0x10, %ecx
jmp 0x27afb
movzbl %bl, %eax
leaq 0x36e18(%rip), %rcx     # 0x5e910
movl (%rcx,%rax,4), %ecx
movl %ecx, %eax
cmpl $0x10, %ecx
jl 0x27b4f
movl %eax, %ecx
andb $-0x2, %cl
addb $-0x6, %cl
movq %rbx, %rdx
sarq %cl, %rdx
leaq 0x371f9(%rip), %rcx     # 0x5ed10
movl (%rcx,%rdx,4), %edx
movl %eax, %ecx
shrl %ecx
addb $-0x7, %cl
shll %cl, %edx
movslq %edx, %rcx
cmpl $0x18, %eax
jl 0x27b3c
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 0x27b79
cmpl $0x8, %eax
jl 0x27b8d
movl %eax, %ecx
andb $-0x2, %cl
addb $-0x6, %cl
movq %rbx, %rdx
sarq %cl, %rdx
leaq 0x371a7(%rip), %rcx     # 0x5ed10
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 0x27b9c
leaq 0x3717c(%rip), %rax     # 0x5ed10
movl (%rax,%rbx,4), %eax
sarl $0x4, %eax
cltq
movq %r8, %rcx
cmpq %r9, %rax
jle 0x274c3
movl $0x400, %r9d            # imm = 0x400
cmpq %r9, %rax
cmovlq %rax, %r9
leaq (,%r9,8), %rcx
movq %r8, %rdx
subq %rcx, %rdx
testq %rax, %rax
sete %sil
movq %rdx, 0x18(%rsp)
movq %rdx, %rcx
jmp 0x274c3