user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<inv>:
  endbr64
  lea    0x1(%rsi),%eax
  cmp    %edx,%eax
  je     L151
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %esi,%r14d
  mov    %edx,%ebp
  lea    (%rsi,%rdx,1),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    %r12d,%edx
  call   <inv>
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <inv>
  mov    %ebp,%r15d
  sub    %r14d,%r15d
  lea    0x0(,%r15,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %r15d,%r15d
  jle    L106
  mov    %rax,%rbx
  mov    %r15d,%r15d
  lea    (%rax,%r15,8),%r15
L80:
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  add    $0x8,%rbx
  cmp    %r15,%rbx
  jne    L80
L106:
  cmp    %r12d,%r14d
  jl     L22
  cmp    %r12d,%ebp
  jle    L31
L22:
  mov    0x8(%rsp),%rdx
  mov    %rdx,%rax
  mov    %r12d,%edi
  mov    %r14d,%esi
  mov    $0x1,%ecx
  jmp    L49
L19:
  cmp    %esi,%r12d
  jg     L27
  movslq %edi,%r9
  lea    0x0(%r13,%r9,8),%r9
  mov    (%rdx),%r10
  mov    (%r9),%r11
  mov    (%r11),%r11d
  mov    %r11d,(%r10)
  mov    (%rdx),%r10
  mov    (%r9),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r10)
  add    $0x1,%edi
  jmp    L129
L27:
  movslq %esi,%r8
  lea    0x0(%r13,%r8,8),%r9
  mov    (%r9),%r8
  mov    0x4(%r8),%r11d
  movslq %edi,%r10
  lea    0x0(%r13,%r10,8),%r15
  mov    (%r15),%rbx
  mov    0x4(%rbx),%r10d
  cmp    %r10d,%r11d
  jle    L0
  mov    (%rdx),%r10
  mov    (%r8),%r8d
  mov    %r8d,(%r10)
  mov    (%rdx),%r8
  mov    (%r9),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r8)
  add    $0x1,%esi
L94:
  add    $0x1,%ecx
  add    $0x8,%rdx
L49:
  lea    -0x1(%rcx),%r8d
  cmp    %edi,%ebp
  jg     L19
  movslq %esi,%r9
  lea    0x0(%r13,%r9,8),%r9
  mov    (%rdx),%r10
  mov    (%r9),%r11
  mov    (%r11),%r11d
  mov    %r11d,(%r10)
  mov    (%rdx),%r10
  mov    (%r9),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r10)
  add    $0x1,%esi
L129:
  cmp    %r12d,%esi
  jl     L94
  cmp    %ebp,%edi
  jl     L94
  test   %ecx,%ecx
  jle    L31
  movslq %r14d,%r14
  lea    0x0(%r13,%r14,8),%rcx
  sub    0x8(%rsp),%rcx
  mov    $0x0,%edx
L77:
  mov    (%rcx,%rax,1),%rsi
  mov    (%rax),%rdi
  mov    (%rdi),%edi
  mov    %edi,(%rsi)
  mov    (%rcx,%rax,1),%rsi
  mov    (%rax),%rdi
  mov    0x4(%rdi),%edi
  mov    %edi,0x4(%rsi)
  mov    %edx,%esi
  add    $0x1,%edx
  add    $0x8,%rax
  cmp    %r8d,%esi
  jl     L77
L31:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  jge    L54
  mov    (%rdx),%r8
  mov    (%rbx),%r9d
  mov    %r9d,(%r8)
  mov    (%rdx),%r8
  mov    (%r15),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r8)
  add    $0x1,%edi
  jmp    L94
L54:
  mov    (%r8),%r10d
  mov    (%rbx),%r8d
  cmp    %r8d,%r10d
  jge    L82
  mov    (%rdx),%r8
  mov    %r10d,(%r8)
  mov    (%rdx),%r8
  mov    (%r9),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r8)
  add    $0x1,%esi
  jmp    L94
L82:
  mov    (%rdx),%r9
  mov    %r8d,(%r9)
  mov    (%rdx),%r8
  mov    (%r15),%r9
  mov    0x4(%r9),%r9d
  mov    %r9d,0x4(%r8)
  add    $0x1,%edi
  jmp    L94
L151:
  ret
```

assistant: ```c
void inv(int **arr, int a, int b) {
  if (b == a + 1) {
    return;
  }
  int m = (a + b) / 2;
  inv(arr, a, m);
  inv(arr, m, b);
  int i, j, k = 0;
  int **temp = (int **)malloc((b - a) * sizeof(int));
  for (i = 0; i < (b - a); i++) {
    temp[i] = (int *)malloc(2 * sizeof(int));
  }
  for (i = a, j = m; i < m || j < b;) {
    if (j >= b) {
      temp[k][0] = arr[i][0];
      temp[k][1] = arr[i][1];
      i++;
    } else if (i >= m) {
      temp[k][0] = arr[j][0];
      temp[k][1] = arr[j][1];
      j++;
    } else {
      if (arr[i][1] > arr[j][1]) {
        temp[k][0] = arr[i][0];
        temp[k][1] = arr[i][1];
        i++;
      } else if (arr[i][1] < arr[j][1]) {
        temp[k][0] = arr[j][0];
        temp[k][1] = arr[j][1];
        j++;
      } else {
        if (arr[i][0] < arr[j][0]) {
          temp[k][0] = arr[i][0];
          temp[k][1] = arr[i][1];
          i++;
        } else {
          temp[k][0] = arr[j][0];
          temp[k][1] = arr[j][1];
          j++;
        }
      }
    }
    k++;
  }
  for (i = 0; i < k; i++) {
    arr[a + i][0] = temp[i][0];
    arr[a + i][1] = temp[i][1];
  }
}
```