user: Translate the below assembly code into C programming language:

```asm
<minCostBST>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,-0x50(%rbp)
  movslq %edx,%rsi
  mov    %edx,-0x78(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsi,%rax
  imul   %rsi,%rax
  lea    0xf(,%rax,4),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffff000,%rdx
  sub    %rdx,%rcx
  and    $0xfffffffffffffff0,%rax
  cmp    %rcx,%rsp
  je     L124
L142:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L142
L124:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L22
L51:
  lea    0x0(,%rsi,4),%rax
  mov    -0x78(%rbp),%edx
  mov    -0x50(%rbp),%r8
  mov    %rsp,%r15
  shr    $0x2,%rax
  mov    %rax,%rdi
  mov    %rax,-0x58(%rbp)
  xor    %eax,%eax
  add    $0x1,%rdi
  test   %edx,%edx
  jle    L145
  nopw   0x0(%rax,%rax,1)
L144:
  movslq %eax,%rdx
  mov    (%r8,%rax,4),%ecx
  add    $0x1,%rax
  imul   %rdi,%rdx
  mov    %ecx,(%r15,%rdx,4)
  cmp    %rsi,%rax
  jne    L144
  cmpl   $0x1,-0x78(%rbp)
  jle    L145
  shl    $0x2,%rax
  movl   $0x2,-0x74(%rbp)
  mov    %rax,-0x80(%rbp)
  nopl   0x0(%rax)
L107:
  mov    -0x74(%rbp),%eax
  mov    %r15,-0x68(%rbp)
  xor    %edx,%edx
  lea    -0x1(%rax),%r12d
  mov    %r12d,%r14d
  nopl   0x0(%rax,%rax,1)
L137:
  mov    D2(%rip),%rsi
  movslq %edx,%rax
  movslq %r14d,%rdi
  mov    %edx,-0x44(%rbp)
  imul   -0x58(%rbp),%rax
  mov    %rdi,-0x60(%rbp)
  mov    (%rsi),%ecx
  mov    %edx,-0x48(%rbp)
  add    %rdi,%rax
  mov    %ecx,(%r15,%rax,4)
  lea    0x1(%rdx),%rax
  mov    %rax,-0x70(%rbp)
  cmp    %edx,%r14d
  jl     L53
  mov    %rax,%r13
  xor    %r12d,%r12d
  mov    %r15,%rax
  movslq -0x44(%rbp),%rbx
  mov    %r14d,%r15d
  imul   -0x58(%rbp),%rbx
  mov    %r12d,%r14d
  add    -0x60(%rbp),%rbx
  mov    %r13,%r12
  mov    %rax,%r13
  jmp    L157
  nopw   0x0(%rax,%rax,1)
L33:
  xor    %r14d,%r14d
  cmp    -0x48(%rbp),%r12d
  jle    L29
  mov    -0x68(%rbp),%rax
  mov    -0x4(%rax,%r12,4),%r14d
L29:
  add    $0x1,%r12
L157:
  lea    -0x1(%r12),%eax
  cmp    %eax,%r15d
  jle    L34
  movslq %r12d,%rax
  imul   -0x58(%rbp),%rax
  add    -0x60(%rbp),%rax
  add    0x0(%r13,%rax,4),%r14d
L34:
  mov    -0x44(%rbp),%esi
  mov    -0x50(%rbp),%rdi
  mov    %r15d,%edx
  call   <sum@plt>
  add    %r14d,%eax
  cmp    %eax,0x0(%r13,%rbx,4)
  jle    L128
  mov    %eax,0x0(%r13,%rbx,4)
L128:
  cmp    %r15d,%r12d
  jle    L33
  mov    %r15d,%r14d
  mov    %r13,%r15
L53:
  mov    -0x70(%rbp),%rdx
  mov    -0x78(%rbp),%eax
  add    $0x1,%r14d
  sub    -0x74(%rbp),%eax
  mov    -0x80(%rbp),%rsi
  lea    -0x1(%rdx),%ecx
  add    %rsi,-0x68(%rbp)
  cmp    %eax,%ecx
  jle    L137
  addl   $0x1,-0x74(%rbp)
  mov    -0x74(%rbp),%eax
  cmp    %eax,-0x78(%rbp)
  jge    L107
L145:
  mov    -0x78(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    (%r15,%rax,4),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L48
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L22:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L51
L48:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int minCostBST(int keys[], int freq[], int size) {
  int cost[size][size];
  for (int i = 0; i < size; i++)
    cost[i][i] = freq[i];
  for (int leng = 2; leng <= size; leng++) {
    for (int i = 0; i <= size - leng + 1; i++) {
      int j = i + leng - 1;
      cost[i][j] = INT_MAX;
      for (int r = i; r <= j; r++) {
        int c = ((r > i) ? cost[i][r - 1] : 0) + ((r < j) ? cost[r + 1][j] : 0) + sum(freq, i, j);
        if (c < cost[i][j])
          cost[i][j] = c;
      }
    }
  }
  return cost[0][size - 1];
}
```