#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*/ MatchClass(char, char);
char *PolyPurge(char *string, char clazz) {
  register char *ptr;
  static char area[1024];
  ptr = area;
  while (*string) {
    if (!MatchClass(clazz, *string)) {
      *(ptr++) = *string;
    }
    string++;
  }
  *ptr = '\0';
  return (area);
}


x86 assembly (clang, -O0):
<PolyPurge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0x2f17(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117d <PolyPurge+0x6d>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1030 <MatchClass@plt>
cmp    $0x0,%eax
jne    116c <PolyPurge+0x5c>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112d <PolyPurge+0x1d>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2eb5(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolyPurge>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1157 <PolyPurge+0x47>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0x2f18(%rip),%rbp
movsbl %sil,%r14d
jmp    113b <PolyPurge+0x2b>
xchg   %ax,%ax
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     115e <PolyPurge+0x4e>
movsbl %al,%esi
mov    %r14d,%edi
call   1030 <MatchClass@plt>
test   %eax,%eax
jne    1130 <PolyPurge+0x20>
movzbl -0x1(%rbx),%eax
mov    %al,0x0(%rbp)
add    $0x1,%rbp
jmp    1130 <PolyPurge+0x20>
lea    0x2ee2(%rip),%rbp
movb   $0x0,0x0(%rbp)
lea    0x2ed7(%rip),%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PolyPurge.area = internal global [1024 x i8] zeroinitializer
define i8* @PolyPurge(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @PolyPurge.area, i64 0, i64 0), i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8, i8* %4
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32 @MatchClass(i8 signext %11, i8 signext %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
store i8 %18, i8* %19
br label %21
21: ; preds = %16, %10
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %6
24: ; preds = %6
%25 = load i8*, i8** %5
store i8 0, i8* %25
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @PolyPurge.area, i64 0, i64 0)
}

LLVM IR (-O2):
@PolyPurge.area = internal global [1024 x i8] zeroinitializer
define i8* @PolyPurge(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %14
%6 = phi i8 [ %17, %14 ], [ %3, %2 ]
%7 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1024 x i8], [1024 x i8]* @PolyPurge.area, i64 0, i64 0), %2 ]
%8 = phi i8* [ %16, %14 ], [ %0, %2 ]
%9 = tail call i32 @MatchClass(i8 signext %1, i8 signext %6)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i8, i8* %8
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
br label %14
14: ; preds = %11, %5
%15 = phi i8* [ %7, %5 ], [ %13, %11 ]
%16 = getelementptr inbounds i8, i8* %8, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %14, %2
%20 = phi i8* [ getelementptr inbounds ([1024 x i8], [1024 x i8]* @PolyPurge.area, i64 0, i64 0), %2 ], [ %15, %14 ]
store i8 0, i8* %20
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @PolyPurge.area, i64 0, i64 0)
}