user: Demonstrate the C code that generates the assembly output below:

```asm
<decodeRLE>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  mov    %edi,%ecx
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  lea    0x7(%rdx),%ebx
  sub    $0x38,%rsp
  mov    %r8d,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  cmovns %edx,%ebx
  sar    $0x3,%ebx
  imul   %ebx,%ecx
  imul   %esi,%ecx
  mov    %ecx,%edi
  mov    %ecx,0x8(%rsp)
  call   <tgaMalloc@plt>
  mov    0x8(%rsp),%ecx
  mov    %rax,%r12
  test   %ecx,%ecx
  jle    L89
  lea    0x1(%rax),%rax
  mov    0xc(%rsp),%r8d
  xor    %ebp,%ebp
  lea    -0x1(%rbx),%r9d
  mov    %rax,0x18(%rsp)
  xchg   %ax,%ax
L121:
  movslq %r8d,%rdx
  mov    %r8d,0x8(%rsp)
  lea    0x1(%r8),%r10d
  movzbl (%r15,%rdx,1),%r11d
  test   %r11b,%r11b
  js     L125
  lea    0x1(%r11),%esi
  movzbl %sil,%esi
  imul   %ebx,%esi
  test   %esi,%esi
  jle    L112
  mov    0x18(%rsp),%rdi
  movslq %ebp,%r8
  sub    %r12,%rdx
  sub    %r8,%rdx
  lea    (%r8,%r12,1),%rax
  lea    (%rdi,%r8,1),%r11
  lea    -0x1(%rsi),%edi
  add    %r15,%rdx
  add    %r11,%rdi
  nopl   0x0(%rax)
L50:
  movzbl 0x1(%rdx,%rax,1),%r8d
  add    $0x1,%rax
  mov    %r8b,-0x1(%rax)
  cmp    %rdi,%rax
  jne    L50
  lea    (%r10,%rsi,1),%r8d
  add    %esi,%ebp
L111:
  cmp    %ecx,%ebp
  jl     L121
L89:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x38,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L125:
  cmp    $0x7,%r13d
  jle    L72
  mov    %r9d,%edx
  movslq %r10d,%rsi
  lea    0x24(%rsp),%rdi
  mov    %ecx,0x14(%rsp)
  add    $0x1,%rdx
  add    %r15,%rsi
  mov    %r11b,0x13(%rsp)
  mov    %r9d,0xc(%rsp)
  call   <memcpy@plt>
  mov    0xc(%rsp),%r9d
  mov    0x8(%rsp),%r8d
  movzbl 0x13(%rsp),%r11d
  mov    0x14(%rsp),%ecx
  lea    0x2(%r8,%r9,1),%r8d
L62:
  and    $0x7f,%r11d
  xor    %r10d,%r10d
  add    $0x1,%r11d
  movzbl %r11b,%r11d
  nop
L70:
  cmp    $0x7,%r13d
  jle    L15
  xor    %eax,%eax
  lea    0x24(%rsp),%rdi
  movslq %ebp,%rsi
L8:
  movzbl (%rdi,%rax,1),%r14d
  lea    (%r12,%rax,1),%rdx
  add    $0x1,%rax
  mov    %r14b,(%rdx,%rsi,1)
  cmp    %eax,%ebx
  jg     L8
  xor    %esi,%esi
  lea    -0x1(%rbx),%eax
  cmp    $0x7,%r13d
  cmovle %esi,%eax
  lea    0x1(%rbp,%rax,1),%ebp
L15:
  add    $0x1,%r10d
  cmp    %r11d,%r10d
  jne    L70
  jmp    L111
L72:
  mov    %r10d,%r8d
  jmp    L62
L112:
  mov    %r10d,%r8d
  jmp    L111
L41:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned char *decodeRLE(int width, int height, int depth, const unsigned char *buffer, int offset) {
  int elementCount = depth / 8;
  unsigned char elements[4];
  int decodeBufferLength = elementCount * width * height;
  unsigned char *decodeBuffer = (unsigned char *)tgaMalloc(decodeBufferLength);
  int decoded = 0;
  while (decoded < decodeBufferLength) {
    int packet = buffer[offset++] & 0xFF;
    if ((packet & 0x80) != 0) {
      int i, j, count;
      for (i = 0; i < elementCount; i++) {
        elements[i] = buffer[offset++];
      }
      count = (packet & 0x7F) + 1;
      for (i = 0; i < count; i++) {
        for (j = 0; j < elementCount; j++) {
          decodeBuffer[decoded++] = elements[j];
        }
      }
    } else {
      int count = (packet + 1) * elementCount;
      int i;
      for (i = 0; i < count; i++) {
        decodeBuffer[decoded++] = buffer[offset++];
      }
    }
  }
  return decodeBuffer;
}
```