user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ss_inplacemerge>:
  endbr64
  push   %r15
  mov    %r9d,%r15d
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  nopl   0x0(%rax)
L198:
  mov    0x20(%rsp),%rax
  movslq -0x4(%rax),%rax
  test   %eax,%eax
  js     L54
  mov    0x10(%rsp),%rdi
  movl   $0x0,0x34(%rsp)
  lea    (%rdi,%rax,4),%r12
L241:
  mov    0x18(%rsp),%rax
  mov    0x28(%rsp),%rbp
  sub    %rbp,%rax
  sar    $0x2,%rax
  mov    %eax,%r14d
  mov    %rax,0x38(%rsp)
  sar    %r14d
  test   %eax,%eax
  jle    L166
  mov    %eax,0xc(%rsp)
  movl   $0xffffffff,0x30(%rsp)
  jmp    L77
  nopl   0x0(%rax)
L130:
  mov    %r14d,%edx
  sar    %edx
  test   %r14d,%r14d
  jle    L169
  mov    %eax,0x30(%rsp)
L188:
  mov    %r14d,0xc(%rsp)
  mov    %edx,%r14d
L77:
  movslq %r14d,%rax
  lea    0x0(%rbp,%rax,4),%rbx
  movslq (%rbx),%rsi
  test   %esi,%esi
  jns    L65
  not    %esi
  movslq %esi,%rsi
L65:
  mov    0x10(%rsp),%r8
  mov    %r15d,%ecx
  mov    %r12,%rdx
  mov    %r13,%rdi
  lea    (%r8,%rsi,4),%rsi
  call   <ss_compare@plt>
  test   %eax,%eax
  jns    L130
  lea    0x4(%rbx),%rbp
  mov    0xc(%rsp),%ebx
  not    %ebx
  and    $0x1,%ebx
  sub    %ebx,%r14d
  mov    %r14d,%edx
  sar    %edx
  test   %r14d,%r14d
  jg     L188
  mov    0x30(%rsp),%eax
L169:
  cmp    %rbp,0x18(%rsp)
  jbe    L128
  test   %eax,%eax
  jne    L90
  notl   0x0(%rbp)
L90:
  mov    0x20(%rsp),%r14
  mov    0x18(%rsp),%rbx
  mov    %rbp,%rdi
  mov    %r14,%rdx
  mov    %rbx,%rsi
  call   <ss_rotate@plt>
  mov    %rbx,%rax
  sub    %rbp,%rax
  sub    %rax,%r14
  mov    %r14,0x20(%rsp)
  cmp    %rbp,0x28(%rsp)
  je     L203
  mov    %rbp,0x18(%rsp)
L128:
  mov    0x34(%rsp),%edi
  subq   $0x4,0x20(%rsp)
  test   %edi,%edi
  jne    L39
L4:
  mov    0x20(%rsp),%r14
  cmp    %r14,0x18(%rsp)
  je     L203
  mov    0x38(%rsp),%ecx
  test   %ecx,%ecx
  jg     L198
L55:
  mov    -0x4(%r14),%edx
  test   %edx,%edx
  js     L200
  mov    0x28(%rsp),%rdi
  cmp    %rdi,0x18(%rsp)
  jbe    L213
L81:
  mov    0x18(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  add    $0x48,%rsp
  mov    %r14,%rdx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <ss_rotate@plt>
  nopl   (%rax)
L54:
  mov    0x10(%rsp),%rcx
  not    %eax
  movl   $0x1,0x34(%rsp)
  cltq
  lea    (%rcx,%rax,4),%r12
  jmp    L241
  nopw   0x0(%rax,%rax,1)
L200:
  mov    0x28(%rsp),%rcx
  cmp    %rcx,0x18(%rsp)
  ja     L81
  sub    $0x4,%r14
  nopl   0x0(%rax,%rax,1)
L66:
  mov    -0x4(%r14),%eax
  sub    $0x4,%r14
  test   %eax,%eax
  js     L66
  cmp    %r14,0x18(%rsp)
  jne    L55
L203:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L213:
  sub    $0x4,%r14
  cmp    %r14,0x18(%rsp)
  jne    L55
  jmp    L203
  nopl   0x0(%rax)
L39:
  mov    0x20(%rsp),%rax
  nopl   (%rax)
L26:
  mov    -0x4(%rax),%esi
  sub    $0x4,%rax
  test   %esi,%esi
  js     L26
  mov    %rax,0x20(%rsp)
  jmp    L4
  nopl   (%rax)
L166:
  cmp    %rbp,0x18(%rsp)
  jbe    L128
  mov    0x20(%rsp),%r14
  jmp    L81
```

assistant: ```c
void ss_inplacemerge(const unsigned char *T, const int *PA, int *first, int *middle, int *last, int depth) {
  const int *p;
  int *a, *b;
  int len, half;
  int q, r;
  int x;
  for (;;) {
    if (*(last - 1) < 0) {
      x = 1;
      p = PA + ~*(last - 1);
    } else {
      x = 0;
      p = PA + *(last - 1);
    }
    for (a = first, len = middle - first, half = len >> 1, r = -1; 0 < len; len = half, half >>= 1) {
      b = a + half;
      q = ss_compare(T, PA + ((0 <= *b) ? *b : ~*b), p, depth);
      if (q < 0) {
        a = b + 1;
        half -= (len & 1) ^ 1;
      } else {
        r = q;
      }
    }
    if (a < middle) {
      if (r == 0) {
        *a = ~*a;
      }
      ss_rotate(a, middle, last);
      last -= middle - a;
      middle = a;
      if (first == middle) {
        break;
      }
    }
    --last;
    if (x != 0) {
      while (*--last < 0) {
      }
    }
    if (middle == last) {
      break;
    }
  }
}
```