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

```asm
<compute_row_thresholds>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  mov    %r8d,-0x30(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L117
L118:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  mov    %al,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  jbe    L83
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
L83:
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x8(%rbp)
  jae    L101
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  mov    %al,-0x8(%rbp)
L101:
  addq   $0x2,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x7(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  mov    %al,-0x6(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x7(%rbp)
  jbe    L94
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  mov    %al,-0x7(%rbp)
L94:
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x6(%rbp)
  jae    L107
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  mov    %al,-0x6(%rbp)
L107:
  addq   $0x2,-0x28(%rbp)
  movzbl -0x7(%rbp),%eax
  cmp    -0x9(%rbp),%al
  jae    L100
  movzbl -0x7(%rbp),%eax
  mov    %al,-0x9(%rbp)
L100:
  movzbl -0x6(%rbp),%eax
  cmp    -0x8(%rbp),%al
  jbe    L113
  movzbl -0x6(%rbp),%eax
  mov    %al,-0x8(%rbp)
L113:
  movzbl -0x9(%rbp),%edx
  movzbl -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %al,-0x5(%rbp)
  movzbl -0x8(%rbp),%eax
  movzbl -0x9(%rbp),%edx
  sub    %edx,%eax
  cmp    %eax,-0x30(%rbp)
  jle    L116
  cmpb   $0x7e,-0x5(%rbp)
  ja     L80
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0xff,(%rax)
  jmp    L63
L80:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x0,(%rax)
  jmp    L63
L116:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl -0x5(%rbp),%edx
  mov    %dl,(%rax)
L63:
  subl   $0x1,-0x4(%rbp)
L117:
  cmpl   $0x0,-0x4(%rbp)
  jg     L118
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void compute_row_thresholds(unsigned char *thresholds_dest, const unsigned char *min_max_a, const unsigned char *min_max_b, int count, int contrast_threshold) {
  int i;
  unsigned char min_a, max_a, min_b, max_b;
  unsigned char test_threshold;
  for (i = count; i > 0; --i) {
    min_a = min_max_a[0];
    max_a = min_max_a[1];
    if (min_max_a[2] < min_a)
      min_a = min_max_a[2];
    if (min_max_a[3] > max_a)
      max_a = min_max_a[3];
    min_max_a += 2;
    min_b = min_max_b[0];
    max_b = min_max_b[1];
    if (min_max_b[2] < min_b)
      min_b = min_max_b[2];
    if (min_max_b[3] > max_b)
      max_b = min_max_b[3];
    min_max_b += 2;
    if (min_b < min_a)
      min_a = min_b;
    if (max_b > max_a)
      max_a = max_b;
    test_threshold = (unsigned char)((min_a + max_a) / 2);
    if ((max_a - min_a) < contrast_threshold) {
      if (test_threshold < 127)
        *thresholds_dest++ = ((unsigned char)255);
      else
        *thresholds_dest++ = ((unsigned char)0);
    } else {
      *thresholds_dest++ = test_threshold;
    }
  }
}
```