#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*/ dnaUtilOpen();
long dnaOrAaFilteredSize(char *raw, char filter[256]) {
  char c;
  long count = 0;
  dnaUtilOpen();
  while ((c = *raw++) != 0) {
    if (filter[(int)c])
      ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<dnaOrAaFilteredSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <dnaUtilOpen@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1175 <dnaOrAaFilteredSize+0x65>
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1170 <dnaOrAaFilteredSize+0x60>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <dnaOrAaFilteredSize+0x1f>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnaOrAaFilteredSize>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r15d,%r15d
xor    %eax,%eax
call   1030 <dnaUtilOpen@plt>
mov    (%rbx),%al
test   %al,%al
je     1158 <dnaOrAaFilteredSize+0x48>
add    $0x1,%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq %al,%rax
cmpb   $0x1,(%r14,%rax,1)
sbb    $0xffffffffffffffff,%r15
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <dnaOrAaFilteredSize+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @dnaOrAaFilteredSize(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 (...) @dnaUtilOpen()
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i64 [ %16, %6 ], [ 0, %2 ]
%9 = phi i8* [ %10, %6 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = sext i8 %7 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
%15 = zext i1 %14 to i64
%16 = add nuw nsw i64 %8, %15
%17 = load i8, i8* %10
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %16, %6 ]
ret i64 %20
}