user: What is the c source code of the assembly code below?

```asm
<RLE_Compress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %rsi,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  je     L163
  mov    %rdi,%r15
  mov    %edx,%r14d
  lea    0x20(%rsp),%rax
  lea    0x420(%rsp),%rdx
L32:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rax,%rdx
  jne    L32
  mov    %r15,%rax
  lea    -0x1(%r14),%edx
  lea    0x1(%r15,%rdx,1),%rcx
L176:
  movzbl (%rax),%edx
  addl   $0x1,0x20(%rsp,%rdx,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L176
  mov    $0x1,%eax
  mov    $0x0,%ebx
L67:
  movzbl %bl,%edx
  mov    0x20(%rsp,%rdx,4),%edi
  cmp    %edi,0x20(%rsp,%rax,4)
  cmovb  %eax,%ebx
  add    $0x1,%rax
  cmp    $0x100,%rax
  jne    L67
  mov    (%rsp),%rax
  mov    %bl,(%rax)
  movl   $0x1,0x1c(%rsp)
  movzbl (%r15),%r13d
  cmp    $0x1,%r14d
  jbe    L13
  movzbl 0x1(%r15),%r12d
  mov    $0x2,%ebp
  movzbl %bl,%eax
  mov    %eax,0xc(%rsp)
L125:
  cmp    %r12b,%r13b
  je     L138
  movzbl %r13b,%ecx
  lea    0x1c(%rsp),%rsi
  mov    0xc(%rsp),%edx
  mov    (%rsp),%rdi
  call   <_RLE_WriteNonRep@plt>
  mov    $0x1,%eax
L81:
  cmp    %r14d,%ebp
  jae    L110
  mov    %ebp,%eax
  mov    %r12d,%r13d
  movzbl (%r15,%rax,1),%r12d
  lea    0x1(%rbp),%ebp
  jmp    L125
L138:
  cmp    %r14d,%ebp
  jae    L59
  mov    $0x2,%eax
L70:
  mov    %ebp,%esi
  mov    %ebp,0x8(%rsp)
  add    $0x1,%ebp
  mov    %esi,%edx
  movzbl (%r15,%rdx,1),%r12d
  mov    %eax,%r8d
  add    $0x1,%eax
  cmp    %ebp,%r14d
  seta   %cl
  cmp    $0x7fff,%eax
  setbe  %dl
  test   %dl,%cl
  je     L102
  cmp    %r12b,%r13b
  je     L70
L102:
  cmp    %r12b,%r13b
  je     L135
  movzbl %r13b,%ecx
  lea    0x1c(%rsp),%rsi
  mov    0xc(%rsp),%edx
  mov    (%rsp),%rdi
  call   <_RLE_WriteRep@plt>
  mov    $0x1,%eax
  jmp    L81
L135:
  movzbl %r13b,%ecx
  lea    0x1c(%rsp),%rsi
  mov    %eax,%r8d
  mov    0xc(%rsp),%edx
  mov    (%rsp),%rdi
  call   <_RLE_WriteRep@plt>
  cmp    %ebp,%r14d
  jbe    L91
  mov    %ebp,%ebp
  movzbl (%r15,%rbp,1),%r12d
  mov    0x8(%rsp),%eax
  lea    0x2(%rax),%ebp
  mov    $0x1,%eax
  jmp    L81
L91:
  mov    %r13d,%r12d
  mov    $0x0,%eax
  jmp    L81
L13:
  mov    %r13d,%r12d
L154:
  movzbl %r12b,%ecx
  movzbl %bl,%edx
  lea    0x1c(%rsp),%rsi
  mov    (%rsp),%rdi
  call   <_RLE_WriteNonRep@plt>
L15:
  mov    0x1c(%rsp),%eax
L163:
  mov    0x428(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L149
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L110:
  cmp    $0x1,%eax
  jne    L15
  jmp    L154
L59:
  movzbl %r13b,%ecx
  lea    0x1c(%rsp),%rsi
  mov    $0x2,%r8d
  mov    0xc(%rsp),%edx
  mov    (%rsp),%rdi
  call   <_RLE_WriteRep@plt>
  mov    %r13d,%r12d
  mov    $0x0,%eax
  jmp    L81
L149:
  call   <__stack_chk_fail@plt>
```

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;
}
```