#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 *, char *);
int /*<<< orphan*/ remove_string(char *, int, int);
int main(void) {
  char test1[] = "This is a test derp";
  char test2[] = "This is another test";
  char test3[] = "blah. blah. This is a test";
  remove_string(test1, 15, 4);
  remove_string(test2, 9, 6);
  remove_string(test3, 0, 12);
  printf("%s\n", test1);
  printf("%s\n", test2);
  printf("%s\n", test3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x2c(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0x48(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x46(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0xf,%esi
mov    $0x4,%edx
call   1040 <remove_string@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
mov    $0x6,%edx
call   1040 <remove_string@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <remove_string@plt>
lea    -0x20(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
movaps 0xece(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x707265,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x74736574207265,%rax
mov    %rax,0x2d(%rsp)
movups 0xeeb(%rip),%xmm0
movups %xmm0,0x4b(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xf,%esi
mov    $0x4,%edx
call   1040 <remove_string@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0x9,%esi
mov    $0x6,%edx
call   1040 <remove_string@plt>
lea    0x40(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <remove_string@plt>
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.test1 = [20 x i8] c"This is a test derp\00"
@__const.main.test2 = [21 x i8] c"This is another test\00"
@__const.main.test3 = [27 x i8] c"blah. blah. This is a test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [21 x i8]
%4 = alloca [27 x i8]
store i32 0, i32* %1
%5 = bitcast [20 x i8]* %2 to i8*
%6 = bitcast [21 x i8]* %3 to i8*
%7 = bitcast [27 x i8]* %4 to i8*
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @remove_string(i8* %8, i32 15, i32 4)
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%11 = call i32 @remove_string(i8* %10, i32 9, i32 6)
%12 = getelementptr inbounds [27 x i8], [27 x i8]* %4, i64 0, i64 0
%13 = call i32 @remove_string(i8* %12, i32 0, i32 12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [27 x i8], [27 x i8]* %4, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test1 = [20 x i8] c"This is a test derp\00"
@__const.main.test2 = [21 x i8] c"This is another test\00"
@__const.main.test3 = [27 x i8] c"blah. blah. This is a test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [21 x i8]
%3 = alloca [27 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [27 x i8], [27 x i8]* %3, i64 0, i64 0
%7 = call i32 @remove_string(i8* %4, i32 15, i32 4)
%8 = call i32 @remove_string(i8* %5, i32 9, i32 6)
%9 = call i32 @remove_string(i8* %6, i32 0, i32 12)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}