#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ strdel(char *, int, int);
int main() {
  char string[200];
  int pos;
  int len;
  printf("请输入初始字符串 ==>");
  gets(string);
  printf("请输入删除位置 ==>");
  scanf("%d", &pos);
  printf("请输入删除长度 ==>");
  scanf("%d", &len);
  strdel(string, pos, len);
  printf("删除后的字符串是 %s \n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0xd4(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
lea    -0xd8(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
mov    -0xd4(%rbp),%esi
mov    -0xd8(%rbp),%edx
call   1030 <strdel@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r14,%rdi
call   1030 <strdel@plt>
lea    0xe9b(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\9D\E5\A7\8B\E5\AD\97\E7\AC\A6\E4\B8\B2 ==>\00"
@.str.1 = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\A0\E9\99\A4\E4\BD\8D\E7\BD\AE ==>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\A0\E9\99\A4\E9\95\BF\E5\BA\A6 ==>\00"
@.str.4 = [30 x i8] c"\E5\88\A0\E9\99\A4\E5\90\8E\E7\9A\84\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @strdel(i8* %12, i32 %13, i32 %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\9D\E5\A7\8B\E5\AD\97\E7\AC\A6\E4\B8\B2 ==>\00"
@.str.1 = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\A0\E9\99\A4\E4\BD\8D\E7\BD\AE ==>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\88\A0\E9\99\A4\E9\95\BF\E5\BA\A6 ==>\00"
@.str.4 = [30 x i8] c"\E5\88\A0\E9\99\A4\E5\90\8E\E7\9A\84\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF %s \0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @strdel(i8* %4, i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %4)
ret i32 0
}