#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 */
typedef char wchar_t;

/* Variables and functions */
int getLineType_HashTableFile(wchar_t *buffer) {
  wchar_t c;
  long int i;
  int point_count;
  i = 0;
  c = buffer[i];
  point_count = 0;
  while (c != '\0') {
    if (buffer[i] == L':') {
      point_count += 1;
    } else {
      break;
    }
    i++;
    c = buffer[i];
  }
  return point_count;
}


x86 assembly (clang, -O0):
<getLineType_HashTableFile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x1c(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1179 <getLineType_HashTableFile+0x79>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1155 <getLineType_HashTableFile+0x55>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <getLineType_HashTableFile+0x5a>
jmp    1179 <getLineType_HashTableFile+0x79>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9(%rbp)
jmp    1125 <getLineType_HashTableFile+0x25>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLineType_HashTableFile>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <getLineType_HashTableFile+0x22>
nopl   0x0(%rax,%rax,1)
cmp    $0x3a,%cl
jne    1122 <getLineType_HashTableFile+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <getLineType_HashTableFile+0x10>
ret

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

LLVM IR (-O2):
define i32 @getLineType_HashTableFile(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %8
%5 = phi i8 [ %11, %8 ], [ %2, %1 ]
%6 = phi i64 [ %9, %8 ], [ 0, %1 ]
%7 = icmp eq i8 %5, 58
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %8
%14 = phi i64 [ %9, %8 ], [ %6, %4 ]
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 0, %1 ], [ %15, %13 ]
ret i32 %17
}