#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*/ printf(char *, ...);
int strlen(char *);
int main() {
  char msg[1010];
  int i = 0, tam = 0;
  gets(msg);
  tam = strlen(msg);
  for (i = 0; i < tam; i++) {
    if (msg[i] != 'p')
      printf("%c", msg[i]);
    else if (msg[i + 1] == 'p') {
      printf("%c", msg[i + 1]);
      i++;
    } else
      printf("");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x404(%rbp)
movl   $0x0,-0x408(%rbp)
lea    -0x400(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x400(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x408(%rbp)
movl   $0x0,-0x404(%rbp)
mov    -0x404(%rbp),%eax
cmp    -0x408(%rbp),%eax
jge    1247 <main+0x117>
movslq -0x404(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0x70,%eax
je     11ca <main+0x9a>
movslq -0x404(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%esi
ff
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122e <main+0xfe>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0x70,%eax
jne    121b <main+0xeb>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%esi
ff
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    1229 <main+0xf9>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122e <main+0xfe>
jmp    1233 <main+0x103>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    117e <main+0x4e>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x3f8,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    118c <main+0x5c>
mov    %eax,%ebx
xor    %ebp,%ebp
jmp    116c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
jge    118c <main+0x5c>
movslq %ebp,%rax
movsbl (%rsp,%rax,1),%edi
cmp    $0x70,%edi
jne    1160 <main+0x30>
cmpb   $0x70,0x1(%rsp,%rax,1)
jne    1165 <main+0x35>
add    $0x1,%rax
mov    $0x70,%edi
mov    %eax,%ebp
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1010 x i8]
%2 = getelementptr inbounds [1010 x i8], [1010 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %28
6: ; preds = %0, %24
%7 = phi i32 [ %26, %24 ], [ 0, %0 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1010 x i8], [1010 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 112
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = sext i8 %10 to i32
br label %20
14: ; preds = %6
%15 = add nsw i32 %7, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1010 x i8], [1010 x i8]* %1, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 112
br i1 %19, label %20, label %24
20: ; preds = %14, %12
%21 = phi i32 [ %13, %12 ], [ 112, %14 ]
%22 = phi i32 [ %7, %12 ], [ %15, %14 ]
%23 = call i32 @putchar(i32 %21)
br label %24
24: ; preds = %20, %14
%25 = phi i32 [ %7, %14 ], [ %22, %20 ]
%26 = add nsw i32 %25, 1
%27 = icmp slt i32 %26, %4
br i1 %27, label %6, label %28
28: ; preds = %24, %0
ret i32 0
}