#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*/ str_del_char(char *, int);
void str_delete(char *S, int n, int m) {
  if (n > m) {
    {
      int tmp_s_w_a_p_h_ = (int)(n);
      (n) = (int)(m);
      (m) = tmp_s_w_a_p_h_;
    };
  }
  for (int i = 0; i <= m - n; i++) {
    str_del_char(S, n);
  }
}


x86 assembly (clang, -O0):
<str_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1140 <str_delete+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1172 <str_delete+0x62>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <str_del_char@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1147 <str_delete+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_delete>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rdi,%r14
cmp    %edx,%esi
mov    %esi,%ebp
cmovg  %edx,%ebp
cmovg  %esi,%ebx
sub    %ebp,%ebx
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <str_del_char@plt>
add    $0xffffffff,%ebx
jne    1130 <str_delete+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @str_delete(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = select i1 %4, i32 %2, i32 %1
%6 = select i1 %4, i32 %1, i32 %2
%7 = add i32 %6, 1
%8 = sub i32 %7, %5
br label %10
9: ; preds = %10
ret void
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 @str_del_char(i8* %0, i32 %5)
%13 = add nuw i32 %11, 1
%14 = icmp eq i32 %13, %8
br i1 %14, label %9, label %10
}