#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s[1001];
  scanf("%[^\n]%*c", s);
  int arr[10] = {0};
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] >= '0' && s[i] <= '9')
      arr[s[i] - '0']++;
  }
  for (int i = 0; i < 10; i++)
    printf("%d ", arr[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movl   $0x0,-0x424(%rbp)
mov    -0x424(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x42c(%rbp),%eax
cmp    %ecx,%eax
jge    1218 <main+0xd8>
movslq -0x424(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x30,%eax
jl     11ff <main+0xbf>
movslq -0x424(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x39,%eax
jg     11ff <main+0xbf>
movslq -0x424(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
cltq
mov    -0x420(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x420(%rbp,%rax,4)
jmp    1204 <main+0xc4>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    1182 <main+0x42>
movl   $0x0,-0x428(%rbp)
cmpl   $0xa,-0x428(%rbp)
jge    125f <main+0x11f>
movslq -0x428(%rbp),%rax
mov    -0x420(%rbp,%rax,4),%esi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x428(%rbp)
jmp    1222 <main+0xe2>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
lea    0xea8(%rip),%rdi
lea    0x40(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11f0 <main+0xb0>
xor    %ebp,%ebp
lea    0x40(%rsp),%rbx
jmp    11a3 <main+0x63>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    11ba <main+0x7a>
movzbl 0x40(%rsp,%rbp,1),%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     1190 <main+0x50>
add    $0xffffffd0,%eax
addl   $0x1,0x10(%rsp,%rax,4)
jmp    1190 <main+0x50>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%r12d
mov    0x18(%rsp),%r15d
mov    0x1c(%rsp),%r14d
mov    0x20(%rsp),%ebx
mov    0x24(%rsp),%r13d
mov    0x28(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x30(%rsp),%eax
mov    %eax,0xc(%rsp)
jmp    1218 <main+0xd8>
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %esi,%esi
lea    0xdea(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1001 x i8]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = bitcast [10 x i32]* %3 to i8*
store i32 0, i32* %4
br label %9
9: ; preds = %40, %0
%10 = load i32, i32* %4
%11 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %43
14: ; preds = %9
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 48
br i1 %20, label %21, label %39
21: ; preds = %14
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 57
br i1 %27, label %28, label %39
28: ; preds = %21
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = sub nsw i32 %33, 48
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = add nsw i32 %37, 1
store i32 %38, i32* %36
br label %39
39: ; preds = %28, %21, %14
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %9
43: ; preds = %9
store i32 0, i32* %5
br label %44
44: ; preds = %53, %43
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %49
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %47
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %44
56: ; preds = %44
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = alloca [10 x i32]
%3 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast [10 x i32]* %2 to i8*
%6 = call i32 @strlen(i8* %3)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %50, label %27
8: ; preds = %63
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%16 = load i32, i32* %15
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%18 = load i32, i32* %17
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%20 = load i32, i32* %19
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%22 = load i32, i32* %21
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%24 = load i32, i32* %23
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%26 = load i32, i32* %25
br label %27
27: ; preds = %8, %0
%28 = phi i32 [ %26, %8 ], [ 0, %0 ]
%29 = phi i32 [ %24, %8 ], [ 0, %0 ]
%30 = phi i32 [ %22, %8 ], [ 0, %0 ]
%31 = phi i32 [ %20, %8 ], [ 0, %0 ]
%32 = phi i32 [ %18, %8 ], [ 0, %0 ]
%33 = phi i32 [ %16, %8 ], [ 0, %0 ]
%34 = phi i32 [ %14, %8 ], [ 0, %0 ]
%35 = phi i32 [ %12, %8 ], [ 0, %0 ]
%36 = phi i32 [ %10, %8 ], [ 0, %0 ]
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = call i32 @putchar(i32 10)
ret i32 0
50: ; preds = %0, %63
%51 = phi i64 [ %64, %63 ], [ 0, %0 ]
%52 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = add i8 %53, -48
%55 = icmp ult i8 %54, 10
br i1 %55, label %56, label %63
56: ; preds = %50
%57 = zext i8 %53 to i64
%58 = add nuw nsw i64 %57, 4294967248
%59 = and i64 %58, 4294967295
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %60
br label %63
63: ; preds = %50, %56
%64 = add nuw nsw i64 %51, 1
%65 = call i32 @strlen(i8* %3)
%66 = sext i32 %65 to i64
%67 = icmp slt i64 %64, %66
br i1 %67, label %50, label %8
}