void Lastname(num, name) int num;
char *name;
{
  static char *n[] = {"BAR", "OUGHT", "ABLE",  "PRI",   "PRES",
                      "ESE", "ANTI",  "CALLY", "ATION", "EING"};
  strcpy(name, n[num / 100]);
  strcat(name, n[(num / 10) % 10]);
  strcat(name, n[num % 10]);
  return;
}


x86 assembly (clang, -O0):
<Lastname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    0x2ef8(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2ece(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2eac(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lastname>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
movslq %edi,%r12
imul   $0x51eb851f,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
cltq
lea    0x2c85(%rip),%r15
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
imul   $0x66666667,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
call   1040 <strcat@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%r12d
movslq %r12d,%rax
mov    (%r15,%rax,8),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@Lastname.n = internal global [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0)]
@.str = [4 x i8] c"BAR\00"
@.str.1 = [6 x i8] c"OUGHT\00"
@.str.2 = [5 x i8] c"ABLE\00"
@.str.3 = [4 x i8] c"PRI\00"
@.str.4 = [5 x i8] c"PRES\00"
@.str.5 = [4 x i8] c"ESE\00"
@.str.6 = [5 x i8] c"ANTI\00"
@.str.7 = [6 x i8] c"CALLY\00"
@.str.8 = [6 x i8] c"ATION\00"
@.str.9 = [5 x i8] c"EING\00"
define void @Lastname(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 100
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = call i8* @strcpy(i8* %5, i8* %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
%15 = srem i32 %14, 10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = call i8* @strcat(i8* %12, i8* %18)
%20 = load i8*, i8** %4
%21 = load i32, i32* %3
%22 = srem i32 %21, 10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = call i8* @strcat(i8* %20, i8* %25)
ret void
}

LLVM IR (-O2):
@Lastname.n = internal unnamed_addr constant [10 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0)]
@.str = [4 x i8] c"BAR\00"
@.str.1 = [6 x i8] c"OUGHT\00"
@.str.2 = [5 x i8] c"ABLE\00"
@.str.3 = [4 x i8] c"PRI\00"
@.str.4 = [5 x i8] c"PRES\00"
@.str.5 = [4 x i8] c"ESE\00"
@.str.6 = [5 x i8] c"ANTI\00"
@.str.7 = [6 x i8] c"CALLY\00"
@.str.8 = [6 x i8] c"ATION\00"
@.str.9 = [5 x i8] c"EING\00"
define void @Lastname(i32 %0, i8* %1) {
%3 = sdiv i32 %0, 100
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %6)
%8 = sdiv i32 %0, 10
%9 = srem i32 %8, 10
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i8* @strcat(i8* dereferenceable(1) %1, i8* dereferenceable(1) %12)
%14 = srem i32 %0, 10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i8*], [10 x i8*]* @Lastname.n, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = tail call i8* @strcat(i8* dereferenceable(1) %1, i8* dereferenceable(1) %17)
ret void
}