#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 */
char *strend(char *);
char *strstrip(char *s) {
  char *p;
  p = strend(s);
  for (p--; p >= s && (*p == ' ' || *p == '>' || *p == '-'); p--)
    *p = '\0';
  return s;
}


x86 assembly (clang, -O0):
<strstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strend@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x11(%rbp)
jb     1188 <strstrip+0x78>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     1182 <strstrip+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x3e,%ecx
mov    %al,-0x12(%rbp)
je     1182 <strstrip+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1198 <strstrip+0x88>
jmp    11b0 <strstrip+0xa0>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1135 <strstrip+0x25>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strend@plt>
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jb     114b <strstrip+0x3b>
movabs $0x4000200100000000,%rcx
nopl   0x0(%rax)
movzbl (%rax),%edx
cmp    $0x3e,%rdx
ja     114b <strstrip+0x3b>
bt     %rdx,%rcx
jae    114b <strstrip+0x3b>
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <strstrip+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strstrip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strend(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 -1
store i8* %7, i8** %3
br label %8
8: ; preds = %33, %1
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = icmp uge i8* %9, %10
br i1 %11, label %12, label %29
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
br i1 %16, label %27, label %17
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 62
br i1 %21, label %27, label %22
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br label %27
27: ; preds = %22, %17, %12
%28 = phi i1 [ true, %17 ], [ true, %12 ], [ %26, %22 ]
br label %29
29: ; preds = %27, %8
%30 = phi i1 [ false, %8 ], [ %28, %27 ]
br i1 %30, label %31, label %36
31: ; preds = %29
%32 = load i8*, i8** %3
store i8 0, i8* %32
br label %33
33: ; preds = %31
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 -1
store i8* %35, i8** %3
br label %8
36: ; preds = %29
%37 = load i8*, i8** %2
ret i8* %37
}

LLVM IR (-O2):
define i8* @strstrip(i8* returned %0) {
%2 = tail call i8* @strend(i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 -1
%4 = icmp ult i8* %3, %0
br i1 %4, label %11, label %5
5: ; preds = %1, %8
%6 = phi i8* [ %9, %8 ], [ %3, %1 ]
%7 = load i8, i8* %6
switch i8 %7, label %11 [
i8 32, label %8
i8 62, label %8
i8 45, label %8
]
8: ; preds = %5, %5, %5
store i8 0, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = icmp ult i8* %9, %0
br i1 %10, label %11, label %5
11: ; preds = %8, %5, %1
ret i8* %0
}