int get_mask_char(mask)
register unsigned int mask;
{
  switch (mask) {
  case ((unsigned short)04):
    return ('?');
  case ((unsigned short)010):
    return ('!');
  case ((unsigned short)020):
    return ('*');
  case ((unsigned short)040):
    return (':');
  case ((unsigned short)0100):
    return ('/');
  case ((unsigned short)01):
    return (']');
  case ((unsigned short)02):
    return (')');
  case ((unsigned short)0200):
    return ('=');
  case ((unsigned short)0400):
    return (',');
  default:
    return ('~');
  }
}


x86 assembly (clang, -O0):
<get_mask_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11e3 <get_mask_char+0xe3>
jmp    111b <get_mask_char+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11ef <get_mask_char+0xef>
jmp    112c <get_mask_char+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     11a7 <get_mask_char+0xa7>
jmp    113d <get_mask_char+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     11b3 <get_mask_char+0xb3>
jmp    114e <get_mask_char+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     11bf <get_mask_char+0xbf>
jmp    115f <get_mask_char+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     11cb <get_mask_char+0xcb>
jmp    1170 <get_mask_char+0x70>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     11d7 <get_mask_char+0xd7>
jmp    1181 <get_mask_char+0x81>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     11fb <get_mask_char+0xfb>
jmp    1194 <get_mask_char+0x94>
mov    -0xc(%rbp),%eax
sub    $0x100,%eax
je     1207 <get_mask_char+0x107>
jmp    1213 <get_mask_char+0x113>
movl   $0x3f,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x21,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x2a,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x3a,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x2f,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x5d,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x29,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x3d,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x2c,-0x4(%rbp)
jmp    121a <get_mask_char+0x11a>
movl   $0x7e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mask_char>:
lea    -0x1(%rdi),%ecx
cmp    $0x3f,%ecx
ja     1123 <get_mask_char+0x23>
mov    $0x3f,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x5d,%eax
ret
cmp    $0x80,%edi
je     115d <get_mask_char+0x5d>
cmp    $0x100,%edi
jne    1139 <get_mask_char+0x39>
mov    $0x2c,%eax
ret
mov    $0x7e,%eax
ret
mov    $0x29,%eax
ret
mov    $0x21,%eax
ret
mov    $0x2a,%eax
ret
mov    $0x3a,%eax
ret
mov    $0x2f,%eax
ret
mov    $0x3d,%eax
ret

LLVM IR (-O0):
define i32 @get_mask_char(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 4, label %5
i32 8, label %6
i32 16, label %7
i32 32, label %8
i32 64, label %9
i32 1, label %10
i32 2, label %11
i32 128, label %12
i32 256, label %13
]
5: ; preds = %1
store i32 63, i32* %2
br label %15
6: ; preds = %1
store i32 33, i32* %2
br label %15
7: ; preds = %1
store i32 42, i32* %2
br label %15
8: ; preds = %1
store i32 58, i32* %2
br label %15
9: ; preds = %1
store i32 47, i32* %2
br label %15
10: ; preds = %1
store i32 93, i32* %2
br label %15
11: ; preds = %1
store i32 41, i32* %2
br label %15
12: ; preds = %1
store i32 61, i32* %2
br label %15
13: ; preds = %1
store i32 44, i32* %2
br label %15
14: ; preds = %1
store i32 126, i32* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_mask_char(i32 %0) {
switch i32 %0, label %10 [
i32 4, label %11
i32 8, label %2
i32 16, label %3
i32 32, label %4
i32 64, label %5
i32 1, label %6
i32 2, label %7
i32 128, label %8
i32 256, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i32 [ 126, %10 ], [ 44, %9 ], [ 61, %8 ], [ 41, %7 ], [ 93, %6 ], [ 47, %5 ], [ 58, %4 ], [ 42, %3 ], [ 33, %2 ], [ 63, %1 ]
ret i32 %12
}