#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 EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
main() {
  int dot = 0;
  char ch;
  while ((ch = getchar()) != EOF) {
    if (ch == '.')
      dot = 1;
    if (dot == 1 && ch != '.') {
      if (ch != ',') {
        putchar(' ');
        dot = 0;
      }
    }
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11b1 <main+0x91>
movsbl -0x9(%rbp),%eax
cmp    $0x2e,%eax
jne    1169 <main+0x49>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11a3 <main+0x83>
movsbl -0x9(%rbp),%eax
cmp    $0x2e,%eax
je     11a3 <main+0x83>
movsbl -0x9(%rbp),%eax
cmp    $0x2c,%eax
je     119e <main+0x7e>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
jmp    11a3 <main+0x83>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r14
cmp    (%r14),%al
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
mov    $0x1,%r15d
xor    %ebp,%ebp
jmp    1176 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     113a <main+0x1a>
cmp    $0x2e,%bl
cmove  %r15d,%ebp
mov    %ebx,%eax
and    $0xfd,%al
cmp    $0x2c,%al
je     1160 <main+0x40>
cmp    $0x1,%ebp
jne    1160 <main+0x40>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    1160 <main+0x40>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %29, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %32
10: ; preds = %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 46
br i1 %21, label %22, label %29
22: ; preds = %18
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 44
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @putchar(i8 signext 32)
store i32 0, i32* %2
br label %28
28: ; preds = %26, %22
br label %29
29: ; preds = %28, %18, %15
%30 = load i8, i8* %3
%31 = call i32 @putchar(i8 signext %30)
br label %4
32: ; preds = %4
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %21, label %4
4: ; preds = %0, %15
%5 = phi i8 [ %18, %15 ], [ %1, %0 ]
%6 = phi i32 [ %16, %15 ], [ 0, %0 ]
%7 = icmp eq i8 %5, 46
%8 = select i1 %7, i32 1, i32 %6
%9 = icmp eq i32 %8, 1
%10 = and i8 %5, -3
%11 = icmp ne i8 %10, 44
%12 = and i1 %11, %9
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = tail call i32 @putchar(i8 signext 32)
br label %15
15: ; preds = %13, %4
%16 = phi i32 [ 0, %13 ], [ %8, %4 ]
%17 = tail call i32 @putchar(i8 signext %5)
%18 = tail call signext i8 (...) @getchar()
%19 = load i8, i8* @EOF
%20 = icmp eq i8 %18, %19
br i1 %20, label %21, label %4
21: ; preds = %15, %0
ret i32 0
}