user: What is the c source code of the assembly code below:

```asm
<EEPROMProgram>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r13
  mov    %rdx,%rbx
  mov    $0x0,%eax
  call   <DEBUG_ASSERT@plt>
  mov    0x400af000,%rax
  movzwl %ax,%eax
  shl    $0x2,%rax
  cmp    %r13,%rax
  seta   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <DEBUG_ASSERT@plt>
  mov    0x400af000,%rax
  lea    0x0(%r13,%rbx,1),%rdx
  movzwl %ax,%eax
  shl    $0x2,%rax
  cmp    %rax,%rdx
  setbe  %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <DEBUG_ASSERT@plt>
  test   $0x3,%r13b
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <DEBUG_ASSERT@plt>
  test   $0x3,%bl
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <DEBUG_ASSERT@plt>
L21:
  mov    0x400af018,%rax
  test   $0x1,%al
  jne    L21
  mov    %r13,%rax
  shr    $0x6,%rax
  mov    %rax,0x400af004
  mov    %r13,%rax
  shr    $0x2,%rax
  and    $0xf,%eax
  mov    %rax,0x400af008
  mov    %rbx,%r12
  shr    $0x2,%r12
  cmp    $0x3,%rbx
  ja     L158
L86:
  mov    0x400fe000,%rax
  and    $0x70ff0000,%eax
  cmp    $0x10050000,%rax
  je     L10
L19:
  mov    0x400af018,%rbx
L103:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L74:
  mov    0x400fe000,%rax
  test   %ax,%ax
  jne    L87
  mov    %r13,%rdi
  call   <EEPROMSetSectorMask@plt>
  add    $0x4,%r13
  jmp    L87
L54:
  mov    0x400fe000,%rax
  and    $0x70ff0000,%eax
  cmp    $0x10050000,%rax
  jne    L103
  mov    0x400fe000,%rax
  test   %ax,%ax
  jne    L103
  call   <EEPROMClearSectorMask@plt>
  jmp    L103
L59:
  test   %r12,%r12
  je     L86
L158:
  mov    0x400fe000,%rax
  and    $0x70ff0000,%eax
  cmp    $0x10050000,%rax
  je     L74
L87:
  mov    0x0(%rbp),%rax
  mov    %rax,0x400af014
L38:
  mov    0x400af018,%rbx
  test   $0x1,%bl
  jne    L38
  test   $0x110,%ebx
  jne    L54
  add    $0x8,%rbp
  sub    $0x1,%r12
  mov    0x400af008,%rax
  test   %rax,%rax
  jne    L59
  mov    0x400af004,%rax
  add    $0x1,%rax
  mov    %rax,0x400af004
  jmp    L59
L10:
  mov    0x400fe000,%rax
  test   %ax,%ax
  jne    L19
  call   <EEPROMClearSectorMask@plt>
  jmp    L19
```

assistant: ```c
unsigned long EEPROMProgram(unsigned long *pulData, unsigned long ulAddress, unsigned long ulCount) {
  unsigned long ulStatus;
  DEBUG_ASSERT(pulData);
  DEBUG_ASSERT(ulAddress < (((((*((volatile unsigned long *)(0x400AF000)))) & 0x0000FFFF) >> 0) * 4));
  DEBUG_ASSERT((ulAddress + ulCount) <= (((((*((volatile unsigned long *)(0x400AF000)))) & 0x0000FFFF) >> 0) * 4));
  DEBUG_ASSERT((ulAddress & 3) == 0);
  DEBUG_ASSERT((ulCount & 3) == 0);
  do {
    ulStatus = (*((volatile unsigned long *)(0x400AF018)));
  } while (ulStatus & 0x00000001);
  (*((volatile unsigned long *)(0x400AF004))) = ((ulAddress) >> 6);
  (*((volatile unsigned long *)(0x400AF008))) = (((ulAddress) >> 2) & 0x0F);
  ulCount /= 4;
  while (ulCount) {
    if ((((*((volatile unsigned long *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00050000)) && (((*((volatile unsigned long *)(0x400FE000))) & (0x0000FF00 | 0x000000FF)) == (0x00000000 | 0x00000000))) {
      EEPROMSetSectorMask(ulAddress);
      ulAddress += 4;
    }
    (*((volatile unsigned long *)(0x400AF014))) = *pulData;
    do {
      ulStatus = (*((volatile unsigned long *)(0x400AF018)));
    } while (ulStatus & 0x00000001);
    if (ulStatus & (0x00000010 | 0x00000100)) {
      if ((((*((volatile unsigned long *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00050000)) && (((*((volatile unsigned long *)(0x400FE000))) & (0x0000FF00 | 0x000000FF)) == (0x00000000 | 0x00000000))) {
        EEPROMClearSectorMask();
      }
      return (ulStatus);
    }
    pulData++;
    ulCount--;
    if ((*((volatile unsigned long *)(0x400AF008))) == 0) {
      (*((volatile unsigned long *)(0x400AF004))) += 1;
    }
  }
  if ((((*((volatile unsigned long *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00050000)) && (((*((volatile unsigned long *)(0x400FE000))) & (0x0000FF00 | 0x000000FF)) == (0x00000000 | 0x00000000))) {
    EEPROMClearSectorMask();
  }
  return ((*((volatile unsigned long *)(0x400AF018))));
}
```