#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char str[100000], s;
  int i = 0, k, k1, j = 0, m = 0;
  gets(str);
  k = strlen(str);
  scanf("%c", &s);
  while (str[i] != '\0') {
    if (str[i] != s)
      str[j++] = str[i];
    i++;
  }
  str[j] = '\0';
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x186b8(%rbp)
movl   $0x0,-0x186c4(%rbp)
movl   $0x0,-0x186c8(%rbp)
lea    -0x186b0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x186b0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x186bc(%rbp)
lea    0xe6b(%rip),%rdi
lea    -0x186b1(%rbp),%rsi
call   1060 <scanf@plt>
movslq -0x186b8(%rbp),%rax
movsbl -0x186b0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1213 <main+0xd3>
movslq -0x186b8(%rbp),%rax
movsbl -0x186b0(%rbp,%rax,1),%eax
ff
movsbl -0x186b1(%rbp),%ecx
cmp    %ecx,%eax
je     11ff <main+0xbf>
movslq -0x186b8(%rbp),%rax
mov    -0x186b0(%rbp,%rax,1),%cl
mov    -0x186c4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x186c4(%rbp)
cltq
mov    %cl,-0x186b0(%rbp,%rax,1)
mov    -0x186b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x186b8(%rbp)
jmp    11a1 <main+0x61>
movslq -0x186c4(%rbp),%rax
movb   $0x0,-0x186b0(%rbp,%rax,1)
lea    -0x186b0(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x186d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x186b0,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe9c(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x10(%rsp),%bl
test   %bl,%bl
je     11ab <main+0x6b>
mov    0xf(%rsp),%cl
lea    0x11(%rsp),%rdx
xor    %eax,%eax
jmp    119b <main+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdx),%ebx
add    $0x1,%rdx
test   %bl,%bl
je     11ad <main+0x6d>
cmp    %cl,%bl
je     1190 <main+0x50>
movslq %eax,%rsi
add    $0x1,%eax
mov    %bl,0x10(%rsp,%rsi,1)
jmp    1190 <main+0x50>
xor    %eax,%eax
cltq
movb   $0x0,0x10(%rsp,%rax,1)
lea    0x10(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x186b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %7
store i32 0, i32* %8
%9 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %5
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %14
14: ; preds = %39, %0
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %42
21: ; preds = %14
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %26, %28
br i1 %29, label %30, label %39
30: ; preds = %21
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %37
store i8 %34, i8* %38
br label %39
39: ; preds = %30, %21
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %14
42: ; preds = %14
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %44
store i8 0, i8* %45
%46 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%47 = call i32 @puts(i8* %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100000 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = call i32 @strlen(i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 0
br i1 %8, label %26, label %9
9: ; preds = %0
%10 = load i8, i8* %2
br label %11
11: ; preds = %9, %20
%12 = phi i64 [ 0, %9 ], [ %22, %20 ]
%13 = phi i8 [ %7, %9 ], [ %24, %20 ]
%14 = phi i32 [ 0, %9 ], [ %21, %20 ]
%15 = icmp eq i8 %13, %10
br i1 %15, label %20, label %16
16: ; preds = %11
%17 = add nsw i32 %14, 1
%18 = sext i32 %14 to i64
%19 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 %18
store i8 %13, i8* %19
br label %20
20: ; preds = %16, %11
%21 = phi i32 [ %17, %16 ], [ %14, %11 ]
%22 = add nuw i64 %12, 1
%23 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %11
26: ; preds = %20, %0
%27 = phi i32 [ 0, %0 ], [ %21, %20 ]
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 %28
store i8 0, i8* %29
%30 = call i32 @puts(i8* %3)
ret i32 0
}