user: 请从给定的汇编指令推导出C源代码：

```asm
<set_ics_data>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%ecx
  mov    %esi,-0x8(%rbp)
  mov    %edx,%eax
  mov    %ecx,%edx
  mov    %dl,-0x4(%rbp)
  mov    %al,-0xc(%rbp)
  mov    $0x0,%eax
  call   <smbus_reset@plt>
  mov    $0x505,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  mov    $0x80,%esi
  mov    $0x80,%edi
  call   <outb@plt>
  mov    $0x0,%eax
  call   <smbus_wait_until_ready@plt>
  mov    $0x502,%edi
  call   <inb@plt>
  cmpb   $0xd2,-0x4(%rbp)
  jne    L6
  mov    $0x507,%esi
  mov    $0xd,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x3f,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xcd,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x7f,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xbf,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x1a,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x2a,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x1,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xf,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xb,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x80,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x8d,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x9b,%edi
  call   <outb@plt>
  jmp    L3
L6:
  mov    $0x507,%esi
  mov    $0x8,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xff,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x3f,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xff,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xff,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xff,%edi
  call   <outb@plt>
  mov    $0x507,%esi
  mov    $0xff,%edi
  call   <outb@plt>
L3:
  movzbl -0x4(%rbp),%eax
  mov    $0x504,%esi
  mov    %eax,%edi
  call   <outb@plt>
  mov    $0x503,%esi
  mov    $0x0,%edi
  call   <outb@plt>
  movsbl -0xc(%rbp),%eax
  mov    $0x505,%esi
  mov    %eax,%edi
  call   <outb@plt>
  mov    $0x502,%esi
  mov    $0x74,%edi
  call   <outb@plt>
  mov    $0x80,%esi
  mov    $0x80,%edi
  call   <outb@plt>
  mov    $0x0,%eax
  call   <smbus_wait_until_ready@plt>
  mov    $0x0,%eax
  call   <smbus_reset@plt>
  nop
  leave
  ret
```

assistant: ```c
void set_ics_data(unsigned char dev, int data, char len) {
  smbus_reset();
  outb(0x00, 0x0500 + 0x5);
  outb(0x80, 0x80);
  smbus_wait_until_ready();
  inb(0x0500 + 0x2);
  if (dev == 0xd2) {
    outb(0x0d, 0x0500 + 0x7);
    outb(0x00, 0x0500 + 0x7);
    outb(0x3f, 0x0500 + 0x7);
    outb(0xcd, 0x0500 + 0x7);
    outb(0x7f, 0x0500 + 0x7);
    outb(0xbf, 0x0500 + 0x7);
    outb(0x1a, 0x0500 + 0x7);
    outb(0x2a, 0x0500 + 0x7);
    outb(0x01, 0x0500 + 0x7);
    outb(0x0f, 0x0500 + 0x7);
    outb(0x0b, 0x0500 + 0x7);
    outb(0x80, 0x0500 + 0x7);
    outb(0x8d, 0x0500 + 0x7);
    outb(0x9b, 0x0500 + 0x7);
  } else {
    outb(0x08, 0x0500 + 0x7);
    outb(0xff, 0x0500 + 0x7);
    outb(0x3f, 0x0500 + 0x7);
    outb(0x00, 0x0500 + 0x7);
    outb(0x00, 0x0500 + 0x7);
    outb(0xff, 0x0500 + 0x7);
    outb(0xff, 0x0500 + 0x7);
    outb(0xff, 0x0500 + 0x7);
    outb(0xff, 0x0500 + 0x7);
  }
  outb(dev, 0x0500 + 0x4);
  outb(0, 0x0500 + 0x3);
  outb(len, 0x0500 + 0x5);
  outb(0x74, 0x0500 + 0x2);
  outb(0x80, 0x80);
  smbus_wait_until_ready();
  smbus_reset();
}
```