user: 请将以下的汇编代码转换成C语言代码：

```asm
<ss_mintrosort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1d8,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %rcx,%r15
  mov    %r8d,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x1c8(%rsp)
  xor    %eax,%eax
  mov    %rcx,%rdi
  sub    %rdx,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  mov    $0x0,%r12d
  mov    %r15,%rax
  mov    %r12d,%r15d
  mov    %r13,%r12
  mov    %rax,%r13
L662:
  mov    %r13,%rax
  sub    %r12,%rax
  cmp    $0x20,%rax
  jg     L705
  cmp    $0x4,%rax
  jg     L108
L186:
  mov    %r15d,%edi
  not    %edi
  shr    $0x1f,%edi
  call   <assert@plt>
  test   %r15d,%r15d
  jne    L556
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L136
  add    $0x1d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  mov    0xc(%rsp),%r8d
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    0x18(%rsp),%rdi
  call   <ss_insertionsort@plt>
  jmp    L186
L556:
  sub    $0x1,%r15d
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    0x40(%rsp,%rcx,8),%r12
  mov    0x48(%rsp,%rcx,8),%r13
  mov    0x50(%rsp,%rcx,8),%ebx
  mov    %ebx,0xc(%rsp)
  mov    0x54(%rsp,%rcx,8),%eax
  mov    %eax,0x10(%rsp)
  jmp    L662
L705:
  movslq 0xc(%rsp),%rbp
  add    0x18(%rsp),%rbp
  cmpl   $0x0,0x10(%rsp)
  je     L57
  mov    0x10(%rsp),%ebx
  sub    $0x1,%ebx
  js     L620
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <ss_pivot@plt>
  mov    (%rax),%edx
  movslq %edx,%rcx
  movslq (%r14,%rcx,4),%rcx
  movzbl 0x0(%rbp,%rcx,1),%r10d
  movzbl %r10b,%ecx
  mov    (%r12),%esi
  mov    %edx,(%r12)
  mov    %esi,(%rax)
  mov    %r12,%r8
L636:
  mov    %r8,%rsi
  add    $0x4,%r8
  cmp    %r8,%r13
  jbe    L132
  movslq (%r8),%rax
  movslq (%r14,%rax,4),%rax
  movzbl 0x0(%rbp,%rax,1),%edx
  cmp    %edx,%ecx
  je     L636
  mov    %r8,%rax
  jle    L632
  lea    0x8(%rsi),%rax
  cmp    %rax,%r13
  ja     L44
  jmp    L632
L57:
  sar    $0x2,%rax
  mov    %eax,%ecx
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <ss_heapsort@plt>
L620:
  lea    0x4(%r12),%rbx
  movslq (%r12),%rax
  movslq (%r14,%rax,4),%rax
  movzbl 0x0(%rbp,%rax,1),%eax
  cmp    %rbx,%r13
  ja     L141
  jmp    L684
L86:
  add    $0x4,%rbx
  cmp    %rbx,%r13
  jbe    L684
L141:
  mov    %eax,%edx
  movslq (%rbx),%rax
  movslq (%r14,%rax,4),%rax
  movzbl 0x0(%rbp,%rax,1),%eax
  cmp    %edx,%eax
  je     L86
  mov    %rbx,%rcx
  sub    %r12,%rcx
  cmp    $0x4,%rcx
  jg     L384
  mov    %rbx,%r12
  jmp    L86
L384:
  mov    %edx,%eax
L684:
  movslq (%r12),%rdx
  movslq (%r14,%rdx,4),%rdx
  movzbl -0x1(%rbp,%rdx,1),%edx
  cmp    %eax,%edx
  jl     L369
L403:
  mov    %rbx,%rbp
  sub    %r12,%rbp
  mov    %r13,%rax
  sub    %rbx,%rax
  cmp    %rax,%rbp
  jg     L527
  cmp    $0x4,%rbp
  jg     L468
  mov    %rbx,%r12
  movl   $0xffffffff,0x10(%rsp)
  jmp    L662
L369:
  mov    0xc(%rsp),%ecx
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <ss_partition@plt>
  mov    %rax,%r12
  jmp    L403
L468:
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    %rbx,0x40(%rsp,%rcx,8)
  mov    %r13,0x48(%rsp,%rcx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rcx,8)
  lea    0x1(%r15),%r13d
  movl   $0xffffffff,0x54(%rsp,%rcx,8)
  add    $0x1,%edi
  mov    %edi,0xc(%rsp)
  mov    %rbp,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  mov    %r13d,%r15d
  mov    %rbx,%r13
  jmp    L662
L527:
  cmp    $0x4,%rax
  jle    L542
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rcx
  lea    (%rcx,%rcx,1),%rdi
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    %r12,0x40(%rsp,%rax,8)
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    %rbx,0x48(%rsp,%rax,8)
  mov    %rdi,%r12
  mov    %rdi,%rax
  mov    %rcx,0x10(%rsp)
  add    %rcx,%rax
  mov    0xc(%rsp),%edi
  lea    0x1(%rdi),%edx
  mov    %edx,0x50(%rsp,%rax,8)
  mov    %rbp,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  add    0x10(%rsp),%r12
  mov    %eax,0x54(%rsp,%r12,8)
  lea    0x1(%r15),%r15d
  mov    %rbx,%r12
  movl   $0xffffffff,0x10(%rsp)
  jmp    L662
L542:
  addl   $0x1,0xc(%rsp)
  mov    %rbp,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  mov    %rbx,%r13
  jmp    L662
L301:
  add    $0x4,%rax
  cmp    %rax,%r13
  jbe    L632
L44:
  mov    (%rax),%esi
  movslq %esi,%rdx
  movslq (%r14,%rdx,4),%rdx
  movzbl 0x0(%rbp,%rdx,1),%edx
  cmp    %edx,%ecx
  jl     L632
  jne    L301
  mov    (%r8),%edx
  mov    %edx,(%rax)
  mov    %esi,(%r8)
  add    $0x4,%r8
  jmp    L301
L132:
  mov    %r8,%rax
L632:
  mov    %r13,%r9
L385:
  mov    %r9,%rdx
  sub    $0x4,%r9
  cmp    %r9,%rax
  jae    L107
  movslq (%r9),%rsi
  movslq (%r14,%rsi,4),%rsi
  movzbl 0x0(%rbp,%rsi,1),%esi
  cmp    %esi,%ecx
  je     L385
  jl     L49
  mov    %r9,%rdx
  jmp    L494
L49:
  sub    $0x8,%rdx
  cmp    %rdx,%rax
  jb     L354
  jmp    L107
L745:
  sub    $0x4,%rdx
  cmp    %rdx,%rax
  jae    L107
L354:
  mov    (%rdx),%edi
  movslq %edi,%rsi
  movslq (%r14,%rsi,4),%rsi
  movzbl 0x0(%rbp,%rsi,1),%esi
  cmp    %esi,%ecx
  jg     L151
  jne    L745
  mov    (%r9),%esi
  mov    %esi,(%rdx)
  mov    %edi,(%r9)
  sub    $0x4,%r9
  jmp    L745
L151:
  cmp    %rdx,%rax
  jb     L494
  jmp    L107
L488:
  add    $0x4,%rax
  cmp    %rdx,%rax
  jae    L507
L477:
  mov    (%rax),%edi
  movslq %edi,%rsi
  movslq (%r14,%rsi,4),%rsi
  movzbl 0x0(%rbp,%rsi,1),%esi
  cmp    %esi,%ecx
  jl     L507
  jne    L488
  mov    (%r8),%esi
  mov    %esi,(%rax)
  mov    %edi,(%r8)
  add    $0x4,%r8
  jmp    L488
L660:
  sub    $0x4,%rdx
  cmp    %rax,%rdx
  jbe    L107
L69:
  mov    (%rdx),%edi
  movslq %edi,%rsi
  movslq (%r14,%rsi,4),%rsi
  movzbl 0x0(%rbp,%rsi,1),%esi
  cmp    %esi,%ecx
  jg     L718
  jne    L660
  mov    (%r9),%esi
  mov    %esi,(%rdx)
  mov    %edi,(%r9)
  sub    $0x4,%r9
  jmp    L660
L718:
  cmp    %rdx,%rax
  jae    L107
L494:
  mov    (%rax),%esi
  mov    (%rdx),%edi
  mov    %edi,(%rax)
  mov    %esi,(%rdx)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jb     L477
L507:
  sub    $0x4,%rdx
  cmp    %rax,%rdx
  ja     L69
L107:
  cmp    %r9,%r8
  jbe    L476
  movslq (%r12),%rax
  movslq (%r14,%rax,4),%rax
  cmp    -0x1(%rbp,%rax,1),%r10b
  ja     L640
L287:
  addl   $0x1,0xc(%rsp)
  jmp    L662
L476:
  lea    -0x4(%rax),%r11
  mov    %rax,%rdi
  sub    %r8,%rdi
  mov    %rdi,0x10(%rsp)
  mov    %r8,%rdx
  sub    %r12,%rdx
  sar    $0x2,%rdx
  sar    $0x2,%rdi
  cmp    %edi,%edx
  cmovg  %edi,%edx
  movslq %edx,%rsi
  shl    $0x2,%rsi
  mov    %rax,%rcx
  sub    %rsi,%rcx
  test   %edx,%edx
  jle    L24
  mov    %edx,%edx
  lea    (%r12,%rdx,4),%r8
  mov    %r12,%rdx
L555:
  mov    (%rdx),%esi
  mov    (%rcx),%edi
  mov    %edi,(%rdx)
  mov    %esi,(%rcx)
  add    $0x4,%rdx
  add    $0x4,%rcx
  cmp    %r8,%rdx
  jne    L555
L24:
  mov    %r9,%rdi
  sub    %r11,%rdi
  mov    %rdi,0x30(%rsp)
  mov    %r13,%rcx
  sub    %r9,%rcx
  sar    $0x2,%rcx
  sub    $0x1,%ecx
  sar    $0x2,%rdi
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  movslq %ecx,%rsi
  shl    $0x2,%rsi
  mov    %r13,%rdx
  sub    %rsi,%rdx
  test   %ecx,%ecx
  jle    L326
  mov    %ecx,%ecx
  lea    (%rax,%rcx,4),%rdi
L150:
  mov    (%rax),%ecx
  mov    (%rdx),%esi
  mov    %esi,(%rax)
  mov    %ecx,(%rdx)
  add    $0x4,%rax
  add    $0x4,%rdx
  cmp    %rax,%rdi
  jne    L150
L326:
  mov    0x10(%rsp),%rax
  lea    (%r12,%rax,1),%rdi
  mov    %rdi,0x38(%rsp)
  mov    %r13,%rax
  sub    0x30(%rsp),%rax
  mov    %rax,0x20(%rsp)
  movslq (%rdi),%rax
  movslq (%r14,%rax,4),%rax
  mov    %rdi,0x28(%rsp)
  cmp    -0x1(%rbp,%rax,1),%r10b
  ja     L84
L100:
  mov    0x30(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  jg     L565
  mov    0x20(%rsp),%rbp
  sub    0x28(%rsp),%rbp
  cmp    %rbp,%rax
  jle    L720
  cmp    %rbp,0x10(%rsp)
  jg     L549
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    0x20(%rsp),%rdi
  mov    %rdi,0x40(%rsp,%rcx,8)
  mov    %r13,0x48(%rsp,%rcx,8)
  mov    0xc(%rsp),%esi
  mov    %esi,0x50(%rsp,%rcx,8)
  lea    0x1(%r15),%r13d
  mov    %ebx,0x54(%rsp,%rcx,8)
  cmp    $0xf,%r13d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r13d,%r13
  lea    0x0(%r13,%r13,1),%rdi
  lea    (%rdi,%r13,1),%rax
  mov    0x28(%rsp),%rdx
  mov    %rdx,0x40(%rsp,%rax,8)
  mov    0x20(%rsp),%rcx
  mov    %rcx,0x48(%rsp,%rax,8)
  mov    %rdi,0x10(%rsp)
  mov    0xc(%rsp),%esi
  lea    0x1(%rsi),%edx
  mov    %edx,0x50(%rsp,%rax,8)
  sar    $0x2,%rbp
  mov    %rbp,%rdi
  call   <ss_ilg@plt>
  add    $0x2,%r15d
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%r13,1),%rdx
  mov    %eax,0x54(%rsp,%rdx,8)
  mov    %ebx,0x10(%rsp)
  mov    0x38(%rsp),%r13
  jmp    L662
L84:
  mov    0xc(%rsp),%ecx
  mov    0x20(%rsp),%rdx
  mov    %rdi,%rsi
  mov    %r14,%rdi
  call   <ss_partition@plt>
  mov    %rax,0x28(%rsp)
  jmp    L100
L720:
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rcx
  lea    (%rcx,%rcx,1),%rdi
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    0x28(%rsp),%rdx
  mov    %rdx,0x40(%rsp,%rax,8)
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    0x20(%rsp),%rdx
  mov    %rdx,0x48(%rsp,%rax,8)
  mov    %rdi,0x28(%rsp)
  mov    %rdi,%rax
  mov    %rcx,0x10(%rsp)
  add    %rcx,%rax
  mov    0xc(%rsp),%esi
  lea    0x1(%rsi),%edx
  mov    %edx,0x50(%rsp,%rax,8)
  sar    $0x2,%rbp
  mov    %rbp,%rdi
  call   <ss_ilg@plt>
  lea    0x1(%r15),%ebp
  mov    0x28(%rsp),%rdi
  add    0x10(%rsp),%rdi
  mov    %eax,0x54(%rsp,%rdi,8)
  cmp    $0xf,%ebp
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %ebp,%rbp
  lea    0x0(%rbp,%rbp,1),%rax
  lea    (%rax,%rbp,1),%rdx
  mov    0x20(%rsp),%rdi
  mov    %rdi,0x40(%rsp,%rdx,8)
  mov    %r13,0x48(%rsp,%rdx,8)
  mov    0xc(%rsp),%esi
  mov    %esi,0x50(%rsp,%rdx,8)
  add    $0x2,%r15d
  mov    %ebx,0x54(%rsp,%rdx,8)
  mov    %ebx,0x10(%rsp)
  mov    0x38(%rsp),%r13
  jmp    L662
L549:
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    0x20(%rsp),%rdi
  mov    %rdi,0x40(%rsp,%rcx,8)
  mov    %r13,0x48(%rsp,%rcx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rcx,8)
  lea    0x1(%r15),%r13d
  mov    %ebx,0x54(%rsp,%rcx,8)
  cmp    $0xf,%r13d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r13d,%r13
  lea    0x0(%r13,%r13,1),%rax
  lea    (%rax,%r13,1),%rdx
  mov    %r12,0x40(%rsp,%rdx,8)
  mov    0x38(%rsp),%rcx
  mov    %rcx,0x48(%rsp,%rdx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rdx,8)
  add    $0x2,%r15d
  mov    %ebx,0x54(%rsp,%rdx,8)
  add    $0x1,%edi
  mov    %edi,0xc(%rsp)
  sar    $0x2,%rbp
  mov    %rbp,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  mov    0x20(%rsp),%r13
  mov    0x28(%rsp),%r12
  jmp    L662
L565:
  mov    0x20(%rsp),%rbp
  sub    0x28(%rsp),%rbp
  cmp    %rbp,0x10(%rsp)
  jle    L584
  cmp    %rbp,0x30(%rsp)
  jg     L548
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    %r12,0x40(%rsp,%rcx,8)
  mov    0x38(%rsp),%rdi
  mov    %rdi,0x48(%rsp,%rcx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rcx,8)
  lea    0x1(%r15),%r12d
  mov    %ebx,0x54(%rsp,%rcx,8)
  cmp    $0xf,%r12d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r12d,%r12
  lea    (%r12,%r12,1),%rdi
  lea    (%rdi,%r12,1),%rax
  mov    0x28(%rsp),%rdx
  mov    %rdx,0x40(%rsp,%rax,8)
  mov    0x20(%rsp),%rdx
  mov    %rdx,0x48(%rsp,%rax,8)
  mov    %rdi,0x10(%rsp)
  mov    0xc(%rsp),%ecx
  lea    0x1(%rcx),%edx
  mov    %edx,0x50(%rsp,%rax,8)
  sar    $0x2,%rbp
  mov    %rbp,%rdi
  call   <ss_ilg@plt>
  add    $0x2,%r15d
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%r12,1),%rdx
  mov    %eax,0x54(%rsp,%rdx,8)
  mov    %ebx,0x10(%rsp)
  mov    0x20(%rsp),%r12
  jmp    L662
L584:
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rcx
  lea    (%rcx,%rcx,1),%rdi
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    0x28(%rsp),%rdx
  mov    %rdx,0x40(%rsp,%rax,8)
  mov    %rdi,%rax
  add    %rcx,%rax
  mov    0x20(%rsp),%rdx
  mov    %rdx,0x48(%rsp,%rax,8)
  mov    %rdi,0x28(%rsp)
  mov    %rdi,%rax
  mov    %rcx,0x10(%rsp)
  add    %rcx,%rax
  mov    0xc(%rsp),%esi
  lea    0x1(%rsi),%edx
  mov    %edx,0x50(%rsp,%rax,8)
  sar    $0x2,%rbp
  mov    %rbp,%rdi
  call   <ss_ilg@plt>
  lea    0x1(%r15),%ebp
  mov    0x28(%rsp),%rdi
  add    0x10(%rsp),%rdi
  mov    %eax,0x54(%rsp,%rdi,8)
  cmp    $0xf,%ebp
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %ebp,%rbp
  lea    0x0(%rbp,%rbp,1),%rax
  lea    (%rax,%rbp,1),%rdx
  mov    %r12,0x40(%rsp,%rdx,8)
  mov    0x38(%rsp),%rdi
  mov    %rdi,0x48(%rsp,%rdx,8)
  mov    0xc(%rsp),%esi
  mov    %esi,0x50(%rsp,%rdx,8)
  add    $0x2,%r15d
  mov    %ebx,0x54(%rsp,%rdx,8)
  mov    %ebx,0x10(%rsp)
  mov    0x20(%rsp),%r12
  jmp    L662
L548:
  cmp    $0xf,%r15d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r15d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    %r12,0x40(%rsp,%rcx,8)
  mov    0x38(%rsp),%rdi
  mov    %rdi,0x48(%rsp,%rcx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rcx,8)
  lea    0x1(%r15),%r12d
  mov    %ebx,0x54(%rsp,%rcx,8)
  cmp    $0xf,%r12d
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movslq %r12d,%r12
  lea    (%r12,%r12,1),%rax
  lea    (%rax,%r12,1),%rdx
  mov    0x20(%rsp),%rcx
  mov    %rcx,0x40(%rsp,%rdx,8)
  mov    %r13,0x48(%rsp,%rdx,8)
  mov    0xc(%rsp),%edi
  mov    %edi,0x50(%rsp,%rdx,8)
  add    $0x2,%r15d
  mov    %ebx,0x54(%rsp,%rdx,8)
  add    $0x1,%edi
  mov    %edi,0xc(%rsp)
  mov    %rbp,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  mov    0x20(%rsp),%r13
  mov    0x28(%rsp),%r12
  jmp    L662
L640:
  mov    0xc(%rsp),%ecx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <ss_partition@plt>
  mov    %rax,%r12
  mov    %r13,%rdi
  sub    %rax,%rdi
  sar    $0x2,%rdi
  call   <ss_ilg@plt>
  mov    %eax,0x10(%rsp)
  jmp    L287
L136:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void ss_mintrosort(const unsigned char *T, const int *PA, int *first, int *last, int depth) {
  struct {
    int *a, *b, c;
    int d;
  } stack[(16)];
  const unsigned char *Td;
  int *a, *b, *c, *d, *e, *f;
  int s, t;
  int ssize;
  int limit;
  int v, x = 0;
  for (ssize = 0, limit = ss_ilg(last - first);;) {
    if ((last - first) <= (8)) {
      if (1 < (last - first)) {
        ss_insertionsort(T, PA, first, last, depth);
      }
      do {
        assert(0 <= ssize);
        if (ssize == 0) {
          return;
        }
        (first) = stack[--ssize].a, (last) = stack[ssize].b, (depth) = stack[ssize].c, (limit) = stack[ssize].d;
      } while (0);
      continue;
    }
    Td = T + depth;
    if (limit-- == 0) {
      ss_heapsort(Td, PA, first, last - first);
    }
    if (limit < 0) {
      for (a = first + 1, v = Td[PA[*first]]; a < last; ++a) {
        if ((x = Td[PA[*a]]) != v) {
          if (1 < (a - first)) {
            break;
          }
          v = x;
          first = a;
        }
      }
      if (Td[PA[*first] - 1] < v) {
        first = ss_partition(PA, first, a, depth);
      }
      if ((a - first) <= (last - a)) {
        if (1 < (a - first)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (a), stack[ssize].b = (last), stack[ssize].c = (depth), stack[ssize++].d = (-1);
          } while (0);
          last = a, depth += 1, limit = ss_ilg(a - first);
        } else {
          first = a, limit = -1;
        }
      } else {
        if (1 < (last - a)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (first), stack[ssize].b = (a), stack[ssize].c = (depth + 1), stack[ssize++].d = (ss_ilg(a - first));
          } while (0);
          first = a, limit = -1;
        } else {
          last = a, depth += 1, limit = ss_ilg(a - first);
        }
      }
      continue;
    }
    a = ss_pivot(Td, PA, first, last);
    v = Td[PA[*a]];
    do {
      t = (*first);
      (*first) = (*a);
      (*a) = t;
    } while (0);
    for (b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) {
    }
    if (((a = b) < last) && (x < v)) {
      for (; (++b < last) && ((x = Td[PA[*b]]) <= v);) {
        if (x == v) {
          do {
            t = (*b);
            (*b) = (*a);
            (*a) = t;
          } while (0);
          ++a;
        }
      }
    }
    for (c = last; (b < --c) && ((x = Td[PA[*c]]) == v);) {
    }
    if ((b < (d = c)) && (x > v)) {
      for (; (b < --c) && ((x = Td[PA[*c]]) >= v);) {
        if (x == v) {
          do {
            t = (*c);
            (*c) = (*d);
            (*d) = t;
          } while (0);
          --d;
        }
      }
    }
    for (; b < c;) {
      do {
        t = (*b);
        (*b) = (*c);
        (*c) = t;
      } while (0);
      for (; (++b < c) && ((x = Td[PA[*b]]) <= v);) {
        if (x == v) {
          do {
            t = (*b);
            (*b) = (*a);
            (*a) = t;
          } while (0);
          ++a;
        }
      }
      for (; (b < --c) && ((x = Td[PA[*c]]) >= v);) {
        if (x == v) {
          do {
            t = (*c);
            (*c) = (*d);
            (*d) = t;
          } while (0);
          --d;
        }
      }
    }
    if (a <= d) {
      c = b - 1;
      if ((s = a - first) > (t = b - a)) {
        s = t;
      }
      for (e = first, f = b - s; 0 < s; --s, ++e, ++f) {
        do {
          t = (*e);
          (*e) = (*f);
          (*f) = t;
        } while (0);
      }
      if ((s = d - c) > (t = last - d - 1)) {
        s = t;
      }
      for (e = b, f = last - s; 0 < s; --s, ++e, ++f) {
        do {
          t = (*e);
          (*e) = (*f);
          (*f) = t;
        } while (0);
      }
      a = first + (b - a), c = last - (d - c);
      b = (v <= Td[PA[*a] - 1]) ? a : ss_partition(PA, a, c, depth);
      if ((a - first) <= (last - c)) {
        if ((last - c) <= (c - b)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (b), stack[ssize].b = (c), stack[ssize].c = (depth + 1), stack[ssize++].d = (ss_ilg(c - b));
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (c), stack[ssize].b = (last), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          last = a;
        } else if ((a - first) <= (c - b)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (c), stack[ssize].b = (last), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (b), stack[ssize].b = (c), stack[ssize].c = (depth + 1), stack[ssize++].d = (ss_ilg(c - b));
          } while (0);
          last = a;
        } else {
          do {
            assert(ssize < (16));
            stack[ssize].a = (c), stack[ssize].b = (last), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (first), stack[ssize].b = (a), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          first = b, last = c, depth += 1, limit = ss_ilg(c - b);
        }
      } else {
        if ((a - first) <= (c - b)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (b), stack[ssize].b = (c), stack[ssize].c = (depth + 1), stack[ssize++].d = (ss_ilg(c - b));
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (first), stack[ssize].b = (a), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          first = c;
        } else if ((last - c) <= (c - b)) {
          do {
            assert(ssize < (16));
            stack[ssize].a = (first), stack[ssize].b = (a), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (b), stack[ssize].b = (c), stack[ssize].c = (depth + 1), stack[ssize++].d = (ss_ilg(c - b));
          } while (0);
          first = c;
        } else {
          do {
            assert(ssize < (16));
            stack[ssize].a = (first), stack[ssize].b = (a), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          do {
            assert(ssize < (16));
            stack[ssize].a = (c), stack[ssize].b = (last), stack[ssize].c = (depth), stack[ssize++].d = (limit);
          } while (0);
          first = b, last = c, depth += 1, limit = ss_ilg(c - b);
        }
      }
    } else {
      limit += 1;
      if (Td[PA[*first] - 1] < v) {
        first = ss_partition(PA, first, last, depth);
        limit = ss_ilg(last - first);
      }
      depth += 1;
    }
  }
}
```