user: Converte this assembly snippet into its equivalent C code:

```asm
<stableMarriage>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xf78,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %esi,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x1f68(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rax
  lea    0xfc0(%rsp),%rdx
L82:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L82
  lea    0xfc0(%rsp),%rdi
  mov    $0x1f4,%ecx
  mov    $0x0,%eax
  rep stos %rax,%es:(%rdi)
  test   %r14d,%r14d
  jle    L65
  mov    %r14d,0xc(%rsp)
  mov    %r14d,%eax
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  jmp    L50
L27:
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %ebp,%edx
  mov    0x10(%rsp),%rdi
  call   <wPrefersM1OverM@plt>
  test   %rax,%rax
  jne    L5
  movslq %r12d,%r12
  mov    %ebp,0x20(%rsp,%r12,4)
  movl   $0x1,0xfc0(%rsp,%r15,4)
  movslq %r13d,%r13
  movl   $0x0,0xfc0(%rsp,%r13,4)
L5:
  add    $0x4,%rbx
  cmp    (%rsp),%rbx
  je     L129
L86:
  cmpl   $0x0,0xfc0(%rsp,%r15,4)
  jne    L129
  mov    (%rbx),%esi
  mov    %esi,%r12d
  sub    %r14d,%r12d
  movslq %r12d,%rax
  mov    0x20(%rsp,%rax,4),%r13d
  cmp    $0xffffffff,%r13d
  jne    L27
  mov    %ebp,0x20(%rsp,%rax,4)
  movl   $0x1,0xfc0(%rsp,%r15,4)
  subl   $0x1,0xc(%rsp)
  jmp    L5
L129:
  cmpl   $0x0,0xc(%rsp)
  jle    L59
L50:
  lea    0xfc0(%rsp),%rax
  mov    $0x0,%ebp
L123:
  cmpl   $0x0,(%rax)
  je     L102
  add    $0x1,%ebp
  add    $0x4,%rax
  cmp    %ebp,%r14d
  jne    L123
  mov    %r14d,%ebp
L102:
  movslq %ebp,%rbx
  imul   $0xfa0,%rbx,%rbx
  add    0x10(%rsp),%rbx
  mov    0x18(%rsp),%rax
  add    %rbx,%rax
  mov    %rax,(%rsp)
  movslq %ebp,%r15
  jmp    L86
L59:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  mov    %r14d,%r12d
  mov    $0x0,%ebx
  lea    D21(%rip),%rbp
L83:
  mov    0x20(%rsp,%rbx,4),%edx
  lea    (%r14,%rbx,1),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L83
L52:
  mov    0x1f68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L133
  add    $0x1f78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L65:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L52
L133:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D18
type_guessed: string
name: retrieve_data
arguments: data_tag: D21
type_guessed: string

tool: D18: W   M

tool: D21:  %d    %d


assistant: ```c
void stableMarriage(int prefer[2 * 1000][1000], int a) {
  int size = a;
  int wPartner[1000];
  for (int i = 0; i < 1000; i++)
    wPartner[i] = -1;
  int mFree[1000] = {0};
  int freeCount = a;
  while (freeCount > 0) {
    int m;
    for (m = 0; m < a; m++)
      if (mFree[m] == 0)
        break;
    for (int i = 0; i < a && mFree[m] == 0; i++) {
      int w = prefer[m][i];
      if (wPartner[w - a] == -1) {
        wPartner[w - a] = m;
        mFree[m] = 1;
        freeCount--;
      } else {
        int m1 = wPartner[w - a];
        if (wPrefersM1OverM(prefer, w, m, m1, a) == 0) {
          wPartner[w - a] = m;
          mFree[m] = 1;
          mFree[m1] = 0;
        }
      }
    }
  }
  printf("W   M\n");
  for (int i = 0; i < a; i++)
    printf(" %d    %d\n", i + a, wPartner[i]);
}
```