#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*/ SubStrings_Copy(char *, char *, unsigned int const);
char *SubStrings_FindAnyOf(char const *const, char *);
unsigned int SubStrings_Length(char *const);
unsigned SubStrings_StripC(const char *const Match, char *const Source) {
  register char *Worker = Source;
  const unsigned Len = SubStrings_Length(Source);
  register unsigned Inc = 0;
  for (; (Worker = SubStrings_FindAnyOf(Match, Worker)); ++Inc) {
    SubStrings_Copy(Worker, Worker + 1, Len);
  }
  return Inc;
}


x86 assembly (clang, -O0):
<SubStrings_StripC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <SubStrings_Length@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <SubStrings_FindAnyOf@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1198 <SubStrings_StripC+0x68>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <SubStrings_Copy@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115b <SubStrings_StripC+0x2b>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubStrings_StripC>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <SubStrings_Length@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <SubStrings_FindAnyOf@plt>
test   %rax,%rax
je     1187 <SubStrings_StripC+0x57>
mov    %rax,%rbp
xor    %ebx,%ebx
nopl   (%rax)
lea    0x1(%rbp),%rsi
mov    %rbp,%rdi
mov    %r15d,%edx
call   1030 <SubStrings_Copy@plt>
add    $0x1,%ebx
mov    %r14,%rdi
mov    %rbp,%rsi
call   1040 <SubStrings_FindAnyOf@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1160 <SubStrings_StripC+0x30>
jmp    1189 <SubStrings_StripC+0x59>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SubStrings_StripC(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @SubStrings_Length(i8* %9)
store i32 %10, i32* %6
store i32 0, i32* %7
br label %11
11: ; preds = %22, %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %5
%14 = call i8* @SubStrings_FindAnyOf(i8* %12, i8* %13)
store i8* %14, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %25
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i32, i32* %6
%21 = call i32 @SubStrings_Copy(i8* %17, i8* %19, i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %7
%24 = add i32 %23, 1
store i32 %24, i32* %7
br label %11
25: ; preds = %11
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @SubStrings_StripC(i8* %0, i8* %1) {
%3 = tail call i32 @SubStrings_Length(i8* %1)
%4 = tail call i8* @SubStrings_FindAnyOf(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %12, %6 ], [ %4, %2 ]
%8 = phi i32 [ %11, %6 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @SubStrings_Copy(i8* %7, i8* %9, i32 %3)
%11 = add i32 %8, 1
%12 = tail call i8* @SubStrings_FindAnyOf(i8* %0, i8* %7)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i32 [ 0, %2 ], [ %11, %6 ]
ret i32 %15
}