user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<minPathSum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbx
  sub    $0x38,%rsp
  mov    %edx,-0x4c(%rbp)
  mov    %rdi,-0x48(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x1(%rsi),%eax
  mov    %eax,-0x50(%rbp)
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L152
L12:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L12
L152:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L105
L77:
  lea    0x7(%rsp),%r8
  xor    %ebx,%ebx
  mov    %r8,%rax
  and    $0xfffffffffffffff8,%r8
  shr    $0x3,%rax
  mov    %r8,%r13
  mov    %rax,-0x58(%rbp)
  movslq -0x4c(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  lea    0x0(,%rax,4),%r15
  lea    0x4(,%rax,4),%r14d
  test   %r12d,%r12d
  js     L175
  nopl   0x0(%rax,%rax,1)
L82:
  mov    %r14d,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%r13,%rbx,8)
  add    $0x1,%rbx
  cmp    %ebx,%r12d
  jge    L82
  mov    -0x50(%rbp),%edx
  mov    %r13,%rax
  lea    0x0(%r13,%rdx,8),%rcx
  nopl   0x0(%rax)
L145:
  mov    (%rax),%rdx
  add    $0x8,%rax
  movl   $0x7fffffff,(%rdx,%r15,1)
  cmp    %rax,%rcx
  jne    L145
L175:
  movslq %r12d,%rax
  mov    0x0(%r13,%rax,8),%rcx
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  js     L10
  mov    -0x4c(%rbp),%ebx
  xor    %eax,%eax
  lea    0x1(%rbx),%esi
  cmp    $0x2,%ebx
  jbe    L52
  mov    %esi,%edx
  movdqa D3(%rip),%xmm0
  mov    %rcx,%rax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopw   0x0(%rax,%rax,1)
L13:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L13
  mov    %esi,%eax
  and    $0xfffffffc,%eax
  cmp    %eax,%esi
  je     L10
L52:
  movslq %eax,%rdx
  mov    -0x4c(%rbp),%ebx
  movl   $0x7fffffff,(%rcx,%rdx,4)
  lea    0x0(,%rdx,4),%rsi
  lea    0x1(%rax),%edx
  cmp    %edx,%ebx
  jl     L10
  add    $0x2,%eax
  movl   $0x7fffffff,0x4(%rcx,%rsi,1)
  cmp    %eax,%ebx
  jl     L10
  movl   $0x7fffffff,0x8(%rcx,%rsi,1)
L10:
  lea    -0x1(%r12),%eax
  mov    -0x60(%rbp),%rbx
  movslq %eax,%r12
  mov    0x0(%r13,%r12,8),%rdx
  movl   $0x0,(%rdx,%rbx,4)
  movl   $0x0,-0x4(%rcx,%r15,1)
  test   %eax,%eax
  js     L14
  mov    -0x4c(%rbp),%ebx
  sub    $0x1,%ebx
  js     L14
  movslq %ebx,%r14
  nopl   0x0(%rax,%rax,1)
L37:
  mov    0x0(%r13,%r12,8),%r10
  mov    -0x48(%rbp),%rax
  mov    0x8(%r13,%r12,8),%rbx
  mov    (%r10,%r15,1),%ecx
  mov    (%rax,%r12,8),%r11
  mov    %r14,%rax
  nopl   0x0(%rax)
L126:
  mov    (%rbx,%rax,4),%esi
  mov    (%r11,%rax,4),%edx
  lea    (%rdx,%rsi,1),%edi
  add    %ecx,%edx
  cmp    %esi,%ecx
  cmovl  %edx,%edi
  mov    %edi,(%r10,%rax,4)
  sub    $0x1,%rax
  mov    %edi,%ecx
  test   %eax,%eax
  jns    L126
  sub    $0x1,%r12
  test   %r12d,%r12d
  jns    L37
L14:
  mov    -0x58(%rbp),%rax
  mov    0x0(,%rax,8),%rax
  mov    (%rax),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L165
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L105:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L77
L165:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D3
data_type: byte[16]

tool: {"D3": [0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0x7f,0xff,0xff,0xff,0x7f]}

assistant: ```c
int minPathSum(int **grid, int m, int n) {
  int *p[m + 1];
  for (int i = 0; i < m + 1; i++)
    p[i] = (int *)malloc((n + 1) * sizeof(int));
  for (int i = 0; i < m + 1; i++)
    p[i][n] = 2147483647;
  for (int i = i; i < n + 1; i++)
    p[m][i] = 2147483647;
  p[m][n - 1] = p[m - 1][n] = 0;
  for (int i = m - 1; i >= 0; i--)
    for (int j = n - 1; j >= 0; j--) {
      p[i][j] = p[i][j + 1] < p[i + 1][j] ? p[i][j + 1] + grid[i][j] : p[i + 1][j] + grid[i][j];
    }
  return p[0][0];
}
```