user: Translate the below assembly code into C programming language:

```asm
<fz_saturation_rgb>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x5c(%rbp)
  mov    %r8d,-0x60(%rbp)
  mov    %r9d,-0x64(%rbp)
  mov    -0x64(%rbp),%edx
  mov    -0x60(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    -0x5c(%rbp),%edx
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x64(%rbp),%edx
  mov    -0x60(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    -0x5c(%rbp),%edx
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L67
  mov    -0x48(%rbp),%rax
  mov    -0x60(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    -0x60(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    -0x60(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L24
L67:
  mov    0x20(%rbp),%edx
  mov    0x18(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    0x10(%rbp),%edx
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    0x20(%rbp),%edx
  mov    0x18(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    0x10(%rbp),%edx
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0x18(%rbp),%eax
  shl    $0x10,%eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  sub    -0x20(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%eax
  cltd
  idiv   %esi
  mov    %eax,-0x10(%rbp)
  mov    -0x5c(%rbp),%eax
  imul   $0x4d,%eax,%edx
  mov    -0x60(%rbp),%eax
  imul   $0x97,%eax,%eax
  add    %eax,%edx
  mov    -0x64(%rbp),%eax
  imul   $0x1c,%eax,%eax
  add    %edx,%eax
  sub    $0xffffff80,%eax
  sar    $0x8,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x5c(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x60(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x64(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x34(%rbp),%eax
  or     -0x30(%rbp),%eax
  or     -0x2c(%rbp),%eax
  and    $0x100,%eax
  test   %eax,%eax
  je     L26
  mov    -0x2c(%rbp),%edx
  mov    -0x30(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    -0x34(%rbp),%edx
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x30(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    -0x34(%rbp),%edx
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  jns    L66
  mov    -0xc(%rbp),%eax
  shl    $0x10,%eax
  mov    %eax,%ecx
  mov    -0xc(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,%edi
  mov    %ecx,%eax
  cltd
  idiv   %edi
  mov    %eax,-0x28(%rbp)
  jmp    L11
L66:
  movl   $0x10000,-0x28(%rbp)
L11:
  cmpl   $0xff,-0x4(%rbp)
  jle    L16
  mov    $0xff,%eax
  sub    -0xc(%rbp),%eax
  shl    $0x10,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    %ecx,%eax
  cltd
  idiv   %esi
  mov    %eax,-0x24(%rbp)
  jmp    L15
L16:
  movl   $0x10000,-0x24(%rbp)
L15:
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%eax
  cmp    %eax,%edx
  cmovle %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x34(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x30(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    -0xc(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    $0x8000,%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x2c(%rbp)
L26:
  mov    -0x48(%rbp),%rax
  mov    -0x34(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    -0x30(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    -0x2c(%rbp),%edx
  mov    %edx,(%rax)
L24:
  pop    %rbp
  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;
}
```