#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);
int tagSchemaDigitsUpToDot(char *s) {
  char c;
  int digitCount = 0;
  for (;;) {
    c = *s++;
    if (c == '.' || c == 0)
      return digitCount;
    if (!isdigit(c))
      return 0;
    ++digitCount;
  }
}


x86 assembly (clang, -O0):
<tagSchemaDigitsUpToDot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x2e,%eax
je     1151 <tagSchemaDigitsUpToDot+0x41>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    115c <tagSchemaDigitsUpToDot+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <tagSchemaDigitsUpToDot+0x78>
movsbl -0x11(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    117a <tagSchemaDigitsUpToDot+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1188 <tagSchemaDigitsUpToDot+0x78>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1123 <tagSchemaDigitsUpToDot+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tagSchemaDigitsUpToDot>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     1141 <tagSchemaDigitsUpToDot+0x31>
cmp    $0x2e,%al
je     1141 <tagSchemaDigitsUpToDot+0x31>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     113f <tagSchemaDigitsUpToDot+0x2f>
add    $0x1,%rbx
jmp    1120 <tagSchemaDigitsUpToDot+0x10>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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