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

```asm
<rle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L90
L40:
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x10(%rbp)
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  jmp    L68
L18:
  addl   $0x1,-0x10(%rbp)
L68:
  mov    -0x10(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L133
  mov    -0x10(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    $0x7e,%eax
  jg     L133
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x15(%rbp)
  je     L18
L133:
  mov    -0x10(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    $0x1,%eax
  jne    L56
  jmp    L130
L125:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L45
  cmpl   $0x1,-0x10(%rbp)
  jle    L45
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L45
  subl   $0x2,-0x10(%rbp)
  jmp    L30
L45:
  addl   $0x1,-0x10(%rbp)
L130:
  mov    -0x10(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L30
  mov    -0x10(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    $0x7e,%eax
  jle    L125
L30:
  mov    -0x14(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  sub    %esi,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L83
L105:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rcx),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0xc(%rbp)
L83:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L105
  jmp    L47
L56:
  mov    -0x10(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  sub    %esi,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x15(%rbp),%edx
  mov    %dl,(%rax)
L47:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L90:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L40
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
int rle(unsigned char *output, const unsigned char *input, int len) {
  int count, index, i;
  unsigned char first;
  unsigned char *out;
  out = output;
  count = 0;
  while (count < len) {
    index = count;
    first = input[index++];
    while ((index < len) && (index - count < 127) && (input[index] == first))
      index++;
    if (index - count == 1) {
      while ((index < len) && (index - count < 127)) {
        if ((input[index] == input[index - 1]) && ((index > 1) && (input[index] == input[index - 2]))) {
          index -= 2;
          break;
        }
        index++;
      }
      *out++ = (unsigned char)(count - index);
      for (i = count; i < index; i++)
        *out++ = input[i];
    } else {
      *out++ = (unsigned char)(index - count);
      *out++ = first;
    }
    count = index;
  }
  *out++ = 0;
  return (out - output);
}
```