#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 /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/);
scalar_t__ ferror(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  int c;
  int c1 = -1;
  while (1) {
    c = getchar();
    if (c == EOF)
      break;
    if ((c == ')') && (c1 == ','))
      fputs("_EMA_", stdout);
    putchar(c);
    c1 = c;
  }
  if (ferror(stdin) || ferror(stdout) || fclose(stdout)) {
    exit(1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%eax
jne    1197 <main+0x37>
jmp    11d3 <main+0x73>
cmpl   $0x29,-0x8(%rbp)
jne    11c0 <main+0x60>
cmpl   $0x2c,-0xc(%rbp)
jne    11c0 <main+0x60>
mov    0x2e1e(%rip),%rax
mov    (%rax),%esi
lea    0xe45(%rip),%rdi
call   1060 <fputs@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x16>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
call   1040 <ferror@plt>
cmp    $0x0,%rax
jne    121b <main+0xbb>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
call   1040 <ferror@plt>
cmp    $0x0,%rax
jne    121b <main+0xbb>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
call   1050 <fclose@plt>
cmp    $0x0,%rax
je     1225 <main+0xc5>
mov    $0x1,%edi
call   1080 <exit@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <getchar@plt>
mov    0x2e6a(%rip),%r15
cmp    (%r15),%eax
jne    11be <main+0x5e>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1040 <ferror@plt>
test   %rax,%rax
jne    11b4 <main+0x54>
mov    0x2e3b(%rip),%rbx
mov    (%rbx),%edi
call   1040 <ferror@plt>
test   %rax,%rax
jne    11b4 <main+0x54>
mov    (%rbx),%edi
call   1050 <fclose@plt>
test   %rax,%rax
jne    11b4 <main+0x54>
xor    %edi,%edi
call   1080 <exit@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    $0xffffffff,%ebx
mov    0x2e06(%rip),%r12
lea    0xe2f(%rip),%r14
jmp    11f3 <main+0x93>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    (%r15),%eax
je     117b <main+0x1b>
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    $0x2c,%ecx
jne    11e0 <main+0x80>
cmp    $0x29,%ebx
jne    11e0 <main+0x80>
mov    (%r12),%esi
mov    %r14,%rdi
call   1060 <fputs@plt>
jmp    11e0 <main+0x80>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [6 x i8] c"_EMA_\00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
br label %4
4: ; preds = %0, %19
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %23
10: ; preds = %4
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 41
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 44
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %13, %10
%20 = load i32, i32* %2
%21 = call i32 @putchar(i32 %20)
%22 = load i32, i32* %2
store i32 %22, i32* %3
br label %4
23: ; preds = %9
%24 = load i32, i32* @stdin
%25 = call i64 @ferror(i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %35, label %27
27: ; preds = %23
%28 = load i32, i32* @stdout
%29 = call i64 @ferror(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i32, i32* @stdout
%33 = call i64 @fclose(i32 %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31, %27, %23
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %31
%38 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [6 x i8] c"_EMA_\00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %18, label %4
4: ; preds = %0, %13
%5 = phi i32 [ %15, %13 ], [ %1, %0 ]
%6 = phi i32 [ %5, %13 ], [ -1, %0 ]
%7 = icmp eq i32 %5, 41
%8 = icmp eq i32 %6, 44
%9 = and i1 %8, %7
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* @stdout
%12 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %4
%14 = tail call i32 @putchar(i32 %5)
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %4
18: ; preds = %13, %0
%19 = load i32, i32* @stdin
%20 = tail call i64 @ferror(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i32, i32* @stdout
%24 = tail call i64 @ferror(i32 %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* @stdout
%28 = tail call i64 @fclose(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26, %22, %18
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %26
%33 = tail call i32 @exit(i32 0)
unreachable
}