#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*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  int i, j = 0;
  char *p = "adfhsdkjhuwehasdfqu";
  char str[64] = {0};
  strcpy(str, p);
  for (i = 0; i < strlen(str); i++) {
    if (str[i] != 'f') {
      str[j++] = str[i];
    }
  }
  str[j] = '\0';
  printf("%s\n", p);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
cmp    %ecx,%eax
jge    11df <main+0x9f>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x66,%eax
je     11cc <main+0x8c>
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,1),%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x60(%rbp,%rax,1)
jmp    11d1 <main+0x91>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1185 <main+0x45>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x60(%rbp,%rax,1)
mov    -0x18(%rbp),%rsi
lea    0xe21(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe11(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeab(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11a6 <main+0x76>
xor    %ebx,%ebx
mov    %rsp,%r14
xor    %ebp,%ebp
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11a8 <main+0x78>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x66,%al
je     1180 <main+0x50>
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %al,(%rsp,%rcx,1)
jmp    1180 <main+0x50>
xor    %ebp,%ebp
movslq %ebp,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xe5e(%rip),%rbx
lea    0xe43(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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