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

```asm
<FlashNVR_WriteData_Byte>:
  endbr64
  mov    $0x1,%r8d
  cmp    $0x2,%dil
  ja     L52
  push   %r15
  push   %r14
  push   %r13
  lea    -0x1(%rcx),%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0xff,%r13w
  ja     L39
  movzbl %sil,%ebp
  movzwl %cx,%eax
  add    %ebp,%eax
  cmp    $0x100,%eax
  jg     L39
  xor    %eax,%eax
  mov    %rdx,%rbx
  mov    %edi,%r12d
  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>
  xor    %eax,%eax
  call   <ReadWPB@plt>
  mov    $0x5,%r8d
  mov    %eax,%r15d
  cmp    $0x1,%eax
  je     L46
L39:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L52:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L46:
  mov    $0xe0700c,%esi
  mov    $0xc000,%edi
  movzbl %r12b,%r14d
  movzwl %r13w,%r13d
  call   <RamWrite32A@plt>
  xor    %esi,%esi
  mov    $0xd000,%edi
  shl    $0x3,%r14d
  call   <RamWrite32A@plt>
  mov    $0xe0701c,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    %r12d,%ecx
  mov    %r15d,%esi
  mov    $0xd000,%edi
  shl    %cl,%esi
  lea    0x1(%rbx,%r13,1),%r12
  call   <RamWrite32A@plt>
  mov    $0xe07008,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  lea    0x10000(%rbp),%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  nopl   0x0(%rax)
L32:
  mov    $0xe07004,%esi
  mov    $0xc000,%edi
  add    $0x1,%rbx
  call   <RamWrite32A@plt>
  movzbl -0x1(%rbx),%esi
  mov    %r14d,%ecx
  mov    $0xd000,%edi
  shl    %cl,%rsi
  call   <RamWrite32A@plt>
  mov    $0xe07010,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  mov    $0x2,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  cmp    %r12,%rbx
  jne    L32
  mov    $0xe07014,%esi
  mov    $0xc000,%edi
  call   <RamWrite32A@plt>
  xor    %esi,%esi
  mov    $0xd000,%edi
  call   <RamWrite32A@plt>
  xor    %edi,%edi
  call   <WPBCtrl@plt>
  xor    %eax,%eax
  call   <FlashReset@plt>
  xor    %r8d,%r8d
  jmp    L39
```

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);
}
```