#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*/ assert(int /*<<< orphan*/);
scalar_t__ hashexdigits(char const *, short, short);
int /*<<< orphan*/ isxdigit(char const);
short hasdata(const char *line) {
  assert(line != NULL);
  if (!isxdigit(line[9])) {
    return 0;
  }
  short start = 9;
  short end = 10;
  short num = 0;
  while (hashexdigits(line, start, end)) {
    start += 2;
    end += 2;
    num += 1;
  }
  return num;
}


x86 assembly (clang, -O0):
<hasdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl 0x9(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
jne    116f <hasdata+0x3f>
movw   $0x0,-0x2(%rbp)
jmp    11cd <hasdata+0x9d>
movw   $0x9,-0x12(%rbp)
movw   $0xa,-0x14(%rbp)
movw   $0x0,-0x16(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x12(%rbp),%ax
movswl %ax,%esi
movswl -0x14(%rbp),%edx
call   1040 <hashexdigits@plt>
cmp    $0x0,%rax
je     11c5 <hasdata+0x95>
movswl -0x12(%rbp),%eax
add    $0x2,%eax
mov    %ax,-0x12(%rbp)
movswl -0x14(%rbp),%eax
add    $0x2,%eax
mov    %ax,-0x14(%rbp)
movswl -0x16(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x16(%rbp)
jmp    1181 <hasdata+0x51>
mov    -0x16(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasdata>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
movsbl 0x9(%r14),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     118e <hasdata+0x5e>
mov    %r14,%rdi
mov    $0x9,%esi
mov    $0xa,%edx
call   1040 <hashexdigits@plt>
test   %rax,%rax
je     118e <hasdata+0x5e>
mov    $0xc,%bx
xor    %ebp,%ebp
lea    -0x1(%rbx),%eax
add    $0x1,%ebp
movswl %ax,%esi
movswl %bx,%edx
mov    %r14,%rdi
call   1040 <hashexdigits@plt>
add    $0x2,%ebx
test   %rax,%rax
jne    1170 <hasdata+0x40>
jmp    1190 <hasdata+0x60>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i16 @hasdata(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 9
%6 = load i8, i8* %5
%7 = tail call i32 @isxdigit(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %1
%10 = tail call i64 @hashexdigits(i8* %0, i16 signext 9, i16 signext 10)
%11 = icmp eq i64 %10, 0
br i1 %11, label %21, label %12
12: ; preds = %9, %12
%13 = phi i16 [ %18, %12 ], [ 0, %9 ]
%14 = phi i16 [ %17, %12 ], [ 10, %9 ]
%15 = phi i16 [ %16, %12 ], [ 9, %9 ]
%16 = add i16 %15, 2
%17 = add i16 %14, 2
%18 = add i16 %13, 1
%19 = tail call i64 @hashexdigits(i8* %0, i16 signext %16, i16 signext %17)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %12
21: ; preds = %12, %9, %1
%22 = phi i16 [ 0, %1 ], [ 0, %9 ], [ %18, %12 ]
ret i16 %22
}