void RFCNB_AName_To_NBName(char *AName, char *NBName) {
  char c, c1, c2;
  int i;
  for (i = 0; i < 16; i++) {
    c = AName[i];
    c1 = (char)((c >> 4) + 'A');
    c2 = (char)((c & 0xF) + 'A');
    NBName[i * 2] = c1;
    NBName[i * 2 + 1] = c2;
  }
  NBName[32] = 0;
}


x86 assembly (clang, -O0):
<RFCNB_AName_To_NBName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    117c <RFCNB_AName_To_NBName+0x7c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
sar    $0x4,%eax
add    $0x41,%eax
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
and    $0xf,%eax
add    $0x41,%eax
mov    %al,-0x13(%rbp)
mov    -0x12(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x13(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1113 <RFCNB_AName_To_NBName+0x13>
mov    -0x10(%rbp),%rax
movb   $0x0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFCNB_AName_To_NBName>:
lea    0x10(%rdi),%rax
cmp    %rsi,%rax
jbe    1163 <RFCNB_AName_To_NBName+0x63>
lea    0x20(%rsi),%rax
cmp    %rdi,%rax
jbe    1163 <RFCNB_AName_To_NBName+0x63>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
movzbl -0x1(%rdi,%rax,1),%ecx
mov    %ecx,%edx
sar    $0x4,%dl
add    $0x41,%dl
and    $0xf,%cl
add    $0x41,%cl
mov    %dl,-0x2(%rsi,%rax,2)
mov    %cl,-0x1(%rsi,%rax,2)
movzbl (%rdi,%rax,1),%ecx
mov    %ecx,%edx
sar    $0x4,%dl
add    $0x41,%dl
and    $0xf,%cl
add    $0x41,%cl
mov    %dl,(%rsi,%rax,2)
mov    %cl,0x1(%rsi,%rax,2)
add    $0x2,%rax
cmp    $0x11,%rax
jne    1120 <RFCNB_AName_To_NBName+0x20>
movb   $0x0,0x20(%rsi)
ret
movq   (%rdi),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
movdqa 0xe88(%rip),%xmm2
pand   %xmm2,%xmm1
movdqa 0xe8c(%rip),%xmm3
pxor   %xmm3,%xmm1
movdqa 0xe90(%rip),%xmm4
paddb  %xmm4,%xmm1
movdqa 0xe94(%rip),%xmm5
movdqa 0xe9c(%rip),%xmm6
pand   %xmm6,%xmm0
paddb  %xmm5,%xmm0
punpcklbw %xmm0,%xmm1
movdqu %xmm1,(%rsi)
movq   0x8(%rdi),%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x4,%xmm1
pand   %xmm2,%xmm1
pxor   %xmm3,%xmm1
paddb  %xmm4,%xmm1
pand   %xmm6,%xmm0
paddb  %xmm5,%xmm0
punpcklbw %xmm0,%xmm1
movdqu %xmm1,0x10(%rsi)
movb   $0x0,0x20(%rsi)
ret

LLVM IR (-O0):
define void @RFCNB_AName_To_NBName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %8
br label %9
9: ; preds = %41, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 16
br i1 %11, label %12, label %44
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %5
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = ashr i32 %19, 4
%21 = add nsw i32 %20, 65
%22 = trunc i32 %21 to i8
store i8 %22, i8* %6
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = and i32 %24, 15
%26 = add nsw i32 %25, 65
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %6
%29 = load i8*, i8** %4
%30 = load i32, i32* %8
%31 = mul nsw i32 %30, 2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %29, i64 %32
store i8 %28, i8* %33
%34 = load i8, i8* %7
%35 = load i8*, i8** %4
%36 = load i32, i32* %8
%37 = mul nsw i32 %36, 2
%38 = add nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %35, i64 %39
store i8 %34, i8* %40
br label %41
41: ; preds = %12
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %9
44: ; preds = %9
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i64 32
store i8 0, i8* %46
ret void
}

LLVM IR (-O2):
define void @RFCNB_AName_To_NBName(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr i8, i8* %1, i64 32
%4 = getelementptr i8, i8* %0, i64 16
%5 = icmp ugt i8* %4, %1
%6 = icmp ugt i8* %3, %0
%7 = and i1 %5, %6
br i1 %7, label %27, label %8
8: ; preds = %2
%9 = bitcast i8* %0 to <8 x i8>*
%10 = load <8 x i8>, <8 x i8>* %9
%11 = ashr <8 x i8> %10, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
%12 = add nsw <8 x i8> %11, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
%13 = and <8 x i8> %10, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
%14 = add nuw nsw <8 x i8> %13, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
%15 = bitcast i8* %1 to <16 x i8>*
%16 = shufflevector <8 x i8> %12, <8 x i8> %14, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %16, <16 x i8>* %15
%17 = getelementptr inbounds i8, i8* %0, i64 8
%18 = bitcast i8* %17 to <8 x i8>*
%19 = load <8 x i8>, <8 x i8>* %18
%20 = ashr <8 x i8> %19, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
%21 = add nsw <8 x i8> %20, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
%22 = and <8 x i8> %19, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
%23 = add nuw nsw <8 x i8> %22, <i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65, i8 65>
%24 = getelementptr inbounds i8, i8* %1, i64 16
%25 = bitcast i8* %24 to <16 x i8>*
%26 = shufflevector <8 x i8> %21, <8 x i8> %23, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %26, <16 x i8>* %25
br label %52
27: ; preds = %2, %27
%28 = phi i64 [ %50, %27 ], [ 0, %2 ]
%29 = getelementptr inbounds i8, i8* %0, i64 %28
%30 = load i8, i8* %29
%31 = ashr i8 %30, 4
%32 = add nsw i8 %31, 65
%33 = and i8 %30, 15
%34 = add nuw nsw i8 %33, 65
%35 = shl nuw nsw i64 %28, 1
%36 = getelementptr inbounds i8, i8* %1, i64 %35
store i8 %32, i8* %36
%37 = or i64 %35, 1
%38 = getelementptr inbounds i8, i8* %1, i64 %37
store i8 %34, i8* %38
%39 = or i64 %28, 1
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = load i8, i8* %40
%42 = ashr i8 %41, 4
%43 = add nsw i8 %42, 65
%44 = and i8 %41, 15
%45 = add nuw nsw i8 %44, 65
%46 = shl nuw nsw i64 %39, 1
%47 = getelementptr inbounds i8, i8* %1, i64 %46
store i8 %43, i8* %47
%48 = or i64 %46, 1
%49 = getelementptr inbounds i8, i8* %1, i64 %48
store i8 %45, i8* %49
%50 = add nuw nsw i64 %28, 2
%51 = icmp eq i64 %50, 16
br i1 %51, label %52, label %27
52: ; preds = %27, %8
%53 = getelementptr inbounds i8, i8* %1, i64 32
store i8 0, i8* %53
ret void
}