char *move2Str(int m) {
  static char promstr[] = "\0pnbrqk";
  static char str[6];
  sprintf(str, "%c%c%c%c%c", ((moveFrom(m)) & 7) + 'a',
          '1' + ((moveFrom(m)) >> 3), ((moveTo(m)) & 7) + 'a',
          '1' + ((moveTo(m)) >> 3), promstr[movePromote(m)]);
  return str;
}


x86 assembly (clang, -O0):
<move2Str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <moveFrom@plt>
and    $0x7,%eax
add    $0x61,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <moveFrom@plt>
sar    $0x3,%eax
add    $0x31,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1060 <moveTo@plt>
and    $0x7,%eax
add    $0x61,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1060 <moveTo@plt>
sar    $0x3,%eax
add    $0x31,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <movePromote@plt>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%r9d
movslq %eax,%rsi
lea    0x2e87(%rip),%rax
movsbl (%rax,%rsi,1),%eax
lea    0x2e85(%rip),%rdi
lea    0xe35(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    0x2e6d(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move2Str>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <moveFrom@plt>
and    $0x7,%eax
lea    0x61(%rax),%r14d
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <moveFrom@plt>
sar    $0x3,%eax
lea    0x31(%rax),%r15d
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <moveTo@plt>
and    $0x7,%eax
lea    0x61(%rax),%r12d
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <moveTo@plt>
sar    $0x3,%eax
lea    0x31(%rax),%ebx
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <movePromote@plt>
cltq
lea    0xe63(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,(%rsp)
lea    0x2e96(%rip),%rbp
lea    0xe56(%rip),%rsi
mov    %rbp,%rdi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@move2Str.promstr = internal global [8 x i8] c"\00pnbrqk\00"
@move2Str.str = internal global [6 x i8] zeroinitializer
@.str = [11 x i8] c"%c%c%c%c%c\00"
define i8* @move2Str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @moveFrom to i32 (i32, ...)*)(i32 %3)
%5 = and i32 %4, 7
%6 = add nsw i32 %5, 97
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @moveFrom to i32 (i32, ...)*)(i32 %7)
%9 = ashr i32 %8, 3
%10 = add nsw i32 49, %9
%11 = load i32, i32* %2
%12 = call i32 (i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, ...)*)(i32 %11)
%13 = and i32 %12, 7
%14 = add nsw i32 %13, 97
%15 = load i32, i32* %2
%16 = call i32 (i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, ...)*)(i32 %15)
%17 = ashr i32 %16, 3
%18 = add nsw i32 49, %17
%19 = load i32, i32* %2
%20 = call i32 (i32, ...) bitcast (i32 (...)* @movePromote to i32 (i32, ...)*)(i32 %19)
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [8 x i8], [8 x i8]* @move2Str.promstr, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @move2Str.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %14, i32 %18, i32 %24)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @move2Str.str, i64 0, i64 0)
}

LLVM IR (-O2):
@move2Str.promstr = internal unnamed_addr constant [8 x i8] c"\00pnbrqk\00"
@move2Str.str = internal global [6 x i8] zeroinitializer
@.str = [11 x i8] c"%c%c%c%c%c\00"
define i8* @move2Str(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @moveFrom to i32 (i32, ...)*)(i32 %0)
%3 = and i32 %2, 7
%4 = add nuw nsw i32 %3, 97
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @moveFrom to i32 (i32, ...)*)(i32 %0)
%6 = ashr i32 %5, 3
%7 = add nsw i32 %6, 49
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, ...)*)(i32 %0)
%9 = and i32 %8, 7
%10 = add nuw nsw i32 %9, 97
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, ...)*)(i32 %0)
%12 = ashr i32 %11, 3
%13 = add nsw i32 %12, 49
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @movePromote to i32 (i32, ...)*)(i32 %0)
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i8], [8 x i8]* @move2Str.promstr, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @move2Str.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13, i32 %18)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @move2Str.str, i64 0, i64 0)
}