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

```asm
<SHAMD5DataWriteMultiple>:
  endbr64
  push   %r15
  lea    0x3f(%rdx),%r15d
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  movl   $0x0,0x4(%rsp)
  cmovns %edx,%r15d
  sar    $0x6,%r15d
  cmp    $0x3f,%edx
  jle    L133
  mov    %rsi,%rbp
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L110:
  mov    %rbp,%rsi
  mov    %r12d,%edi
  add    $0x1,%ebx
  add    $0x100,%rbp
  call   <SHAMD5DataWrite@plt>
  cmp    %ebx,%r15d
  jg     L110
  lea    -0x1(%r15),%eax
  mov    $0x100,%edx
  add    $0x1,%rax
  shl    $0x8,%rax
  cmp    $0x3f,%r13d
  cmovle %rdx,%rax
  add    %rax,%r14
L133:
  test   $0x3f,%r13b
  je     L309
  lea    0x118(%r12),%edx
  movslq %edx,%rdx
  nopl   0x0(%rax,%rax,1)
L246:
  mov    (%rdx),%rax
  test   $0x2,%al
  je     L246
  mov    %r13d,%eax
  mov    %r13d,%edi
  sar    $0x1f,%eax
  shr    $0x1a,%eax
  lea    0x0(%r13,%rax,1),%edx
  and    $0x3f,%edx
  sub    %eax,%edx
  lea    0x3(%rdx),%eax
  cmovns %edx,%eax
  and    $0x3,%edi
  sar    $0x2,%eax
  cmp    $0x3,%edx
  jle    L280
  movslq (%r14),%rcx
  lea    0x80(%r12),%esi
  movslq %esi,%rsi
  mov    %rcx,(%rsi)
  cmp    $0x7,%edx
  jle    L276
  movslq 0x10(%r14),%r8
  lea    0x84(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x2,%eax
  je     L276
  movslq 0x20(%r14),%r8
  lea    0x88(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x3,%eax
  je     L276
  movslq 0x30(%r14),%r8
  lea    0x8c(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x4,%eax
  je     L276
  movslq 0x40(%r14),%r8
  lea    0x90(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x5,%eax
  je     L276
  movslq 0x50(%r14),%r8
  lea    0x94(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x6,%eax
  je     L276
  movslq 0x60(%r14),%r8
  lea    0x98(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x7,%eax
  je     L276
  movslq 0x70(%r14),%r8
  lea    0x9c(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x8,%eax
  je     L276
  movslq 0x80(%r14),%r8
  lea    0xa0(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0x9,%eax
  je     L276
  movslq 0x90(%r14),%r8
  lea    0xa4(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0xa,%eax
  je     L276
  movslq 0xa0(%r14),%r8
  lea    0xa8(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0xb,%eax
  je     L276
  movslq 0xb0(%r14),%r8
  lea    0xac(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0xc,%eax
  je     L276
  movslq 0xc0(%r14),%r8
  lea    0xb0(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0xd,%eax
  je     L276
  movslq 0xd0(%r14),%r8
  lea    0xb4(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  cmp    $0xf,%eax
  jne    L276
  movslq 0xe0(%r14),%r8
  lea    0xb8(%r12),%ecx
  movslq %ecx,%rcx
  mov    %r8,(%rcx)
  xchg   %ax,%ax
L276:
  lea    -0x1(%rax),%ecx
  xor    %r8d,%r8d
  cmp    $0x3,%edx
  lea    0x0(,%rcx,4),%rax
  cmovle %r8,%rax
  add    $0x1,%rcx
  shl    $0x4,%rcx
  add    %rsi,%rax
  cmp    $0x3,%edx
  mov    $0x10,%edx
  cmovle %rdx,%rcx
  add    %rcx,%r14
  test   %edi,%edi
  je     L309
L291:
  mov    %r13d,%edx
  sar    $0x1f,%edx
  shr    $0x1e,%edx
  add    %edx,%r13d
  and    $0x3,%r13d
  sub    %edx,%r13d
  xor    %edx,%edx
  test   %r13d,%r13d
  jle    L216
  movslq %r13d,%rdx
  lea    0x4(%rsp),%rcx
  shl    $0x2,%rdx
  cmp    $0x8,%edx
  jae    L297
  test   $0x4,%dl
  jne    L167
  test   %edx,%edx
  jne    L176
L204:
  movslq 0x4(%rsp),%rdx
L216:
  mov    %rdx,(%rax)
L309:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L288
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L280:
  test   %edi,%edi
  je     L309
  lea    0x80(%r12),%eax
  cltq
  jmp    L291
  nopw   0x0(%rax,%rax,1)
L297:
  mov    (%r14),%rsi
  lea    0x8(%rsp),%r8
  mov    %rsi,0x4(%rsp)
  mov    %edx,%esi
  mov    -0x8(%r14,%rsi,1),%rdi
  mov    %rdi,-0x8(%rcx,%rsi,1)
  sub    %r8,%rcx
  add    %ecx,%edx
  sub    %rcx,%r14
  and    $0xfffffff8,%edx
  cmp    $0x8,%edx
  jb     L204
  and    $0xfffffff8,%edx
  xor    %ecx,%ecx
L70:
  mov    %ecx,%esi
  add    $0x8,%ecx
  mov    (%r14,%rsi,1),%rdi
  mov    %rdi,(%r8,%rsi,1)
  cmp    %edx,%ecx
  jb     L70
  jmp    L204
L176:
  movzbl (%r14),%edx
  mov    %dl,0x4(%rsp)
  jmp    L204
L167:
  mov    (%r14),%esi
  mov    %edx,%edx
  mov    %esi,0x4(%rsp)
  mov    -0x4(%r14,%rdx,1),%esi
  mov    %esi,-0x4(%rcx,%rdx,1)
  jmp    L204
L288:
  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;
    }
  }
}
```