char *make_argname(pname, vname)
char *pname;
char *vname;
{
  char *name;
  name = xmalloc(strlen(pname) + strlen(vname) + strlen("argument") + 3);
  sprintf(name, "%s_%s_%s", locase(pname), vname, "argument");
  return (name);
}


x86 assembly (clang, -O0):
<make_argname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x8,%rdi
add    $0x3,%rdi
mov    $0x0,%al
call   1040 <xmalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <locase@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
lea    0xe5a(%rip),%rsi
lea    0xe5c(%rip),%r8
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_argname>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0xb,%rdi
xor    %eax,%eax
call   1040 <xmalloc@plt>
movslq %eax,%rbx
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <locase@plt>
lea    0xe82(%rip),%rsi
lea    0xe84(%rip),%r8
mov    %rbx,%rdi
mov    %eax,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s_%s_%s\00"
@.str.1 = [9 x i8] c"argument\00"
define i8* @make_argname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 8
%12 = add i64 %11, 3
%13 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @locase to i32 (i8*, ...)*)(i8* %17)
%19 = load i8*, i8** %4
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s_%s_%s\00"
@.str.1 = [9 x i8] c"argument\00"
define i8* @make_argname(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 11
%6 = add i64 %5, %4
%7 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @locase to i32 (i8*, ...)*)(i8* %0)
%11 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %9
}