#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 */
char getchar();
scalar_t__ isblank(char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main(int argc, const char **argv) {
  char currc, prevc;
  while (1) {
    printf(">>> ");
    currc = getchar();
    prevc = 0;
    while (currc != '\n') {
      if (!(isblank(currc) && !(prevc ^ currc))) {
        putchar(currc);
      }
      prevc = currc;
      currc = getchar();
    }
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     11c1 <main+0x81>
movsbl -0x11(%rbp),%edi
call   1050 <isblank@plt>
cmp    $0x0,%rax
je     11a3 <main+0x63>
movsbl -0x12(%rbp),%eax
movsbl -0x11(%rbp),%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     11ac <main+0x6c>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xeb2(%rip),%r14
jmp    115a <main+0x1a>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1150 <main+0x10>
mov    %eax,%r15d
xor    %ebx,%ebx
jmp    1198 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r15d,%ebx
mov    %eax,%r15d
cmp    $0xa,%al
je     1150 <main+0x10>
movsbl %r15b,%ebp
mov    %ebp,%edi
call   1050 <isblank@plt>
cmp    %bpl,%bl
jne    1180 <main+0x40>
test   %rax,%rax
jne    1187 <main+0x47>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [5 x i8] c">>> \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2, %32
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %6
store i8 0, i8* %7
br label %11
11: ; preds = %29, %8
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %32
15: ; preds = %11
%16 = load i8, i8* %6
%17 = call i64 @isblank(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = xor i32 %21, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %19, %15
%27 = load i8, i8* %6
%28 = call i32 @putchar(i8 signext %27)
br label %29
29: ; preds = %26, %19
%30 = load i8, i8* %6
store i8 %30, i8* %7
%31 = call signext i8 (...) @getchar()
store i8 %31, i8* %6
br label %11
32: ; preds = %11
%33 = call i32 @putchar(i8 signext 10)
br label %8
}

LLVM IR (-O2):
@.str = [5 x i8] c">>> \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %19, %2
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %19, label %7
7: ; preds = %3, %16
%8 = phi i8 [ %9, %16 ], [ 0, %3 ]
%9 = phi i8 [ %17, %16 ], [ %5, %3 ]
%10 = tail call i64 @isblank(i8 signext %9)
%11 = icmp ne i64 %10, 0
%12 = icmp eq i8 %8, %9
%13 = and i1 %12, %11
br i1 %13, label %16, label %14
14: ; preds = %7
%15 = tail call i32 @putchar(i8 signext %9)
br label %16
16: ; preds = %7, %14
%17 = tail call signext i8 (...) @getchar()
%18 = icmp eq i8 %17, 10
br i1 %18, label %19, label %7
19: ; preds = %16, %3
%20 = tail call i32 @putchar(i8 signext 10)
br label %3
}