#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);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  int i, a[10];
  long int n;
  for (i = 0; i < 10; i++)
    a[i] = 0;
  scanf("%li", &n);
  while (n != 0) {
    a[n % 10]++;
    n /= 10;
  }
  for (i = 0; i < 10; i++)
    if (a[i] > 1)
      printf("%d ", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115a <main+0x3a>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9f(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x0,-0x38(%rbp)
je     11a5 <main+0x85>
mov    -0x38(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x30(%rbp,%rdx,4),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp,%rdx,4)
mov    -0x38(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x38(%rbp)
jmp    116a <main+0x4a>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11e7 <main+0xc7>
movslq -0x8(%rbp),%rax
cmpl   $0x1,-0x30(%rbp,%rax,4)
jle    11d4 <main+0xb4>
mov    -0x8(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    11d9 <main+0xb9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ac <main+0x8c>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xebf(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rdx
test   %rdx,%rdx
je     11ae <main+0x8e>
movabs $0x6666666666666667,%rsi
66 66 66
nop
mov    %rdx,%rcx
mov    %rdx,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
addl   $0x1,0x10(%rsp,%rdi,4)
add    $0x9,%rcx
cmp    $0x13,%rcx
jae    1160 <main+0x40>
mov    %rdx,0x8(%rsp)
cmpl   $0x1,0x10(%rsp)
jle    11ae <main+0x8e>
lea    0xe5d(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x14(%rsp)
jge    121d <main+0xfd>
cmpl   $0x2,0x18(%rsp)
jge    1235 <main+0x115>
cmpl   $0x2,0x1c(%rsp)
jge    1251 <main+0x131>
cmpl   $0x2,0x20(%rsp)
jge    126d <main+0x14d>
cmpl   $0x2,0x24(%rsp)
jge    1289 <main+0x169>
cmpl   $0x2,0x28(%rsp)
jge    12a5 <main+0x185>
cmpl   $0x2,0x2c(%rsp)
jge    12c1 <main+0x1a1>
cmpl   $0x2,0x30(%rsp)
jge    12dd <main+0x1bd>
cmpl   $0x2,0x34(%rsp)
jl     1216 <main+0xf6>
lea    0xdf8(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret
lea    0xde0(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x18(%rsp)
jl     11bc <main+0x9c>
lea    0xdc8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x1c(%rsp)
jl     11c7 <main+0xa7>
lea    0xdac(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x20(%rsp)
jl     11d2 <main+0xb2>
lea    0xd90(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x24(%rsp)
jl     11dd <main+0xbd>
lea    0xd74(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x28(%rsp)
jl     11e8 <main+0xc8>
lea    0xd58(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x2c(%rsp)
jl     11f3 <main+0xd3>
lea    0xd3c(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x30(%rsp)
jl     11fe <main+0xde>
lea    0xd20(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
cmpl   $0x2,0x34(%rsp)
jge    1205 <main+0xe5>
jmp    1216 <main+0xf6>

LLVM IR (-O0):
@.str = [4 x i8] c"%li\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
br label %17
17: ; preds = %20, %15
%18 = load i64, i64* %4
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i64, i64* %4
%22 = srem i64 %21, 10
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
%26 = load i64, i64* %4
%27 = sdiv i64 %26, 10
store i64 %27, i64* %4
br label %17
28: ; preds = %17
store i32 0, i32* %2
br label %29
29: ; preds = %42, %28
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %45
32: ; preds = %29
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = icmp sgt i32 %36, 1
br i1 %37, label %38, label %41
38: ; preds = %32
%39 = load i32, i32* %2
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %32
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %29
45: ; preds = %29
ret i32 0
}

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