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

```asm
<blocksum>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  mov    %r12,%rdi
  mov    %r8d,%ebp
  push   %rbx
  mov    %edx,%ebx
  imul   %ecx,%ebx
  sub    $0x28,%rsp
  lea    0x0(,%rbx,8),%edx
  mov    %r9,0x8(%rsp)
  call   <memset@plt>
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,0x10(%rsp)
  lea    (%r12,%rax,1),%rdi
  test   %r14d,%r14d
  jle    L246
  test   %ebp,%ebp
  jle    L148
  lea    -0x1(%rbp),%eax
  movslq %r13d,%r8
  mov    $0xfffffffffffffffc,%r9
  mov    %r12,%rcx
  shl    $0x2,%rax
  shl    $0x2,%r8
  xor    %esi,%esi
  lea    0x4(%r15,%rax,1),%rdx
  sub    %rax,%r9
  nopl   0x0(%rax,%rax,1)
L241:
  movss  (%rcx),%xmm0
  lea    (%r9,%rdx,1),%rax
  nopl   0x0(%rax,%rax,1)
L34:
  addss  (%rax),%xmm0
  add    $0x4,%rax
  movss  %xmm0,(%rcx)
  cmp    %rdx,%rax
  jne    L34
  add    $0x1,%esi
  add    %r8,%rcx
  add    %r8,%rdx
  cmp    %esi,%r14d
  jne    L241
L148:
  cmp    $0x1,%r13d
  jle    L246
  mov    %rdi,0x18(%rsp)
  movslq %r13d,%r11
  movslq %ebp,%rax
  mov    %r15,%rsi
  lea    (%r15,%rax,4),%r10
  shl    $0x2,%r11
  mov    %r12,%rcx
  mov    %ebp,%r15d
  xor    %r8d,%r8d
  lea    -0x1(%r13),%r9d
  nopl   0x0(%rax)
L269:
  movss  (%rcx),%xmm0
  xor    %eax,%eax
  lea    0x1(%r15),%edi
  nopw   0x0(%rax,%rax,1)
L27:
  lea    (%rdi,%rax,1),%edx
  movss  (%rsi,%rax,4),%xmm1
  cmp    %ebx,%edx
  jge    L113
  addss  (%r10,%rax,4),%xmm0
L113:
  subss  %xmm1,%xmm0
  movss  %xmm0,0x4(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L27
  add    $0x1,%r8d
  add    %r11,%rcx
  add    %r11,%r10
  add    %r11,%rsi
  add    %r13d,%r15d
  cmp    %r8d,%r14d
  jne    L269
  mov    0x18(%rsp),%rdi
L240:
  test   %ebp,%ebp
  jle    L63
  movslq %r13d,%rsi
  mov    %rdi,%rcx
  mov    %r12,%r8
  xor    %r9d,%r9d
  shl    $0x2,%rsi
  nopl   0x0(%rax,%rax,1)
L149:
  movss  (%rcx),%xmm0
  mov    %r8,%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L141:
  addss  (%rdx),%xmm0
  add    $0x1,%eax
  add    %rsi,%rdx
  movss  %xmm0,(%rcx)
  cmp    %eax,%ebp
  jne    L141
  add    $0x1,%r9d
  add    $0x4,%rcx
  add    $0x4,%r8
  cmp    %r9d,%r13d
  jne    L149
L63:
  cmp    $0x1,%r14d
  jle    L33
  lea    0x1(%rbp),%r10d
  movslq %r13d,%r8
  mov    %r13d,%r11d
  xor    %r15d,%r15d
  imul   %r13d,%r10d
  shl    $0x2,%r8
  imul   %r13d,%ebp
  lea    (%rdi,%r8,1),%r9
  sub    %r10d,%ebp
  nopl   (%rax)
L187:
  lea    0x0(,%r15,4),%rax
  mov    %r10d,%edx
  mov    $0x1,%ecx
  nopl   0x0(%rax,%rax,1)
L124:
  movss  (%rdi,%rax,1),%xmm0
  movss  (%r12,%rax,1),%xmm1
  cmp    %edx,%ebx
  jle    L163
  lea    0x0(%rbp,%rdx,1),%esi
  add    $0x1,%ecx
  add    %r13d,%edx
  movslq %esi,%rsi
  addss  (%r12,%rsi,4),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,(%r9,%rax,1)
  add    %r8,%rax
  cmp    %r14d,%ecx
  jne    L124
  add    $0x1,%r15
  add    $0x1,%r10d
  cmp    %r15,%r11
  jne    L187
L33:
  test   %ebx,%ebx
  jle    L247
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rcx
  lea    0x4(%r12,%rax,1),%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L179
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L179
  mov    %ebx,%edx
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L116:
  movups (%rdi,%rax,1),%xmm2
  movups %xmm2,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L116
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%bl
  je     L247
  mov    %eax,%ecx
  mov    0x8(%rsp),%rsi
  movss  (%rdi,%rcx,4),%xmm0
  lea    0x0(,%rcx,4),%rdx
  movss  %xmm0,(%rsi,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%ebx
  jle    L247
  movss  0x4(%rdi,%rdx,1),%xmm0
  add    $0x2,%eax
  movss  %xmm0,0x4(%rsi,%rdx,1)
  cmp    %eax,%ebx
  jle    L247
  movss  0x8(%rdi,%rdx,1),%xmm0
  movss  %xmm0,0x8(%rsi,%rdx,1)
L247:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L163:
  subss  %xmm1,%xmm0
  add    $0x1,%ecx
  add    %r13d,%edx
  movss  %xmm0,(%r9,%rax,1)
  add    %r8,%rax
  cmp    %ecx,%r14d
  jne    L124
  add    $0x1,%r15
  add    $0x1,%r10d
  cmp    %r15,%r11
  jne    L187
  jmp    L33
L246:
  test   %r13d,%r13d
  jle    L33
  jmp    L240
L179:
  mov    0x8(%rsp),%rdx
  mov    %ebx,%ebx
  xor    %eax,%eax
  nopl   0x0(%rax)
L178:
  movss  (%rdi,%rax,4),%xmm0
  movss  %xmm0,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L178
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void blocksum(float *A, float *workspace, int w, int h, int c, float *B) {
  int i, j;
  int y;
  int size;
  float *Q;
  float *N;
  size = w * h;
  memset(workspace, 0, 2 * size * sizeof(float));
  Q = workspace;
  N = workspace + size;
  for (j = 0; j < h; j++) {
    y = j * w;
    for (i = 0; i < c; i++) {
      Q[y] += A[y + i];
    }
  }
  for (j = 0; j < h; j++) {
    y = j * w;
    for (i = 1; i < w; i++) {
      if (y + i + c < size)
        Q[y + i] = Q[y + i - 1] + A[y + i + c - 1] - A[y + i - 1];
      else
        Q[y + i] = Q[y + i - 1] - A[y + i - 1];
    }
  }
  for (i = 0; i < w; i++) {
    for (j = 0; j < c; j++) {
      N[i] += Q[j * w + i];
    }
  }
  for (i = 0; i < w; i++) {
    for (j = 1; j < h; j++) {
      if ((j + c) * w + i < size)
        N[j * w + i] = N[(j - 1) * w + i] + Q[(j + c - 1) * w + i] - Q[(j - 1) * w + i];
      else
        N[j * w + i] = N[(j - 1) * w + i] - Q[(j - 1) * w + i];
    }
  }
  for (i = 0; i < size; i++) {
    B[i] = (float)N[i];
  }
  return;
}
```