#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*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
void removeString(char datastorage[][128], int length, char query[128]) {
  int i, remove;
  puts("Input the number of the String you want to remove.\n");
  printf(">>");
  scanf("%d", &remove);
  query = datastorage[remove];
  printf("Removing %s........", query);
  for (i = remove; i < length; i++) {
    strcpy(datastorage[i], datastorage[i + 1]);
  }
  length = length - 1;
}


x86 assembly (clang, -O0):
<removeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0x7,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e9 <removeString+0xa9>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x7,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a8 <removeString+0x68>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeString>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rsi
shl    $0x7,%rsi
add    %r14,%rsi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0xc(%rsp),%rax
cmp    %ebx,%eax
jge    11cb <removeString+0x8b>
movslq %ebx,%rbp
sub    %rax,%rbp
shl    $0x7,%rax
add    %rax,%r14
nopl   0x0(%rax,%rax,1)
lea    0x80(%r14),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%r14
add    $0xffffffffffffffff,%rbp
jne    11b0 <removeString+0x70>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Input the number of the String you want to remove.\0A\00"
@.str.1 = [3 x i8] c">>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [20 x i8] c"Removing %s........\00"
define void @removeString([128 x i8]* %0, i32 %1, i8* %2) {
%4 = alloca [128 x i8]*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store [128 x i8]* %0, [128 x i8]** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%12 = load [128 x i8]*, [128 x i8]** %4
%13 = load i32, i32* %8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 %14
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %15, i64 0, i64 0
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %8
store i32 %19, i32* %7
br label %20
20: ; preds = %37, %3
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %40
24: ; preds = %20
%25 = load [128 x i8]*, [128 x i8]** %4
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %25, i64 %27
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %28, i64 0, i64 0
%30 = load [128 x i8]*, [128 x i8]** %4
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %30, i64 %33
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %34, i64 0, i64 0
%36 = call i32 @strcpy(i8* %29, i8* %35)
br label %37
37: ; preds = %24
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %20
40: ; preds = %20
%41 = load i32, i32* %5
%42 = sub nsw i32 %41, 1
store i32 %42, i32* %5
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Input the number of the String you want to remove.\0A\00"
@.str.1 = [3 x i8] c">>\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [20 x i8] c"Removing %s........\00"
define void @removeString([128 x i8]* %0, i32 %1, i8* nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %0, i64 %10, i64 0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, %1
br i1 %14, label %15, label %25
15: ; preds = %3
%16 = sext i32 %13 to i64
%17 = sext i32 %1 to i64
br label %18
18: ; preds = %15, %18
%19 = phi i64 [ %16, %15 ], [ %21, %18 ]
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %0, i64 %19, i64 0
%21 = add nsw i64 %19, 1
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %0, i64 %21, i64 0
%23 = call i32 @strcpy(i8* %20, i8* %22)
%24 = icmp eq i64 %21, %17
br i1 %24, label %25, label %18
25: ; preds = %18, %3
ret void
}