user: Converte this assembly snippet into its equivalent C code:

```asm
<SHAMD5DataWriteMultiple>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r12d
  mov    %rsi,%r14
  mov    %edx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  lea    0x3f(%rdx),%r15d
  test   %edx,%edx
  cmovns %edx,%r15d
  sar    $0x6,%r15d
  cmp    $0x3f,%edx
  jle    L28
  mov    %rsi,%rbp
  mov    $0x0,%ebx
L64:
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <SHAMD5DataWrite@plt>
  add    $0x100,%rbp
  add    $0x1,%ebx
  cmp    %ebx,%r15d
  jg     L64
  lea    -0x1(%r15),%eax
  add    $0x1,%rax
  shl    $0x8,%rax
  cmp    $0x3f,%r13d
  mov    $0x100,%edx
  cmovle %rdx,%rax
  add    %rax,%r14
L28:
  test   $0x3f,%r13b
  je     L3
  lea    0x118(%r12),%edx
  movslq %edx,%rdx
L69:
  mov    (%rdx),%rax
  test   $0x2,%al
  je     L69
  mov    %r13d,%eax
  sar    $0x1f,%eax
  shr    $0x1a,%eax
  lea    0x0(%r13,%rax,1),%edi
  and    $0x3f,%edi
  sub    %eax,%edi
  lea    0x3(%rdi),%ecx
  cmovns %edi,%ecx
  sar    $0x2,%ecx
  cmp    $0x3,%edi
  jle    L12
  movslq %r12d,%rdx
  lea    0x80(%rdx),%rax
  neg    %rdx
  lea    (%r14,%rdx,4),%r8
  mov    $0x0,%edx
L46:
  movslq -0x200(%r8,%rax,4),%rsi
  mov    %rsi,(%rax)
  add    $0x1,%edx
  add    $0x4,%rax
  cmp    %edx,%ecx
  jg     L46
  sub    $0x1,%ecx
  mov    %ecx,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  cmp    $0x3,%edi
  mov    $0x10,%edx
  cmovle %rdx,%rax
  add    %rax,%r14
  cmp    $0x3,%edi
  mov    $0x0,%eax
  cmovle %eax,%ecx
  mov    %r13d,%eax
  sar    $0x1f,%eax
  shr    $0x1e,%eax
  lea    0x0(%r13,%rax,1),%edx
  and    $0x3,%edx
  sub    %eax,%edx
  test   $0x3,%r13b
  je     L3
  shl    $0x2,%ecx
L81:
  test   %edx,%edx
  jle    L4
  mov    $0x0,%eax
L24:
  mov    (%r14,%rax,4),%esi
  mov    %esi,0x4(%rsp,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L24
L4:
  lea    0x80(%rcx,%r12,1),%eax
  cltq
  movslq 0x4(%rsp),%rdx
  mov    %rdx,(%rax)
L3:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  test   $0x3,%r13b
  je     L3
  mov    %r13d,%eax
  sar    $0x1f,%eax
  shr    $0x1e,%eax
  lea    0x0(%r13,%rax,1),%edx
  and    $0x3,%edx
  sub    %eax,%edx
  mov    $0x0,%ecx
  jmp    L81
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void SHAMD5DataWriteMultiple(uint32_t ui32Base, uint8_t *pui8DataSrc, uint32_t ui32DataLength) {
  uint32_t ui32Idx, ui32Count, ui32TempData = 0, ui32Lastword;
  uint8_t *ui8TempData;
  ;
  ui32Count = ui32DataLength / 64;
  for (ui32Idx = 0; ui32Idx < ui32Count; ui32Idx++) {
    SHAMD5DataWrite(ui32Base, pui8DataSrc);
    pui8DataSrc += 64;
  }
  ui32Count = ui32DataLength % 64;
  if (ui32Count) {
    while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000002) == 0) {
    }
    ui32Count = ui32Count / 4;
    for (ui32Idx = 0; ui32Idx < ui32Count; ui32Idx++) {
      (*((volatile unsigned long *)(ui32Base + 0x00000080 + (ui32Idx * 4)))) = *((uint32_t *)pui8DataSrc);
      pui8DataSrc += 4;
    }
    ui32Count = ui32DataLength % 4;
    ui8TempData = (uint8_t *)&ui32TempData;
    if (ui32Count) {
      ui32Lastword = 0;
      if (ui32Idx) {
        ui32Lastword = (ui32Idx - 1) * 4;
      }
      for (ui32Idx = 0; ui32Idx < ui32Count; ui32Idx++) {
        *(ui8TempData + ui32Idx) = *(pui8DataSrc + ui32Idx);
      }
      (*((volatile unsigned long *)(ui32Base + 0x00000080 + ui32Lastword))) = ui32TempData;
    }
  }
}
```