user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rate_to_constant>:
  endbr64
  cmp    $0x2580,%edi
  je     L146
  jg     L270
  cmp    $0x12c,%edi
  je     L18
  jle    L304
  cmp    $0x708,%edi
  je     L67
  jle    L238
  cmp    $0x960,%edi
  je     L314
  cmp    $0x12c0,%edi
  jne    L213
  mov    D187(%rip),%rax
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax)
L270:
  cmp    $0x7a120,%edi
  je     L205
  jle    L46
  cmp    $0xf4240,%edi
  je     L124
  jle    L177
  cmp    $0x119400,%edi
  je     L182
  cmp    $0x16e360,%edi
  jne    L213
  mov    D31(%rip),%rax
  mov    (%rax),%eax
  ret
  xchg   %ax,%ax
L238:
  cmp    $0x258,%edi
  je     L289
  cmp    $0x4b0,%edi
  jne    L213
  mov    D184(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L304:
  cmp    $0x86,%edi
  je     L211
  jle    L187
  cmp    $0x96,%edi
  je     L137
  cmp    $0xc8,%edi
  jne    L213
  mov    D165(%rip),%rax
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax)
L177:
  cmp    $0x8ca00,%edi
  je     L241
  cmp    $0xe1000,%edi
  jne    L213
  mov    D62(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L46:
  cmp    $0x1c200,%edi
  je     L311
  jle    L246
  cmp    $0x38400,%edi
  je     L111
  cmp    $0x70800,%edi
  jne    L213
  mov    D92(%rip),%rax
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax,%rax,1)
L187:
  cmp    $0x4b,%edi
  je     L210
  cmp    $0x6e,%edi
  jne    L112
  mov    D57(%rip),%rax
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax,%rax,1)
L246:
  cmp    $0x9600,%edi
  je     L81
  cmp    $0xe100,%edi
  jne    L73
  mov    D120(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L112:
  cmp    $0x32,%edi
  jne    L213
  mov    D70(%rip),%rax
  mov    (%rax),%eax
  ret
  nopl   0x0(%rax,%rax,1)
L73:
  cmp    $0x4b00,%edi
  jne    L213
  mov    D215(%rip),%rax
  mov    (%rax),%eax
  ret
  xchg   %ax,%ax
L146:
  mov    D125(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L81:
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L210:
  mov    D208(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L111:
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L311:
  mov    D119(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L241:
  mov    D202(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L137:
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L211:
  mov    D6(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L289:
  mov    D183(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L182:
  mov    D168(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L124:
  mov    D228(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L205:
  mov    D130(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L314:
  mov    D152(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L67:
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  ret
  nopw   0x0(%rax,%rax,1)
L18:
  mov    D34(%rip),%rax
  mov    (%rax),%eax
  ret
L213:
  xor    %eax,%eax
  ret
```

assistant: ```c
int rate_to_constant(int baudrate) {
  switch (baudrate) {
  case 50:
    return B50;
  case 75:
    return B75;
  case 110:
    return B110;
  case 134:
    return B134;
  case 150:
    return B150;
  case 200:
    return B200;
  case 300:
    return B300;
  case 600:
    return B600;
  case 1200:
    return B1200;
  case 1800:
    return B1800;
  case 2400:
    return B2400;
  case 4800:
    return B4800;
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  case 38400:
    return B38400;
  case 57600:
    return B57600;
  case 115200:
    return B115200;
  case 230400:
    return B230400;
  case 460800:
    return B460800;
  case 500000:
    return B500000;
  case 576000:
    return B576000;
  case 921600:
    return B921600;
  case 1000000:
    return B1000000;
  case 1152000:
    return B1152000;
  case 1500000:
    return B1500000;
  default:
    return 0;
  }
}
```