#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*/ piece_inverse(char *, char, int /*<<< orphan*/);
char *piece_delete_multiple(char *source_destination, char delimiter,
                            int columns_to_piece) {
  if (columns_to_piece <= 0)
    return source_destination;
  do {
    if (!piece_inverse(source_destination, delimiter, 0)) {
      return source_destination;
    }
  } while (--columns_to_piece);
  return source_destination;
}


x86 assembly (clang, -O0):
<piece_delete_multiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     113c <piece_delete_multiple+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <piece_delete_multiple+0x75>
jmp    1141 <piece_delete_multiple+0x31>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
movsbl -0x11(%rbp),%esi
call   1030 <piece_inverse@plt>
cmp    $0x0,%eax
jne    1166 <piece_delete_multiple+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <piece_delete_multiple+0x75>
jmp    116b <piece_delete_multiple+0x5b>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jne    1141 <piece_delete_multiple+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_delete_multiple>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
test   %edx,%edx
jle    114a <piece_delete_multiple+0x3a>
mov    %edx,%ebx
add    $0xffffffff,%ebx
movsbl %sil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <piece_inverse@plt>
sub    $0x1,%ebx
setb   %cl
test   %eax,%eax
je     114a <piece_delete_multiple+0x3a>
test   %cl,%cl
je     1130 <piece_delete_multiple+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @piece_delete_multiple(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i8*, i8** %5
store i8* %11, i8** %4
br label %27
12: ; preds = %3
br label %13
13: ; preds = %21, %12
%14 = load i8*, i8** %5
%15 = load i8, i8* %6
%16 = call i32 @piece_inverse(i8* %14, i8 signext %15, i32 0)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %13
%19 = load i8*, i8** %5
store i8* %19, i8** %4
br label %27
20: ; preds = %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, -1
store i32 %23, i32* %7
%24 = icmp ne i32 %23, 0
br i1 %24, label %13, label %25
25: ; preds = %21
%26 = load i8*, i8** %5
store i8* %26, i8** %4
br label %27
27: ; preds = %25, %18, %10
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @piece_delete_multiple(i8* returned %0, i8 signext %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = tail call i32 @piece_inverse(i8* %0, i8 signext %1, i32 0)
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %6, -1
%10 = icmp eq i32 %9, 0
%11 = select i1 %8, i1 true, i1 %10
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret i8* %0
}