int ar_name(name)
char *name;
{
  char *p = index(name, '('), *end = name + strlen(name) - 1;
  if (p == 0 || p == name || *end != ')')
    return 0;
  if (p[1] == '(' && end[-1] == ')')
    fatal("attempt to use unsupported feature: `%s'", name);
  return 1;
}


x86 assembly (clang, -O0):
<ar_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1040 <index@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119a <ar_name+0x6a>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     119a <ar_name+0x6a>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
je     11a6 <ar_name+0x76>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <ar_name+0xb1>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x28,%eax
jne    11da <ar_name+0xaa>
mov    -0x20(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x29,%eax
jne    11da <ar_name+0xaa>
mov    -0x10(%rbp),%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <fatal@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar_name>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x28,%esi
call   1040 <index@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
test   %rbp,%rbp
je     1184 <ar_name+0x54>
cmp    %rbx,%rbp
je     1184 <ar_name+0x54>
cmpb   $0x29,-0x1(%rbx,%rax,1)
jne    1184 <ar_name+0x54>
mov    $0x1,%r14d
cmpb   $0x28,0x1(%rbp)
jne    1184 <ar_name+0x54>
cmpb   $0x29,-0x2(%rbx,%rax,1)
jne    1184 <ar_name+0x54>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <fatal@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"attempt to use unsupported feature: `%s'\00"
define i32 @ar_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @index(i8* %6, i32 40)
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8* %12, i8** %5
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %24, label %15
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = icmp eq i8* %16, %17
br i1 %18, label %24, label %19
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 41
br i1 %23, label %24, label %25
24: ; preds = %19, %15, %1
store i32 0, i32* %2
br label %41
25: ; preds = %19
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 40
br i1 %30, label %31, label %40
31: ; preds = %25
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 -1
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 41
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i8*, i8** %3
%39 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %37, %31, %25
store i32 1, i32* %2
br label %41
41: ; preds = %40, %24
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
@.str = [41 x i8] c"attempt to use unsupported feature: `%s'\00"
define i32 @ar_name(i8* %0) {
%2 = tail call i8* @index(i8* %0, i32 40)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp eq i8* %2, null
%7 = icmp eq i8* %2, %0
%8 = or i1 %6, %7
br i1 %8, label %22, label %9
9: ; preds = %1
%10 = load i8, i8* %5
%11 = icmp eq i8 %10, 41
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %2, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 40
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %5, i64 -1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 41
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %22
22: ; preds = %12, %16, %20, %1, %9
%23 = phi i32 [ 0, %9 ], [ 0, %1 ], [ 1, %20 ], [ 1, %16 ], [ 1, %12 ]
ret i32 %23
}