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

```asm
<SortUnstableInt>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x38,%rsp
  mov    %edi,0x1c(%rsp)
  shl    $0x2,%edi
  mov    %rsi,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r15d,%r15d
  jle    L245
  mov    0x20(%rsp),%rdi
  mov    0x1c(%rsp),%esi
  lea    0xf(%rbx),%rax
  lea    0x4(%rbx),%rcx
  sub    %rdi,%rax
  lea    -0x1(%rsi),%r12d
  cmp    $0x1e,%rax
  seta   %al
  cmp    $0x2,%r12d
  seta   %dl
  and    %edx,%eax
  mov    %rbp,%rdx
  sub    %rcx,%rdx
  cmp    $0x8,%rdx
  seta   %dl
  test   %dl,%al
  je     L193
  lea    0x4(%rdi),%rdx
  mov    %rbp,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L193
  shr    $0x2,%esi
  sub    %rbp,%rdi
  mov    %rbp,%rax
  movdqa D20(%rip),%xmm0
  mov    %esi,%edx
  movdqa D13(%rip),%xmm2
  mov    %rbx,%rsi
  mov    %rdi,%rcx
  shl    $0x4,%rdx
  sub    %rbp,%rsi
  add    %rbp,%rdx
  cs nopw 0x0(%rax,%rax,1)
L333:
  movdqa %xmm0,%xmm1
  paddd  %xmm2,%xmm0
  movups %xmm1,(%rsi,%rax,1)
  movdqu (%rcx,%rax,1),%xmm3
  add    $0x10,%rax
  movups %xmm3,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L333
  mov    0x1c(%rsp),%edi
  mov    %edi,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%dil
  je     L309
  mov    0x20(%rsp),%r10
  mov    %eax,%ecx
  mov    %eax,(%rbx,%rcx,4)
  lea    0x0(,%rcx,4),%rdx
  mov    (%r10,%rcx,4),%esi
  mov    %esi,0x0(%rbp,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%edi
  jle    L309
  mov    %ecx,0x4(%rbx,%rdx,1)
  mov    0x4(%r10,%rdx,1),%ecx
  add    $0x2,%eax
  mov    %ecx,0x4(%rbp,%rdx,1)
  cmp    %eax,%edi
  jle    L309
  mov    %eax,0x8(%rbx,%rdx,1)
  mov    0x8(%r10,%rdx,1),%eax
  mov    %eax,0x8(%rbp,%rdx,1)
L309:
  mov    $0xc8,%edi
  mov    %r12d,%r15d
  xor    %r14d,%r14d
  call   <malloc@plt>
  mov    $0x2,%r11d
  mov    %rax,0x8(%rsp)
  movl   $0x0,(%rax)
  mov    %r12d,0x4(%rax)
  nopl   0x0(%rax)
L87:
  mov    %r15d,%edx
  lea    -0x2(%r11),%eax
  lea    0x1(%r14),%r13d
  sub    %r14d,%edx
  mov    %eax,0x18(%rsp)
  cmp    $0x6,%edx
  jle    L272
  lea    (%r14,%r15,1),%eax
  movslq %r14d,%r8
  sar    %eax
  shl    $0x2,%r8
  cltq
  lea    (%rbx,%rax,4),%rsi
  movslq %r15d,%rax
  lea    (%rbx,%rax,4),%rax
  mov    (%rsi),%ecx
  mov    (%rax),%edi
  mov    %edi,(%rsi)
  lea    (%rbx,%r8,1),%rsi
  mov    %ecx,(%rax)
  movslq (%rsi),%rdi
  mov    %rdi,%r9
  lea    0x0(%rbp,%rdi,4),%r10
  movslq %ecx,%rdi
  mov    0x0(%rbp,%rdi,4),%edi
  cmp    %edi,(%r10)
  jle    L258
  mov    %ecx,(%rsi)
  mov    %r9d,%ecx
  mov    %r9d,(%rax)
  mov    (%r10),%edi
L258:
  lea    0x4(%rbx,%r8,1),%r9
  movslq (%r9),%r8
  mov    %r9,0x10(%rsp)
  mov    %r8,%r10
  mov    0x0(%rbp,%r8,4),%r8d
  cmp    %edi,%r8d
  jle    L151
  mov    %ecx,(%r9)
  mov    %r10d,(%rax)
  movslq (%r9),%rcx
  mov    0x0(%rbp,%rcx,4),%r8d
  mov    %rcx,%r10
L151:
  movslq (%rsi),%rdi
  movd   %r10d,%xmm0
  movd   %edi,%xmm4
  mov    %rdi,%rcx
  lea    0x0(%rbp,%rdi,4),%rdi
  punpckldq %xmm4,%xmm0
  cmp    %r8d,(%rdi)
  jle    L97
  movq   %xmm0,(%rsi)
  mov    (%rdi),%r8d
  mov    %ecx,%r10d
L97:
  cmp    %r13d,%r15d
  jl     L278
  mov    %r15d,%r12d
  nopl   0x0(%rax)
L346:
  movslq %r13d,%rax
  lea    0x4(%rbx,%rax,4),%rax
  nopl   0x0(%rax,%rax,1)
L255:
  movslq (%rax),%rcx
  mov    %rax,%rdx
  add    $0x1,%r13d
  lea    0x4(%rax),%rax
  mov    %rcx,%rdi
  cmp    %r8d,0x0(%rbp,%rcx,4)
  jl     L255
  movslq %r12d,%rax
  lea    -0x4(%rbx,%rax,4),%rcx
L266:
  movslq (%rcx),%r9
  mov    %rcx,%rax
  sub    $0x1,%r12d
  lea    -0x4(%rcx),%rcx
  mov    %r9,%rsi
  cmp    %r8d,0x0(%rbp,%r9,4)
  jg     L266
  cmp    %r12d,%r13d
  jle    L174
  mov    %r12d,%edx
  sub    %r14d,%edx
L271:
  mov    0x10(%rsp),%rdi
  cmpl   $0x2e,0x18(%rsp)
  mov    %esi,(%rdi)
  mov    %r10d,(%rax)
  jg     L315
L188:
  mov    0x8(%rsp),%rdi
  lea    -0x1(%r11),%eax
  sub    $0x1,%r12d
  movd   %r13d,%xmm1
  cltq
  movd   %r15d,%xmm6
  movd   %r14d,%xmm0
  lea    -0x4(%rdi,%rax,4),%rsi
  movslq %r11d,%rax
  punpckldq %xmm6,%xmm1
  add    $0x2,%r11d
  lea    (%rdi,%rax,4),%rcx
  movd   %r12d,%xmm5
  movdqa %xmm1,%xmm2
  mov    %r15d,%eax
  sub    %r13d,%eax
  punpckldq %xmm5,%xmm0
  add    $0x1,%eax
  punpcklqdq %xmm0,%xmm2
  punpcklqdq %xmm1,%xmm0
  cmp    %edx,%eax
  jl     L163
  movups %xmm2,(%rsi)
  mov    %r12d,%r15d
L206:
  mov    (%rcx),%r14d
  jmp    L87
  nopw   0x0(%rax,%rax,1)
L174:
  mov    %r9d,(%rdx)
  mov    %edi,(%rax)
  jmp    L346
  nopw   0x0(%rax,%rax,1)
L272:
  movslq %r13d,%r8
  mov    %r14d,%edi
  sub    $0x1,%r8
  cmp    %r13d,%r15d
  jl     L256
  nopw   0x0(%rax,%rax,1)
L113:
  movslq 0x4(%rbx,%r8,4),%rax
  mov    0x0(%rbp,%rax,4),%esi
  mov    %rax,%r9
  cmp    %r14d,%edi
  jl     L236
  movslq %edi,%rax
  jmp    L338
  cs nopw 0x0(%rax,%rax,1)
L148:
  mov    %ecx,0x4(%rbx,%rax,4)
  lea    -0x1(%rax),%edx
  sub    $0x1,%rax
  cmp    %eax,%r14d
  jg     L317
L338:
  movslq (%rbx,%rax,4),%rcx
  cmp    %esi,0x0(%rbp,%rcx,4)
  jg     L148
L299:
  add    $0x1,%edi
  mov    %r9d,0x4(%rbx,%rax,4)
  add    $0x1,%r8
  cmp    %r15d,%edi
  jne    L113
L256:
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L327
  mov    0x8(%rsp),%rsi
  lea    -0x3(%r11),%eax
  mov    0x18(%rsp),%r11d
  cltq
  mov    (%rsi,%rax,4),%r15d
  lea    -0x4(%rsi,%rax,4),%rcx
  jmp    L206
  nopl   0x0(%rax)
L317:
  movslq %edx,%rax
  jmp    L299
L163:
  movups %xmm0,(%rsi)
  jmp    L206
L236:
  mov    %r8,%rax
  jmp    L299
L315:
  lea    D7(%rip),%rdi
  mov    %r11d,0x10(%rsp)
  mov    %edx,0x18(%rsp)
  call   <printf@plt>
  mov    0x10(%rsp),%r11d
  mov    0x18(%rsp),%edx
  jmp    L188
L327:
  movslq 0x1c(%rsp),%rcx
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L109
  mov    0x20(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  nopw   0x0(%rax,%rax,1)
L57:
  movslq (%rbx,%rax,4),%rdx
  mov    (%rsi,%rdx,4),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L57
L109:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L278:
  mov    (%rax),%esi
  mov    %r15d,%r12d
  jmp    L271
L193:
  mov    0x1c(%rsp),%esi
  mov    0x20(%rsp),%rdi
  mov    %rbp,%rdx
  xor    %eax,%eax
L296:
  mov    %eax,(%rbx,%rax,4)
  mov    (%rdi,%rax,4),%ecx
  add    $0x1,%rax
  add    $0x4,%rdx
  mov    %ecx,-0x4(%rdx)
  cmp    %rsi,%rax
  jne    L296
  jmp    L309
L245:
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%r12d
  jmp    L309
```

tool_calls: name: read_data
arguments: data_tag: D20
type_infered: byte[16]
name: read_data
arguments: data_tag: D13
type_infered: byte[16]
name: read_data
arguments: data_tag: D7
type_infered: string

tool: {"D20": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D13": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: D7: Imminent stack overflow!


assistant: ```c
void SortUnstableInt(int N, int *B, int *C, int *idx) {
  int l, r;
  int i, j, k;
  int vidx, itemp;
  int stack_idx, *stack;
  int v;
  int *A;
  A = (int *)malloc(N * sizeof(int));
  for (j = 0; j < N; j++) {
    idx[j] = j;
    A[j] = B[j];
  }
  stack = (int *)malloc(50 * sizeof(int));
  stack_idx = 0;
  stack[stack_idx++] = 0;
  stack[stack_idx++] = N - 1;
  while (stack_idx > 0) {
    r = stack[--stack_idx];
    l = stack[--stack_idx];
    if (r - l >= 7) {
      k = (l + r) >> 1;
      {
        itemp = idx[k];
        idx[k] = idx[r];
        idx[r] = itemp;
      };
      if (A[idx[l]] > A[idx[r]]) {
        itemp = idx[l];
        idx[l] = idx[r];
        idx[r] = itemp;
      };
      if (A[idx[l + 1]] > A[idx[r]]) {
        itemp = idx[l + 1];
        idx[l + 1] = idx[r];
        idx[r] = itemp;
      };
      if (A[idx[l]] > A[idx[l + 1]]) {
        itemp = idx[l];
        idx[l] = idx[l + 1];
        idx[l + 1] = itemp;
      };
      i = l + 1;
      j = r;
      vidx = idx[i];
      v = A[vidx];
      while (i <= j) {
        while (A[idx[++i]] < v)
          ;
        while (A[idx[--j]] > v)
          ;
        if (i <= j) {
          itemp = idx[i];
          idx[i] = idx[j];
          idx[j] = itemp;
        };
      }
      idx[l + 1] = idx[j];
      idx[j] = vidx;
      if (stack_idx + 4 > 50)
        printf("Imminent stack overflow!\n");
      if (r - i + 1 >= j - l) {
        stack[stack_idx++] = i;
        stack[stack_idx++] = r;
        stack[stack_idx++] = l;
        stack[stack_idx++] = j - 1;
      } else {
        stack[stack_idx++] = l;
        stack[stack_idx++] = j - 1;
        stack[stack_idx++] = i;
        stack[stack_idx++] = r;
      }
    } else {
      for (j = l + 1; j <= r; j++) {
        vidx = idx[j];
        v = A[vidx];
        for (i = j - 1; i >= l; i--) {
          if (A[idx[i]] <= v)
            break;
          idx[i + 1] = idx[i];
        }
        idx[i + 1] = vidx;
      }
    }
  }
  for (j = 0; j < N; j++)
    C[j] = B[idx[j]];
  free(A);
  free(stack);
}
```