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

```asm
<pmt_decode_group>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  movslq %esi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %ecx,0xc(%rsp)
  test   %rbp,%rbp
  jle    L117
  mov    %rdi,%r15
  movslq %ecx,%rax
  mov    %rdx,%r12
  mov    %rdx,%rdi
  mov    %rax,(%rsp)
  mov    %r15,%rbx
  jmp    L36
  nopw   0x0(%rax,%rax,1)
L91:
  and    $0x7f,%edx
  cmp    %rax,%rbp
  jl     L94
  movslq %edx,%rax
  lea    (%rdi,%rax,4),%r13
  mov    %r13,%rax
  sub    %r12,%rax
  sar    $0x2,%rax
  cmp    (%rsp),%rax
  jg     L96
  mov    0x4(%rbx),%esi
  add    $0x8,%rbx
  call   <memset@plt>
  mov    %rbx,%rax
  mov    %r13,%rdi
  sub    %r15,%rax
  sar    $0x2,%rax
  cmp    %rbp,%rax
  jge    L24
L36:
  lea    0x4(%rbx),%r13
  mov    (%rbx),%edx
  mov    %r13,%rax
  sub    %r15,%rax
  sar    $0x2,%rax
  test   $0x80,%dl
  jne    L91
  cmp    %rax,%rbp
  jl     L94
  movslq %edx,%rbx
  shl    $0x2,%rbx
  lea    (%rdi,%rbx,1),%r14
  mov    %r14,%rax
  sub    %r12,%rax
  sar    $0x2,%rax
  cmp    (%rsp),%rax
  jg     L96
  mov    %r13,%rsi
  add    %r13,%rbx
  call   <memcpy@plt>
  mov    %rbx,%rax
  mov    %r14,%rdi
  sub    %r15,%rax
  sar    $0x2,%rax
  cmp    %rbp,%rax
  jl     L36
L24:
  mov    %rdi,%rax
  sub    %r12,%rax
  sar    $0x2,%rax
L84:
  cmp    %eax,0xc(%rsp)
  je     L28
  mov    0xc(%rsp),%edx
  mov    %eax,%esi
  lea    D28(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L94:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
L28:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L96:
  lea    D25(%rip),%rdi
  call   <puts@plt>
  add    $0x18,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L117:
  xor    %eax,%eax
  jmp    L84
```

tool_calls: name: read_data
arguments: data_label: D28
type_infered: string
name: read_data
arguments: data_label: D18
type_infered: string
name: read_data
arguments: data_label: D25
type_infered: string

tool: D28: ERROR: decoded %d bytes, expected %d


tool: D18: ERROR: attempted to read past end of input data.

tool: D25: ERROR: attempted to write past end of output buffer.

assistant: ```c
int pmt_decode_group(uint8_t *raw_group_buf, int raw_group_size, uint8_t *decoded_group_buf, int decoded_group_buf_size) {
  uint8_t *src = raw_group_buf;
  uint8_t *dst = decoded_group_buf;
  while ((src - raw_group_buf) < raw_group_size) {
    if (*src & 0x80) {
      uint8_t run_length = *src & 0x7f;
      src++;
      if ((src - raw_group_buf) > raw_group_size) {
        printf("ERROR: attempted to read past end of input data.\n");
        return -1;
      }
      if ((dst + run_length - decoded_group_buf) > decoded_group_buf_size) {
        printf("ERROR: attempted to write past end of output buffer.\n");
        return -1;
      }
      memset(dst, *src, run_length);
      src++;
      dst += run_length;
    } else {
      uint8_t copy_count = *src;
      src++;
      if ((src - raw_group_buf) > raw_group_size) {
        printf("ERROR: attempted to read past end of input data.\n");
        return -1;
      }
      if ((dst + copy_count - decoded_group_buf) > decoded_group_buf_size) {
        printf("ERROR: attempted to write past end of output buffer.\n");
        return -1;
      }
      memcpy(dst, src, copy_count);
      src += copy_count;
      dst += copy_count;
    }
  }
  int decoded_bytes = dst - decoded_group_buf;
  if (decoded_bytes != decoded_group_buf_size) {
    printf("ERROR: decoded %d bytes, expected %d\n", decoded_bytes, decoded_group_buf_size);
    return -1;
  } else {
    return decoded_bytes;
  }
}
```