#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__ isdigit(char);
int is_ip_char(char c) {
  return isdigit(c) || c == '.' || c == ':' || (c >= 'a' && c <= 'f') ||
         (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<is_ip_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    11a1 <is_ip_char+0x91>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     11a1 <is_ip_char+0x91>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x2(%rbp)
je     11a1 <is_ip_char+0x91>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     117c <is_ip_char+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    11a1 <is_ip_char+0x91>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     119b <is_ip_char+0x8b>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ip_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <is_ip_char+0x17>
pop    %rbx
ret
cmp    $0x2e,%bl
je     1125 <is_ip_char+0x15>
cmp    $0x3a,%bl
je     1125 <is_ip_char+0x15>
lea    -0x61(%rbx),%ecx
cmp    $0x6,%cl
jb     1125 <is_ip_char+0x15>
add    $0xbf,%bl
xor    %eax,%eax
cmp    $0x6,%bl
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_ip_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %32, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br i1 %9, label %32, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br i1 %13, label %32, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 102
br i1 %21, label %32, label %22
22: ; preds = %18, %14
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 65
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 70
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ false, %22 ], [ %29, %26 ]
br label %32
32: ; preds = %30, %18, %10, %6, %1
%33 = phi i1 [ true, %18 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %31, %30 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_ip_char(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
switch i8 %0, label %6 [
i8 58, label %13
i8 46, label %13
]
6: ; preds = %5
%7 = add i8 %0, -97
%8 = icmp ult i8 %7, 6
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = add i8 %0, -65
%11 = icmp ult i8 %10, 6
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %5, %1, %6, %9
%14 = phi i32 [ 1, %5 ], [ %12, %9 ], [ 1, %6 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %14
}