user: Please show me the C implementation that matches the assembly code listed below:

```asm
<__int32_t_decode_array>:
  endbr64
  movslq %r8d,%r8
  lea    0x0(,%r8,4),%r9d
  cmp    %edx,%r9d
  jg     L3
  mov    %r8,%r10
  test   %r8d,%r8d
  jle    L92
  movslq %esi,%r11
  mov    %r8d,%edx
  shl    $0x2,%r8
  push   %rbx
  lea    (%r8,%r11,1),%rbx
  lea    (%rdi,%r11,4),%rax
  lea    (%rdi,%rbx,4),%rbx
  cmp    %rbx,%rcx
  setae  %bl
  add    %rcx,%r8
  cmp    %r8,%rax
  setae  %r8b
  or     %r8b,%bl
  je     L77
  cmp    $0x1,%r10d
  je     L77
  lea    -0x1(%r10),%r8d
  cmp    $0x2,%r8d
  jbe    L81
  mov    %r10d,%r8d
  mov    %rcx,%rdx
  shr    $0x2,%r8d
  sub    $0x1,%r8d
  shl    $0x6,%r8
  lea    0x40(%rax,%r8,1),%r8
  nopl   0x0(%rax,%rax,1)
L79:
  movdqu (%rax),%xmm1
  movdqu 0x10(%rax),%xmm6
  add    $0x40,%rax
  add    $0x10,%rdx
  movdqu -0x20(%rax),%xmm3
  movdqa %xmm1,%xmm2
  shufps $0xdd,%xmm6,%xmm1
  movdqa %xmm1,%xmm4
  shufps $0x88,%xmm6,%xmm2
  movdqu -0x10(%rax),%xmm6
  movdqa %xmm3,%xmm5
  movdqa %xmm2,%xmm0
  shufps $0x88,%xmm6,%xmm5
  shufps $0xdd,%xmm6,%xmm3
  shufps $0x88,%xmm5,%xmm0
  shufps $0x88,%xmm3,%xmm4
  pslld  $0x18,%xmm0
  pslld  $0x10,%xmm4
  shufps $0xdd,%xmm5,%xmm2
  shufps $0xdd,%xmm3,%xmm1
  paddd  %xmm4,%xmm0
  pslld  $0x8,%xmm2
  paddd  %xmm2,%xmm0
  paddd  %xmm1,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rax,%r8
  jne    L79
  mov    %r10d,%eax
  and    $0xfffffffc,%eax
  mov    %eax,%r8d
  lea    (%rsi,%rax,4),%esi
  cmp    %eax,%r10d
  je     L65
  mov    %r10d,%edx
  sub    %eax,%edx
  cmp    $0x1,%edx
  je     L49
L40:
  lea    (%r11,%rax,4),%r10
  lea    (%rdi,%r10,4),%r10
  movq   0x8(%r10),%xmm4
  movq   (%r10),%xmm1
  movq   0x18(%r10),%xmm0
  movq   0x10(%r10),%xmm3
  movdqa %xmm1,%xmm2
  punpckldq %xmm4,%xmm1
  punpckldq %xmm4,%xmm2
  pshufd $0xe,%xmm1,%xmm1
  movdqa %xmm3,%xmm5
  punpckldq %xmm0,%xmm3
  punpckldq %xmm0,%xmm5
  movdqa %xmm1,%xmm4
  pshufd $0xe,%xmm3,%xmm3
  movdqa %xmm2,%xmm0
  punpckldq %xmm5,%xmm2
  punpckldq %xmm5,%xmm0
  punpckldq %xmm3,%xmm4
  pshufd $0xe,%xmm2,%xmm2
  pslld  $0x18,%xmm0
  pslld  $0x10,%xmm4
  punpckldq %xmm3,%xmm1
  paddd  %xmm4,%xmm0
  pslld  $0x8,%xmm2
  pshufd $0xe,%xmm1,%xmm1
  paddd  %xmm2,%xmm0
  paddd  %xmm1,%xmm0
  movq   %xmm0,(%rcx,%rax,4)
  mov    %edx,%eax
  and    $0xfffffffe,%eax
  lea    (%rsi,%rax,4),%esi
  add    %eax,%r8d
  cmp    %eax,%edx
  je     L65
L49:
  movslq %esi,%rdx
  movslq %r8d,%r8
  lea    0x0(,%rdx,4),%rsi
  mov    (%rdi,%rdx,4),%edx
  mov    0x4(%rdi,%rsi,1),%eax
  shl    $0x18,%edx
  shl    $0x10,%eax
  add    %edx,%eax
  mov    0x8(%rdi,%rsi,1),%edx
  shl    $0x8,%edx
  add    %edx,%eax
  add    0xc(%rdi,%rsi,1),%eax
  mov    %eax,(%rcx,%r8,4)
L65:
  mov    %r9d,%eax
  pop    %rbx
  ret
  nop
L77:
  lea    -0x1(%r10),%edx
  lea    0x4(%rcx,%rdx,4),%rdi
  nopl   0x0(%rax)
L64:
  mov    0x4(%rax),%edx
  mov    (%rax),%esi
  add    $0x4,%rcx
  add    $0x10,%rax
  shl    $0x18,%esi
  shl    $0x10,%edx
  add    %esi,%edx
  mov    -0x8(%rax),%esi
  shl    $0x8,%esi
  add    %esi,%edx
  add    -0x4(%rax),%edx
  mov    %edx,-0x4(%rcx)
  cmp    %rdi,%rcx
  jne    L64
  mov    %r9d,%eax
  pop    %rbx
  ret
L3:
  mov    $0xffffffff,%r9d
L92:
  mov    %r9d,%eax
  ret
L81:
  xor    %eax,%eax
  xor    %r8d,%r8d
  jmp    L40
```

assistant: ```c
int __int32_t_decode_array(const void *_buf, int offset, int maxlen, int32_t *p, int elements) {
  int total_size = sizeof(int32_t) * elements;
  uint8_t *buf = (uint8_t *)_buf;
  int pos = offset;
  int element;
  if (maxlen < total_size)
    return -1;
  for (element = 0; element < elements; element++) {
    p[element] = (buf[pos + 0] << 24) + (buf[pos + 1] << 16) + (buf[pos + 2] << 8) + buf[pos + 3];
    pos += 4;
  }
  return total_size;
}
```