user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dedisperse_blocked_cached>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %edx,-0xa4(%rbp)
  mov    %ecx,-0xa8(%rbp)
  movl   $0x80,-0x58(%rbp)
  movl   $0x400,-0x54(%rbp)
  mov    -0xa8(%rbp),%eax
  cltd
  idivl  -0x54(%rbp)
  mov    %eax,-0x50(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <get_npass@plt>
  mov    %eax,-0x4c(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <get_npass@plt>
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  sub    -0x4c(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0xa4(%rbp),%eax
  cltd
  idivl  -0x58(%rbp)
  mov    %eax,-0x40(%rbp)
  mov    -0xa4(%rbp),%eax
  cltd
  idivl  -0x58(%rbp)
  mov    %eax,-0x3c(%rbp)
  mov    -0xa4(%rbp),%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %eax,-0x38(%rbp)
  mov    -0x54(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <matrix@plt>
  cltq
  mov    %rax,-0x28(%rbp)
  mov    -0x54(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %eax,%edx
  mov    -0x58(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <matrix@plt>
  cltq
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x90(%rbp)
  jmp    L240
L253:
  movl   $0x0,-0x8c(%rbp)
  jmp    L197
L172:
  mov    -0x8c(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x8c(%rbp),%eax
  add    $0x1,%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x88(%rbp)
  mov    -0x88(%rbp),%eax
  cmp    -0xa8(%rbp),%eax
  jle    L239
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x88(%rbp)
  movl   $0x0,-0x84(%rbp)
  jmp    L252
L121:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  addl   $0x1,-0x84(%rbp)
L252:
  mov    -0x84(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L121
L239:
  movl   $0x0,-0x80(%rbp)
  jmp    L164
L16:
  mov    -0x88(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%eax
  imul   -0x58(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x80(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x98(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rcx
  mov    -0x80(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x80(%rbp)
L164:
  mov    -0x80(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L16
  mov    -0x54(%rbp),%edx
  mov    -0x58(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x58(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dedisperse@plt>
  movl   $0x0,-0x7c(%rbp)
  jmp    L86
L203:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    -0x90(%rbp),%ecx
  mov    %ecx,%esi
  imul   -0x58(%rbp),%esi
  mov    -0x7c(%rbp),%ecx
  add    %esi,%ecx
  movslq %ecx,%rcx
  lea    0x0(,%rcx,8),%rsi
  mov    -0xa0(%rbp),%rcx
  add    %rsi,%rcx
  mov    (%rcx),%rsi
  mov    -0x2c(%rbp),%ecx
  movslq %ecx,%rcx
  shl    $0x2,%rcx
  add    %rsi,%rcx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x7c(%rbp)
L86:
  mov    -0x7c(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L203
  addl   $0x1,-0x8c(%rbp)
L197:
  mov    -0x8c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L172
  addl   $0x1,-0x90(%rbp)
L240:
  mov    -0x90(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L253
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xa4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x78(%rbp)
  jmp    L186
L225:
  movl   $0x0,-0x74(%rbp)
  jmp    L161
L87:
  mov    -0x78(%rbp),%eax
  imul   -0x58(%rbp),%eax
  mov    %eax,%edx
  mov    -0x74(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x78(%rbp),%eax
  imul   -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x74(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x78(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  add    %rsi,%rdx
  mov    %rdx,(%rax)
  addl   $0x1,-0x74(%rbp)
L161:
  mov    -0x74(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L87
  addl   $0x1,-0x78(%rbp)
L186:
  mov    -0x78(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L225
  mov    -0x58(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  cltd
  idivl  -0x40(%rbp)
  mov    %eax,-0x54(%rbp)
  mov    -0xa8(%rbp),%eax
  cltd
  idivl  -0x54(%rbp)
  mov    %eax,-0x50(%rbp)
  mov    -0x54(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %eax,%edx
  mov    -0x40(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <matrix@plt>
  cltq
  mov    %rax,-0x10(%rbp)
  mov    -0x54(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %eax,%edx
  mov    -0x40(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <matrix@plt>
  cltq
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x70(%rbp)
  jmp    L12
L98:
  movl   $0x0,-0x6c(%rbp)
  jmp    L110
L18:
  mov    -0x6c(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  cmp    -0xa8(%rbp),%eax
  jle    L166
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x68(%rbp)
  movl   $0x0,-0x64(%rbp)
  jmp    L15
L48:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  addl   $0x1,-0x64(%rbp)
L15:
  mov    -0x64(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L48
L166:
  movl   $0x0,-0x60(%rbp)
  jmp    L43
L133:
  mov    -0x68(%rbp),%eax
  sub    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x70(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x60(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rcx
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x10(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x60(%rbp)
L43:
  mov    -0x60(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L133
  mov    -0x54(%rbp),%edx
  mov    -0x40(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x8(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dedisperse@plt>
  movl   $0x0,-0x5c(%rbp)
  jmp    L76
L175:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    -0x70(%rbp),%ecx
  mov    %ecx,%esi
  imul   -0x40(%rbp),%esi
  mov    -0x5c(%rbp),%ecx
  add    %esi,%ecx
  movslq %ecx,%rcx
  lea    0x0(,%rcx,8),%rsi
  mov    -0x98(%rbp),%rcx
  add    %rsi,%rcx
  mov    (%rcx),%rsi
  mov    -0x30(%rbp),%ecx
  movslq %ecx,%rcx
  shl    $0x2,%rcx
  add    %rsi,%rcx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x5c(%rbp)
L76:
  mov    -0x5c(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L175
  addl   $0x1,-0x6c(%rbp)
L110:
  mov    -0x6c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L18
  addl   $0x1,-0x70(%rbp)
L12:
  mov    -0x70(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L98
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void dedisperse_blocked_cached(float **dat, float **dat2, int nchan, int ndat) {
  int nchan1 = 128;
  int chunk_size = 1024;
  int nchunk = ndat / chunk_size;
  int npass1 = get_npass(nchan1);
  int npass = get_npass(nchan);
  int npass2 = npass - npass1;
  int nchan2 = nchan / nchan1;
  int nblock = nchan / nchan1;
  int nblock2 = nchan / nchan2;
#pragma omp parallel
  {
    float **tmp1 = matrix(nchan1, chunk_size + nchan1);
    float **tmp2 = matrix(nchan1, chunk_size + nchan1);
#pragma omp for collapse(2) schedule(dynamic, 2)
    for (int i = 0; i < nblock; i++) {
      for (int j = 0; j < nchunk; j++) {
        int istart = j * chunk_size;
        int istop = (j + 1) * chunk_size + nchan1;
        if (istop > ndat) {
          istop = ndat;
          for (int k = 0; k < nchan1; k++)
            memset(tmp1[k] + chunk_size, 0, sizeof(float) * nchan1);
        }
        for (int k = 0; k < nchan1; k++)
          memcpy(tmp1[k], &(dat[i * nchan1 + k][istart]), (istop - istart) * sizeof(float));
        dedisperse(tmp1, tmp2, nchan1, chunk_size + nchan1);
        for (int k = 0; k < nchan1; k++)
          memcpy(&(dat2[i * nchan1 + k][istart]), tmp1[k], chunk_size * sizeof(float));
      }
    }
    free(tmp1[0]);
    free(tmp1);
    free(tmp2[0]);
    free(tmp2);
  }
  float **dat_shift = (float **)malloc(sizeof(float *) * nchan);
  for (int i = 0; i < nblock; i++)
    for (int j = 0; j < nchan1; j++)
      dat_shift[j * nblock + i] = dat2[i * nchan1 + j] + i * j;
  int nelem = nchan1 * chunk_size;
  chunk_size = nelem / nchan2;
  nchunk = ndat / chunk_size;
#pragma omp parallel
  {
    float **tmp1 = matrix(nchan2, chunk_size + nchan2);
    float **tmp2 = matrix(nchan2, chunk_size + nchan2);
#pragma omp for collapse(2) schedule(dynamic, 4)
    for (int i = 0; i < nblock2; i++) {
      for (int j = 0; j < nchunk; j++) {
        int istart = j * chunk_size;
        int istop = (j + 1) * chunk_size + nchan2;
        if (istop > ndat) {
          istop = ndat;
          for (int k = 0; k < nchan2; k++)
            memset(tmp1[k] + chunk_size, 0, sizeof(float) * nchan2);
        }
        for (int k = 0; k < nchan2; k++) {
          memcpy(tmp1[k], dat_shift[i * nchan2 + k] + istart, (istop - istart) * sizeof(float));
        }
        dedisperse(tmp1, tmp2, nchan2, chunk_size + nchan2);
        for (int k = 0; k < nchan2; k++)
          memcpy(dat[i * nchan2 + k] + istart, tmp2[k], chunk_size * sizeof(float));
      }
    }
    free(tmp1[0]);
    free(tmp1);
    free(tmp2[0]);
    free(tmp2);
  }
}
```