#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*/ printf(char *, char *);
int main(void) {
  int c;
  int i = 0;
  int slash = 0;
  char line[1000];
  while ((c = getchar()) != EOF) {
    if (c == '/' && slash == 1) {
      i--;
      while ((c = getchar()) != '\n') {
        i = i;
      }
      slash = 0;
    } else if (c == '/' && slash == 0) {
      slash = 1;
      line[i] = c;
      i++;
    } else if (c == '\n' && line[i - 1] == '\n') {
      i = i;
    } else {
      slash = 0;
      line[i] = c;
      i++;
    }
  }
  printf("\n__________String__________\n%s\n", line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
je     1236 <main+0x116>
cmpl   $0x2f,-0x8(%rbp)
jne    11a0 <main+0x80>
cmpl   $0x1,-0x10(%rbp)
jne    11a0 <main+0x80>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1194 <main+0x74>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x10(%rbp)
jmp    1231 <main+0x111>
cmpl   $0x2f,-0x8(%rbp)
jne    11d9 <main+0xb9>
cmpl   $0x0,-0x10(%rbp)
jne    11d9 <main+0xb9>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x400(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122c <main+0x10c>
cmpl   $0xa,-0x8(%rbp)
jne    1207 <main+0xe7>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1207 <main+0xe7>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1227 <main+0x107>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x400(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122c <main+0x10c>
jmp    1231 <main+0x111>
jmp    1140 <main+0x20>
lea    -0x400(%rbp),%rsi
lea    0xdbc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x3e8,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ead(%rip),%r15
cmp    (%r15),%eax
jne    115f <main+0x3f>
lea    0xeb9(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    118c <main+0x6c>
mov    %al,(%rsp,%rcx,1)
add    $0x1,%ecx
xor    %ebx,%ebx
mov    %ecx,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%eax
je     1140 <main+0x20>
cmp    $0x2f,%eax
jne    11c0 <main+0xa0>
cmp    $0x1,%ebx
jne    11c0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    11a0 <main+0x80>
add    $0xffffffff,%ebp
xor    %ebx,%ebx
jmp    1180 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x2f,%eax
jne    11e0 <main+0xc0>
test   %ebx,%ebx
jne    11e0 <main+0xc0>
movslq %ebp,%rax
movb   $0x2f,(%rsp,%rax,1)
add    $0x1,%ebp
mov    $0x1,%ebx
jmp    1180 <main+0x60>
nopw   0x0(%rax,%rax,1)
movslq %ebp,%rcx
cmp    $0xa,%eax
jne    1168 <main+0x48>
cmpb   $0xa,-0x1(%rcx,%r14,1)
jne    1168 <main+0x48>
jmp    1180 <main+0x60>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [32 x i8] c"\0A__________String__________\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %62, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %63
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 47
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %19
19: ; preds = %22, %16
%20 = call i32 (...) @getchar()
store i32 %20, i32* %2
%21 = icmp ne i32 %20, 10
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32, i32* %3
store i32 %23, i32* %3
br label %19
24: ; preds = %19
store i32 0, i32* %4
br label %62
25: ; preds = %13, %10
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 47
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %28
store i32 1, i32* %4
%32 = load i32, i32* %2
%33 = trunc i32 %32 to i8
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %35
store i8 %33, i8* %36
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %61
39: ; preds = %28, %25
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 10
br i1 %41, label %42, label %52
42: ; preds = %39
%43 = load i32, i32* %3
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %52
50: ; preds = %42
%51 = load i32, i32* %3
store i32 %51, i32* %3
br label %60
52: ; preds = %42, %39
store i32 0, i32* %4
%53 = load i32, i32* %2
%54 = trunc i32 %53 to i8
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %56
store i8 %54, i8* %57
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %60
60: ; preds = %52, %50
br label %61
61: ; preds = %60, %31
br label %62
62: ; preds = %61, %24
br label %6
63: ; preds = %6
%64 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%65 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %64)
%66 = load i32, i32* %1
ret i32 %66
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [32 x i8] c"\0A__________String__________\0A%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %44, label %6
6: ; preds = %0, %38
%7 = phi i32 [ %41, %38 ], [ %3, %0 ]
%8 = phi i32 [ %40, %38 ], [ 0, %0 ]
%9 = phi i32 [ %39, %38 ], [ 0, %0 ]
%10 = icmp eq i32 %7, 47
%11 = icmp eq i32 %8, 1
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %13, label %16
13: ; preds = %6, %13
%14 = tail call i32 (...) @getchar()
%15 = icmp eq i32 %14, 10
br i1 %15, label %36, label %13
16: ; preds = %6
%17 = icmp eq i32 %8, 0
%18 = select i1 %10, i1 %17, i1 false
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = sext i32 %9 to i64
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %20
store i8 47, i8* %21
%22 = add nsw i32 %9, 1
br label %38
23: ; preds = %16
%24 = icmp eq i32 %7, 10
br i1 %24, label %25, label %31
25: ; preds = %23
%26 = add nsw i32 %9, -1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 10
br i1 %30, label %38, label %31
31: ; preds = %25, %23
%32 = trunc i32 %7 to i8
%33 = sext i32 %9 to i64
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %33
store i8 %32, i8* %34
%35 = add nsw i32 %9, 1
br label %38
36: ; preds = %13
%37 = add nsw i32 %9, -1
br label %38
38: ; preds = %36, %25, %19, %31
%39 = phi i32 [ %22, %19 ], [ %35, %31 ], [ %9, %25 ], [ %37, %36 ]
%40 = phi i32 [ 1, %19 ], [ 0, %31 ], [ %8, %25 ], [ 0, %36 ]
%41 = tail call i32 (...) @getchar()
%42 = load i32, i32* @EOF
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %6
44: ; preds = %38, %0
%45 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}