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

```asm
<rob3>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0x10(%rsp)
  test   %esi,%esi
  jle    L106
  movslq %esi,%rax
  mov    %rdi,%rbx
  lea    0x0(,%rsi,8),%edi
  mov    %esi,%r15d
  mov    %rax,0x18(%rsp)
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %r15d,%eax
  mov    %rax,(%rsp)
  mov    %r12,%rbp
  lea    -0x1(%rax),%r15d
  lea    (%r12,%rax,8),%r13
  lea    0x0(,%rax,4),%r14d
  nopw   0x0(%rax,%rax,1)
L108:
  mov    %r14d,%edi
  add    $0x8,%rbp
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmp    %r13,%rbp
  jne    L108
  mov    (%rsp),%rbp
  xor    %eax,%eax
  shl    $0x2,%rbp
  nop
L142:
  mov    (%rbx,%rax,1),%ecx
  mov    (%r12,%rax,2),%rdx
  mov    %ecx,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rbp,%rax
  jne    L142
  mov    0x10(%rsp),%eax
  cmp    $0x1,%eax
  je     L117
  add    $0x1,%eax
  movl   $0x2,(%rsp)
  mov    %eax,0x14(%rsp)
  movq   $0x4,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L39:
  mov    (%rsp),%edi
  cmp    %edi,0x10(%rsp)
  js     L8
  mov    (%rsp),%eax
  mov    0x8(%rsp),%r11
  xor    %r14d,%r14d
  xor    %r8d,%r8d
  lea    -0x1(%rax),%r9d
  lea    -0x2(%rax),%r10d
  nopl   0x0(%rax,%rax,1)
L86:
  mov    D8(%rip),%rax
  mov    (%r12,%r14,8),%rbp
  add    $0x1,%r8d
  mov    (%rax),%ecx
  lea    0x0(%rbp,%r11,1),%rdi
  mov    %ecx,(%rdi)
  cmp    %r14d,%r9d
  jl     L157
  mov    %r14,%rax
  jmp    L23
  nopw   0x0(%rax,%rax,1)
L45:
  mov    -0x8(%rbp,%rax,4),%esi
  cmp    %r10d,%eax
  jl     L143
  add    %esi,%edx
L19:
  cmp    %ecx,%edx
  jle    L35
  mov    %edx,(%rdi)
L35:
  add    $0x1,%rax
  cmp    %eax,%r9d
  jl     L157
  mov    (%rdi),%ecx
L23:
  mov    (%rbx,%rax,4),%edx
  cmp    %r8d,%eax
  jg     L45
  cmp    %eax,%r10d
  jle    L19
  mov    0x10(%r12,%rax,8),%rsi
  add    (%rsi,%r11,1),%edx
  jmp    L19
  nopl   0x0(%rax)
L143:
  mov    0x10(%r12,%rax,8),%r13
  add    0x0(%r13,%r11,1),%esi
  add    %esi,%edx
  jmp    L19
  cs nopw 0x0(%rax,%rax,1)
L157:
  add    $0x1,%r14
  add    $0x4,%r11
  add    $0x1,%r9d
  add    $0x1,%r10d
  cmp    %r15d,%r8d
  jne    L86
L8:
  addl   $0x1,(%rsp)
  sub    $0x1,%r15d
  mov    (%rsp),%eax
  addq   $0x4,0x8(%rsp)
  cmp    0x14(%rsp),%eax
  jne    L39
L117:
  mov    (%r12),%rax
  mov    0x18(%rsp),%rbx
  mov    -0x4(%rax,%rbx,4),%eax
L106:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int rob3(int *nums, int numsSize) {
  if (numsSize <= 0)
    return 0;
  int **array = malloc(sizeof(int *) * numsSize);
  for (int i = 0; i < numsSize; i++)
    array[i] = malloc(sizeof(int) * numsSize);
  for (int i = 0; i < numsSize; i++)
    array[i][i] = nums[i];
  for (int length = 2; length <= numsSize; length++) {
    for (int i = 0; i < numsSize - length + 1; i++) {
      int j = i + length - 1;
      array[i][j] = INT_MIN;
      for (int k = i; k <= j; k++) {
        int tmp = nums[k];
        if (k >= 2 + i && k <= j - 2)
          tmp += array[i][k - 2] + array[k + 2][j];
        else if (k <= j - 2)
          tmp += array[k + 2][j];
        else if (k >= 2 + i)
          tmp += array[i][k - 2];
        if (array[i][j] < tmp)
          array[i][j] = tmp;
      }
    }
  }
  return array[0][numsSize - 1];
}
```