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

```asm
<RLE_Compress>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x450,%rsp
  mov    %rdi,-0x438(%rbp)
  mov    %rsi,-0x440(%rbp)
  mov    %edx,-0x444(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x444(%rbp)
  jne    L142
  mov    $0x0,%eax
  jmp    L146
L142:
  movl   $0x0,-0x414(%rbp)
  jmp    L202
L81:
  mov    -0x414(%rbp),%eax
  movl   $0x0,-0x410(%rbp,%rax,4)
  addl   $0x1,-0x414(%rbp)
L202:
  cmpl   $0xff,-0x414(%rbp)
  jbe    L81
  movl   $0x0,-0x414(%rbp)
  jmp    L17
L22:
  mov    -0x414(%rbp),%edx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  movslq %eax,%rdx
  mov    -0x410(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x410(%rbp,%rax,4)
  addl   $0x1,-0x414(%rbp)
L17:
  mov    -0x414(%rbp),%eax
  cmp    -0x444(%rbp),%eax
  jb     L22
  movb   $0x0,-0x421(%rbp)
  movl   $0x1,-0x414(%rbp)
  jmp    L220
L200:
  mov    -0x414(%rbp),%eax
  mov    -0x410(%rbp,%rax,4),%edx
  movzbl -0x421(%rbp),%eax
  cltq
  mov    -0x410(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jae    L55
  mov    -0x414(%rbp),%eax
  mov    %al,-0x421(%rbp)
L55:
  addl   $0x1,-0x414(%rbp)
L220:
  cmpl   $0xff,-0x414(%rbp)
  jbe    L200
  mov    -0x440(%rbp),%rax
  movzbl -0x421(%rbp),%edx
  mov    %dl,(%rax)
  movl   $0x1,-0x420(%rbp)
  mov    -0x438(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x423(%rbp)
  movl   $0x1,-0x41c(%rbp)
  movl   $0x1,-0x418(%rbp)
  cmpl   $0x1,-0x444(%rbp)
  jbe    L39
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  mov    %eax,%edx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x422(%rbp)
  movl   $0x2,-0x418(%rbp)
L121:
  movzbl -0x423(%rbp),%eax
  cmp    -0x422(%rbp),%al
  jne    L133
  jmp    L245
L189:
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  mov    %eax,%edx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x422(%rbp)
  addl   $0x1,-0x418(%rbp)
L245:
  mov    -0x41c(%rbp),%eax
  cmp    -0x444(%rbp),%eax
  jae    L18
  movzbl -0x423(%rbp),%eax
  cmp    -0x422(%rbp),%al
  jne    L18
  cmpl   $0x7fff,-0x418(%rbp)
  jbe    L189
L18:
  movzbl -0x423(%rbp),%eax
  cmp    -0x422(%rbp),%al
  jne    L244
  movzbl -0x423(%rbp),%ecx
  movzbl -0x421(%rbp),%edx
  mov    -0x418(%rbp),%edi
  lea    -0x420(%rbp),%rsi
  mov    -0x440(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <_RLE_WriteRep@plt>
  mov    -0x41c(%rbp),%eax
  cmp    -0x444(%rbp),%eax
  jae    L94
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  mov    %eax,%edx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x423(%rbp)
  movl   $0x1,-0x418(%rbp)
  jmp    L28
L94:
  movl   $0x0,-0x418(%rbp)
  jmp    L28
L244:
  mov    -0x418(%rbp),%eax
  lea    -0x1(%rax),%edi
  movzbl -0x423(%rbp),%ecx
  movzbl -0x421(%rbp),%edx
  lea    -0x420(%rbp),%rsi
  mov    -0x440(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <_RLE_WriteRep@plt>
  movzbl -0x422(%rbp),%eax
  mov    %al,-0x423(%rbp)
  movl   $0x1,-0x418(%rbp)
  jmp    L28
L133:
  movzbl -0x423(%rbp),%ecx
  movzbl -0x421(%rbp),%edx
  lea    -0x420(%rbp),%rsi
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <_RLE_WriteNonRep@plt>
  movzbl -0x422(%rbp),%eax
  mov    %al,-0x423(%rbp)
  movl   $0x1,-0x418(%rbp)
L28:
  mov    -0x41c(%rbp),%eax
  cmp    -0x444(%rbp),%eax
  jae    L218
  mov    -0x41c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x41c(%rbp)
  mov    %eax,%edx
  mov    -0x438(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x422(%rbp)
  movl   $0x2,-0x418(%rbp)
L218:
  mov    -0x41c(%rbp),%eax
  cmp    -0x444(%rbp),%eax
  jb     L121
  cmpl   $0x1,-0x418(%rbp)
  ja     L121
L39:
  cmpl   $0x1,-0x418(%rbp)
  jne    L35
  movzbl -0x423(%rbp),%ecx
  movzbl -0x421(%rbp),%edx
  lea    -0x420(%rbp),%rsi
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <_RLE_WriteNonRep@plt>
L35:
  mov    -0x420(%rbp),%eax
L146:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  leave
  ret
```

assistant: ```c
int RLE_Compress(unsigned char *in, unsigned char *out, unsigned int insize) {
  unsigned char byte1, byte2, marker;
  unsigned int inpos, outpos, count, i, histogram[256];
  if (insize < 1) {
    return 0;
  }
  for (i = 0; i < 256; ++i) {
    histogram[i] = 0;
  }
  for (i = 0; i < insize; ++i) {
    ++histogram[in[i]];
  }
  marker = 0;
  for (i = 1; i < 256; ++i) {
    if (histogram[i] < histogram[marker]) {
      marker = i;
    }
  }
  out[0] = marker;
  outpos = 1;
  byte1 = in[0];
  inpos = 1;
  count = 1;
  if (insize >= 2) {
    byte2 = in[inpos++];
    count = 2;
    do {
      if (byte1 == byte2) {
        while ((inpos < insize) && (byte1 == byte2) && (count < 32768)) {
          byte2 = in[inpos++];
          ++count;
        }
        if (byte1 == byte2) {
          _RLE_WriteRep(out, &outpos, marker, byte1, count);
          if (inpos < insize) {
            byte1 = in[inpos++];
            count = 1;
          } else {
            count = 0;
          }
        } else {
          _RLE_WriteRep(out, &outpos, marker, byte1, count - 1);
          byte1 = byte2;
          count = 1;
        }
      } else {
        _RLE_WriteNonRep(out, &outpos, marker, byte1);
        byte1 = byte2;
        count = 1;
      }
      if (inpos < insize) {
        byte2 = in[inpos++];
        count = 2;
      }
    } while ((inpos < insize) || (count >= 2));
  }
  if (count == 1) {
    _RLE_WriteNonRep(out, &outpos, marker, byte1);
  }
  return outpos;
}
```