#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ summary();
int /*<<< orphan*/ test_failure();
int /*<<< orphan*/ test_filter_any_index();
int /*<<< orphan*/ test_filter_any_ptr();
int /*<<< orphan*/ test_filter_ch_index();
int /*<<< orphan*/ test_filter_ch_ptr();
int /*<<< orphan*/ test_filter_substr();
int main(int ac, char **av) {
  fprintf(stderr, "** Tests of filter_ch_index **\n");
  if (!test_filter_ch_index()) {
    test_failure();
  }
  fprintf(stderr, "** Tests of filter_ch_ptr **\n");
  if (!test_filter_ch_ptr()) {
    test_failure();
  }
  fprintf(stderr, "** Tests of filter_any_index **\n");
  if (!test_filter_any_index()) {
    test_failure();
  }
  fprintf(stderr, "** Tests of filter_any_ptr **\n");
  if (!test_filter_any_ptr()) {
    test_failure();
  }
  fprintf(stderr, "** Tests of filter_substr **\n");
  if (!test_filter_substr()) {
    test_failure();
  }
  summary();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1050 <test_filter_ch_index@plt>
cmp    $0x0,%eax
jne    11c2 <main+0x42>
mov    $0x0,%al
call   10a0 <test_failure@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
lea    0xe4e(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1060 <test_filter_ch_ptr@plt>
cmp    $0x0,%eax
jne    11ee <main+0x6e>
mov    $0x0,%al
call   10a0 <test_failure@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xe40(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1030 <test_filter_any_index@plt>
cmp    $0x0,%eax
jne    121a <main+0x9a>
mov    $0x0,%al
call   10a0 <test_failure@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1040 <test_filter_any_ptr@plt>
cmp    $0x0,%eax
jne    1246 <main+0xc6>
mov    $0x0,%al
call   10a0 <test_failure@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1090 <test_filter_substr@plt>
cmp    $0x0,%eax
jne    1272 <main+0xf2>
mov    $0x0,%al
call   10a0 <test_failure@plt>
mov    $0x0,%al
call   1080 <summary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e58(%rip),%rbx
mov    (%rbx),%edi
lea    0xe6f(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1050 <test_filter_ch_index@plt>
test   %eax,%eax
jne    11a8 <main+0x28>
xor    %eax,%eax
call   10a0 <test_failure@plt>
mov    (%rbx),%edi
lea    0xe6f(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1060 <test_filter_ch_ptr@plt>
test   %eax,%eax
jne    11c8 <main+0x48>
xor    %eax,%eax
call   10a0 <test_failure@plt>
mov    (%rbx),%edi
lea    0xe6d(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1030 <test_filter_any_index@plt>
test   %eax,%eax
jne    11e8 <main+0x68>
xor    %eax,%eax
call   10a0 <test_failure@plt>
mov    (%rbx),%edi
lea    0xe6e(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1040 <test_filter_any_ptr@plt>
test   %eax,%eax
jne    1208 <main+0x88>
xor    %eax,%eax
call   10a0 <test_failure@plt>
mov    (%rbx),%edi
lea    0xe6d(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1090 <test_filter_substr@plt>
test   %eax,%eax
jne    1228 <main+0xa8>
xor    %eax,%eax
call   10a0 <test_failure@plt>
xor    %eax,%eax
call   1080 <summary@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"** Tests of filter_ch_index **\0A\00"
@.str.1 = [30 x i8] c"** Tests of filter_ch_ptr **\0A\00"
@.str.2 = [33 x i8] c"** Tests of filter_any_index **\0A\00"
@.str.3 = [31 x i8] c"** Tests of filter_any_ptr **\0A\00"
@.str.4 = [30 x i8] c"** Tests of filter_substr **\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @test_filter_ch_index()
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 (...) @test_failure()
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (...) @test_filter_ch_ptr()
%16 = icmp ne i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %12
%18 = call i32 (...) @test_failure()
br label %19
19: ; preds = %17, %12
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (...) @test_filter_any_index()
%23 = icmp ne i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %19
%25 = call i32 (...) @test_failure()
br label %26
26: ; preds = %24, %19
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (...) @test_filter_any_ptr()
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %26
%32 = call i32 (...) @test_failure()
br label %33
33: ; preds = %31, %26
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (...) @test_filter_substr()
%37 = icmp ne i32 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %33
%39 = call i32 (...) @test_failure()
br label %40
40: ; preds = %38, %33
%41 = call i32 (...) @summary()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"** Tests of filter_ch_index **\0A\00"
@.str.1 = [30 x i8] c"** Tests of filter_ch_ptr **\0A\00"
@.str.2 = [33 x i8] c"** Tests of filter_any_index **\0A\00"
@.str.3 = [31 x i8] c"** Tests of filter_any_ptr **\0A\00"
@.str.4 = [30 x i8] c"** Tests of filter_substr **\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @test_filter_ch_index()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @test_failure()
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (...) @test_filter_ch_ptr()
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @test_failure()
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (...) @test_filter_any_index()
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = tail call i32 (...) @test_failure()
br label %23
23: ; preds = %21, %16
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%26 = tail call i32 (...) @test_filter_any_ptr()
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = tail call i32 (...) @test_failure()
br label %30
30: ; preds = %28, %23
%31 = load i32, i32* @stderr
%32 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%33 = tail call i32 (...) @test_filter_substr()
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = tail call i32 (...) @test_failure()
br label %37
37: ; preds = %35, %30
%38 = tail call i32 (...) @summary()
ret i32 0
}