int iso3166_numeric(int cc) {
  static const unsigned char codes[112] = {
      0x10, 0x15, 0x11, 0x91, 0x11, 0x11, 0x1D, 0x11, 0x51, 0x15, 0x50, 0x14,
      0x11, 0x11, 0x11, 0x11, 0x10, 0x11, 0x11, 0x51, 0x44, 0xC4, 0x14, 0x91,
      0x11, 0x18, 0x51, 0x44, 0x84, 0xC7, 0x44, 0x45, 0x54, 0x54, 0x18, 0x00,
      0x11, 0x11, 0x11, 0x11, 0x11, 0x51, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
      0x11, 0x41, 0x11, 0x45, 0x46, 0x54, 0x44, 0x45, 0x44, 0x44, 0x44, 0x44,
      0x11, 0x10, 0x1D, 0x11, 0x11, 0x11, 0xE9, 0x10, 0x10, 0x44, 0x44, 0x44,
      0xB4, 0x87, 0x40, 0x11, 0x11, 0x11, 0x45, 0x44, 0x4C, 0x50, 0xD8, 0x44,
      0x44, 0x44, 0x45, 0xC0, 0x47, 0x10, 0x10, 0x13, 0x10, 0x11, 0x11, 0x15,
      0x11, 0x11, 0x11, 0x59, 0x91, 0x00, 0x04, 0x84, 0x07, 0x01, 0x44, 0x54,
      0x00, 0x10, 0x84, 0x40,
  };
  int b = cc >> 3;
  if (b < 0 || b >= 112) {
    return 0;
  }
  return codes[b] & (1 << (cc & 0x7)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<iso3166_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 <iso3166_numeric+0x24>
cmpl   $0x70,-0xc(%rbp)
jl     1130 <iso3166_numeric+0x30>
movl   $0x0,-0x4(%rbp)
jmp    115e <iso3166_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):
<iso3166_numeric>:
xor    %eax,%eax
cmp    $0x37f,%edi
ja     1126 <iso3166_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):
@iso3166_numeric.codes = internal constant [112 x i8] c"\10\15\11\91\11\11\1D\11Q\15P\14\11\11\11\11\10\11\11QD\C4\14\91\11\18QD\84\C7DETT\18\00\11\11\11\11\11Q\11\11\11\11\11\11\11A\11EFTDEDDDD\11\10\1D\11\11\11\E9\10\10DDD\B4\87@\11\11\11EDLP\D8DDDE\C0G\10\10\13\10\11\11\15\11\11\11Y\91\00\04\84\07\01DT\00\10\84@"
define i32 @iso3166_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, 112
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 [112 x i8], [112 x i8]* @iso3166_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):
@iso3166_numeric.codes = internal unnamed_addr constant [112 x i8] c"\10\15\11\91\11\11\1D\11Q\15P\14\11\11\11\11\10\11\11QD\C4\14\91\11\18QD\84\C7DETT\18\00\11\11\11\11\11Q\11\11\11\11\11\11\11A\11EFTDEDDDD\11\10\1D\11\11\11\E9\10\10DDD\B4\87@\11\11\11EDLP\D8DDDE\C0G\10\10\13\10\11\11\15\11\11\11Y\91\00\04\84\07\01DT\00\10\84@"
define i32 @iso3166_numeric(i32 %0) {
%2 = icmp ugt i32 %0, 895
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [112 x i8], [112 x i8]* @iso3166_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
}