#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*/ seq_init();
void dnaOrAaFilter(char *in, char *out, char filter[256]) {
  char c;
  seq_init();
  while ((c = *in++) != 0) {
    if ((c = filter[(int)c]) != 0)
      *out++ = c;
  }
  *out++ = 0;
}


x86 assembly (clang, -O0):
<dnaOrAaFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <seq_init@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1181 <dnaOrAaFilter+0x71>
mov    -0x18(%rbp),%rax
movsbl -0x19(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     117c <dnaOrAaFilter+0x6c>
mov    -0x19(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    112b <dnaOrAaFilter+0x1b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnaOrAaFilter>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <seq_init@plt>
mov    (%rbx),%al
test   %al,%al
je     1161 <dnaOrAaFilter+0x51>
add    $0x1,%rbx
jmp    114b <dnaOrAaFilter+0x3b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1161 <dnaOrAaFilter+0x51>
movsbq %al,%rax
movzbl (%r14,%rax,1),%eax
test   %al,%al
je     1140 <dnaOrAaFilter+0x30>
mov    %al,(%r15)
add    $0x1,%r15
jmp    1140 <dnaOrAaFilter+0x30>
movb   $0x0,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dnaOrAaFilter(i8* nocapture %0, i8* nocapture writeonly %1, i8* nocapture %2) {
%4 = tail call i32 (...) @seq_init()
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %3, %18
%8 = phi i8 [ %20, %18 ], [ %5, %3 ]
%9 = phi i8* [ %11, %18 ], [ %0, %3 ]
%10 = phi i8* [ %19, %18 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = sext i8 %8 to i64
%13 = getelementptr inbounds i8, i8* %2, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %7
%17 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %14, i8* %10
br label %18
18: ; preds = %16, %7
%19 = phi i8* [ %17, %16 ], [ %10, %7 ]
%20 = load i8, i8* %11
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %7
22: ; preds = %18, %3
%23 = phi i8* [ %1, %3 ], [ %19, %18 ]
store i8 0, i8* %23
ret void
}