#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*/ assert(char *);
int /*<<< orphan*/ memmove(char *, char *, int /*<<< orphan*/);
char *strchr(char *, char);
int /*<<< orphan*/ strlen(char *);
void remove_html_tags(char *buff) {
  while ((buff = strchr(buff, '<')) != NULL) {
    char *tptr = strchr(buff, '>');
    assert(tptr);
    memmove(buff, tptr + 1, strlen(tptr));
  }
}


x86 assembly (clang, -O0):
<remove_html_tags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     11b4 <remove_html_tags+0x74>
mov    -0x8(%rbp),%rdi
mov    $0x3e,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1060 <memmove@plt>
jmp    114c <remove_html_tags+0xc>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_html_tags>:
push   %r15
push   %r14
push   %rbx
mov    $0x3c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11a6 <remove_html_tags+0x66>
mov    %rax,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x3e,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1060 <memmove@plt>
mov    %r14,%rdi
mov    $0x3c,%esi
call   1040 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1160 <remove_html_tags+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @remove_html_tags(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 60)
store i8* %6, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %19
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = call i8* @strchr(i8* %9, i8 signext 62)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @assert(i8* %11)
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8*, i8** %3
%17 = call i32 @strlen(i8* %16)
%18 = call i32 @memmove(i8* %13, i8* %15, i32 %17)
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @remove_html_tags(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 60)
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = tail call i8* @strchr(i8* %5, i8 signext 62)
%7 = tail call i32 @assert(i8* %6)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @strlen(i8* %6)
%10 = tail call i32 @memmove(i8* %5, i8* %8, i32 %9)
%11 = tail call i8* @strchr(i8* dereferenceable(1) %5, i8 signext 60)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}