#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*/ isdigit(char);
const char *getzname(register const char *strp) {
  char c;
  while ((c = *strp) != '\0' && !isdigit(c) && c != ',' && c != '-' && c != '+')
    ++strp;
  return strp;
}


x86 assembly (clang, -O0):
<getzname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1180 <getzname+0x70>
movsbl -0x9(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
jne    1180 <getzname+0x70>
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0xa(%rbp)
je     1180 <getzname+0x70>
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0xa(%rbp)
je     1180 <getzname+0x70>
movsbl -0x9(%rbp),%eax
cmp    $0x2b,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1190 <getzname+0x80>
jmp    11a1 <getzname+0x91>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <getzname+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getzname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%bl
test   %bl,%bl
je     1141 <getzname+0x31>
nopl   (%rax)
movsbl %bl,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1141 <getzname+0x31>
add    $0xd5,%bl
cmp    $0x3,%bl
jb     1141 <getzname+0x31>
movzbl 0x1(%r14),%ebx
add    $0x1,%r14
test   %bl,%bl
jne    1120 <getzname+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getzname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %27, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %4
%10 = load i8, i8* %3
%11 = call i32 @isdigit(i8 signext %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %25, label %13
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 44
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 45
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 43
br label %25
25: ; preds = %21, %17, %13, %9, %4
%26 = phi i1 [ false, %17 ], [ false, %13 ], [ false, %9 ], [ false, %4 ], [ %24, %21 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %4
30: ; preds = %25
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @getzname(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = tail call i32 @isdigit(i8 signext %5)
%8 = freeze i32 %7
%9 = icmp ne i32 %8, 0
%10 = add i8 %5, -43
%11 = icmp ult i8 %10, 3
%12 = or i1 %9, %11
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %4, %1
%18 = phi i8* [ %0, %1 ], [ %6, %4 ], [ %14, %13 ]
ret i8* %18
}