user: Converte this assembly snippet into its equivalent C code:

```asm
<shrink>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%rbx
  movsd  %xmm0,(%rsp)
  mov    %esi,0x1c(%rsp)
  mov    %edx,0x18(%rsp)
  mov    %fs:0x28,%rcx
  mov    %rcx,0x38(%rsp)
  xor    %ecx,%ecx
  movl   $0x0,0x30(%rsp)
  movb   $0x41,0x2e(%rsp)
  movb   $0x41,0x2f(%rsp)
  pxor   %xmm3,%xmm3
  cvtsi2sd %edx,%xmm3
  movq   %xmm3,%r13
  pxor   %xmm4,%xmm4
  cvtsi2sd %esi,%xmm4
  movq   %xmm4,%r12
  movapd %xmm3,%xmm1
  movapd %xmm4,%xmm0
  call   <fmin@plt>
  movq   %xmm0,%rbp
  movq   %r13,%xmm1
  movq   %r12,%xmm0
  call   <fmax@plt>
  movq   %rbp,%xmm1
  mulsd  D26(%rip),%xmm1
  addsd  %xmm0,%xmm1
  movsd  D28(%rip),%xmm0
  call   <fmax@plt>
  movq   %rbp,%xmm1
  mulsd  D29(%rip),%xmm1
  call   <fmax@plt>
  cvttsd2si %xmm0,%esi
  mov    %esi,0x34(%rsp)
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  movslq %eax,%rbp
  mov    %rbp,0x8(%rsp)
  mov    0x1c(%rsp),%edi
  mov    %edi,%esi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  movslq %eax,%r15
  mov    0x18(%rsp),%edi
  mov    %edi,%esi
  mov    $0x0,%eax
  call   <alloc_array@plt>
  movslq %eax,%r12
  mov    %r12,0x10(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x1c(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x18(%rsp),%xmm1
  call   <fmin@plt>
  movapd %xmm0,%xmm1
  mov    $0x2,%eax
  call   <alloc_array@plt>
  movslq %eax,%r14
  lea    0x1c(%rsp),%rdx
  lea    0x18(%rsp),%rcx
  lea    0x2f(%rsp),%rsi
  lea    0x2e(%rsp),%rdi
  lea    0x30(%rsp),%rax
  push   %rax
  lea    0x3c(%rsp),%rax
  push   %rax
  push   %rbp
  push   %rcx
  push   %r12
  push   %rdx
  push   %r15
  push   %r14
  mov    %rdx,%r9
  mov    %rbx,%r8
  mov    $0x0,%eax
  call   <dgesvd_@plt>
  mov    %r14,%rbx
  add    $0x40,%rsp
  mov    $0x0,%ebp
  jmp    L2
L0:
  movsd  (%rbx),%xmm1
  subsd  (%rsp),%xmm1
  pxor   %xmm0,%xmm0
  call   <fmax@plt>
  movsd  %xmm0,(%rbx)
  add    $0x1,%ebp
  add    $0x8,%rbx
L2:
  mov    0x18(%rsp),%r13d
  mov    0x1c(%rsp),%r12d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r13d,%xmm1
  call   <fmin@plt>
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  comisd %xmm0,%xmm1
  ja     L0
  mov    %r13d,%esi
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <alloc_array_z@plt>
  mov    0x1c(%rsp),%ebx
  mov    0x18(%rsp),%ebp
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <diag@plt>
  mov    %eax,%r8d
  mov    0x18(%rsp),%esi
  push   $0x6e
  push   %rbx
  mov    %ebp,%r9d
  mov    $0x6e,%ecx
  mov    %esi,%edx
  mov    0x20(%rsp),%r13
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <mm@plt>
  mov    %eax,%edi
  push   $0x6e
  push   %rbx
  mov    %ebx,%r9d
  mov    %r15,%r8
  mov    $0x6e,%ecx
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <mm@plt>
  mov    %eax,%ebx
  add    $0x20,%rsp
  mov    0x8(%rsp),%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <free_array@plt>
  movslq %ebx,%rax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D26
data_type: f32[2]
name: disassemble_data
arguments: tag: D28
data_type: f32[2]
name: disassemble_data
arguments: tag: D29
data_type: f32[2]

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

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

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

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;
}
```