user: What would the C source look like for the assembly code provided here:

```asm
<flash_unlock_block>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %rdi,-0x138(%rbp)
  mov    %esi,-0x13c(%rbp)
  mov    %edx,-0x140(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x4c4b40,-0x128(%rbp)
  mov    -0x138(%rbp),%rax
  and    $0xff800000,%eax
  cmp    $0xfff,%eax
  ja     L45
  mov    -0x138(%rbp),%rax
  and    $0x2f800000,%eax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L37
L45:
  mov    -0x138(%rbp),%rax
  mov    %eax,%eax
  and    $0xff800000,%eax
L37:
  mov    %rax,-0x118(%rbp)
  mov    -0x118(%rbp),%rax
  movw   $0x50,(%rax)
  mov    -0x138(%rbp),%rax
  and    $0xff800000,%eax
  mov    %rax,-0x120(%rbp)
  movl   $0x0,-0x124(%rbp)
  jmp    L226
L282:
  mov    -0x120(%rbp),%rax
  cmp    -0x138(%rbp),%rax
  jne    L255
  mov    -0x124(%rbp),%eax
  cltq
  movw   $0x0,-0x110(%rbp,%rax,2)
  jmp    L70
L255:
  mov    -0x120(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L104
  mov    -0x120(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L108
L104:
  mov    -0x120(%rbp),%rax
  mov    %eax,%eax
L108:
  movw   $0x98,(%rax)
  mov    -0x120(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L155
  mov    -0x120(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  add    $0x4,%rax
  jmp    L159
L155:
  mov    -0x120(%rbp),%rax
  mov    %eax,%eax
  add    $0x4,%rax
L159:
  movzwl (%rax),%edx
  mov    -0x124(%rbp),%eax
  cltq
  mov    %dx,-0x110(%rbp,%rax,2)
L70:
  mov    -0x13c(%rbp),%eax
  cltq
  and    $0xfffffffffffffffe,%rax
  add    %rax,-0x120(%rbp)
  addl   $0x1,-0x124(%rbp)
L226:
  mov    -0x124(%rbp),%eax
  cmp    -0x140(%rbp),%eax
  jl     L282
  mov    -0x138(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L215
  mov    -0x138(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L83
L215:
  mov    -0x138(%rbp),%rax
  mov    %eax,%eax
L83:
  movb   $0x60,(%rax)
  mov    -0x138(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L128
  mov    -0x138(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L250
L128:
  mov    -0x138(%rbp),%rax
  mov    %eax,%eax
L250:
  movb   $0xd0,(%rax)
  movl   $0x4c4b40,-0x128(%rbp)
  jmp    L290
L253:
  subl   $0x1,-0x128(%rbp)
  cmpl   $0x0,-0x128(%rbp)
  je     L251
L290:
  mov    -0x118(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0x12a(%rbp)
  movzwl -0x12a(%rbp),%eax
  and    $0x80,%eax
  cmp    $0x80,%eax
  jne    L253
  mov    -0x138(%rbp),%rax
  and    $0xff800000,%eax
  mov    %rax,-0x120(%rbp)
  movl   $0x0,-0x124(%rbp)
  jmp    L296
L168:
  mov    -0x124(%rbp),%eax
  cltq
  movzwl -0x110(%rbp,%rax,2),%eax
  test   %ax,%ax
  je     L183
  mov    -0x120(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L212
  mov    -0x120(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L234
L212:
  mov    -0x120(%rbp),%rax
  mov    %eax,%eax
L234:
  movb   $0x60,(%rax)
  mov    -0x120(%rbp),%rax
  cmp    $0xfff,%eax
  ja     L38
  mov    -0x120(%rbp),%rax
  or     $0xd0000000,%eax
  mov    %eax,%eax
  jmp    L20
L38:
  mov    -0x120(%rbp),%rax
  mov    %eax,%eax
L20:
  movb   $0x1,(%rax)
  movl   $0x4c4b40,-0x128(%rbp)
  jmp    L62
L27:
  subl   $0x1,-0x128(%rbp)
  cmpl   $0x0,-0x128(%rbp)
  je     L244
L62:
  mov    -0x118(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0x12a(%rbp)
  movzwl -0x12a(%rbp),%eax
  and    $0x80,%eax
  cmp    $0x80,%eax
  jne    L27
L183:
  mov    -0x13c(%rbp),%eax
  cltq
  and    $0xfffffffffffffffe,%rax
  add    %rax,-0x120(%rbp)
  addl   $0x1,-0x124(%rbp)
L296:
  mov    -0x124(%rbp),%eax
  cmp    -0x140(%rbp),%eax
  jl     L168
  jmp    L61
L251:
  nop
  jmp    L61
L244:
  nop
L61:
  mov    -0x118(%rbp),%rax
  movw   $0xff,(%rax)
  movzwl -0x12a(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L129
  call   <__stack_chk_fail@plt>
L129:
  leave
  ret
```

assistant: ```c
int flash_unlock_block(volatile unsigned char *block, int block_size, int blocks) {
  volatile unsigned short *ROM, *bp;
  unsigned short stat;
  int timeout = 5000000;
  unsigned short is_locked[128];
  int i;
  ROM = (unsigned short *)((volatile unsigned char *)(((unsigned)((unsigned long)block & 0xFF800000) < 0x1000) ? ((unsigned)((unsigned long)block & 0xFF800000) | 0xd0000000) : (unsigned)((unsigned long)block & 0xFF800000)));
  ROM[0] = 0x50;
  bp = (unsigned short *)((unsigned long)block & 0xFF800000);
  for (i = 0; i < blocks; i++) {
    if (bp == (unsigned short *)block) {
      is_locked[i] = 0;
    } else {
      *(volatile unsigned short *)((volatile unsigned char *)(((unsigned)(bp) < 0x1000) ? ((unsigned)(bp) | 0xd0000000) : (unsigned)(bp))) = 0x98;
      is_locked[i] = ((volatile unsigned short *)((volatile unsigned char *)(((unsigned)(bp) < 0x1000) ? ((unsigned)(bp) | 0xd0000000) : (unsigned)(bp))))[2];
    }
    bp += block_size / sizeof(*bp);
  }
  ((volatile unsigned char *)(((unsigned)(block) < 0x1000) ? ((unsigned)(block) | 0xd0000000) : (unsigned)(block)))[0] = 0x60;
  ((volatile unsigned char *)(((unsigned)(block) < 0x1000) ? ((unsigned)(block) | 0xd0000000) : (unsigned)(block)))[0] = 0xD0;
  timeout = 5000000;
  while (((stat = ROM[0]) & 0x80) != 0x80) {
    if (--timeout == 0)
      goto done;
  }
  bp = (unsigned short *)((unsigned long)block & 0xFF800000);
  for (i = 0; i < blocks; i++) {
    if (is_locked[i]) {
      *((volatile unsigned char *)(((unsigned)(bp) < 0x1000) ? ((unsigned)(bp) | 0xd0000000) : (unsigned)(bp))) = 0x60;
      *((volatile unsigned char *)(((unsigned)(bp) < 0x1000) ? ((unsigned)(bp) | 0xd0000000) : (unsigned)(bp))) = 0x01;
      timeout = 5000000;
      while (((stat = ROM[0]) & 0x80) != 0x80) {
        if (--timeout == 0)
          goto done;
      }
    }
    bp += block_size / sizeof(*bp);
  }
done:
  ROM[0] = 0xFF;
  return stat;
}
```