int ffpxsz(int datatype) {
  if (datatype == 11)
    return (sizeof(char));
  else if (datatype == 20)
    return (sizeof(short));
  else if (datatype == 21)
    return (sizeof(short));
  else if (datatype == 40)
    return (sizeof(long));
  else if (datatype == 41)
    return (sizeof(long));
  else if (datatype == 31)
    return (sizeof(int));
  else if (datatype == 30)
    return (sizeof(int));
  else if (datatype == 42)
    return (sizeof(float));
  else if (datatype == 82)
    return (sizeof(double));
  else if (datatype == 14)
    return (sizeof(char));
  else
    return (0);
}


x86 assembly (clang, -O0):
<ffpxsz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jne    111d <ffpxsz+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x14,-0x8(%rbp)
jne    1133 <ffpxsz+0x33>
movl   $0x2,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x15,-0x8(%rbp)
jne    1149 <ffpxsz+0x49>
movl   $0x2,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x28,-0x8(%rbp)
jne    115f <ffpxsz+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x29,-0x8(%rbp)
jne    1175 <ffpxsz+0x75>
movl   $0x8,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x1f,-0x8(%rbp)
jne    118b <ffpxsz+0x8b>
movl   $0x4,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x1e,-0x8(%rbp)
jne    11a1 <ffpxsz+0xa1>
movl   $0x4,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x2a,-0x8(%rbp)
jne    11b7 <ffpxsz+0xb7>
movl   $0x4,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0x52,-0x8(%rbp)
jne    11cd <ffpxsz+0xcd>
movl   $0x8,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
cmpl   $0xe,-0x8(%rbp)
jne    11e3 <ffpxsz+0xe3>
movl   $0x1,-0x4(%rbp)
jmp    11ea <ffpxsz+0xea>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffpxsz>:
add    $0xfffffff5,%edi
cmp    $0x47,%edi
ja     112f <ffpxsz+0x2f>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x8,%eax
ret
mov    $0x4,%eax
ret
mov    $0x2,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ffpxsz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 11
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %44
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 20
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %44
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 21
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 2, i32* %2
br label %44
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 40
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 8, i32* %2
br label %44
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 41
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 8, i32* %2
br label %44
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 31
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 4, i32* %2
br label %44
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 30
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 4, i32* %2
br label %44
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 42
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 4, i32* %2
br label %44
35: ; preds = %31
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 82
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 8, i32* %2
br label %44
39: ; preds = %35
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 14
br i1 %41, label %42, label %43
42: ; preds = %39
store i32 1, i32* %2
br label %44
43: ; preds = %39
store i32 0, i32* %2
br label %44
44: ; preds = %43, %42, %38, %34, %30, %26, %22, %18, %14, %10, %6
%45 = load i32, i32* %2
ret i32 %45
}

LLVM IR (-O2):
define i32 @ffpxsz(i32 %0) {
switch i32 %0, label %10 [
i32 11, label %11
i32 20, label %2
i32 21, label %3
i32 40, label %4
i32 41, label %5
i32 31, label %6
i32 30, label %7
i32 42, label %8
i32 82, label %9
i32 14, label %11
]
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, %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i32 [ 2, %2 ], [ 2, %3 ], [ 8, %4 ], [ 8, %5 ], [ 4, %6 ], [ 4, %7 ], [ 4, %8 ], [ 8, %9 ], [ 0, %10 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %12
}