#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 */
scalar_t__ utl_strdelc_check(char, char *);
int /*<<< orphan*/ utl_strdelc_shift(char *);
char *utl_strdelc(char *str, char *dels) {
  int it;
  it = 0;
  while (str[it]) {
    if (utl_strdelc_check(str[it], dels))
      utl_strdelc_shift(str + it);
    else
      it++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<utl_strdelc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     118d <utl_strdelc+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <utl_strdelc_check@plt>
cmp    $0x0,%rax
je     117f <utl_strdelc+0x5f>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1030 <utl_strdelc_shift@plt>
jmp    1188 <utl_strdelc+0x68>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <utl_strdelc+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_strdelc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
mov    (%rdi),%al
test   %al,%al
je     116d <utl_strdelc+0x4d>
mov    %rsi,%r14
xor    %ebp,%ebp
mov    %r15,%rbx
jmp    1153 <utl_strdelc+0x33>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
movslq %ebp,%rax
lea    (%r15,%rax,1),%rbx
movzbl (%r15,%rax,1),%eax
test   %al,%al
je     116d <utl_strdelc+0x4d>
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <utl_strdelc_check@plt>
test   %rax,%rax
je     1140 <utl_strdelc+0x20>
mov    %rbx,%rdi
call   1030 <utl_strdelc_shift@plt>
jmp    1143 <utl_strdelc+0x23>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @utl_strdelc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %31, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %32
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = call i64 @utl_strdelc_check(i8 signext %18, i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %13
%23 = load i8*, i8** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = call i32 @utl_strdelc_shift(i8* %26)
br label %31
28: ; preds = %13
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %31
31: ; preds = %28, %22
br label %6
32: ; preds = %6
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
define i8* @utl_strdelc(i8* returned %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %2, %15
%6 = phi i8 [ %19, %15 ], [ %3, %2 ]
%7 = phi i8* [ %18, %15 ], [ %0, %2 ]
%8 = phi i32 [ %16, %15 ], [ 0, %2 ]
%9 = tail call i64 @utl_strdelc_check(i8 signext %6, i8* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = tail call i32 @utl_strdelc_shift(i8* %7)
br label %15
13: ; preds = %5
%14 = add nsw i32 %8, 1
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %8, %11 ], [ %14, %13 ]
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %5
21: ; preds = %15, %2
ret i8* %0
}