#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 */
int strlen(char *);
int is_label_anonymous(char *label) {
  int length, i;
  char c;
  c = *label;
  if (!(c == '-' || c == '+'))
    return 0;
  length = strlen(label);
  for (i = 0; i < length; i++) {
    if (*(label + i) != c)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_label_anonymous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x2d,%eax
je     114b <is_label_anonymous+0x3b>
movsbl -0x19(%rbp),%eax
cmp    $0x2b,%eax
je     114b <is_label_anonymous+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <is_label_anonymous+0x98>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a1 <is_label_anonymous+0x91>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     118e <is_label_anonymous+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <is_label_anonymous+0x98>
jmp    1193 <is_label_anonymous+0x83>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115e <is_label_anonymous+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_label_anonymous>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%bl
cmp    $0x2d,%bl
je     1125 <is_label_anonymous+0x15>
xor    %eax,%eax
cmp    $0x2b,%bl
jne    1153 <is_label_anonymous+0x43>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jle    1153 <is_label_anonymous+0x43>
mov    %ecx,%ecx
xor    %edx,%edx
nopl   0x0(%rax)
cmp    %bl,(%r14,%rdx,1)
jne    1151 <is_label_anonymous+0x41>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1140 <is_label_anonymous+0x30>
jmp    1153 <is_label_anonymous+0x43>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_label_anonymous(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %6
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 45
br i1 %11, label %17, label %12
12: ; preds = %1
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %17, label %16
16: ; preds = %12
store i32 0, i32* %2
br label %40
17: ; preds = %12, %1
%18 = load i8*, i8** %3
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %4
store i32 0, i32* %5
br label %20
20: ; preds = %36, %17
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %39
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %30, %32
br i1 %33, label %34, label %35
34: ; preds = %24
store i32 0, i32* %2
br label %40
35: ; preds = %24
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %20
39: ; preds = %20
store i32 1, i32* %2
br label %40
40: ; preds = %39, %34, %16
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
define i32 @is_label_anonymous(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %16 [
i8 45, label %3
i8 43, label %3
]
3: ; preds = %1, %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %10
8: ; preds = %10
%9 = icmp eq i64 %15, %7
br i1 %9, label %16, label %10
10: ; preds = %6, %8
%11 = phi i64 [ 0, %6 ], [ %15, %8 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %2
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %8, label %16
16: ; preds = %10, %8, %3, %1
%17 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %10 ], [ 1, %8 ]
ret i32 %17
}