user: 这段汇编代码用C语言表示是什么样的：

```asm
<realtek_mst_i2c_spi_send_command>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %r8,0x8(%rsp)
  cmp    $0x3,%edx
  ja     L179
  lea    -0x1(%rsi),%r15d
  cmp    $0x3,%r15d
  ja     L179
  mov    %esi,%r13d
  mov    %edx,%r14d
  mov    %rcx,%r12
  call   <get_fd_from_context@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L179
  lea    0x0(,%r15,8),%eax
  lea    (%r14,%r14,1),%edx
  or     %eax,%edx
  movzbl (%r12),%eax
  cmp    $0x20,%al
  je     L116
  ja     L11
  cmp    $0x1,%al
  je     L163
  cmp    $0x6,%al
  jne    L227
  xor    %r12d,%r12d
L172:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L83:
  cmp    $0x52,%al
  je     L116
  cmp    $0x60,%al
  jne    L227
L116:
  movl   $0x1,(%rsp)
L13:
  or     $0xa0,%dl
  mov    %edx,0x4(%rsp)
L201:
  mov    $0x60,%esi
  mov    %ebp,%edi
  call   <realtek_mst_i2c_spi_write_register@plt>
  movzbl (%r12),%edx
  mov    $0x61,%esi
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <realtek_mst_i2c_spi_write_register@plt>
  or     %eax,%ebx
  test   %r15d,%r15d
  je     L148
  lea    -0x2(%r13),%eax
  lea    0x1(%r12),%r15
  lea    0x2(%r12,%rax,1),%r13
  mov    $0x64,%r12d
  sub    %r15d,%r12d
  nop
L183:
  movzbl (%r15),%edx
  lea    (%r12,%r15,1),%esi
  mov    %ebp,%edi
  add    $0x1,%r15
  call   <realtek_mst_i2c_spi_write_register@plt>
  or     %eax,%ebx
  cmp    %r13,%r15
  jne    L183
L148:
  movzbl 0x4(%rsp),%edx
  mov    $0x60,%esi
  mov    %ebp,%edi
  or     $0x1,%edx
  movzbl %dl,%edx
  call   <realtek_mst_i2c_spi_write_register@plt>
  or     %ebx,%eax
  mov    %eax,%r12d
  jne    L172
  mov    (%rsp),%r8d
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    $0x60,%esi
  mov    %ebp,%edi
  call   <realtek_mst_i2c_spi_wait_command_done@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L172
  test   %r14d,%r14d
  je     L172
  mov    0x8(%rsp),%rbx
  lea    -0x1(%r14),%eax
  mov    $0x67,%r14d
  lea    0x1(%rbx,%rax,1),%r13
  sub    %ebx,%r14d
  xchg   %ax,%ax
L21:
  lea    (%r14,%rbx,1),%esi
  mov    %rbx,%rdx
  mov    %ebp,%edi
  add    $0x1,%rbx
  call   <realtek_mst_i2c_spi_read_register@plt>
  or     %eax,%r12d
  cmp    %rbx,%r13
  jne    L21
  jmp    L172
  nop
L11:
  cmp    $0xc7,%al
  je     L137
  jbe    L83
  add    $0x29,%eax
  cmp    $0x1,%al
  jbe    L116
L227:
  or     $0x40,%edx
  movl   $0x1,(%rsp)
  mov    %edx,0x4(%rsp)
  jmp    L201
  nopl   0x0(%rax,%rax,1)
L137:
  movl   $0x14,(%rsp)
  jmp    L13
  nopl   0x0(%rax)
L163:
  or     $0x60,%edx
  movl   $0x1,(%rsp)
  mov    %edx,0x4(%rsp)
  jmp    L201
L179:
  mov    $0xffffffff,%r12d
  jmp    L172
```

assistant: ```c
int realtek_mst_i2c_spi_send_command(const struct flashrom_flashctx *flash, unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr) {
  unsigned i;
  int max_timeout_mul = 1;
  int ret = 0;
  if (writecnt > 4 || readcnt > 3 || writecnt == 0) {
    return -1;
  }
  int fd = get_fd_from_context(flash);
  if (fd < 0)
    return -1;
  writecnt--;
  uint8_t ctrl_reg_val = (writecnt << 3) | (readcnt << 1);
  switch (writearr[0]) {
  case 0x06:
    return 0;
  case 0x01:
    ctrl_reg_val |= (1 << 5);
    ctrl_reg_val |= (2 << 5);
    break;
  case 0xc7:
    max_timeout_mul *= 20;
  case 0x60:
  case 0x52:
  case 0xd8:
  case 0xd7:
  case 0x20:
    ctrl_reg_val |= (1 << 5);
    ctrl_reg_val |= (4 << 5);
    break;
  default:
    ctrl_reg_val |= (2 << 5);
  }
  ret |= realtek_mst_i2c_spi_write_register(fd, 0x60, ctrl_reg_val);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0x61, writearr[0]);
  for (i = 0; i < writecnt; ++i)
    ret |= realtek_mst_i2c_spi_write_register(fd, 0x64 + i, writearr[i + 1]);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0x60, ctrl_reg_val | 0x1);
  if (ret)
    return ret;
  ret = realtek_mst_i2c_spi_wait_command_done(fd, 0x60, 0x01, 0, max_timeout_mul);
  if (ret)
    return ret;
  for (i = 0; i < readcnt; ++i)
    ret |= realtek_mst_i2c_spi_read_register(fd, 0x67 + i, &readarr[i]);
  return ret;
}
```