#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*/ memset(char *, char, int);
char *strstr(char *, char *);
void filter_title(char *start) {
  char *cp;
  if ((cp = strstr(start, "<title")) || (cp = strstr(start, "<TITLE"))) {
    start = cp;
    if ((cp = strstr(start + 6, "</title>")) ||
        (cp = strstr(start + 6, "</TITLE>"))) {
      memset(start, ' ', cp - start + 8);
    }
  }
}


x86 assembly (clang, -O0):
<filter_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1168 <filter_title+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11d8 <filter_title+0xb8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11b4 <filter_title+0x94>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xe76(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11d3 <filter_title+0xb3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x8,%rax
mov    %eax,%edx
mov    $0x20,%esi
call   1030 <memset@plt>
jmp    11d8 <filter_title+0xb8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_title>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1152 <filter_title+0x32>
lea    0xec5(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1199 <filter_title+0x79>
lea    0x6(%rbx),%r14
lea    0xeb1(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
jne    117e <filter_title+0x5e>
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1199 <filter_title+0x79>
sub    %ebx,%eax
add    $0x8,%eax
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"<title\00"
@.str.1 = [7 x i8] c"<TITLE\00"
@.str.2 = [9 x i8] c"</title>\00"
@.str.3 = [9 x i8] c"</TITLE>\00"
define void @filter_title(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i8* @strstr(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %33
11: ; preds = %7, %1
%12 = load i8*, i8** %3
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 6
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i8* %15, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %22, label %17
17: ; preds = %11
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 6
%20 = call i8* @strstr(i8* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i8* %20, i8** %3
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %32
22: ; preds = %17, %11
%23 = load i8*, i8** %2
%24 = load i8*, i8** %3
%25 = load i8*, i8** %2
%26 = ptrtoint i8* %24 to i64
%27 = ptrtoint i8* %25 to i64
%28 = sub i64 %26, %27
%29 = add nsw i64 %28, 8
%30 = trunc i64 %29 to i32
%31 = call i32 @memset(i8* %23, i8 signext 32, i32 %30)
br label %32
32: ; preds = %22, %17
br label %33
33: ; preds = %32, %7
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<title\00"
@.str.1 = [7 x i8] c"<TITLE\00"
@.str.2 = [9 x i8] c"</title>\00"
@.str.3 = [9 x i8] c"</TITLE>\00"
define void @filter_title(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %23, label %7
7: ; preds = %4, %1
%8 = phi i8* [ %2, %1 ], [ %5, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 6
%10 = tail call i8* @strstr(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = tail call i8* @strstr(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %23, label %15
15: ; preds = %12, %7
%16 = phi i8* [ %10, %7 ], [ %13, %12 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %8 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
%21 = add i32 %20, 8
%22 = tail call i32 @memset(i8* %8, i8 signext 32, i32 %21)
br label %23
23: ; preds = %12, %15, %4
ret void
}