#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);
unsigned char IsHostName(char *nick) {
  char *p;
  for (p = nick; *p; p++)
    if (!isdigit(*p) && (*p != '.'))
      return 0xFF;
  return 0;
}


x86 assembly (clang, -O0):
<IsHostName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <IsHostName+0x65>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115f <IsHostName+0x4f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     115f <IsHostName+0x4f>
movb   $0xff,-0x1(%rbp)
jmp    1179 <IsHostName+0x69>
jmp    1164 <IsHostName+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <IsHostName+0x14>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsHostName>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1141 <IsHostName+0x31>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    112b <IsHostName+0x1b>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1141 <IsHostName+0x31>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1120 <IsHostName+0x10>
cmpb   $0x2e,-0x1(%rbx)
je     1120 <IsHostName+0x10>
mov    $0xff,%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

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