user: 请将以下的汇编代码转换成C语言代码：

```asm
<block_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <unlock_block_for_writes@plt>
  mov    -0x14(%rbp),%eax
  mov    $0xe8,%esi
  mov    %eax,%edi
  call   <flash_write@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <flash_read@plt>
  and    $0x80,%eax
  test   %eax,%eax
  jne    L10
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L10:
  mov    -0x14(%rbp),%eax
  mov    $0x1f,%esi
  mov    %eax,%edi
  call   <flash_write@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L21
L101:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x14(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  add    %ecx,%edx
  mov    %eax,%esi
  mov    %edx,%edi
  call   <flash_write@plt>
  addl   $0x1,-0x8(%rbp)
L21:
  cmpl   $0x1f,-0x8(%rbp)
  jle    L101
  mov    -0x14(%rbp),%eax
  mov    $0xd0,%esi
  mov    %eax,%edi
  call   <flash_write@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <flash_read@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L44
L32:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <flash_read@plt>
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L44:
  mov    -0x4(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L81
  cmpl   $0xffe,-0x8(%rbp)
  jle    L32
L81:
  mov    -0x4(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L97
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L97:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <flash_read_status@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L58
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L58:
  mov    -0x4(%rbp),%eax
  and    $0x30,%eax
  test   %eax,%eax
  je     L99
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L99:
  mov    -0x4(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L103
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L103:
  mov    -0x4(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L84
  mov    -0x14(%rbp),%eax
  lea    (%rax,%rax,1),%ecx
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%esi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <warnx@plt>
L84:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <lock_block_to_prevent_writes@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <flash_read_mode@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D2
datatype: string
name: unpack_data
arguments: data_tag: D38
datatype: string
name: unpack_data
arguments: data_tag: D22
datatype: string
name: unpack_data
arguments: data_tag: D9
datatype: string
name: unpack_data
arguments: data_tag: D50
datatype: string
name: unpack_data
arguments: data_tag: D35
datatype: string

tool: D2: block_write to flash failed - block write not supported by device?

tool: D38: ERROR on block-write - flash is busy even after 0x%x checks


tool: D22: Vpp voltage droop error during block-write, aborted, status=0x%02x


tool: D9: Command sequence error during block-write, aborted, status=0x%02x


tool: D50: Block locked during block-write process, aborted, status=0x%02x


tool: D35: Block-write failed at offset 0x%08x, status=0x%02x


assistant: ```c
void block_write(int addr16b, int *data) {
  int j, f, status;
  unlock_block_for_writes(addr16b);
  flash_write(addr16b, 0xe8);
  if ((flash_read(addr16b) & 0x80) == 0)
    warnx("block_write to flash failed - block write not supported by device?");
  flash_write(addr16b, 0x1f);
  for (j = 0; j < 0x20; j++)
    flash_write(addr16b + j, data[j]);
  flash_write(addr16b, 0xd0);
  status = flash_read(addr16b);
  for (j = 0; ((status & 0x80) == 0) && (j < 0xfff); j++)
    status = flash_read(addr16b);
  if ((status & 0x80) == 0)
    warnx("ERROR on block-write - flash is busy even after 0x%x checks\n", j);
  status = flash_read_status(addr16b);
  if ((status & (1 << 3)) != 0)
    warnx("Vpp voltage droop error during block-write, aborted, status=0x%02x\n", status);
  if ((status & (3 << 4)) != 0)
    warnx("Command sequence error during block-write, aborted, status=0x%02x\n", status);
  if ((status & (1 << 1)) != 0)
    warnx("Block locked during block-write process, aborted, status=0x%02x\n", status);
  if ((status & (1 << 5)) != 0)
    warnx("Block-write failed at offset 0x%08x, status=0x%02x\n", addr16b << 1, status);
  lock_block_to_prevent_writes(addr16b);
  flash_read_mode(addr16b);
}
```