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

```asm
<triNumber>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jg     L90
  mov    $0x0,%eax
  jmp    L60
L90:
  cmpl   $0x1,-0x2c(%rbp)
  jne    L77
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  jmp    L60
L77:
  mov    $0x7d4,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    $0x7d4,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x20(%rbp)
  jmp    L49
L13:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  cltq
  imul   $0x7d4,%rax,%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x1c(%rbp)
  jmp    L66
L3:
  mov    -0x20(%rbp),%eax
  cltq
  imul   $0x7d4,%rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rsi
  mov    -0x18(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x10(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x1c(%rbp)
L66:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L3
  mov    -0x20(%rbp),%eax
  cltq
  imul   $0x7d4,%rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x10(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  addl   $0x1,-0x20(%rbp)
L49:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L13
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L40
L33:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jge    L54
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
L54:
  addl   $0x1,-0x1c(%rbp)
L40:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L33
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%eax
L60:
  leave
  ret
```

assistant: ```c
int triNumber(int value[][500 + 1], int level) {
  if (level <= 0)
    return 0;
  if (level == 1)
    return value[0][0];
  int *pre = (int *)malloc((500 + 1) * sizeof(int));
  int *cur = (int *)malloc((500 + 1) * sizeof(int));
  int *tmp, i, j;
  pre[0] = value[0][0];
  for (i = 1; i < level; i++) {
    cur[0] = pre[0] + value[i][0];
    for (j = 1; j < i; j++) {
      cur[j] = value[i][j] + (((pre[j - 1]) > (pre[j]) ? (pre[j - 1]) : (pre[j])));
    }
    cur[j] = value[i][j] + pre[j - 1];
    tmp = cur;
    cur = pre;
    pre = tmp;
  }
  i = 0;
  for (j = 0; j < level; j++) {
    if (pre[j] > i)
      i = pre[j];
  }
  free(pre);
  free(cur);
  return i;
}
```