#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 *, char *);
int strlen(char *);
int main() {
  char word[100];
  int i = 0;
  int hashtable[26];
  int k = 0;
  scanf("%s", word);
  int length = strlen(word);
  for (i = 0; i < 26; i++)
    hashtable[i] = 0;
  for (i = 0; i < length; i++) {
    int temp = ((int)word[i] - 97);
    hashtable[temp]++;
    if (hashtable[temp] >= 2) {
      printf("%c", temp + 97);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0xe4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xe8(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x1a,-0x74(%rbp)
jge    11a0 <main+0x70>
movslq -0x74(%rbp),%rax
movl   $0x0,-0xe0(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1179 <main+0x49>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0xe8(%rbp),%eax
jge    121d <main+0xed>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
sub    $0x61,%eax
mov    %eax,-0xec(%rbp)
movslq -0xec(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xe0(%rbp,%rax,4)
movslq -0xec(%rbp),%rax
cmpl   $0x2,-0xe0(%rbp,%rax,4)
02
jl     120a <main+0xda>
mov    -0xec(%rbp),%esi
add    $0x61,%esi
lea    0xdfe(%rip),%rdi
call   1040 <printf@plt>
jmp    120f <main+0xdf>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11a7 <main+0x77>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
lea    0xebd(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0x60(%rsp)
test   %eax,%eax
jle    11d0 <main+0xa0>
mov    %eax,%r15d
xor    %ebx,%ebx
lea    0xe72(%rip),%r14
jmp    11a9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     11d0 <main+0xa0>
movsbl 0x70(%rsp,%rbx,1),%esi
movslq %esi,%rax
mov    -0x184(%rsp,%rax,4),%ecx
lea    0x1(%rcx),%edx
mov    %edx,-0x184(%rsp,%rax,4)
test   %ecx,%ecx
jle    11a0 <main+0x70>
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [26 x i32]
%3 = bitcast [26 x i32]* %2 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @strlen(i8* %4)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %0
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %8, %23
%11 = phi i64 [ 0, %8 ], [ %24, %23 ]
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, -97
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
%20 = icmp sgt i32 %18, 0
br i1 %20, label %21, label %23
21: ; preds = %10
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %23
23: ; preds = %21, %10
%24 = add nuw nsw i64 %11, 1
%25 = icmp eq i64 %24, %9
br i1 %25, label %26, label %10
26: ; preds = %23, %0
ret i32 0
}