#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 *delete_a_char_in_str(char *, int, char);
int my_str_length(char *);
char *delete_ele_of_b_from_a(char *str_a, char *str_b) {
  int i;
  for (i = 0; i < my_str_length(str_b); i++) {
    str_a = delete_a_char_in_str(str_a, my_str_length(str_a), str_b[i]);
  }
  return str_a;
}


x86 assembly (clang, -O0):
<delete_ele_of_b_from_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <my_str_length@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    118d <delete_ele_of_b_from_a+0x6d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_str_length@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
call   1040 <delete_a_char_in_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <delete_ele_of_b_from_a+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_ele_of_b_from_a>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <my_str_length@plt>
test   %eax,%eax
jle    116d <delete_ele_of_b_from_a+0x4d>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
call   1030 <my_str_length@plt>
movsbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <delete_a_char_in_str@plt>
mov    %rax,%r15
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <my_str_length@plt>
cltq
cmp    %rax,%rbx
jl     1140 <delete_ele_of_b_from_a+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @delete_ele_of_b_from_a(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 = %21, %2
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = call i32 @my_str_length(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @my_str_length(i8* %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = call i8* @delete_a_char_in_str(i8* %12, i32 %14, i8 signext %19)
store i8* %20, i8** %3
br label %21
21: ; preds = %11
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @delete_ele_of_b_from_a(i8* %0, i8* %1) {
%3 = tail call i32 @my_str_length(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = tail call i32 @my_str_length(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 %6
%10 = load i8, i8* %9
%11 = tail call i8* @delete_a_char_in_str(i8* %7, i32 %8, i8 signext %10)
%12 = add nuw nsw i64 %6, 1
%13 = tail call i32 @my_str_length(i8* %1)
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %5, label %16
16: ; preds = %5, %2
%17 = phi i8* [ %0, %2 ], [ %11, %5 ]
ret i8* %17
}