symname(sname) char *sname;
{
  int k;
  char c;
  blanks();
  if (alpha(chr()) == 0)
    return 0;
  k = 0;
  while (an(chr()))
    sname[k++] = gchr();
  sname[k] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<symname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <blanks@plt>
mov    $0x0,%al
call   1060 <chr@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <alpha@plt>
cmp    $0x0,%eax
jne    1188 <symname+0x38>
movl   $0x0,-0x4(%rbp)
jmp    11de <symname+0x8e>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1060 <chr@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <an@plt>
cmp    $0x0,%eax
je     11cb <symname+0x7b>
mov    $0x0,%al
call   1050 <gchr@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    118f <symname+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symname>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <blanks@plt>
xor    %eax,%eax
call   1060 <chr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <alpha@plt>
test   %eax,%eax
je     11bd <symname+0x6d>
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <chr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <an@plt>
test   %eax,%eax
je     11b4 <symname+0x64>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <gchr@plt>
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
xor    %eax,%eax
call   1060 <chr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <an@plt>
test   %eax,%eax
jne    1190 <symname+0x40>
mov    %ebp,%ebp
movb   $0x0,(%rbx,%rbp,1)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @symname(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
%6 = call i32 (...) @blanks()
%7 = call i32 (...) @chr()
%8 = call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %29
11: ; preds = %1
store i32 0, i32* %4
br label %12
12: ; preds = %16, %11
%13 = call i32 (...) @chr()
%14 = call i32 (i32, ...) bitcast (i32 (...)* @an to i32 (i32, ...)*)(i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = call i32 (...) @gchr()
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %18, i8* %23
br label %12
24: ; preds = %12
%25 = load i8*, i8** %3
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 0, i8* %28
store i32 1, i32* %2
br label %29
29: ; preds = %24, %10
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @symname(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @blanks()
%3 = tail call i32 (...) @chr()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %24, label %6
6: ; preds = %1
%7 = tail call i32 (...) @chr()
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @an to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %6, %10
%11 = phi i64 [ %14, %10 ], [ 0, %6 ]
%12 = tail call i32 (...) @gchr()
%13 = trunc i32 %12 to i8
%14 = add nuw i64 %11, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %13, i8* %15
%16 = tail call i32 (...) @chr()
%17 = tail call i32 (i32, ...) bitcast (i32 (...)* @an to i32 (i32, ...)*)(i32 %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %10
19: ; preds = %10
%20 = and i64 %14, 4294967295
br label %21
21: ; preds = %19, %6
%22 = phi i64 [ 0, %6 ], [ %20, %19 ]
%23 = getelementptr inbounds i8, i8* %0, i64 %22
store i8 0, i8* %23
br label %24
24: ; preds = %1, %21
%25 = phi i32 [ 1, %21 ], [ 0, %1 ]
ret i32 %25
}