user: What would the C source look like for the assembly code provided here?

```asm
<fz_saturation_rgb>:
  endbr64
  push   %r13
  cmp    %ecx,%r8d
  mov    %rsi,%r10
  mov    %rdx,%rsi
  push   %r12
  mov    %ecx,%edx
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  mov    0x28(%rsp),%r12d
  cmovle %r8d,%ebx
  mov    0x30(%rsp),%r11d
  mov    0x38(%rsp),%ebp
  cmp    %r9d,%ebx
  cmovg  %r9d,%ebx
  cmp    %ecx,%r8d
  cmovge %r8d,%edx
  cmp    %r9d,%edx
  cmovl  %r9d,%edx
  cmp    %edx,%ebx
  je     L39
  cmp    %r12d,%r11d
  mov    %r12d,%eax
  cmovge %r11d,%eax
  cmp    %ebp,%eax
  cmovl  %ebp,%eax
  cmp    %r12d,%r11d
  cmovg  %r12d,%r11d
  cmp    %ebp,%r11d
  cmovg  %ebp,%r11d
  sub    %ebx,%edx
  mov    %r8d,%ebx
  sub    %r11d,%eax
  mov    %edx,%r11d
  shl    $0x10,%eax
  cltd
  idiv   %r11d
  imul   $0x97,%r8d,%r11d
  imul   $0x4d,%ecx,%edx
  add    %r11d,%edx
  imul   $0x1c,%r9d,%r11d
  lea    0x80(%rdx,%r11,1),%r11d
  sar    $0x8,%r11d
  sub    %r11d,%ecx
  sub    %r11d,%ebx
  sub    %r11d,%r9d
  imul   %eax,%ecx
  imul   %eax,%ebx
  imul   %eax,%r9d
  add    $0x8000,%ecx
  sar    $0x10,%ecx
  add    $0x8000,%ebx
  lea    (%rcx,%r11,1),%ebp
  sar    $0x10,%ebx
  add    $0x8000,%r9d
  lea    (%rbx,%r11,1),%edx
  sar    $0x10,%r9d
  mov    %ebp,%eax
  lea    (%r9,%r11,1),%r8d
  or     %edx,%eax
  or     %r8d,%eax
  test   $0x1,%ah
  je     L1
  cmp    %edx,%ebp
  mov    %edx,%eax
  cmovle %ebp,%eax
  cmp    %r8d,%eax
  cmovg  %r8d,%eax
  cmp    %edx,%ebp
  cmovge %ebp,%edx
  mov    $0x10000,%ebp
  mov    %eax,%r12d
  cmp    %r8d,%edx
  cmovge %edx,%r8d
  test   %eax,%eax
  jns    L25
  mov    %r11d,%eax
  mov    %r11d,%r13d
  shl    $0x10,%eax
  sub    %r12d,%r13d
  cltd
  idiv   %r13d
  mov    %eax,%ebp
L25:
  mov    $0x10000,%eax
  cmp    $0xff,%r8d
  jle    L28
  mov    $0xff,%eax
  sub    %r11d,%r8d
  sub    %r11d,%eax
  shl    $0x10,%eax
  cltd
  idiv   %r8d
L28:
  cmp    %eax,%ebp
  cmovle %ebp,%eax
  imul   %eax,%ecx
  imul   %eax,%ebx
  imul   %eax,%r9d
  add    $0x8000,%ecx
  add    $0x8000,%ebx
  sar    $0x10,%ecx
  add    $0x8000,%r9d
  sar    $0x10,%ebx
  lea    (%rcx,%r11,1),%ebp
  sar    $0x10,%r9d
  lea    (%rbx,%r11,1),%edx
  lea    (%r9,%r11,1),%r8d
L1:
  mov    %ebp,(%rdi)
  pop    %rbx
  mov    %edx,(%r10)
  pop    %rbp
  mov    %r8d,(%rsi)
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L39:
  mov    %r8d,%ebp
  mov    %r8d,%edx
  pop    %rbx
  mov    %ebp,(%rdi)
  pop    %rbp
  mov    %edx,(%r10)
  pop    %r12
  mov    %r8d,(%rsi)
  pop    %r13
  ret
```

assistant: ```c
void fz_saturation_rgb(int *rd, int *gd, int *bd, int rb, int gb, int bb, int rs, int gs, int bs) {
  int minb, maxb;
  int mins, maxs;
  int y;
  int scale;
  int r, g, b;
  minb = ((rb) < (((gb) < (bb) ? (gb) : (bb))) ? (rb) : (((gb) < (bb) ? (gb) : (bb))));
  maxb = ((rb) > (((gb) > (bb) ? (gb) : (bb))) ? (rb) : (((gb) > (bb) ? (gb) : (bb))));
  if (minb == maxb) {
    *rd = gb;
    *gd = gb;
    *bd = gb;
    return;
  }
  mins = ((rs) < (((gs) < (bs) ? (gs) : (bs))) ? (rs) : (((gs) < (bs) ? (gs) : (bs))));
  maxs = ((rs) > (((gs) > (bs) ? (gs) : (bs))) ? (rs) : (((gs) > (bs) ? (gs) : (bs))));
  scale = ((maxs - mins) << 16) / (maxb - minb);
  y = (rb * 77 + gb * 151 + bb * 28 + 0x80) >> 8;
  r = y + ((((rb - y) * scale) + 0x8000) >> 16);
  g = y + ((((gb - y) * scale) + 0x8000) >> 16);
  b = y + ((((bb - y) * scale) + 0x8000) >> 16);
  if ((r | g | b) & 0x100) {
    int scalemin, scalemax;
    int min, max;
    min = ((r) < (((g) < (b) ? (g) : (b))) ? (r) : (((g) < (b) ? (g) : (b))));
    max = ((r) > (((g) > (b) ? (g) : (b))) ? (r) : (((g) > (b) ? (g) : (b))));
    if (min < 0)
      scalemin = (y << 16) / (y - min);
    else
      scalemin = 0x10000;
    if (max > 255)
      scalemax = ((255 - y) << 16) / (max - y);
    else
      scalemax = 0x10000;
    scale = ((scalemin) < (scalemax) ? (scalemin) : (scalemax));
    r = y + (((r - y) * scale + 0x8000) >> 16);
    g = y + (((g - y) * scale + 0x8000) >> 16);
    b = y + (((b - y) * scale + 0x8000) >> 16);
  }
  *rd = r;
  *gd = g;
  *bd = b;
}
```