#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 */
struct AttributeFilter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ generateFilter(struct AttributeFilter *, int, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
void interpreteFilter(struct AttributeFilter *attr_filter, int argc,
                      char **argv) {
  int i, len;
  char *arg;
  i = 0;
  while (++i < argc) {
    arg = argv[i];
    len = strlen(arg);
    if (strncmp(arg, "--class_filter", sizeof("--class_filter")) == 0) {
      arg[len - 1] = '\0';
      generateFilter(attr_filter, 0, arg + sizeof("--class_filter") + 2);
    } else if (strncmp(arg, "--field_filter", sizeof("--field_filter")) == 0) {
      arg[len - 1] = '\0';
      generateFilter(attr_filter, 1, arg + sizeof("--field_filter") + 2);
    } else if (strncmp(arg, "--method_filter", sizeof("--method_filter")) ==
               0) {
      arg[len - 1] = '\0';
      generateFilter(attr_filter, 2, arg + sizeof("--method_filter") + 2);
    } else if (strncmp(arg, "--code_filter", sizeof("--code_filter")) == 0) {
      arg[len - 1] = '\0';
      generateFilter(attr_filter, 3, arg + sizeof("--code_filter") + 2);
    }
    break;
  }
}


x86 assembly (clang, -O0):
<interpreteFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    -0xc(%rbp),%eax
jge    12c0 <interpreteFilter+0x190>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    11c4 <interpreteFilter+0x94>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0xf,%rdx
add    $0x2,%rdx
xor    %esi,%esi
call   1030 <generateFilter@plt>
jmp    12bb <interpreteFilter+0x18b>
mov    -0x28(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1213 <interpreteFilter+0xe3>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0xf,%rdx
add    $0x2,%rdx
mov    $0x1,%esi
call   1030 <generateFilter@plt>
jmp    12b6 <interpreteFilter+0x186>
mov    -0x28(%rbp),%rdi
lea    0xe00(%rip),%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1262 <interpreteFilter+0x132>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0x10,%rdx
add    $0x2,%rdx
mov    $0x2,%esi
call   1030 <generateFilter@plt>
jmp    12b1 <interpreteFilter+0x181>
mov    -0x28(%rbp),%rdi
lea    0xdc1(%rip),%rsi
mov    $0xe,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12ac <interpreteFilter+0x17c>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
add    $0xe,%rdx
add    $0x2,%rdx
mov    $0x3,%esi
call   1030 <generateFilter@plt>
jmp    12b1 <interpreteFilter+0x181>
jmp    12b6 <interpreteFilter+0x186>
jmp    12bb <interpreteFilter+0x18b>
jmp    12c0 <interpreteFilter+0x190>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpreteFilter>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     11b7 <interpreteFilter+0x87>
mov    %rdi,%r14
mov    0x8(%rdx),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
mov    $0xf,%edx
call   1040 <strncmp@plt>
mov    $0x11,%ebp
test   %rax,%rax
je     11c2 <interpreteFilter+0x92>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
mov    $0xf,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11c6 <interpreteFilter+0x96>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11cd <interpreteFilter+0x9d>
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
mov    $0xe,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11d9 <interpreteFilter+0xa9>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
jmp    11e3 <interpreteFilter+0xb3>
mov    $0x1,%esi
jmp    11e3 <interpreteFilter+0xb3>
mov    $0x2,%esi
mov    $0x12,%ebp
jmp    11e3 <interpreteFilter+0xb3>
mov    $0x3,%esi
mov    $0x10,%ebp
movslq %r15d,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
add    %rbx,%rbp
mov    %r14,%rdi
mov    %rbp,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <generateFilter@plt>

LLVM IR (-O0):
%struct.AttributeFilter = type { i32 }
@.str = [15 x i8] c"--class_filter\00"
@.str.1 = [15 x i8] c"--field_filter\00"
@.str.2 = [16 x i8] c"--method_filter\00"
@.str.3 = [14 x i8] c"--code_filter\00"
define void @interpreteFilter(%struct.AttributeFilter* %0, i32 %1, i8** %2) {
%4 = alloca %struct.AttributeFilter*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store %struct.AttributeFilter* %0, %struct.AttributeFilter** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
store i32 0, i32* %7
br label %10
10: ; preds = %3
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 1
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %86
15: ; preds = %10
%16 = load i8**, i8*** %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = call i32 @strlen(i8* %21)
store i32 %22, i32* %8
%23 = load i8*, i8** %9
%24 = call i64 @strncmp(i8* %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %37
26: ; preds = %15
%27 = load i8*, i8** %9
%28 = load i32, i32* %8
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
store i8 0, i8* %31
%32 = load %struct.AttributeFilter*, %struct.AttributeFilter** %4
%33 = load i8*, i8** %9
%34 = getelementptr inbounds i8, i8* %33, i64 15
%35 = getelementptr inbounds i8, i8* %34, i64 2
%36 = call i32 @generateFilter(%struct.AttributeFilter* %32, i32 0, i8* %35)
br label %85
37: ; preds = %15
%38 = load i8*, i8** %9
%39 = call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 15)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %52
41: ; preds = %37
%42 = load i8*, i8** %9
%43 = load i32, i32* %8
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %42, i64 %45
store i8 0, i8* %46
%47 = load %struct.AttributeFilter*, %struct.AttributeFilter** %4
%48 = load i8*, i8** %9
%49 = getelementptr inbounds i8, i8* %48, i64 15
%50 = getelementptr inbounds i8, i8* %49, i64 2
%51 = call i32 @generateFilter(%struct.AttributeFilter* %47, i32 1, i8* %50)
br label %84
52: ; preds = %37
%53 = load i8*, i8** %9
%54 = call i64 @strncmp(i8* %53, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 16)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %67
56: ; preds = %52
%57 = load i8*, i8** %9
%58 = load i32, i32* %8
%59 = sub nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %57, i64 %60
store i8 0, i8* %61
%62 = load %struct.AttributeFilter*, %struct.AttributeFilter** %4
%63 = load i8*, i8** %9
%64 = getelementptr inbounds i8, i8* %63, i64 16
%65 = getelementptr inbounds i8, i8* %64, i64 2
%66 = call i32 @generateFilter(%struct.AttributeFilter* %62, i32 2, i8* %65)
br label %83
67: ; preds = %52
%68 = load i8*, i8** %9
%69 = call i64 @strncmp(i8* %68, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 14)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %82
71: ; preds = %67
%72 = load i8*, i8** %9
%73 = load i32, i32* %8
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %72, i64 %75
store i8 0, i8* %76
%77 = load %struct.AttributeFilter*, %struct.AttributeFilter** %4
%78 = load i8*, i8** %9
%79 = getelementptr inbounds i8, i8* %78, i64 14
%80 = getelementptr inbounds i8, i8* %79, i64 2
%81 = call i32 @generateFilter(%struct.AttributeFilter* %77, i32 3, i8* %80)
br label %82
82: ; preds = %71, %67
br label %83
83: ; preds = %82, %56
br label %84
84: ; preds = %83, %41
br label %85
85: ; preds = %84, %26
br label %86
86: ; preds = %85, %10
ret void
}

LLVM IR (-O2):
%struct.AttributeFilter = type { i32 }
@.str = [15 x i8] c"--class_filter\00"
@.str.1 = [15 x i8] c"--field_filter\00"
@.str.2 = [16 x i8] c"--method_filter\00"
@.str.3 = [14 x i8] c"--code_filter\00"
define void @interpreteFilter(%struct.AttributeFilter* %0, i32 %1, i8** nocapture %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %28
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @strlen(i8* %7)
%9 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%10 = icmp eq i64 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %5
%12 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 15)
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 16)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 14)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %17, %14, %11, %5
%21 = phi i64 [ 17, %5 ], [ 17, %11 ], [ 18, %14 ], [ 16, %17 ]
%22 = phi i32 [ 0, %5 ], [ 1, %11 ], [ 2, %14 ], [ 3, %17 ]
%23 = add nsw i32 %8, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %7, i64 %24
store i8 0, i8* %25
%26 = getelementptr inbounds i8, i8* %7, i64 %21
%27 = tail call i32 @generateFilter(%struct.AttributeFilter* %0, i32 %22, i8* %26)
br label %28
28: ; preds = %20, %17, %3
ret void
}