#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 */
struct lm {
  int dummy;
};

/* Variables and functions */
char *lmCloneString(struct lm *, char *);
int /*<<< orphan*/ stripChar(char *, char);
char *stripAll(char *in, char *toRemove, struct lm *lm) {
  char *result = lmCloneString(lm, in);
  char c, *s = toRemove;
  while ((c = *s++) != 0)
    stripChar(result, c);
  return result;
}


x86 assembly (clang, -O0):
<stripAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <lmCloneString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     117f <stripAll+0x5f>
mov    -0x20(%rbp),%rdi
movsbl -0x21(%rbp),%esi
call   1040 <stripChar@plt>
jmp    114d <stripAll+0x2d>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripAll>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1030 <lmCloneString@plt>
mov    %rax,%r14
mov    (%rbx),%al
test   %al,%al
je     1156 <stripAll+0x36>
add    $0x1,%rbx
nop
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <stripChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <stripAll+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.lm = type { i32 }
define i8* @stripAll(i8* %0, i8* %1, %struct.lm* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.lm*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.lm* %2, %struct.lm** %6
%10 = load %struct.lm*, %struct.lm** %6
%11 = load i8*, i8** %4
%12 = call i8* @lmCloneString(%struct.lm* %10, i8* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %5
store i8* %13, i8** %9
br label %14
14: ; preds = %20, %3
%15 = load i8*, i8** %9
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %9
%17 = load i8, i8* %15
store i8 %17, i8* %8
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %14
%21 = load i8*, i8** %7
%22 = load i8, i8* %8
%23 = call i32 @stripChar(i8* %21, i8 signext %22)
br label %14
24: ; preds = %14
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
%struct.lm = type { i32 }
define i8* @stripAll(i8* %0, i8* nocapture %1, %struct.lm* %2) {
%4 = tail call i8* @lmCloneString(%struct.lm* %2, i8* %0)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi i8 [ %12, %7 ], [ %5, %3 ]
%9 = phi i8* [ %10, %7 ], [ %1, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = tail call i32 @stripChar(i8* %4, i8 signext %8)
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret i8* %4
}