#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 *, ...);
int main() {
  int c, i;
  int cAt, cExcl, cDollar;
  int nAt[50 + 1];
  int nExcl[50 + 1];
  int nDollar[50 + 1];
  c = i = cAt = cExcl = cDollar = 0;
  nAt[50 + 1] = nExcl[50 + 1] = nDollar[50 + 1] = 0;
  for (i = 0; i < 50; ++i) {
    nAt[i] = 0;
    nExcl[i] = 0;
    nDollar[i] = 0;
  }
  while ((c = getchar()) != EOF) {
    if (c == '@') {
      ++cAt;
    }
    if (c == '!') {
      ++cExcl;
    }
    if (c == '$') {
      ++cDollar;
    }
    nAt[cAt + 1] = '#';
    nExcl[cExcl + 1] = '#';
    nDollar[cDollar + 1] = '#';
    if (c == '\n') {
      printf("\nAt: ");
      for (i = 0; i <= cAt; i++) {
        printf("%c", nAt[i]);
      }
      printf("\nExcl: ");
      for (i = 0; i <= cExcl; i++) {
        printf("%c", nExcl[i]);
      }
      printf("\nDollar: ");
      for (i = 0; i <= cDollar; i++) {
        printf("%c", nDollar[i]);
      }
      printf("\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x1c4(%rbp)
movl   $0x0,-0xf4(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    11bc <main+0x9c>
movslq -0xc(%rbp),%rax
movl   $0x0,-0xf0(%rbp,%rax,4)
movslq -0xc(%rbp),%rax
movl   $0x0,-0x1c0(%rbp,%rax,4)
movslq -0xc(%rbp),%rax
movl   $0x0,-0x290(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x57>
jmp    11c1 <main+0xa1>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e16(%rip),%rcx
cmp    (%rcx),%eax
je     1341 <main+0x221>
cmpl   $0x40,-0x8(%rbp)
jne    11ed <main+0xcd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x21,-0x8(%rbp)
jne    1200 <main+0xe0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x24,-0x8(%rbp)
jne    1213 <main+0xf3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x23,-0xf0(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x23,-0x1c0(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x23,-0x290(%rbp,%rax,4)
cmpl   $0xa,-0x8(%rbp)
jne    133c <main+0x21c>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     129e <main+0x17e>
movslq -0xc(%rbp),%rax
mov    -0xf0(%rbp,%rax,4),%esi
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    126b <main+0x14b>
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     12e6 <main+0x1c6>
movslq -0xc(%rbp),%rax
mov    -0x1c0(%rbp,%rax,4),%esi
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12b3 <main+0x193>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     132e <main+0x20e>
movslq -0xc(%rbp),%rax
mov    -0x290(%rbp,%rax,4),%esi
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12fb <main+0x1db>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
xor    %eax,%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
movl   $0x0,0xfc(%rsp)
movl   $0x0,0x1cc(%rsp)
movl   $0x0,0x29c(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x210(%rsp)
movaps %xmm0,0x220(%rsp)
movaps %xmm0,0x230(%rsp)
movaps %xmm0,0x240(%rsp)
movaps %xmm0,0x250(%rsp)
movaps %xmm0,0x260(%rsp)
movaps %xmm0,0x270(%rsp)
movaps %xmm0,0x280(%rsp)
movq   $0x0,0x290(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movq   $0x0,0x1c0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0xf0(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2d40(%rip),%rcx
cmp    (%rcx),%eax
jne    12c0 <main+0x190>
xor    %eax,%eax
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
xor    %edx,%edx
xor    %r12d,%r12d
jmp    12ea <main+0x1ba>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %ebx,%ecx
mov    %r14d,%edx
mov    %ebp,%r12d
mov    0x2d02(%rip),%rsi
cmp    (%rsi),%eax
je     12ac <main+0x17c>
xor    %r15d,%r15d
cmp    $0x40,%eax
sete   %r15b
lea    (%r12,%r15,1),%ebp
xor    %r13d,%r13d
cmp    $0x21,%eax
sete   %r13b
lea    (%rdx,%r13,1),%r14d
xor    %esi,%esi
cmp    $0x24,%eax
sete   %sil
lea    (%rcx,%rsi,1),%ebx
movl   $0x23,0x1d4(%rsp,%rbp,4)
movl   $0x23,0x104(%rsp,%r14,4)
movl   $0x23,0x34(%rsp,%rbx,4)
cmp    $0xa,%eax
jne    12d0 <main+0x1a0>
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rbp,0x28(%rsp)
lea    0xcaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%r15,1),%ebp
add    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x1d0(%rsp,%rbx,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1370 <main+0x240>
lea    0xc7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%rax
lea    (%rax,%r13,1),%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x100(%rsp,%rbp,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13b0 <main+0x280>
lea    0xc42(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%rax
mov    0x8(%rsp),%rcx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x30(%rsp,%rbp,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13f0 <main+0x2c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x28(%rsp),%rbp
mov    0x18(%rsp),%rbx
jmp    12d0 <main+0x1a0>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [6 x i8] c"\0AAt: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [8 x i8] c"\0AExcl: \00"
@.str.3 = [10 x i8] c"\0ADollar: \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [51 x i32]
%8 = alloca [51 x i32]
%9 = alloca [51 x i32]
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
%10 = getelementptr inbounds [51 x i32], [51 x i32]* %9, i64 0, i64 51
store i32 0, i32* %10
%11 = getelementptr inbounds [51 x i32], [51 x i32]* %8, i64 0, i64 51
store i32 0, i32* %11
%12 = getelementptr inbounds [51 x i32], [51 x i32]* %7, i64 0, i64 51
store i32 0, i32* %12
store i32 0, i32* %3
br label %13
13: ; preds = %26, %0
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 50
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [51 x i32], [51 x i32]* %7, i64 0, i64 %18
store i32 0, i32* %19
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [51 x i32], [51 x i32]* %8, i64 0, i64 %21
store i32 0, i32* %22
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [51 x i32], [51 x i32]* %9, i64 0, i64 %24
store i32 0, i32* %25
br label %26
26: ; preds = %16
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %13
29: ; preds = %13
br label %30
30: ; preds = %114, %29
%31 = call i32 (...) @getchar()
store i32 %31, i32* %2
%32 = load i32, i32* @EOF
%33 = icmp ne i32 %31, %32
br i1 %33, label %34, label %115
34: ; preds = %30
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 64
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %40
40: ; preds = %37, %34
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 33
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %2
%48 = icmp eq i32 %47, 36
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
br label %52
52: ; preds = %49, %46
%53 = load i32, i32* %4
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [51 x i32], [51 x i32]* %7, i64 0, i64 %55
store i32 35, i32* %56
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [51 x i32], [51 x i32]* %8, i64 0, i64 %59
store i32 35, i32* %60
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [51 x i32], [51 x i32]* %9, i64 0, i64 %63
store i32 35, i32* %64
%65 = load i32, i32* %2
%66 = icmp eq i32 %65, 10
br i1 %66, label %67, label %114
67: ; preds = %52
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %69
69: ; preds = %79, %67
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = icmp sle i32 %70, %71
br i1 %72, label %73, label %82
73: ; preds = %69
%74 = load i32, i32* %3
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [51 x i32], [51 x i32]* %7, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %73
%80 = load i32, i32* %3
%81 = add nsw i32 %80, 1
store i32 %81, i32* %3
br label %69
82: ; preds = %69
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %84
84: ; preds = %94, %82
%85 = load i32, i32* %3
%86 = load i32, i32* %5
%87 = icmp sle i32 %85, %86
br i1 %87, label %88, label %97
88: ; preds = %84
%89 = load i32, i32* %3
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [51 x i32], [51 x i32]* %8, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %92)
br label %94
94: ; preds = %88
%95 = load i32, i32* %3
%96 = add nsw i32 %95, 1
store i32 %96, i32* %3
br label %84
97: ; preds = %84
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %99
99: ; preds = %109, %97
%100 = load i32, i32* %3
%101 = load i32, i32* %6
%102 = icmp sle i32 %100, %101
br i1 %102, label %103, label %112
103: ; preds = %99
%104 = load i32, i32* %3
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [51 x i32], [51 x i32]* %9, i64 0, i64 %105
%107 = load i32, i32* %106
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %107)
br label %109
109: ; preds = %103
%110 = load i32, i32* %3
%111 = add nsw i32 %110, 1
store i32 %111, i32* %3
br label %99
112: ; preds = %99
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %114
114: ; preds = %112, %52
br label %30
115: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [6 x i8] c"\0AAt: \00"
@.str.2 = [8 x i8] c"\0AExcl: \00"
@.str.3 = [10 x i8] c"\0ADollar: \00"
define i32 @main() {
%1 = alloca [51 x i32]
%2 = bitcast [51 x i32]* %1 to i8*
%3 = alloca [51 x i32]
%4 = bitcast [51 x i32]* %3 to i8*
%5 = alloca [51 x i32]
%6 = bitcast [51 x i32]* %5 to i8*
%7 = getelementptr inbounds [51 x i32], [51 x i32]* %5, i64 0, i64 51
store i32 0, i32* %7
%8 = getelementptr inbounds [51 x i32], [51 x i32]* %3, i64 0, i64 51
store i32 0, i32* %8
%9 = getelementptr inbounds [51 x i32], [51 x i32]* %1, i64 0, i64 51
store i32 0, i32* %9
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %79, label %13
13: ; preds = %0, %75
%14 = phi i32 [ %76, %75 ], [ %10, %0 ]
%15 = phi i32 [ %26, %75 ], [ 0, %0 ]
%16 = phi i32 [ %23, %75 ], [ 0, %0 ]
%17 = phi i32 [ %20, %75 ], [ 0, %0 ]
%18 = icmp eq i32 %14, 64
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %17, %19
%21 = icmp eq i32 %14, 33
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %16, %22
%24 = icmp eq i32 %14, 36
%25 = zext i1 %24 to i32
%26 = add nuw nsw i32 %15, %25
%27 = add nuw nsw i32 %20, 1
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds [51 x i32], [51 x i32]* %1, i64 0, i64 %28
store i32 35, i32* %29
%30 = add nuw nsw i32 %23, 1
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [51 x i32], [51 x i32]* %3, i64 0, i64 %31
store i32 35, i32* %32
%33 = add nuw nsw i32 %26, 1
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [51 x i32], [51 x i32]* %5, i64 0, i64 %34
store i32 35, i32* %35
%36 = icmp eq i32 %14, 10
br i1 %36, label %37, label %75
37: ; preds = %13
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%39 = add nuw i32 %17, 1
%40 = add nuw i32 %39, %19
%41 = zext i32 %40 to i64
br label %42
42: ; preds = %37, %42
%43 = phi i64 [ 0, %37 ], [ %47, %42 ]
%44 = getelementptr inbounds [51 x i32], [51 x i32]* %1, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = tail call i32 @putchar(i32 %45)
%47 = add nuw nsw i64 %43, 1
%48 = icmp eq i64 %47, %41
br i1 %48, label %49, label %42
49: ; preds = %42
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%51 = add nuw i32 %16, 1
%52 = add nuw i32 %51, %22
%53 = zext i32 %52 to i64
br label %54
54: ; preds = %49, %54
%55 = phi i64 [ 0, %49 ], [ %59, %54 ]
%56 = getelementptr inbounds [51 x i32], [51 x i32]* %3, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = tail call i32 @putchar(i32 %57)
%59 = add nuw nsw i64 %55, 1
%60 = icmp eq i64 %59, %53
br i1 %60, label %61, label %54
61: ; preds = %54
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%63 = add nuw i32 %15, 1
%64 = add nuw i32 %63, %25
%65 = zext i32 %64 to i64
br label %66
66: ; preds = %61, %66
%67 = phi i64 [ 0, %61 ], [ %71, %66 ]
%68 = getelementptr inbounds [51 x i32], [51 x i32]* %5, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = tail call i32 @putchar(i32 %69)
%71 = add nuw nsw i64 %67, 1
%72 = icmp eq i64 %71, %65
br i1 %72, label %73, label %66
73: ; preds = %66
%74 = tail call i32 @putchar(i32 10)
br label %75
75: ; preds = %73, %13
%76 = tail call i32 (...) @getchar()
%77 = load i32, i32* @EOF
%78 = icmp eq i32 %76, %77
br i1 %78, label %79, label %13
79: ; preds = %75, %0
ret i32 0
}