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

```asm
<FlashProgram>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  and    $0x3,%esi
  jne    L48
L69:
  test   $0x3,%dl
  jne    L101
  movq   $0x1,0x400fd014
  mov    0x400fe1a0,%rax
  test   $0x1,%al
  je     L134
  test   %rdx,%rdx
  je     L105
  nopl   0x0(%rax,%rax,1)
L151:
  mov    %rbx,%rax
  lea    (%rbx,%rdx,1),%rsi
  and    $0xffffffffffffff80,%rax
  mov    %rax,0x400fd000
  jmp    L12
  nopl   (%rax)
L9:
  mov    0x0(%rbp),%rax
  add    $0x8,%rbp
  sub    $0x4,%rdx
  mov    %rax,0x400fd100(%rcx)
L12:
  mov    %rsi,%rax
  sub    %rdx,%rax
  mov    %rax,%rcx
  and    $0x7c,%ecx
  jne    L29
  mov    0x400fd030,%rdi
  test   %rdi,%rdi
  jne    L39
L29:
  test   %rdx,%rdx
  jne    L9
L39:
  mov    $0xa4420001,%ebx
  mov    %rbx,0x400fd020
L59:
  mov    0x400fd020,%rcx
  and    $0x1,%ecx
  jne    L59
  test   %rdx,%rdx
  je     L105
  mov    %rax,%rbx
  jmp    L151
L134:
  test   %rdx,%rdx
  je     L105
L1:
  mov    %rbx,%rax
  lea    (%rbx,%rdx,1),%rsi
  mov    $0xa4420001,%ecx
  neg    %rax
  lea    0x0(%rbp,%rax,2),%rdi
  mov    %rbx,%rax
  nopl   0x0(%rax,%rax,1)
L98:
  mov    %rax,0x400fd000
  mov    (%rdi,%rax,2),%rdx
  mov    %rdx,0x400fd004
  mov    %rcx,0x400fd008
  nopl   0x0(%rax)
L91:
  mov    0x400fd008,%rdx
  and    $0x1,%edx
  jne    L91
  add    $0x4,%rax
  cmp    %rax,%rsi
  jne    L98
L105:
  mov    0x400fd00c,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  and    $0x1,%eax
  neg    %rax
  ret
L101:
  mov    $0xc9,%esi
  lea    D11(%rip),%rdi
  mov    %rdx,0x8(%rsp)
  call   <AssertFailure@plt>
  mov    0x8(%rsp),%rdx
  movq   $0x1,0x400fd014
  mov    0x400fe1a0,%rax
  test   $0x1,%al
  jne    L151
  jmp    L1
L48:
  mov    $0xc8,%esi
  lea    D11(%rip),%rdi
  mov    %rdx,0x8(%rsp)
  call   <AssertFailure@plt>
  mov    0x8(%rsp),%rdx
  jmp    L69
```

tool_calls: name: parse_data
arguments: data_tag: D11
datatype: string

tool: D11: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/flashlib.c

assistant: ```c
long FlashProgram(unsigned long *pulData, unsigned long ulAddress, unsigned long ulCount) {
  {
    if (!(!(ulAddress & 3))) {
      AssertFailure("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/flashlib.c", 200);
    }
  };
  {
    if (!(!(ulCount & 3))) {
      AssertFailure("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S8962_Crossworks/Boot/lib/driverlib/flashlib.c", 201);
    }
  };
  (*((volatile unsigned long *)(0x400FD014))) = 0x00000001;
  if ((*((volatile unsigned long *)(0x400FE1A0))) & 0x00000001) {
    while (ulCount) {
      (*((volatile unsigned long *)(0x400FD000))) = ulAddress & ~(0x7f);
      while (((ulAddress & 0x7c) || ((*((volatile unsigned long *)(0x400FD030))) == 0)) && (ulCount != 0)) {
        (*((volatile unsigned long *)(0x400FD100 + (ulAddress & 0x7c)))) = *pulData++;
        ulAddress += 4;
        ulCount -= 4;
      }
      (*((volatile unsigned long *)(0x400FD020))) = 0xA4420000 | 0x00000001;
      while ((*((volatile unsigned long *)(0x400FD020))) & 0x00000001) {
      }
    }
  } else {
    while (ulCount) {
      (*((volatile unsigned long *)(0x400FD000))) = ulAddress;
      (*((volatile unsigned long *)(0x400FD004))) = *pulData;
      (*((volatile unsigned long *)(0x400FD008))) = 0xA4420000 | 0x00000001;
      while ((*((volatile unsigned long *)(0x400FD008))) & 0x00000001) {
      }
      pulData++;
      ulAddress += 4;
      ulCount -= 4;
    }
  }
  if ((*((volatile unsigned long *)(0x400FD00C))) & 0x00000001) {
    return (-1);
  }
  return (0);
}
```