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

```asm
<shrink>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x78(%rbp)
  movsd  %xmm0,-0x80(%rbp)
  mov    %esi,-0x84(%rbp)
  mov    %edx,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x6c(%rbp)
  movb   $0x41,-0x6e(%rbp)
  movb   $0x41,-0x6d(%rbp)
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movq   %xmm3,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movsd  D16(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movq   %xmm4,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movsd  D17(%rip),%xmm1
  movapd %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,-0x98(%rbp)
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm5,%xmm5
  cvtsi2sd %eax,%xmm5
  movq   %xmm5,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  addsd  -0x98(%rbp),%xmm0
  mov    D18(%rip),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  movq   %xmm0,%rax
  movsd  -0x90(%rbp),%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  cltq
  mov    %rax,-0x60(%rbp)
  mov    -0x84(%rbp),%edx
  mov    -0x84(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  cltq
  mov    %rax,-0x58(%rbp)
  mov    -0x88(%rbp),%edx
  mov    -0x88(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  cltq
  mov    %rax,-0x50(%rbp)
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movq   %xmm6,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%rbx
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movq   %xmm7,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%rax
  movq   %rbx,%xmm1
  movq   %rax,%xmm0
  mov    $0x2,%eax
  call   <alloc_array@plt>
  cltq
  mov    %rax,-0x48(%rbp)
  lea    -0x84(%rbp),%r9
  mov    -0x78(%rbp),%r8
  lea    -0x88(%rbp),%rcx
  lea    -0x84(%rbp),%rdx
  lea    -0x6d(%rbp),%rsi
  lea    -0x6e(%rbp),%rax
  lea    -0x6c(%rbp),%rdi
  push   %rdi
  lea    -0x68(%rbp),%rdi
  push   %rdi
  push   -0x60(%rbp)
  lea    -0x88(%rbp),%rdi
  push   %rdi
  push   -0x50(%rbp)
  lea    -0x84(%rbp),%rdi
  push   %rdi
  push   -0x58(%rbp)
  push   -0x48(%rbp)
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <dgesvd_@plt>
  add    $0x40,%rsp
  movl   $0x0,-0x64(%rbp)
  jmp    L21
L20:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x80(%rbp),%xmm0
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  movapd %xmm0,%xmm1
  mov    D2(%rip),%rax
  movq   %rax,%xmm0
  call   <fmax@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0x64(%rbp)
L21:
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x64(%rbp),%xmm3
  movsd  %xmm3,-0x90(%rbp)
  mov    -0x88(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x84(%rbp),%eax
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movq   %xmm4,%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm5
  comisd -0x90(%rbp),%xmm5
  ja     L20
  mov    -0x88(%rbp),%edx
  mov    -0x84(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <alloc_array_z@plt>
  cltq
  mov    %rax,-0x40(%rbp)
  mov    -0x84(%rbp),%r13d
  mov    -0x84(%rbp),%r15d
  mov    -0x84(%rbp),%r12d
  mov    -0x88(%rbp),%ebx
  mov    -0x84(%rbp),%r14d
  mov    -0x88(%rbp),%eax
  mov    %eax,-0x90(%rbp)
  mov    -0x84(%rbp),%edx
  mov    -0x88(%rbp),%ecx
  mov    -0x48(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <diag@plt>
  mov    %eax,%ecx
  mov    -0x88(%rbp),%edx
  mov    -0x88(%rbp),%esi
  mov    -0x50(%rbp),%rax
  push   $0x6e
  push   %r14
  mov    -0x90(%rbp),%r9d
  mov    %ecx,%r8d
  mov    $0x6e,%ecx
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mm@plt>
  add    $0x10,%rsp
  mov    -0x58(%rbp),%rdx
  push   $0x6e
  push   %r13
  mov    %r15d,%r9d
  mov    %rdx,%r8
  mov    $0x6e,%ecx
  mov    %r12d,%edx
  mov    %ebx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <mm@plt>
  add    $0x10,%rsp
  cltq
  mov    %rax,-0x40(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    -0x40(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: label: D16
datatype: f32[2]
name: retrieve_data
arguments: label: D17
datatype: f32[2]
name: retrieve_data
arguments: label: D18
datatype: f32[2]
name: retrieve_data
arguments: label: D2
datatype: f32[2]

tool: {"D16": [0.0,2.3125]}

tool: {"D17": [0.0,2.125]}

tool: {"D18": [0.0,1.875]}

tool: {"D2": [0.0,0.0]}

assistant: ```c
double *shrink(double *A, double tau, int nrows, int ncols) {
  int i;
  int info = 0;
  char JOBU = 'A';
  char JOBVT = 'A';
  int LWORK = fmax(fmax(1, 3 * fmin(nrows, ncols) + fmax(nrows, ncols)), 5 * fmin(nrows, ncols));
  double *WORK = alloc_array(1, LWORK);
  double *U = alloc_array(nrows, nrows);
  double *VT = alloc_array(ncols, ncols);
  double *S = alloc_array(fmin(nrows, ncols), fmin(nrows, ncols));
  dgesvd_(&JOBU, &JOBVT, &nrows, &ncols, A, &nrows, S, U, &nrows, VT, &ncols, WORK, &LWORK, &info);
  for (i = 0; i < fmin(nrows, ncols); i++) {
    S[i] = fmax(0.0, S[i] - tau);
  }
  double *C = alloc_array_z(nrows, ncols);
  C = mm(mm(VT, ncols, ncols, 'n', diag(S, ncols, nrows), ncols, nrows, 'n'), ncols, nrows, 'n', U, nrows, nrows, 'n');
  free_array(WORK);
  free_array(U);
  free_array(VT);
  free_array(S);
  return C;
}
```