#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ isalpha(char);
char *fname(char *namelist) {
  static char holder[30];
  register char *point;
  for (point = holder; isalpha(*namelist); namelist++, point++)
    *point = *namelist;
  *point = '\0';
  return (holder);
}


x86 assembly (clang, -O0):
<fname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f1d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1166 <fname+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <fname+0x17>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2ecc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     114e <fname+0x3e>
add    $0x1,%rbx
lea    0x2f11(%rip),%r14
nop
movzbl -0x1(%rbx),%eax
mov    %al,(%r14)
add    $0x1,%r14
movsbl (%rbx),%edi
call   1030 <isalpha@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <fname+0x20>
jmp    1155 <fname+0x45>
lea    0x2eeb(%rip),%r14
movb   $0x0,(%r14)
lea    0x2ee0(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@fname.holder = internal global [30 x i8] zeroinitializer
define i8* @fname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @fname.holder, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = call i64 @isalpha(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
store i8 %11, i8* %12
br label %13
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %4
18: ; preds = %4
%19 = load i8*, i8** %3
store i8 0, i8* %19
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @fname.holder, i64 0, i64 0)
}

LLVM IR (-O2):
@fname.holder = internal global [30 x i8] zeroinitializer
define i8* @fname(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isalpha(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %10, %5 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @fname.holder, i64 0, i64 0), %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = load i8, i8* %7
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %9
%12 = tail call i64 @isalpha(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @fname.holder, i64 0, i64 0), %1 ], [ %10, %5 ]
store i8 0, i8* %15
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @fname.holder, i64 0, i64 0)
}