#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 */
unsigned int consec_non_bf(const char *code, size_t len, unsigned int index) {
  unsigned int i;
  for (i = index; i < len; i++) {
    switch (code[i]) {
    case 0x6C:
    case 0x6B:
    case 0x70:
    case 0x71:
    case 0x3A:
    case 0x2B:
    case 0x06:
    case 0x07:
      return i - index;
    }
  }
  return i - index;
}


x86 assembly (clang, -O0):
<consec_non_bf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    11ac <consec_non_bf+0xac>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x24(%rbp)
add    $0xfffffffa,%eax
sub    $0x2,%eax
jb     118b <consec_non_bf+0x8b>
jmp    1141 <consec_non_bf+0x41>
mov    -0x24(%rbp),%eax
sub    $0x2b,%eax
je     118b <consec_non_bf+0x8b>
jmp    1152 <consec_non_bf+0x52>
mov    -0x24(%rbp),%eax
sub    $0x3a,%eax
je     118b <consec_non_bf+0x8b>
jmp    1163 <consec_non_bf+0x63>
mov    -0x24(%rbp),%eax
add    $0xffffff95,%eax
sub    $0x2,%eax
jb     118b <consec_non_bf+0x8b>
jmp    1177 <consec_non_bf+0x77>
mov    -0x24(%rbp),%eax
add    $0xffffff90,%eax
sub    $0x1,%eax
ja     1199 <consec_non_bf+0x99>
jmp    118b <consec_non_bf+0x8b>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b5 <consec_non_bf+0xb5>
jmp    119e <consec_non_bf+0x9e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1115 <consec_non_bf+0x15>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consec_non_bf>:
mov    %edx,%ecx
mov    %edx,%eax
cmp    %rsi,%rcx
jae    1145 <consec_non_bf+0x45>
mov    $0x63,%r8d
movabs $0x4000800000000c0,%r9
mov    %rcx,%rax
jmp    1128 <consec_non_bf+0x28>
xchg   %ax,%ax
add    $0x1,%eax
cmp    %rsi,%rax
jae    1145 <consec_non_bf+0x45>
movsbl (%rdi,%rax,1),%ecx
cmp    $0x3a,%ecx
ja     1137 <consec_non_bf+0x37>
bt     %rcx,%r9
jb     1145 <consec_non_bf+0x45>
add    $0xffffff95,%ecx
cmp    $0x6,%ecx
ja     1120 <consec_non_bf+0x20>
bt     %ecx,%r8d
jae    1120 <consec_non_bf+0x20>
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @consec_non_bf(i8* %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
store i32 %9, i32* %8
br label %10
10: ; preds = %27, %3
%11 = load i32, i32* %8
%12 = zext i32 %11 to i64
%13 = load i64, i64* %6
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = load i32, i32* %8
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %26 [
i32 108, label %22
i32 107, label %22
i32 112, label %22
i32 113, label %22
i32 58, label %22
i32 43, label %22
i32 6, label %22
i32 7, label %22
]
22: ; preds = %15, %15, %15, %15, %15, %15, %15, %15
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = sub i32 %23, %24
store i32 %25, i32* %4
br label %34
26: ; preds = %15
br label %27
27: ; preds = %26
%28 = load i32, i32* %8
%29 = add i32 %28, 1
store i32 %29, i32* %8
br label %10
30: ; preds = %10
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = sub i32 %31, %32
store i32 %33, i32* %4
br label %34
34: ; preds = %30, %22
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @consec_non_bf(i8* nocapture %0, i64 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = icmp ult i64 %4, %1
br i1 %5, label %6, label %18
6: ; preds = %3, %11
%7 = phi i64 [ %14, %11 ], [ %4, %3 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %11 [
i32 108, label %16
i32 107, label %16
i32 112, label %16
i32 113, label %16
i32 58, label %16
i32 43, label %16
i32 6, label %16
i32 7, label %16
]
11: ; preds = %6
%12 = trunc i64 %7 to i32
%13 = add i32 %12, 1
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, %1
br i1 %15, label %6, label %18
16: ; preds = %6, %6, %6, %6, %6, %6, %6, %6
%17 = trunc i64 %7 to i32
br label %18
18: ; preds = %11, %16, %3
%19 = phi i32 [ %2, %3 ], [ %17, %16 ], [ %13, %11 ]
%20 = sub i32 %19, %2
ret i32 %20
}