user: Translate the below assembly code into C programming language:

```asm
<set_serial>:
  endbr64
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r12
  mov    %r12,%rsi
  call   <tcgetattr@plt>
  test   %rax,%rax
  jne    L61
  mov    D29(%rip),%rax
  mov    D119(%rip),%rdx
  pxor   %xmm0,%xmm0
  movups %xmm0,0x18(%rsp)
  mov    (%rax),%eax
  mov    %eax,0x28(%rsp)
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  or     (%rdx),%eax
  mov    D143(%rip),%rdx
  or     (%rdx),%eax
  mov    %eax,0x10(%rsp)
  cmp    $0x1c200,%ebx
  je     L173
  cmp    $0xe100,%ebx
  je     L117
  cmp    $0x9600,%ebx
  je     L135
  cmp    $0x4b00,%ebx
  je     L67
  cmp    $0x2580,%ebx
  je     L196
  cmp    $0x12c0,%ebx
  je     L50
  cmp    $0x960,%ebx
  je     L28
  cmp    $0x4b0,%ebx
  je     L92
  cmp    $0x12c,%ebx
  jne    L61
  mov    D156(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L173:
  mov    D96(%rip),%rbx
L89:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  call   <cfsetospeed@plt>
  mov    (%rbx),%esi
  mov    %r12,%rdi
  call   <cfsetispeed@plt>
  mov    D148(%rip),%rax
  mov    %r12,%rdx
  mov    %ebp,%edi
  mov    (%rax),%esi
  call   <tcsetattr@plt>
  test   %rax,%rax
  jne    L61
  mov    D113(%rip),%rax
  lea    0xc(%rsp),%r12
  mov    %ebp,%edi
  mov    %r12,%rdx
  mov    (%rax),%esi
  call   <ioctl@plt>
  mov    D103(%rip),%rax
  mov    %r12,%rdx
  mov    %ebp,%edi
  mov    (%rax),%eax
  or     %eax,0xc(%rsp)
  mov    D158(%rip),%rax
  mov    (%rax),%esi
  call   <ioctl@plt>
  xor    %eax,%eax
L32:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L202
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L67:
  mov    D141(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L117:
  mov    D159(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L135:
  mov    D6(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L196:
  mov    D25(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L50:
  mov    D37(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L28:
  mov    D93(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L92:
  mov    D65(%rip),%rbx
  jmp    L89
  nopl   0x0(%rax)
L61:
  mov    $0xffffffff,%eax
  jmp    L32
L202:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int set_serial(int fd, int baud) {
  struct termios tios;
  if (tcgetattr(fd, &tios))
    return -1;
  tios.c_iflag = IGNPAR;
  tios.c_oflag = 0;
  tios.c_cflag = (CS8 | CREAD | CLOCAL);
  tios.c_lflag = 0;
  if (baud == 115200) {
    cfsetospeed(&tios, B115200);
    cfsetispeed(&tios, B115200);
  } else if (baud == 57600) {
    cfsetospeed(&tios, B57600);
    cfsetispeed(&tios, B57600);
  } else if (baud == 38400) {
    cfsetospeed(&tios, B38400);
    cfsetispeed(&tios, B38400);
  } else if (baud == 19200) {
    cfsetospeed(&tios, B19200);
    cfsetispeed(&tios, B19200);
  } else if (baud == 9600) {
    cfsetospeed(&tios, B9600);
    cfsetispeed(&tios, B9600);
  } else if (baud == 4800) {
    cfsetospeed(&tios, B4800);
    cfsetispeed(&tios, B4800);
  } else if (baud == 2400) {
    cfsetospeed(&tios, B2400);
    cfsetispeed(&tios, B2400);
  } else if (baud == 1200) {
    cfsetospeed(&tios, B1200);
    cfsetispeed(&tios, B1200);
  } else if (baud == 300) {
    cfsetospeed(&tios, B300);
    cfsetispeed(&tios, B300);
  } else
    return -1;
  if (tcsetattr(fd, TCSANOW, &tios))
    return -1;
  struct serial_struct ss;
  ioctl(fd, TIOCGSERIAL, &ss);
  ss.flags |= ASYNC_LOW_LATENCY;
  ioctl(fd, TIOCSSERIAL, &ss);
  return 0;
}
```