#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 main() {
  int i, len, j;
  char str[80];
  gets(str);
  i = j = 0;
  while (str[i] != '\0') {
    if (str[i] != 'a')
      str[j++] = str[i];
    i++;
  }
  str[j] = '\0';
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1191 <main+0x71>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x61,%eax
je     1183 <main+0x63>
movslq -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cltq
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
movslq -0x10(%rbp),%rax
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
xor    %eax,%eax
jmp    1144 <main+0x24>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x61,%cl
je     1140 <main+0x20>
movslq %eax,%rdx
test   %cl,%cl
je     115b <main+0x3b>
lea    0x1(%rdx),%eax
mov    %cl,(%rsp,%rdx,1)
jmp    1140 <main+0x20>
movb   $0x0,(%rsp,%rdx,1)
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
br label %4
4: ; preds = %13, %0
%5 = phi i64 [ %15, %13 ], [ 0, %0 ]
%6 = phi i32 [ %14, %13 ], [ 0, %0 ]
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %5
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 0, label %16
i8 97, label %13
]
9: ; preds = %4
%10 = add nsw i32 %6, 1
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %11
store i8 %8, i8* %12
br label %13
13: ; preds = %4, %9
%14 = phi i32 [ %10, %9 ], [ %6, %4 ]
%15 = add nuw i64 %5, 1
br label %4
16: ; preds = %4
%17 = sext i32 %6 to i64
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %17
store i8 0, i8* %18
%19 = call i32 @puts(i8* %2)
ret i32 0
}