int iso4217_numeric(int cc) {
  static const unsigned char codes[125] = {
      0x00, 0x11, 0x00, 0x00, 0x11, 0x10, 0x1D, 0x10, 0x11, 0x01, 0x10, 0x04,
      0x01, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x11, 0x00, 0x44, 0x00, 0x90,
      0x01, 0x08, 0x41, 0x40, 0x40, 0x41, 0x04, 0x00, 0x40, 0x40, 0x00, 0x00,
      0x10, 0x00, 0x00, 0x00, 0x11, 0x11, 0x10, 0x11, 0x11, 0x11, 0x01, 0x01,
      0x10, 0x41, 0x11, 0x45, 0x46, 0x44, 0x04, 0x40, 0x40, 0x44, 0x00, 0x00,
      0x11, 0x00, 0x05, 0x01, 0x11, 0x10, 0x30, 0x00, 0x10, 0x44, 0x40, 0x00,
      0x04, 0x44, 0x40, 0x11, 0x01, 0x00, 0x00, 0x04, 0x48, 0x40, 0x00, 0x00,
      0x00, 0x04, 0x44, 0x40, 0x45, 0x00, 0x00, 0x01, 0x00, 0x10, 0x11, 0x11,
      0x00, 0x11, 0x11, 0x00, 0x81, 0x00, 0x04, 0x04, 0x04, 0x01, 0x00, 0x14,
      0x00, 0x00, 0x44, 0x00, 0x20, 0x00, 0x00, 0x80, 0x7F, 0xB5, 0xFD, 0xFB,
      0xBF, 0xBF, 0x3F, 0x47, 0xA4,
  };
  int b = cc >> 3;
  if (b < 0 || b >= 125) {
    return 0;
  }
  return codes[b] & (1 << (cc & 0x7)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<iso4217_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1124 <iso4217_numeric+0x24>
cmpl   $0x7d,-0xc(%rbp)
jl     1130 <iso4217_numeric+0x30>
movl   $0x0,-0x4(%rbp)
jmp    115e <iso4217_numeric+0x5e>
movslq -0xc(%rbp),%rcx
lea    0xec5(%rip),%rax
movzbl (%rax,%rcx,1),%edx
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso4217_numeric>:
xor    %eax,%eax
cmp    $0x3e7,%edi
ja     1126 <iso4217_numeric+0x26>
mov    %edi,%eax
shr    $0x3,%rax
lea    0xee9(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x7,%dil
mov    %edi,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
@iso4217_numeric.codes = internal constant [125 x i8] c"\00\11\00\00\11\10\1D\10\11\01\10\04\01\11\10\10\10\01\01\11\00D\00\90\01\08A@@A\04\00@@\00\00\10\00\00\00\11\11\10\11\11\11\01\01\10A\11EFD\04@@D\00\00\11\00\05\01\11\100\00\10D@\00\04D@\11\01\00\00\04H@\00\00\00\04D@E\00\00\01\00\10\11\11\00\11\11\00\81\00\04\04\04\01\00\14\00\00D\00 \00\00\80\7F\B5\FD\FB\BF\BF?G\A4"
define i32 @iso4217_numeric(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 3
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 125
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 0, i32* %2
br label %26
13: ; preds = %9
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [125 x i8], [125 x i8]* @iso4217_numeric.codes, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i32, i32* %3
%20 = and i32 %19, 7
%21 = shl i32 1, %20
%22 = and i32 %18, %21
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
store i32 %25, i32* %2
br label %26
26: ; preds = %13, %12
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@iso4217_numeric.codes = internal unnamed_addr constant [125 x i8] c"\00\11\00\00\11\10\1D\10\11\01\10\04\01\11\10\10\10\01\01\11\00D\00\90\01\08A@@A\04\00@@\00\00\10\00\00\00\11\11\10\11\11\11\01\01\10A\11EFD\04@@D\00\00\11\00\05\01\11\100\00\10D@\00\04D@\11\01\00\00\04H@\00\00\00\04D@E\00\00\01\00\10\11\11\00\11\11\00\81\00\04\04\04\01\00\14\00\00D\00 \00\00\80\7F\B5\FD\FB\BF\BF?G\A4"
define i32 @iso4217_numeric(i32 %0) {
%2 = icmp ugt i32 %0, 999
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [125 x i8], [125 x i8]* @iso4217_numeric.codes, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %0, 7
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
br label %12
12: ; preds = %1, %3
%13 = phi i32 [ %11, %3 ], [ 0, %1 ]
ret i32 %13
}