user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<realtek_mst_i2c_spi_write_256>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  and    $0xff,%ebx
  jne    L21
  call   <get_fd_from_context@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L107
  mov    %eax,%edi
  call   <realtek_mst_i2c_spi_disable_protection@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  je     L13
L50:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L13:
  mov    $0x2,%edx
  mov    $0x6d,%esi
  mov    %ebp,%edi
  call   <realtek_mst_i2c_spi_write_register@plt>
  mov    $0xff,%edx
  mov    $0x71,%esi
  mov    %ebp,%edi
  mov    %eax,%r15d
  call   <realtek_mst_i2c_spi_write_register@plt>
  or     %eax,%r15d
  test   %r13d,%r13d
  jne    L46
  jmp    L50
  nopl   0x0(%rax,%rax,1)
L19:
  mov    0x4(%rsp),%eax
  xor    %ecx,%ecx
  mov    %ebp,%edi
  lea    (%rax,%rbx,1),%esi
  mov    %esi,%edx
  shr    $0x10,%esi
  shr    $0x8,%edx
  call   <realtek_mst_i2c_spi_map_page@plt>
  or     %eax,%r15d
  jne    L50
  mov    $0x1,%r8d
  mov    $0x10,%ecx
  mov    $0x10,%edx
  mov    %ebp,%edi
  mov    $0x6f,%esi
  call   <realtek_mst_i2c_spi_wait_command_done@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L50
  mov    0x8(%rsp),%rcx
  mov    %ebx,%eax
  mov    $0x70,%esi
  mov    %ebp,%edi
  lea    (%rcx,%rax,4),%rdx
  mov    %r12d,%ecx
  call   <realtek_mst_i2c_spi_write_page@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L50
  mov    %ebp,%edi
  call   <realtek_mst_i2c_execute_write@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L50
  add    $0x100,%ebx
  cmp    %ebx,%r13d
  jbe    L50
L46:
  mov    %r13d,%r14d
  mov    $0x100,%esi
  sub    %ebx,%r14d
  mov    %r14d,%edi
  call   <min@plt>
  mov    %eax,%r12d
  cmp    $0xff,%r14d
  ja     L19
  lea    -0x1(%rax),%edx
  mov    $0x71,%esi
  mov    %ebp,%edi
  call   <realtek_mst_i2c_spi_write_register@plt>
  or     %eax,%r15d
  jmp    L19
  nopl   0x0(%rax)
L21:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1150 <default_spi_write_256@plt>
L107:
  mov    $0xffffffff,%r15d
  jmp    L50
```

assistant: ```c
int realtek_mst_i2c_spi_write_256(struct flashrom_flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len) {
  unsigned i;
  int ret = 0;
  if (start & 0xff)
    return default_spi_write_256(flash, buf, start, len);
  int fd = get_fd_from_context(flash);
  if (fd < 0)
    return -1;
  ret = realtek_mst_i2c_spi_disable_protection(fd);
  if (ret)
    return ret;
  ret |= realtek_mst_i2c_spi_write_register(fd, 0x6D, 0x02);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0x71, (256 - 1));
  for (i = 0; i < len; i += 256) {
    uint16_t page_len = min(len - i, 256);
    if (len - i < 256)
      ret |= realtek_mst_i2c_spi_write_register(fd, 0x71, page_len - 1);
    uint8_t block_idx = (start + i) >> 16;
    uint8_t page_idx = (start + i) >> 8;
    ret |= realtek_mst_i2c_spi_map_page(fd, block_idx, page_idx, 0);
    if (ret)
      break;
    ret |= realtek_mst_i2c_spi_wait_command_done(fd, 0x6F, 0x10, 0x10, 1);
    if (ret)
      break;
    ret |= realtek_mst_i2c_spi_write_page(fd, 0x70, buf + i, page_len);
    if (ret)
      break;
    ret |= realtek_mst_i2c_execute_write(fd);
    if (ret)
      break;
  }
  return ret;
}
```