#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 /*<<< orphan*/ isalpha(char const);
scalar_t__ strcmp(char const *, char *);
int is_correct_name(const char name[]) {
  if (strcmp(name, "!") == 0)
    return 0;
  if (strcmp(name, "?") == 0)
    return 0;
  while (name[0] != '\0') {
    if (!isalpha(name[0])) {
      if (name[1] != '\0')
        return 0;
      else if (name[0] != '!' && name[0] != '?')
        return 0;
    }
    name++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_correct_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <is_correct_name+0x32>
movl   $0x0,-0x4(%rbp)
jmp    120d <is_correct_name+0xed>
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1178 <is_correct_name+0x58>
movl   $0x0,-0x4(%rbp)
jmp    120d <is_correct_name+0xed>
jmp    117d <is_correct_name+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1206 <is_correct_name+0xe6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
jne    11f5 <is_correct_name+0xd5>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     11bf <is_correct_name+0x9f>
movl   $0x0,-0x4(%rbp)
jmp    120d <is_correct_name+0xed>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
je     11eb <is_correct_name+0xcb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     11eb <is_correct_name+0xcb>
movl   $0x0,-0x4(%rbp)
jmp    120d <is_correct_name+0xed>
jmp    11f0 <is_correct_name+0xd0>
jmp    11f5 <is_correct_name+0xd5>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    117d <is_correct_name+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_correct_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1194 <is_correct_name+0x74>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1194 <is_correct_name+0x74>
mov    (%rbx),%cl
test   %cl,%cl
je     1177 <is_correct_name+0x57>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %cl,%edi
call   1040 <isalpha@plt>
movzbl (%rbx),%ecx
test   %eax,%eax
je     117e <is_correct_name+0x5e>
add    $0x1,%rbx
test   %cl,%cl
jne    1160 <is_correct_name+0x40>
mov    $0x1,%ebp
jmp    1194 <is_correct_name+0x74>
test   %cl,%cl
jne    1194 <is_correct_name+0x74>
mov    -0x1(%rbx),%al
cmp    $0x21,%al
sete   %cl
cmp    $0x3f,%al
sete   %al
or     %cl,%al
movzbl %al,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"!\00"
@.str.1 = [2 x i8] c"?\00"
define i32 @is_correct_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %52
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %52
13: ; preds = %8
br label %14
14: ; preds = %48, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %51
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = call i32 @isalpha(i8 signext %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %48, label %26
26: ; preds = %20
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %26
store i32 0, i32* %2
br label %52
33: ; preds = %26
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 33
br i1 %38, label %39, label %46
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 0
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 63
br i1 %44, label %45, label %46
45: ; preds = %39
store i32 0, i32* %2
br label %52
46: ; preds = %39, %33
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47, %20
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %3
br label %14
51: ; preds = %14
store i32 1, i32* %2
br label %52
52: ; preds = %51, %45, %32, %12, %7
%53 = load i32, i32* %2
ret i32 %53
}

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
@.str.1 = [2 x i8] c"?\00"
define i32 @is_correct_name(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %28, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %28, label %7
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 0
br i1 %9, label %28, label %10
10: ; preds = %7, %25
%11 = phi i8 [ %16, %25 ], [ %8, %7 ]
%12 = phi i8* [ %26, %25 ], [ %0, %7 ]
%13 = tail call i32 @isalpha(i8 signext %11)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
br i1 %14, label %17, label %25
17: ; preds = %10
%18 = icmp eq i8 %16, 0
br i1 %18, label %19, label %28
19: ; preds = %17
%20 = load i8, i8* %12
%21 = icmp eq i8 %20, 33
%22 = icmp eq i8 %20, 63
%23 = or i1 %21, %22
%24 = zext i1 %23 to i32
br label %28
25: ; preds = %10
%26 = getelementptr inbounds i8, i8* %12, i64 1
%27 = icmp eq i8 %16, 0
br i1 %27, label %28, label %10
28: ; preds = %25, %19, %17, %7, %4, %1
%29 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %7 ], [ 0, %17 ], [ %24, %19 ], [ 1, %25 ]
ret i32 %29
}