void CreateName(char *buffer, int characterOffset, char fileSelector) {
  *buffer++ = 'A' + characterOffset;
  *buffer++ = fileSelector;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = fileSelector;
  *buffer++ = fileSelector;
  *buffer++ = fileSelector;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = 'a' + characterOffset;
  *buffer++ = 'a' + characterOffset;
  *buffer = '\0';
}


x86 assembly (clang, -O0):
<CreateName>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateName>:
lea    0x41(%rsi),%eax
mov    %al,(%rdi)
mov    %dl,0x1(%rdi)
add    $0x61,%sil
mov    %sil,0x2(%rdi)
mov    %sil,0x3(%rdi)
mov    %dl,0x4(%rdi)
mov    %dl,0x5(%rdi)
mov    %dl,0x6(%rdi)
movzbl %sil,%eax
imul   $0x1010101,%eax,%eax
mov    %eax,0x7(%rdi)
mov    %al,0xb(%rdi)
movb   $0x0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @CreateName(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %5
%8 = add nsw i32 65, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 %9, i8* %10
%12 = load i8, i8* %6
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
store i8 %12, i8* %13
%15 = load i32, i32* %5
%16 = add nsw i32 97, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
store i8 %17, i8* %18
%20 = load i32, i32* %5
%21 = add nsw i32 97, %20
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
store i8 %22, i8* %23
%25 = load i8, i8* %6
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
store i8 %25, i8* %26
%28 = load i8, i8* %6
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
store i8 %28, i8* %29
%31 = load i8, i8* %6
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %4
store i8 %31, i8* %32
%34 = load i32, i32* %5
%35 = add nsw i32 97, %34
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %4
store i8 %36, i8* %37
%39 = load i32, i32* %5
%40 = add nsw i32 97, %39
%41 = trunc i32 %40 to i8
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %4
store i8 %41, i8* %42
%44 = load i32, i32* %5
%45 = add nsw i32 97, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %4
store i8 %46, i8* %47
%49 = load i32, i32* %5
%50 = add nsw i32 97, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %4
store i8 %51, i8* %52
%54 = load i32, i32* %5
%55 = add nsw i32 97, %54
%56 = trunc i32 %55 to i8
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %4
store i8 %56, i8* %57
%59 = load i8*, i8** %4
store i8 0, i8* %59
ret void
}

LLVM IR (-O2):
define void @CreateName(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = trunc i32 %1 to i8
%5 = add i8 %4, 65
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %2, i8* %6
%8 = add i8 %4, 97
%9 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %8, i8* %7
%10 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %2, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %2, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %2, i8* %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
store i8 0, i8* %14
ret void
}