int serial_check_baud(int baud) {
  switch (baud) {
  case 50:
  case 75:
  case 110:
  case 134:
  case 150:
  case 1800:
  case 2400:
  case 4800:
  case 9600:
  case 19200:
  case 38400:
  case 57600:
  case 115200:
    return (!0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<serial_check_baud>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x32,%eax
je     11fb <serial_check_baud+0xfb>
jmp    111b <serial_check_baud+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x4b,%eax
je     11fb <serial_check_baud+0xfb>
jmp    112c <serial_check_baud+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     11fb <serial_check_baud+0xfb>
jmp    113d <serial_check_baud+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     11fb <serial_check_baud+0xfb>
jmp    1150 <serial_check_baud+0x50>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     11fb <serial_check_baud+0xfb>
jmp    1163 <serial_check_baud+0x63>
mov    -0xc(%rbp),%eax
sub    $0x708,%eax
je     11fb <serial_check_baud+0xfb>
jmp    1176 <serial_check_baud+0x76>
mov    -0xc(%rbp),%eax
sub    $0x960,%eax
je     11fb <serial_check_baud+0xfb>
jmp    1189 <serial_check_baud+0x89>
mov    -0xc(%rbp),%eax
sub    $0x12c0,%eax
je     11fb <serial_check_baud+0xfb>
jmp    119c <serial_check_baud+0x9c>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     11fb <serial_check_baud+0xfb>
jmp    11af <serial_check_baud+0xaf>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     11fb <serial_check_baud+0xfb>
jmp    11c2 <serial_check_baud+0xc2>
mov    -0xc(%rbp),%eax
sub    $0x9600,%eax
je     11fb <serial_check_baud+0xfb>
jmp    11d5 <serial_check_baud+0xd5>
mov    -0xc(%rbp),%eax
sub    $0xe100,%eax
je     11fb <serial_check_baud+0xfb>
jmp    11e8 <serial_check_baud+0xe8>
mov    -0xc(%rbp),%eax
sub    $0x1c200,%eax
jne    1207 <serial_check_baud+0x107>
jmp    11fb <serial_check_baud+0xfb>
movl   $0x1,-0x4(%rbp)
jmp    120e <serial_check_baud+0x10e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_check_baud>:
mov    $0x1,%eax
cmp    $0x95f,%edi
jle    112e <serial_check_baud+0x2e>
cmp    $0x4aff,%edi
jle    1150 <serial_check_baud+0x50>
cmp    $0xe0ff,%edi
jg     1184 <serial_check_baud+0x84>
cmp    $0x4b00,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x9600,%edi
jne    1194 <serial_check_baud+0x94>
ret
cmp    $0x85,%edi
jg     116a <serial_check_baud+0x6a>
add    $0xffffffce,%edi
cmp    $0x3c,%edi
ja     1194 <serial_check_baud+0x94>
movabs $0x1000000002000001,%rcx
bt     %rdi,%rcx
jb     112d <serial_check_baud+0x2d>
jmp    1194 <serial_check_baud+0x94>
cmp    $0x960,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x12c0,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x2580,%edi
je     112d <serial_check_baud+0x2d>
jmp    1194 <serial_check_baud+0x94>
cmp    $0x86,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x96,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x708,%edi
je     112d <serial_check_baud+0x2d>
jmp    1194 <serial_check_baud+0x94>
cmp    $0xe100,%edi
je     112d <serial_check_baud+0x2d>
cmp    $0x1c200,%edi
je     112d <serial_check_baud+0x2d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @serial_check_baud(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 50, label %5
i32 75, label %5
i32 110, label %5
i32 134, label %5
i32 150, label %5
i32 1800, label %5
i32 2400, label %5
i32 4800, label %5
i32 9600, label %5
i32 19200, label %5
i32 38400, label %5
i32 57600, label %5
i32 115200, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @serial_check_baud(i32 %0) {
switch i32 %0, label %2 [
i32 50, label %3
i32 75, label %3
i32 110, label %3
i32 134, label %3
i32 150, label %3
i32 1800, label %3
i32 2400, label %3
i32 4800, label %3
i32 9600, label %3
i32 19200, label %3
i32 38400, label %3
i32 57600, label %3
i32 115200, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}