#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 EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
void remove_multiple_blanks() {
  int c, p;
  while ((c = getchar()) != EOF) {
    if (c == '\n' && p == '\n')
      continue;
    p = c;
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<remove_multiple_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     116d <remove_multiple_blanks+0x4d>
cmpl   $0xa,-0x4(%rbp)
jne    115a <remove_multiple_blanks+0x3a>
cmpl   $0xa,-0x8(%rbp)
jne    115a <remove_multiple_blanks+0x3a>
jmp    1128 <remove_multiple_blanks+0x8>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <remove_multiple_blanks+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_multiple_blanks>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    113f <remove_multiple_blanks+0x1f>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
jmp    1165 <remove_multiple_blanks+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ecx
cmp    (%r14),%eax
je     1137 <remove_multiple_blanks+0x17>
mov    %eax,%ebx
cmp    $0xa,%eax
jne    1150 <remove_multiple_blanks+0x30>
cmp    $0xa,%ecx
je     1157 <remove_multiple_blanks+0x37>
jmp    1150 <remove_multiple_blanks+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define void @remove_multiple_blanks() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %14, %13, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %3
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %10
br label %3
14: ; preds = %10, %7
%15 = load i32, i32* %1
store i32 %15, i32* %2
%16 = load i32, i32* %1
%17 = call i32 @putchar(i32 %16)
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @remove_multiple_blanks() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %12
%5 = phi i32 [ %13, %12 ], [ %1, %0 ]
%6 = phi i32 [ %5, %12 ], [ undef, %0 ]
%7 = icmp eq i32 %5, 10
%8 = icmp eq i32 %6, 10
%9 = select i1 %7, i1 %8, i1 false
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @putchar(i32 %5)
br label %12
12: ; preds = %10, %4
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %12, %0
ret void
}