user: Please show me the C implementation that matches the assembly code listed below:

```asm
<twoSum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L50
L63:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L50:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L63
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <sort@plt>
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L15
L87:
  addl   $0x1,-0x18(%rbp)
L49:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cmp    %eax,-0x30(%rbp)
  jg     L87
  jmp    L18
L30:
  subl   $0x1,-0x14(%rbp)
L18:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cmp    %eax,-0x30(%rbp)
  jl     L30
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cmp    %eax,-0x30(%rbp)
  jne    L15
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  cmovg  %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  mov    -0x8(%rbp),%rcx
  add    $0x4,%rcx
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x8(%rbp),%rax
  jmp    L29
L15:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L49
L29:
  leave
  ret
```

assistant: ```c
int *twoSum(int *nums, int size, int target) {
  int *indexes = (int *)malloc(sizeof(int) * size);
  for (int i = 0; i < size; i++)
    indexes[i] = i;
  sort(nums, indexes, 0, size - 1);
  int *result = (int *)malloc(sizeof(int) * 2);
  int l = 0, r = size - 1;
  while (l < r) {
    while (nums[l] + nums[r] < target)
      l++;
    while (nums[l] + nums[r] > target)
      r--;
    if (nums[l] + nums[r] == target) {
      result[0] = ((indexes[l]) < (indexes[r]) ? (indexes[l]) : (indexes[r]));
      result[1] = ((indexes[l]) > (indexes[r]) ? (indexes[l]) : (indexes[r]));
      return result;
    }
  }
}
```