#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ flush();
int getcharWrapper(char *);
int /*<<< orphan*/ putcharWrapper(int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char c;
  int eof = 0;
  while (!(eof = getcharWrapper(&c))) {
    if (c != 0x5c) {
      putcharWrapper(c);
      continue;
    }
    long count = 0;
    while (!(eof = getcharWrapper(&c))) {
      if (c == 0x30) {
        if (count % 2 == 0) {
          putcharWrapper(0x00);
          break;
        } else {
          putcharWrapper(0x5c);
          putcharWrapper(0x30);
          break;
        }
      } else if (c == 0x5c) {
        putcharWrapper(0x5c);
        count++;
      } else {
        putcharWrapper(0x5c);
        putcharWrapper(c);
        break;
      }
    }
    if (eof) {
      putcharWrapper(0x5c);
      flush();
      fflush(stdout);
      return 0;
    }
  }
  flush();
  fflush(stdout);
}


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)
movl   $0x0,-0x18(%rbp)
lea    -0x11(%rbp),%rdi
call   1050 <getcharWrapper@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117e <main+0x3e>
jmp    1290 <main+0x150>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
je     1199 <main+0x59>
movsbl -0x11(%rbp),%edi
call   1060 <putcharWrapper@plt>
jmp    115d <main+0x1d>
movq   $0x0,-0x20(%rbp)
lea    -0x11(%rbp),%rdi
call   1050 <getcharWrapper@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11c2 <main+0x82>
jmp    1256 <main+0x116>
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jne    120c <main+0xcc>
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11f3 <main+0xb3>
xor    %edi,%edi
call   1060 <putcharWrapper@plt>
jmp    1256 <main+0x116>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
mov    $0x30,%edi
call   1060 <putcharWrapper@plt>
jmp    1256 <main+0x116>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
jne    1234 <main+0xf4>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    124c <main+0x10c>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
movsbl -0x11(%rbp),%edi
call   1060 <putcharWrapper@plt>
jmp    1256 <main+0x116>
jmp    1251 <main+0x111>
jmp    11a1 <main+0x61>
cmpl   $0x0,-0x18(%rbp)
je     128b <main+0x14b>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
mov    $0x0,%al
call   1030 <flush@plt>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movl   $0x0,-0x4(%rbp)
jmp    12a5 <main+0x165>
jmp    115d <main+0x1d>
mov    $0x0,%al
call   1030 <flush@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x7(%rsp),%rdi
call   1050 <getcharWrapper@plt>
test   %eax,%eax
jne    11f6 <main+0xb6>
lea    0x7(%rsp),%r14
jmp    1181 <main+0x41>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
movsbl 0x7(%rsp),%edi
nopl   0x0(%rax)
call   1060 <putcharWrapper@plt>
mov    %r14,%rdi
call   1050 <getcharWrapper@plt>
test   %eax,%eax
jne    11f6 <main+0xb6>
movsbl 0x7(%rsp),%edi
cmp    $0x5c,%edi
jne    1170 <main+0x30>
mov    %r14,%rdi
call   1050 <getcharWrapper@plt>
test   %eax,%eax
jne    11ec <main+0xac>
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl 0x7(%rsp),%eax
cmp    $0x5c,%al
jne    11d0 <main+0x90>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1050 <getcharWrapper@plt>
test   %eax,%eax
je     11a0 <main+0x60>
jmp    11ec <main+0xac>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x30,%al
jne    115d <main+0x1d>
xor    %edi,%edi
test   $0x1,%bl
je     1170 <main+0x30>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
mov    $0x30,%edi
jmp    1170 <main+0x30>
mov    $0x5c,%edi
call   1060 <putcharWrapper@plt>
xor    %eax,%eax
call   1030 <flush@plt>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %9
9: ; preds = %62, %17, %2
%10 = call i32 @getcharWrapper(i8* %6)
store i32 %10, i32* %7
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %63
13: ; preds = %9
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 92
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = call i32 @putcharWrapper(i32 %19)
br label %9
21: ; preds = %13
store i64 0, i64* %8
br label %22
22: ; preds = %53, %21
%23 = call i32 @getcharWrapper(i8* %6)
store i32 %23, i32* %7
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %54
26: ; preds = %22
%27 = load i8, i8* %6
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 48
br i1 %29, label %30, label %39
30: ; preds = %26
%31 = load i64, i64* %8
%32 = srem i64 %31, 2
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 @putcharWrapper(i32 0)
br label %54
36: ; preds = %30
%37 = call i32 @putcharWrapper(i32 92)
%38 = call i32 @putcharWrapper(i32 48)
br label %54
39: ; preds = %26
%40 = load i8, i8* %6
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 92
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = call i32 @putcharWrapper(i32 92)
%45 = load i64, i64* %8
%46 = add nsw i64 %45, 1
store i64 %46, i64* %8
br label %52
47: ; preds = %39
%48 = call i32 @putcharWrapper(i32 92)
%49 = load i8, i8* %6
%50 = sext i8 %49 to i32
%51 = call i32 @putcharWrapper(i32 %50)
br label %54
52: ; preds = %43
br label %53
53: ; preds = %52
br label %22
54: ; preds = %47, %36, %34, %22
%55 = load i32, i32* %7
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %62
57: ; preds = %54
%58 = call i32 @putcharWrapper(i32 92)
%59 = call i32 (...) @flush()
%60 = load i32, i32* @stdout
%61 = call i32 @fflush(i32 %60)
store i32 0, i32* %3
br label %67
62: ; preds = %54
br label %9
63: ; preds = %9
%64 = call i32 (...) @flush()
%65 = load i32, i32* @stdout
%66 = call i32 @fflush(i32 %65)
br label %67
67: ; preds = %63, %57
%68 = load i32, i32* %3
ret i32 %68
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i32 @getcharWrapper(i8* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %38
6: ; preds = %2, %14
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 92
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 @getcharWrapper(i8* %3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %36
12: ; preds = %6
%13 = sext i8 %7 to i32
br label %14
14: ; preds = %22, %25, %32, %12
%15 = phi i32 [ 48, %25 ], [ %35, %32 ], [ %13, %12 ], [ 0, %22 ]
%16 = call i32 @putcharWrapper(i32 %15)
%17 = call i32 @getcharWrapper(i8* %3)
%18 = icmp eq i32 %17, 0
br i1 %18, label %6, label %38
19: ; preds = %9, %27
%20 = phi i64 [ %29, %27 ], [ 0, %9 ]
%21 = load i8, i8* %3
switch i8 %21, label %32 [
i8 48, label %22
i8 92, label %27
]
22: ; preds = %19
%23 = and i64 %20, 1
%24 = icmp eq i64 %23, 0
br i1 %24, label %14, label %25
25: ; preds = %22
%26 = call i32 @putcharWrapper(i32 92)
br label %14
27: ; preds = %19
%28 = call i32 @putcharWrapper(i32 92)
%29 = add nuw nsw i64 %20, 1
%30 = call i32 @getcharWrapper(i8* %3)
%31 = icmp eq i32 %30, 0
br i1 %31, label %19, label %36
32: ; preds = %19
%33 = call i32 @putcharWrapper(i32 92)
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
br label %14
36: ; preds = %9, %27
%37 = call i32 @putcharWrapper(i32 92)
br label %38
38: ; preds = %14, %2, %36
%39 = call i32 (...) @flush()
%40 = load i32, i32* @stdout
%41 = call i32 @fflush(i32 %40)
ret i32 0
}