user: What is the c source code of the assembly code below:

```asm
<dmat_as_ddmatrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rsi,0x20(%rsp)
  mov    %rdx,0x38(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    0x8(%rdi),%ebx
  mov    %ebx,0x18(%rsp)
  mov    0xc(%rdi),%eax
  mov    %eax,0x4(%rsp)
  mov    0x10(%rdi),%eax
  mov    %eax,0x28(%rsp)
  mov    0x14(%rdi),%r14d
  mov    0x4(%rdi),%r15d
  mov    %r15d,0x1c(%rsp)
  lea    0x44(%rsp),%rdx
  lea    0x40(%rsp),%rsi
  call   <dmat_ldimget@plt>
  cmpl   $0x0,0x40(%rsp)
  jle    L12
  cmpl   $0x0,0x44(%rsp)
  jle    L155
  lea    0x50(%rsp),%rcx
  lea    0x4c(%rsp),%rdx
  lea    0x48(%rsp),%rsi
  lea    0x54(%rsp),%r8
  mov    %r15d,%edi
  call   <Cblacs_gridinfo@plt>
  mov    0x50(%rsp),%eax
  or     0x54(%rsp),%eax
  mov    %eax,0x8(%rsp)
  test   %ebx,%ebx
  jle    L65
  mov    %ebx,0x2c(%rsp)
  imul   %r14d,%ebx
  mov    %ebx,0xc(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0x30(%rsp)
  movl   $0x0,0x34(%rsp)
  movl   $0x0,0x14(%rsp)
  jmp    L122
L136:
  movslq %r13d,%rax
  mov    0x20(%rsp),%rsi
  lea    (%rsi,%rax,8),%rcx
  sub    $0x8,%rsp
  push   %rbx
  mov    %r15d,%r9d
  mov    0x28(%rsp),%r8d
  mov    0x10(%rsp),%edx
  mov    0x20(%rsp),%esi
  mov    0x2c(%rsp),%edi
  call   <Cdgesd2d@plt>
  add    $0x10,%rsp
  jmp    L39
L114:
  add    %r14d,%r12d
  lea    0x1(%rbx),%eax
  cltd
  idivl  0x4c(%rsp)
  mov    %edx,%ebx
  sub    %r14d,%ebp
  add    0xc(%rsp),%r13d
  cmp    %r12d,0x4(%rsp)
  jle    L154
L147:
  cmp    %r14d,%ebp
  mov    %r14d,%eax
  cmovle %ebp,%eax
  mov    %eax,(%rsp)
  cmpl   $0x0,0x8(%rsp)
  je     L136
L39:
  cmp    %r15d,0x50(%rsp)
  jne    L114
  cmp    %ebx,0x54(%rsp)
  jne    L114
  mov    0x40(%rsp),%r8d
  mov    0x30(%rsp),%eax
  imul   %r8d,%eax
  add    0x34(%rsp),%eax
  cltq
  mov    0x38(%rsp),%rdi
  lea    (%rdi,%rax,8),%rcx
  sub    $0x8,%rsp
  push   $0x0
  mov    $0x0,%r9d
  mov    0x10(%rsp),%edx
  mov    0x20(%rsp),%esi
  mov    0x2c(%rsp),%edi
  call   <Cdgerv2d@plt>
  mov    0x10(%rsp),%eax
  add    0x40(%rsp),%eax
  cltd
  idivl  0x54(%rsp)
  mov    %edx,0x40(%rsp)
  add    $0x10,%rsp
  jmp    L114
L154:
  cmp    %r15d,0x50(%rsp)
  je     L6
L110:
  mov    0x28(%rsp),%ecx
  add    %ecx,0x14(%rsp)
  mov    0x14(%rsp),%edi
  lea    0x1(%r15),%eax
  cltd
  idivl  0x48(%rsp)
  mov    %edx,%r15d
  sub    %ecx,0x2c(%rsp)
  cmp    %edi,0x18(%rsp)
  jle    L34
L122:
  mov    0x2c(%rsp),%esi
  mov    0x28(%rsp),%eax
  cmp    %eax,%esi
  cmovle %esi,%eax
  mov    %eax,0x10(%rsp)
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L154
  mov    %eax,%ebp
  mov    0x14(%rsp),%r13d
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  jmp    L147
L6:
  mov    0x10(%rsp),%eax
  add    0x34(%rsp),%eax
  cltd
  idivl  0x40(%rsp)
  mov    %edx,0x34(%rsp)
  jmp    L110
L34:
  mov    $0x0,%eax
L159:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L189
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  mov    $0xffffffff,%eax
  jmp    L159
L155:
  mov    $0xffffffff,%eax
  jmp    L159
L65:
  mov    $0x0,%eax
  jmp    L159
L189:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int dmat_as_ddmatrix(int *desc, double *A_global, double *A_local) {
  const int M = desc[2], N = desc[3];
  const int Mb = desc[4], Nb = desc[5];
  int nrows, ncols;
  int row, col;
  int recvr = 0, recvc = 0;
  int ictxt = desc[1];
  int nprow, npcol;
  int myprow, mypcol;
  int rdest = 0, cdest = 0;
  int nr, nc;
  dmat_ldimget(desc, &nrows, &ncols);
  if (nrows < 1 || ncols < 1)
    return -1;
  Cblacs_gridinfo(ictxt, &nprow, &npcol, &myprow, &mypcol);
  const int owner = (myprow == 0 && mypcol == 0);
  for (row = 0; row < M; row += Mb, rdest = (rdest + 1) % nprow) {
    cdest = 0;
    nr = Mb;
    if (M - row < Mb)
      nr = M - row;
    for (col = 0; col < N; col += Nb, cdest = (cdest + 1) % npcol) {
      nc = Nb;
      if (N - col < Nb)
        nc = N - col;
      if (owner) {
        Cdgesd2d(ictxt, nr, nc, A_global + (row + M * col), M, rdest, cdest);
      }
      if (myprow == rdest && mypcol == cdest) {
        Cdgerv2d(ictxt, nr, nc, A_local + (recvr + nrows * recvc), nrows, 0, 0);
        recvc = (recvc + nc) % ncols;
      }
    }
    if (myprow == rdest)
      recvr = (recvr + nr) % nrows;
  }
  return 0;
}
```