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

```asm
<EEPROM_Write>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  setne  %dl
  cmp    $0x100,%r12d
  setle  %al
  test   %al,%dl
  je     L105
  mov    %edi,%r13d
  cmp    $0xff,%edi
  jg     L105
  lea    0x14(%rsp),%rax
  mov    %rsi,%r14
  lea    0x10(%rsp),%rbx
  mov    %rax,0x8(%rsp)
  nopl   (%rax)
L95:
  mov    %r13d,%eax
  mov    $0x8,%ebp
  mov    0x8(%rsp),%rdi
  mov    %r14,%rsi
  and    $0x7,%eax
  mov    %r13d,0x10(%rsp)
  sub    %eax,%ebp
  cmp    %r12d,%ebp
  cmovg  %r12d,%ebp
  mov    %ebp,%edx
  call   <memcpy@plt>
  lea    0x1(%rbp),%edx
  mov    $0x1,%ecx
  mov    %rbx,%rsi
  mov    $0xa0,%edi
  call   <I2C_Xfer@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L39
  nopl   0x0(%rax)
L34:
  mov    $0x1,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  add    $0x1,%r15d
  mov    $0xa0,%edi
  call   <I2C_Xfer@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  je     L67
  cmp    $0x18f,%r15d
  jle    L34
  test   %eax,%eax
  jne    L78
L67:
  movslq %ebp,%rax
  add    %ebp,%r13d
  lea    (%r14,%rax,4),%r14
  sub    %ebp,%r12d
  jne    L95
L28:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x48,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L39:
  lea    D23(%rip),%rdi
  call   <printf@plt>
  mov    $0xfffffffe,%r8d
  jmp    L28
L78:
  lea    D14(%rip),%rdi
  mov    %eax,0x8(%rsp)
  call   <printf@plt>
  mov    0x8(%rsp),%r8d
  jmp    L28
L105:
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0xfffffffd,%r8d
  jmp    L28
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D23
type_guessed: string
name: retrieve_data
arguments: data_tag: D14
type_guessed: string
name: retrieve_data
arguments: data_tag: D8
type_guessed: string

tool: D23: 
Failed to write to EEPROM!

tool: D14: 
Timeout getting ACK from EEPROM during write!

tool: D8: 
Invalid EEPROM addressing

assistant: ```c
int32_t EEPROM_Write(uint32_t startdestpos, uint8_t *src, uint32_t len) {
  int32_t retval = 0;
  if (startdestpos < 256 && len && len <= 256) {
    uint8_t tmpbuf[9];
    uint8_t i = startdestpos;
    while (len) {
      uint32_t loopcnt = 0;
      uint8_t startoffset = i & 0x07;
      uint8_t maxcopysize = 8 - startoffset;
      uint8_t bytestocopy = (len > maxcopysize) ? maxcopysize : len;
      tmpbuf[0] = i;
      memcpy(tmpbuf + 1, src, bytestocopy);
      retval = I2C_Xfer((0x50 << 1), tmpbuf, bytestocopy + 1, 1);
      if (!retval) {
        do {
          retval = I2C_Xfer((0x50 << 1), tmpbuf, 1, 1);
          loopcnt++;
        } while (retval && loopcnt < 400);
        if (retval) {
          printf("\nTimeout getting ACK from EEPROM during write!");
          break;
        }
        len -= bytestocopy;
        i += bytestocopy;
        src += bytestocopy;
      } else {
        printf("\nFailed to write to EEPROM!");
        retval = -2;
        break;
      }
    }
  } else {
    printf("\nInvalid EEPROM addressing");
    retval = -3;
  }
  return retval;
}
```