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

```asm
<FlashNVR_WriteData_Byte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdx,-0x20(%rbp)
  mov    %ecx,%eax
  mov    %edi,%edx
  mov    %dl,-0x14(%rbp)
  mov    %esi,%edx
  mov    %dl,-0x18(%rbp)
  mov    %ax,-0x24(%rbp)
  cmpb   $0x2,-0x14(%rbp)
  jbe    L25
  mov    $0x1,%eax
  jmp    L48
L25:
  cmpw   $0x0,-0x24(%rbp)
  je     L52
  cmpw   $0x100,-0x24(%rbp)
  jbe    L58
L52:
  mov    $0x1,%eax
  jmp    L48
L58:
  movzbl -0x18(%rbp),%edx
  movzwl -0x24(%rbp),%eax
  add    %edx,%eax
  cmp    $0x100,%eax
  jle    L80
  mov    $0x1,%eax
  jmp    L48
L80:
  mov    $0x0,%eax
  call   <FlashResetRelease@plt>
  mov    $0xe07014,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x1,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe0701c,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x7,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07008,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x10100,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe0700c,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x7,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07010,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x7,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07030,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x73,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07034,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x43,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0x1,%edi
  call   <WPBCtrl@plt>
  mov    $0x0,%eax
  call   <ReadWPB@plt>
  cmp    $0x1,%eax
  je     L9
  mov    $0x5,%eax
  jmp    L48
L9:
  mov    $0xe0700c,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x0,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe0701c,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  movzbl -0x14(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07008,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  movzbl -0x18(%rbp),%eax
  add    $0x10000,%eax
  mov    %eax,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  movw   $0x0,-0x2(%rbp)
  jmp    L109
L33:
  mov    $0xe07004,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  movzwl -0x2(%rbp),%edx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  movzbl -0x14(%rbp),%eax
  shl    $0x3,%eax
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  mov    %eax,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0xe07010,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x2,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  movzwl -0x2(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x2(%rbp)
L109:
  movzwl -0x2(%rbp),%eax
  cmp    -0x24(%rbp),%ax
  jb     L33
  mov    $0xe07014,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x0,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  mov    $0x0,%edi
  call   <WPBCtrl@plt>
  mov    $0x0,%eax
  call   <FlashReset@plt>
  mov    $0x0,%eax
L48:
  leave
  ret
```

assistant: ```c
short FlashNVR_WriteData_Byte(unsigned char Sel, unsigned char SetAddress, unsigned char *WritePtr, unsigned short Num) {
  unsigned short UsNum;
  if (Sel >= 3)
    return (1);
  if (Num == 0 || Num > 256)
    return (1);
  if (SetAddress + Num > 256)
    return (1);
  FlashResetRelease();
  RamWrite32A(0xC000, (0xE07000 + 0x14));
  RamWrite32A(0xD000, 1);
  RamWrite32A(0xC000, (0xE07000 + 0x1C));
  RamWrite32A(0xD000, 7);
  RamWrite32A(0xC000, (0xE07000 + 0x08));
  RamWrite32A(0xD000, 0x00010100);
  RamWrite32A(0xC000, (0xE07000 + 0x0C));
  RamWrite32A(0xD000, 7);
  RamWrite32A(0xC000, (0xE07000 + 0x10));
  RamWrite32A(0xD000, 7);
  RamWrite32A(0xC000, (0xE07000 + 0x30));
  RamWrite32A(0xD000, 0x73);
  RamWrite32A(0xC000, (0xE07000 + 0x34));
  RamWrite32A(0xD000, 0x43);
  WPBCtrl(0x01);
  if (ReadWPB() != 1)
    return (5);
  RamWrite32A(0xC000, (0xE07000 + 0x0C));
  RamWrite32A(0xD000, 0);
  RamWrite32A(0xC000, (0xE07000 + 0x1C));
  RamWrite32A(0xD000, (1 << Sel));
  RamWrite32A(0xC000, (0xE07000 + 0x08));
  RamWrite32A(0xD000, 0x00010000 + SetAddress);
  for (UsNum = 0; UsNum < Num; UsNum++) {
    RamWrite32A(0xC000, (0xE07000 + 0x04));
    RamWrite32A(0xD000, ((unsigned long)(WritePtr[UsNum]) << (Sel * 8)));
    RamWrite32A(0xC000, (0xE07000 + 0x10));
    RamWrite32A(0xD000, 2);
  }
  RamWrite32A(0xC000, (0xE07000 + 0x14));
  RamWrite32A(0xD000, 0);
  WPBCtrl(0x00);
  FlashReset();
  return (0);
}
```