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

```asm
<serialOpen>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,%ebx
  mov    %edx,%r13d
  mov    %ecx,%r12d
  mov    %r8d,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D180(%rip),%rax
  mov    (%rax),%esi
  mov    D18(%rip),%rax
  or     (%rax),%esi
  mov    D139(%rip),%rax
  or     (%rax),%esi
  call   <open@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jg     L106
L245:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L349
  mov    %ebp,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  mov    $0x0,%edx
  mov    D160(%rip),%rax
  mov    (%rax),%esi
  mov    %ebp,%edi
  call   <fcntl@plt>
  mov    %rsp,%r15
  mov    %r15,%rsi
  mov    %ebp,%edi
  call   <tcgetattr@plt>
  mov    %r15,%rdi
  call   <cfmakeraw@plt>
  mov    D297(%rip),%rax
  mov    (%rax),%rdx
  mov    (%rsp),%rax
  movl   $0x0,(%rax,%rdx,4)
  mov    D159(%rip),%rax
  mov    (%rax),%rdx
  mov    (%rsp),%rax
  movl   $0x14,(%rax,%rdx,4)
  cmp    $0x4b00,%ebx
  je     L268
  ja     L278
  cmp    $0x12c0,%ebx
  je     L22
  jbe    L114
  cmp    $0x2580,%ebx
  jne    L204
  mov    D351(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L114:
  cmp    $0x4b0,%ebx
  je     L206
  cmp    $0x708,%ebx
  jne    L204
  mov    D114(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L278:
  cmp    $0xe100,%ebx
  je     L10
  cmp    $0x1c200,%ebx
  jne    L264
  mov    D151(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L264:
  cmp    $0x9600,%ebx
  jne    L204
  mov    D301(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L206:
  mov    D13(%rip),%rax
  mov    (%rax),%r15d
L256:
  mov    %rsp,%rbx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <cfsetispeed@plt>
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <cfsetospeed@plt>
  mov    D12(%rip),%rax
  mov    (%rax),%edx
  mov    D209(%rip),%rax
  or     (%rax),%edx
  not    %edx
  and    0x8(%rsp),%edx
  mov    D52(%rip),%rax
  mov    (%rax),%eax
  mov    D71(%rip),%rcx
  or     (%rcx),%eax
  not    %eax
  and    %eax,0xc(%rsp)
  mov    D251(%rip),%rax
  mov    (%rax),%eax
  mov    D147(%rip),%rcx
  or     (%rcx),%eax
  or     %edx,%eax
  mov    D33(%rip),%rdx
  mov    (%rdx),%edx
  not    %edx
  and    %edx,0x14(%rsp)
  cmp    $0x6,%r13d
  je     L143
  cmp    $0x7,%r13d
  je     L137
  cmp    $0x5,%r13d
  je     L247
  mov    D220(%rip),%rdx
  or     (%rdx),%eax
  jmp    L263
L22:
  mov    D332(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L268:
  mov    D17(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L10:
  mov    D165(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L204:
  mov    D17(%rip),%rax
  mov    (%rax),%r15d
  jmp    L256
L247:
  mov    D243(%rip),%rdx
  or     (%rdx),%eax
L263:
  mov    D0(%rip),%rdx
  mov    (%rdx),%ecx
  mov    %ecx,%edx
  or     %eax,%edx
  cmp    $0x65,%r12b
  je     L126
  jg     L78
  cmp    $0x45,%r12b
  je     L126
  cmp    $0x4f,%r12b
  jne    L89
L170:
  mov    D187(%rip),%rax
  and    (%rax),%edx
  mov    %edx,%eax
  jmp    L167
L143:
  mov    D69(%rip),%rdx
  or     (%rdx),%eax
  jmp    L263
L137:
  mov    D181(%rip),%rdx
  or     (%rdx),%eax
  jmp    L263
L78:
  cmp    $0x6f,%r12b
  je     L170
L89:
  not    %ecx
  and    %ecx,%eax
  jmp    L167
L126:
  mov    D187(%rip),%rax
  mov    (%rax),%eax
  not    %eax
  and    %edx,%eax
L167:
  cmp    $0x2,%r14d
  je     L164
  mov    D344(%rip),%rdx
  mov    (%rdx),%edx
  not    %edx
  and    %edx,%eax
L322:
  mov    %eax,0x8(%rsp)
  mov    D100(%rip),%rax
  mov    (%rax),%eax
  mov    D94(%rip),%rdx
  or     (%rdx),%eax
  mov    D72(%rip),%rdx
  or     (%rdx),%eax
  mov    D22(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,0x10(%rsp)
  mov    %rsp,%rdx
  mov    D38(%rip),%rax
  mov    (%rax),%esi
  mov    %ebp,%edi
  call   <tcsetattr@plt>
  jmp    L245
L164:
  mov    D344(%rip),%rdx
  and    (%rdx),%eax
  jmp    L322
L349:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int serialOpen(const char *device, unsigned int baudrate, unsigned int bits, char parity, unsigned int stop) {
  int fd = -1;
  struct termios optnew;
  speed_t speed = B19200;
  fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY);
  if (fd > 0) {
    fcntl(fd, F_SETFL, 0);
    tcgetattr(fd, &optnew);
    cfmakeraw(&optnew);
    optnew.c_cc[VMIN] = 0;
    optnew.c_cc[VTIME] = 2 * 10;
    switch (baudrate) {
    case 1200:
      speed = B1200;
      break;
    case 1800:
      speed = B1800;
      break;
    case 4800:
      speed = B4800;
      break;
    case 9600:
      speed = B9600;
      break;
    case 19200:
      speed = B19200;
      break;
    case 38400:
      speed = B38400;
      break;
    case 57600:
      speed = B57600;
      break;
    case 115200:
      speed = B115200;
      break;
    default:
      speed = B19200;
      break;
    }
    cfsetispeed(&optnew, speed);
    cfsetospeed(&optnew, speed);
    optnew.c_cflag &= ~CSIZE;
    optnew.c_cflag &= ~CRTSCTS;
    optnew.c_iflag &= ~(ICRNL | IXON);
    optnew.c_cflag |= CLOCAL | CREAD;
    optnew.c_oflag &= ~OPOST;
    switch (bits) {
    case 5:
      optnew.c_cflag |= CS5;
      break;
    case 6:
      optnew.c_cflag |= CS6;
      break;
    case 7:
      optnew.c_cflag |= CS7;
      break;
    default:
      optnew.c_cflag |= CS8;
      break;
    }
    optnew.c_cflag |= PARENB;
    switch (parity) {
    case 'e':
    case 'E':
      optnew.c_cflag &= ~PARODD;
      break;
    case 'o':
    case 'O':
      optnew.c_cflag &= PARODD;
      break;
    default:
      optnew.c_cflag &= ~PARENB;
      break;
    }
    if (stop == 2)
      optnew.c_cflag &= CSTOPB;
    else
      optnew.c_cflag &= ~CSTOPB;
    optnew.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
    tcsetattr(fd, TCSANOW, &optnew);
  }
  return fd;
}
```