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

```asm
<reduce8>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %edi,-0x94(%rbp)
  mov    %esi,-0x98(%rbp)
  mov    %edx,-0x9c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x8,-0x7c(%rbp)
  movl   $0x0,-0x88(%rbp)
  movl   $0xffffffff,-0x84(%rbp)
  movl   $0x1,-0x78(%rbp)
  movl   $0x0,-0x70(%rbp)
  movl   $0x0,-0x6c(%rbp)
  movl   $0x0,-0x68(%rbp)
  movl   $0xd0,-0x64(%rbp)
  movl   $0x10,-0x60(%rbp)
  movl   $0x10,-0x5c(%rbp)
  movl   $0x10,-0x58(%rbp)
  movl   $0xe0,-0x54(%rbp)
  movl   $0x10,-0x50(%rbp)
  movl   $0xf7,-0x4c(%rbp)
  movl   $0xf5,-0x48(%rbp)
  movl   $0x3a,-0x44(%rbp)
  movl   $0x10,-0x40(%rbp)
  movl   $0x10,-0x3c(%rbp)
  movl   $0xf0,-0x38(%rbp)
  movl   $0xfb,-0x34(%rbp)
  movl   $0x3d,-0x30(%rbp)
  movl   $0xf8,-0x2c(%rbp)
  movl   $0x10,-0x28(%rbp)
  movl   $0xf0,-0x24(%rbp)
  movl   $0xf0,-0x20(%rbp)
  movl   $0xf0,-0x1c(%rbp)
  movl   $0xf0,-0x18(%rbp)
  movl   $0xf0,-0x14(%rbp)
  mov    -0x94(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  mov    %eax,-0x94(%rbp)
  mov    -0x94(%rbp),%eax
  imul   -0x78(%rbp),%eax
  mov    %eax,-0x94(%rbp)
  mov    -0x98(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  mov    %eax,-0x98(%rbp)
  mov    -0x98(%rbp),%eax
  imul   -0x78(%rbp),%eax
  mov    %eax,-0x98(%rbp)
  mov    -0x9c(%rbp),%eax
  cltd
  idivl  -0x78(%rbp)
  mov    %eax,-0x9c(%rbp)
  mov    -0x9c(%rbp),%eax
  imul   -0x78(%rbp),%eax
  mov    %eax,-0x9c(%rbp)
  cmpl   $0x1d,-0x94(%rbp)
  jg     L62
  cmpl   $0x1d,-0x98(%rbp)
  jg     L62
  cmpl   $0x1d,-0x9c(%rbp)
  jg     L62
  mov    $0x0,%eax
  jmp    L99
L62:
  cmpl   $0xc8,-0x94(%rbp)
  jle    L8
  cmpl   $0xc8,-0x98(%rbp)
  jle    L8
  cmpl   $0xc8,-0x9c(%rbp)
  jle    L8
  mov    $0x7,%eax
  jmp    L99
L8:
  movl   $0xffffffff,-0x84(%rbp)
  movl   $0x0,-0x80(%rbp)
  jmp    L17
L50:
  mov    -0x80(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x70,%rax
  mov    (%rax),%eax
  sub    -0x94(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  imul   -0x94(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x80(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x6c,%rax
  mov    (%rax),%eax
  sub    -0x98(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  imul   -0x98(%rbp),%eax
  add    %eax,%ecx
  mov    -0x80(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x68,%rax
  mov    (%rax),%eax
  sub    -0x9c(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  imul   -0x9c(%rbp),%eax
  add    %ecx,%eax
  mov    %eax,-0x74(%rbp)
  cmpl   $0xffffffff,-0x84(%rbp)
  je     L94
  mov    -0x74(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jge    L57
L94:
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x84(%rbp)
  mov    -0x80(%rbp),%eax
  mov    %eax,-0x88(%rbp)
L57:
  addl   $0x1,-0x80(%rbp)
L17:
  mov    -0x80(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jl     L50
  mov    -0x88(%rbp),%eax
L99:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  leave
  ret
```

assistant: ```c
int reduce8(int r, int g, int b) {
  int colors_len = 8;
  int select = 0;
  int odistance = -1;
  int i, k = 1;
  int colors[][3] = {
      {0x00, 0x00, 0x00}, {0xd0, 0x10, 0x10}, {0x10, 0xe0, 0x10}, {0xf7, 0xf5, 0x3a}, {0x10, 0x10, 0xf0}, {0xfb, 0x3d, 0xf8}, {0x10, 0xf0, 0xf0}, {0xf0, 0xf0, 0xf0},
  };
  r /= k;
  r *= k;
  g /= k;
  g *= k;
  b /= k;
  b *= k;
  if (r < 30 && g < 30 && b < 30)
    return 0;
  if (r > 200 && g > 200 && b > 200)
    return 7;
  odistance = -1;
  for (i = 0; i < colors_len; i++) {
    int distance = (((((colors[i][0] - r)) < 0) ? -((colors[i][0] - r)) : ((colors[i][0] - r))) * (r)) + (((((colors[i][1] - g)) < 0) ? -((colors[i][1] - g)) : ((colors[i][1] - g))) * (g)) + (((((colors[i][2] - b)) < 0) ? -((colors[i][2] - b)) : ((colors[i][2] - b))) * (b));
    if (odistance == -1 || distance < odistance) {
      odistance = distance;
      select = i;
    }
  }
  return select;
}
```