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

```asm
<MATRIX_CHAIN_ORDER>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L59
L15:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  movl   $0x0,(%rdx,%rax,4)
  addl   $0x1,-0x1c(%rbp)
L59:
  mov    -0x1c(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L15
  movl   $0x2,-0x18(%rbp)
  jmp    L24
L85:
  movl   $0x1,-0x14(%rbp)
  jmp    L82
L17:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  movl   $0x3b9ac9ff,(%rdx,%rax,4)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L1
L83:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%ecx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,%ecx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  add    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  cmp    %eax,-0x4(%rbp)
  jge    L61
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rcx,%rax,4)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  cltq
  mov    -0x10(%rbp),%edx
  mov    %edx,(%rcx,%rax,4)
L61:
  addl   $0x1,-0x10(%rbp)
L1:
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L83
  addl   $0x1,-0x14(%rbp)
L82:
  mov    -0xc(%rbp),%eax
  sub    -0x18(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jle    L17
  addl   $0x1,-0x18(%rbp)
L24:
  mov    -0x18(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L85
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void MATRIX_CHAIN_ORDER(int m[][100], int s[][100], int p[], int p_array_size) {
  int n = p_array_size - 1;
  for (int i = 1; i <= n; i++)
    m[i][i] = 0;
  for (int l = 2; l <= n; l++) {
    for (int i = 1; i <= n - l + 1; i++) {
      int j = i + l - 1;
      m[i][j] = 999999999;
      for (int k = i; k <= j - 1; k++) {
        int q = m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j];
        if (q < m[i][j]) {
          m[i][j] = q;
          s[i][j] = k;
        }
      }
    }
  }
}
```