#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__ _in_range(char const, int, int);
scalar_t__ isdigit(char const);
char const *_is_nickname(char const *peek) {
  unsigned max_it = 8;
  if (!_in_range(*peek, 0x41, 0x7D))
    return NULL;
  peek++;
  while (max_it-- > 0) {
    if (_in_range(*peek, 0x41, 0x7D) || isdigit(*peek) || *peek == '-')
      peek++;
    else
      break;
  }
  return peek;
}


x86 assembly (clang, -O0):
<_is_nickname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x41,%esi
mov    $0x7d,%edx
movsbl (%rax),%edi
call   1030 <_in_range@plt>
cmp    $0x0,%rax
jne    1160 <_is_nickname+0x40>
movq   $0x0,-0x8(%rbp)
jmp    11e9 <_is_nickname+0xc9>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jbe    11e1 <_is_nickname+0xc1>
mov    -0x10(%rbp),%rax
mov    $0x41,%esi
mov    $0x7d,%edx
movsbl (%rax),%edi
call   1030 <_in_range@plt>
cmp    $0x0,%rax
jne    11c6 <_is_nickname+0xa6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    11c6 <_is_nickname+0xa6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11d7 <_is_nickname+0xb7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11dc <_is_nickname+0xbc>
jmp    11e1 <_is_nickname+0xc1>
jmp    116c <_is_nickname+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_nickname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
je     12d7 <_is_nickname+0x1b7>
movsbl 0x1(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    1175 <_is_nickname+0x55>
lea    0x1(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1175 <_is_nickname+0x55>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x2(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    11a8 <_is_nickname+0x88>
lea    0x2(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    11a8 <_is_nickname+0x88>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x3(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    11db <_is_nickname+0xbb>
lea    0x3(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    11db <_is_nickname+0xbb>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x4(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    120e <_is_nickname+0xee>
lea    0x4(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    120e <_is_nickname+0xee>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x5(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    1241 <_is_nickname+0x121>
lea    0x5(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1241 <_is_nickname+0x121>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x6(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    1270 <_is_nickname+0x150>
lea    0x6(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1270 <_is_nickname+0x150>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x7(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    129f <_is_nickname+0x17f>
lea    0x7(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    129f <_is_nickname+0x17f>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
movsbl 0x8(%r14),%edi
mov    $0x41,%esi
mov    $0x7d,%edx
call   1030 <_in_range@plt>
test   %rax,%rax
jne    12ce <_is_nickname+0x1ae>
lea    0x8(%r14),%rbx
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    12ce <_is_nickname+0x1ae>
cmpb   $0x2d,(%rbx)
jne    12d9 <_is_nickname+0x1b9>
add    $0x9,%r14
mov    %r14,%rbx
jmp    12d9 <_is_nickname+0x1b9>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_is_nickname(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @_in_range(i8 signext %2, i32 65, i32 125)
%4 = icmp eq i64 %3, 0
br i1 %4, label %103, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i64 @_in_range(i8 signext %7, i32 65, i32 125)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8, i8* %6
%12 = tail call i64 @isdigit(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8, i8* %6
%16 = icmp eq i8 %15, 45
br i1 %16, label %17, label %103
17: ; preds = %14, %10, %5
%18 = getelementptr inbounds i8, i8* %0, i64 2
%19 = load i8, i8* %18
%20 = tail call i64 @_in_range(i8 signext %19, i32 65, i32 125)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i8, i8* %18
%24 = tail call i64 @isdigit(i8 signext %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i8, i8* %18
%28 = icmp eq i8 %27, 45
br i1 %28, label %29, label %103
29: ; preds = %26, %22, %17
%30 = getelementptr inbounds i8, i8* %0, i64 3
%31 = load i8, i8* %30
%32 = tail call i64 @_in_range(i8 signext %31, i32 65, i32 125)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %29
%35 = load i8, i8* %30
%36 = tail call i64 @isdigit(i8 signext %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i8, i8* %30
%40 = icmp eq i8 %39, 45
br i1 %40, label %41, label %103
41: ; preds = %38, %34, %29
%42 = getelementptr inbounds i8, i8* %0, i64 4
%43 = load i8, i8* %42
%44 = tail call i64 @_in_range(i8 signext %43, i32 65, i32 125)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %41
%47 = load i8, i8* %42
%48 = tail call i64 @isdigit(i8 signext %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i8, i8* %42
%52 = icmp eq i8 %51, 45
br i1 %52, label %53, label %103
53: ; preds = %50, %46, %41
%54 = getelementptr inbounds i8, i8* %0, i64 5
%55 = load i8, i8* %54
%56 = tail call i64 @_in_range(i8 signext %55, i32 65, i32 125)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %65
58: ; preds = %53
%59 = load i8, i8* %54
%60 = tail call i64 @isdigit(i8 signext %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %58
%63 = load i8, i8* %54
%64 = icmp eq i8 %63, 45
br i1 %64, label %65, label %103
65: ; preds = %62, %58, %53
%66 = getelementptr inbounds i8, i8* %0, i64 6
%67 = load i8, i8* %66
%68 = tail call i64 @_in_range(i8 signext %67, i32 65, i32 125)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %77
70: ; preds = %65
%71 = load i8, i8* %66
%72 = tail call i64 @isdigit(i8 signext %71)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = load i8, i8* %66
%76 = icmp eq i8 %75, 45
br i1 %76, label %77, label %103
77: ; preds = %74, %70, %65
%78 = getelementptr inbounds i8, i8* %0, i64 7
%79 = load i8, i8* %78
%80 = tail call i64 @_in_range(i8 signext %79, i32 65, i32 125)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %89
82: ; preds = %77
%83 = load i8, i8* %78
%84 = tail call i64 @isdigit(i8 signext %83)
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %82
%87 = load i8, i8* %78
%88 = icmp eq i8 %87, 45
br i1 %88, label %89, label %103
89: ; preds = %86, %82, %77
%90 = getelementptr inbounds i8, i8* %0, i64 8
%91 = load i8, i8* %90
%92 = tail call i64 @_in_range(i8 signext %91, i32 65, i32 125)
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %101
94: ; preds = %89
%95 = load i8, i8* %90
%96 = tail call i64 @isdigit(i8 signext %95)
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %94
%99 = load i8, i8* %90
%100 = icmp eq i8 %99, 45
br i1 %100, label %101, label %103
101: ; preds = %98, %94, %89
%102 = getelementptr inbounds i8, i8* %0, i64 9
br label %103
103: ; preds = %14, %26, %38, %50, %62, %74, %86, %98, %101, %1
%104 = phi i8* [ null, %1 ], [ %6, %14 ], [ %18, %26 ], [ %30, %38 ], [ %42, %50 ], [ %54, %62 ], [ %66, %74 ], [ %78, %86 ], [ %90, %98 ], [ %102, %101 ]
ret i8* %104
}