#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*/ squeeze(char *, int);
int /*<<< orphan*/ squeezestr(char *, char *);
int main(void) {
  char str1[] = "Hello, World!";
  int ch1 = 'l';
  char str2[] = "Hello, World!";
  char sch2[] = "dHrl";
  char str3[] = "Hello, World!";
  char sch3[] = "";
  printf("%s\n", str1);
  squeeze(str1, ch1);
  printf("Remove this character: %c\n", ch1);
  printf("%s\n\n", str1);
  printf("%s\n", str2);
  squeezestr(str2, sch2);
  printf("Remove these characters: %s\n", sch2);
  printf("%s\n\n", str2);
  printf("%s\n", str3);
  squeezestr(str3, sch3);
  printf("Remove no characters\n");
  printf("%s\n", str3);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xea2(%rip),%ax
mov    %ax,-0x6(%rbp)
movl   $0x6c,-0x18(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x26(%rbp)
mov    0xe82(%rip),%eax
mov    %eax,-0x1e(%rbp)
mov    0xe7c(%rip),%ax
mov    %ax,-0x1a(%rbp)
mov    0xe74(%rip),%eax
mov    %eax,-0x2b(%rbp)
mov    0xe6f(%rip),%al
mov    %al,-0x27(%rbp)
mov    0xe53(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xe51(%rip),%eax
mov    %eax,-0x31(%rbp)
mov    0xe4b(%rip),%ax
mov    %ax,-0x2d(%rbp)
lea    -0x3a(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x12(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <squeeze@plt>
mov    -0x18(%rbp),%esi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x26(%rbp),%rsi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x26(%rbp),%rdi
lea    -0x2b(%rbp),%rsi
call   1060 <squeezestr@plt>
lea    -0x2b(%rbp),%rsi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x26(%rbp),%rsi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x39(%rbp),%rsi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x39(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1060 <squeezestr@plt>
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x39(%rbp),%rsi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movabs $0x21646c726f5720,%rax
mov    %rax,0x36(%rsp)
movabs $0x57202c6f6c6c6548,%rcx
2c 20 57
mov    %rcx,0x30(%rsp)
mov    %rax,0x26(%rsp)
mov    %rcx,0x20(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x6c724864,0x8(%rsp)
6c
mov    %rax,0x16(%rsp)
mov    %rcx,0x10(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x6c,%esi
call   1030 <squeeze@plt>
lea    0xe65(%rip),%rdi
mov    $0x6c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6d(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <squeezestr@plt>
lea    0xe41(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <squeezestr@plt>
lea    0xe26(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.str1 = [14 x i8] c"Hello, World!\00"
@__const.main.str2 = [14 x i8] c"Hello, World!\00"
@__const.main.sch2 = [5 x i8] c"dHrl\00"
@__const.main.str3 = [14 x i8] c"Hello, World!\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"Remove this character: %c\0A\00"
@.str.2 = [5 x i8] c"%s\0A\0A\00"
@.str.3 = [29 x i8] c"Remove these characters: %s\0A\00"
@.str.4 = [22 x i8] c"Remove no characters\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i32
%4 = alloca [14 x i8]
%5 = alloca [5 x i8]
%6 = alloca [14 x i8]
%7 = alloca [1 x i8]
store i32 0, i32* %1
%8 = bitcast [14 x i8]* %2 to i8*
store i32 108, i32* %3
%9 = bitcast [14 x i8]* %4 to i8*
%10 = bitcast [5 x i8]* %5 to i8*
%11 = bitcast [14 x i8]* %6 to i8*
%12 = bitcast [1 x i8]* %7 to i8*
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%16 = load i32, i32* %3
%17 = call i32 @squeeze(i8* %15, i32 %16)
%18 = load i32, i32* %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%26 = call i32 @squeezestr(i8* %24, i8* %25)
%27 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%34 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%35 = call i32 @squeezestr(i8* %33, i8* %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%37 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
ret i32 0
}

LLVM IR (-O2):
@__const.main.sch2 = [5 x i8] c"dHrl\00"
@__const.main.str3 = [14 x i8] c"Hello, World!\00"
@.str.1 = [27 x i8] c"Remove this character: %c\0A\00"
@.str.2 = [5 x i8] c"%s\0A\0A\00"
@.str.3 = [29 x i8] c"Remove these characters: %s\0A\00"
@str = [21 x i8] c"Remove no characters\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca [14 x i8]
%3 = alloca [5 x i8]
%4 = alloca [14 x i8]
%5 = alloca [1 x i8]
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 0, i8* %10
%11 = call i32 @puts(i8* %6)
%12 = call i32 @squeeze(i8* %6, i32 108)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 108)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%15 = call i32 @puts(i8* %7)
%16 = call i32 @squeezestr(i8* %7, i8* %8)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%19 = call i32 @puts(i8* %9)
%20 = call i32 @squeezestr(i8* %9, i8* %10)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%22 = call i32 @puts(i8* %9)
ret i32 0
}