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

```asm
<compress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%r15d
  jmp    L147
L177:
  add    $0x1,%ebp
  jmp    L147
L105:
  test   %r12d,%r12d
  jne    L81
  cmp    $0x7ffe,%ebp
  jg     L81
  movslq %ebp,%rax
  lea    D53(%rip),%rdx
  mov    %bl,(%rdx,%rax,1)
  lea    0x1(%rbp),%ebp
  mov    %r15d,%r12d
  jmp    L147
L81:
  test   %ebp,%ebp
  jle    L131
  cmp    $0x1,%r12d
  je     L190
  test   %r12d,%r12d
  je     L93
L131:
  mov    %bl,D54(%rip)
  mov    %r15d,%r12d
  mov    $0x1,%ebp
  jmp    L147
L190:
  mov    %ebp,%eax
  shr    $0x18,%eax
  or     $0xffffff80,%eax
  mov    %al,0x4(%rsp)
  mov    %ebp,%eax
  sar    $0x10,%eax
  mov    %al,0x5(%rsp)
  mov    %ebp,%eax
  movzbl %ah,%eax
  mov    %al,0x6(%rsp)
  mov    %bpl,0x7(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  call   <fwrite@plt>
  jmp    L131
L93:
  mov    %ebp,%eax
  sar    $0x8,%eax
  and    $0x7f,%eax
  mov    %al,0x4(%rsp)
  mov    %bpl,0x5(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x2,%esi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    %ebp,%esi
  lea    D54(%rip),%rdi
  call   <fwrite@plt>
  jmp    L131
L41:
  mov    $0x1,%r12d
  mov    $0x1,%ebp
L147:
  mov    %r13,%rdi
  call   <getc@plt>
  mov    %eax,%ebx
  mov    D54(%rip),%rax
  cmp    %ebx,(%rax)
  je     L110
  test   %ebx,%ebx
  jne    L105
  cmp    $0x1,%r12d
  je     L177
  test   %r12d,%r12d
  jne    L41
  test   %ebp,%ebp
  jle    L41
  mov    %ebp,%eax
  sar    $0x8,%eax
  and    $0x7f,%eax
  mov    %al,0x4(%rsp)
  mov    %bpl,0x5(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x2,%esi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    %ebp,%esi
  lea    D54(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x1,%r12d
  mov    $0x1,%ebp
  jmp    L147
L110:
  test   %ebp,%ebp
  jle    L135
  cmp    $0x1,%r12d
  je     L82
  test   %r12d,%r12d
  je     L12
L135:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L212
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L82:
  mov    %ebp,%eax
  shr    $0x18,%eax
  or     $0xffffff80,%eax
  mov    %al,0x4(%rsp)
  mov    %ebp,%eax
  sar    $0x10,%eax
  mov    %al,0x5(%rsp)
  mov    %ebp,%eax
  movzbl %ah,%eax
  mov    %al,0x6(%rsp)
  mov    %bpl,0x7(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x4,%esi
  call   <fwrite@plt>
  jmp    L135
L12:
  mov    %ebp,%eax
  sar    $0x8,%eax
  and    $0x7f,%eax
  mov    %al,0x4(%rsp)
  mov    %bpl,0x5(%rsp)
  lea    0x4(%rsp),%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x2,%esi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    %ebp,%esi
  lea    D54(%rip),%rdi
  call   <fwrite@plt>
  jmp    L135
L212:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void compress(FILE *in, FILE *out) {
  static unsigned char data_buf[65526];
  unsigned char number_buf[4];
  int count = 0;
  int zero_mode = -1;
  int input;
  while ((input = getc(in)) != EOF) {
    if (input == 0) {
      if (zero_mode == 1) {
        count++;
      } else {
        if (count > 0) {
          if (zero_mode == 1) {
            number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
            number_buf[1] = (count >> 16) & 0xff;
            number_buf[2] = (count >> 8) & 0xff;
            number_buf[3] = count & 0xff;
            fwrite(number_buf, 4, 1, out);
          } else if (zero_mode == 0) {
            number_buf[0] = (count >> 8) & 0x7f;
            number_buf[1] = count & 0xff;
            fwrite(number_buf, 2, 1, out);
            fwrite(data_buf, count, 1, out);
          }
        }
        zero_mode = 1;
        count = 1;
      }
    } else {
      if (zero_mode == 0 && count < 0x7fff) {
        data_buf[count++] = input;
      } else {
        if (count > 0) {
          if (zero_mode == 1) {
            number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
            number_buf[1] = (count >> 16) & 0xff;
            number_buf[2] = (count >> 8) & 0xff;
            number_buf[3] = count & 0xff;
            fwrite(number_buf, 4, 1, out);
          } else if (zero_mode == 0) {
            number_buf[0] = (count >> 8) & 0x7f;
            number_buf[1] = count & 0xff;
            fwrite(number_buf, 2, 1, out);
            fwrite(data_buf, count, 1, out);
          }
        }
        zero_mode = 0;
        data_buf[0] = input;
        count = 1;
      }
    }
  }
  if (count > 0) {
    if (zero_mode == 1) {
      number_buf[0] = ((count >> 24) & 0x7f) | 0x80;
      number_buf[1] = (count >> 16) & 0xff;
      number_buf[2] = (count >> 8) & 0xff;
      number_buf[3] = count & 0xff;
      fwrite(number_buf, 4, 1, out);
    } else if (zero_mode == 0) {
      number_buf[0] = (count >> 8) & 0x7f;
      number_buf[1] = count & 0xff;
      fwrite(number_buf, 2, 1, out);
      fwrite(data_buf, count, 1, out);
    }
  }
}
```