user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<RLEdecompress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %edi,0x1c(%rsp)
  mov    %esi,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x14(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L176
L222:
  mov    $0x0,%ebx
L72:
  mov    $0x1,%edx
  mov    0x8(%rsp),%rsi
  mov    %r12d,%edi
  call   <write@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x14(%rsp)
  jne    L72
  mov    $0x1,%ebx
  movl   $0x0,0x14(%rsp)
  jmp    L28
L94:
  mov    0x14(%rsp),%ebx
  neg    %ebx
  mov    %ebx,%edx
  mov    0x8(%rsp),%rsi
  mov    %r12d,%edi
  call   <write@plt>
  movl   $0x0,0x14(%rsp)
  jmp    L28
L6:
  lea    -0x1(%r13),%eax
  cmp    %ebx,%eax
  je     L206
  lea    0x1(%rbx),%r14d
  cmp    %r14d,%r13d
  jle    L50
  movslq %ebx,%rbx
  mov    0x8(%rsp),%rax
  lea    0x1(%rax,%rbx,1),%r15
  mov    $0x1,%edx
  mov    %r15,%rsi
  mov    %r12d,%edi
  call   <write@plt>
  movsbl %bpl,%ebp
  add    $0x1,%ebp
  mov    $0x1,%ebx
L239:
  mov    $0x1,%edx
  mov    %r15,%rsi
  mov    %r12d,%edi
  call   <write@plt>
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jne    L239
L177:
  lea    0x1(%r14),%ebx
  cmp    %ebx,%r13d
  jle    L232
L119:
  movslq %ebx,%rax
  movzbl 0x20(%rsp,%rax,1),%ebp
  movsbl %bpl,%r15d
  test   %r15d,%r15d
  jg     L6
  lea    0x1(%rbx),%eax
  mov    %r13d,%ebp
  sub    %eax,%ebp
  mov    %r15d,%edx
  neg    %edx
  cmp    %ebp,%edx
  jg     L46
  cmp    %r13d,%eax
  jge    L17
  movslq %ebx,%rax
  mov    0x8(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rsi
  mov    %r12d,%edi
  call   <write@plt>
  sub    %r15d,%ebx
  mov    %ebx,%r14d
  jmp    L177
L50:
  movl   $0x1,0x18(%rsp)
  jmp    L177
L46:
  cmp    %r13d,%eax
  jge    L178
  movslq %ebx,%rbx
  mov    0x8(%rsp),%rax
  lea    0x1(%rax,%rbx,1),%rsi
  mov    %ebp,%edx
  mov    %r12d,%edi
  call   <write@plt>
  lea    (%r15,%rbp,1),%eax
  mov    %eax,0x14(%rsp)
L232:
  cmpl   $0x0,0x18(%rsp)
  jne    L146
L176:
  mov    $0x400,%edx
  mov    0x8(%rsp),%rsi
  mov    0x1c(%rsp),%edi
  call   <read@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  je     L22
  cmpl   $0x0,0x14(%rsp)
  jg     L222
  mov    $0x0,%ebx
  cmpl   $0x0,0x14(%rsp)
  js     L94
L28:
  movl   $0x0,0x18(%rsp)
  cmp    %ebx,%r13d
  jg     L119
  jmp    L176
L206:
  mov    %r15d,0x14(%rsp)
  jmp    L232
L178:
  mov    $0x1,%r13d
  jmp    L22
L17:
  mov    $0x1,%r13d
L22:
  mov    %r12d,%edi
  call   <close@plt>
  mov    0x1c(%rsp),%edi
  call   <close@plt>
  or     0x14(%rsp),%r13d
  setne  %al
  movzbl %al,%eax
  mov    0x428(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L89
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L146:
  mov    0x18(%rsp),%r13d
  jmp    L22
L89:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int RLEdecompress(int in, int out) {
  int last_ocatet = 0;
  ssize_t lu;
  signed char buf[1024];
  int ERROR = 0;
  while ((lu = read(in, buf, 1024)) != 0) {
    int i = 0, j;
    if (last_ocatet > 0) {
      for (i = 0; i < last_ocatet; i++)
        write(out, buf, 1);
      last_ocatet = 0;
      i = 1;
    }
    if (last_ocatet < 0) {
      write(out, buf, -last_ocatet);
      i = -last_ocatet;
      last_ocatet = 0;
    }
    while (i < lu) {
      int c = buf[i];
      if (c > 0) {
        if (i == lu - 1) {
          last_ocatet = c;
          break;
        }
        for (j = 0; j <= c; j++) {
          if (i + 1 >= lu) {
            ERROR = 1;
            break;
          }
          write(out, buf + i + 1, 1);
        }
        i++;
      } else {
        int a = lu - (i + 1);
        if (a < -c) {
          if (i + 1 >= lu) {
            ERROR = 1;
            break;
          }
          write(out, buf + i + 1, a);
          last_ocatet = c + a;
          break;
        }
        if (i + 1 >= lu) {
          ERROR = 1;
          break;
        }
        write(out, buf + 1 + i, -c);
        i += -c;
      }
      i++;
    }
    if (ERROR) {
      break;
    }
  }
  close(out);
  close(in);
  if (ERROR || last_ocatet != 0) {
    return 1;
  }
  return 0;
}
```