#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 *, long *);
int main(void) {
  int digit_seen[10] = {0};
  int duplicates[10] = {0};
  int digit;
  int empty = 0;
  long n;
  printf("Enter a number: ");
  scanf("%ld", &n);
  while (n > 0) {
    digit = n % 10;
    if (digit_seen[digit]) {
      duplicates[digit] += 1;
    }
    digit_seen[digit] = 2;
    n /= 10;
  }
  for (int i = 0; i < 10; i += 1) {
    empty += duplicates[i];
  }
  if (empty == 0) {
    printf("No repeated digits\n");
  } else {
    printf("Repeated digit(s): ");
    for (int i = 0; i < 10; i += 1) {
      if (duplicates[i] > 0) {
        printf("%d ", i);
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x68(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,-0x70(%rbp)
jle    11e6 <main+0xb6>
mov    -0x70(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     11c3 <main+0x93>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x60(%rbp,%rax,4)
movslq -0x64(%rbp),%rax
movl   $0x2,-0x30(%rbp,%rax,4)
mov    -0x70(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x70(%rbp)
jmp    1187 <main+0x57>
movl   $0x0,-0x74(%rbp)
cmpl   $0xa,-0x74(%rbp)
jge    1213 <main+0xe3>
movslq -0x74(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11ed <main+0xbd>
cmpl   $0x0,-0x68(%rbp)
jne    1230 <main+0x100>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1290 <main+0x160>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x78(%rbp)
cmpl   $0xa,-0x78(%rbp)
jge    1282 <main+0x152>
movslq -0x78(%rbp),%rax
cmpl   $0x0,-0x60(%rbp,%rax,4)
jle    126f <main+0x13f>
mov    -0x78(%rbp),%esi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1274 <main+0x144>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1245 <main+0x115>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movq   $0x0,0x60(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe85(%rip),%rdi
lea    0x38(%rsp),%rsi
call   1060 <scanf@plt>
xor    %edx,%edx
mov    0x38(%rsp),%rcx
mov    $0x0,%esi
mov    $0x0,%r13d
mov    $0x0,%ebp
mov    $0x0,%ebx
mov    $0x0,%r14d
mov    $0x0,%r15d
mov    $0x0,%r12d
mov    $0x0,%eax
test   %rcx,%rcx
jle    1244 <main+0x104>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
jmp    11f1 <main+0xb1>
nopw   0x0(%rax,%rax,1)
movl   $0x2,0x40(%rsp,%rax,4)
cmp    $0xa,%rcx
mov    %rdx,%rcx
jb     1217 <main+0xd7>
mov    %rcx,%rax
mul    %rsi
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rdi
mov    %rcx,%rax
sub    %rdi,%rax
cmpl   $0x0,0x40(%rsp,%rax,4)
je     11e0 <main+0xa0>
addl   $0x1,0x10(%rsp,%rax,4)
jmp    11e0 <main+0xa0>
mov    %rdx,0x38(%rsp)
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%r12d
mov    0x18(%rsp),%r15d
mov    0x1c(%rsp),%r14d
mov    0x20(%rsp),%ebx
mov    0x24(%rsp),%ebp
mov    0x28(%rsp),%r13d
mov    0x2c(%rsp),%esi
mov    0x30(%rsp),%edx
add    %r12d,%eax
add    %r15d,%eax
add    %r14d,%eax
add    %ebx,%eax
add    %ebp,%eax
add    %r13d,%eax
add    %esi,%eax
add    %edx,%eax
mov    0x34(%rsp),%ecx
add    %ecx,%eax
jne    1271 <main+0x131>
lea    0xdc6(%rip),%rdi
call   1040 <puts@plt>
jmp    1388 <main+0x248>
mov    %ecx,0x4(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
lea    0xd91(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x10(%rsp)
jle    12a2 <main+0x162>
lea    0xd90(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r12d,%r12d
jle    12ba <main+0x17a>
lea    0xd7b(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
jle    12d2 <main+0x192>
lea    0xd63(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
jle    12ea <main+0x1aa>
lea    0xd4b(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    1301 <main+0x1c1>
lea    0xd34(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    1318 <main+0x1d8>
lea    0xd1d(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    1330 <main+0x1f0>
lea    0xd05(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x8(%rsp)
jle    134a <main+0x20a>
lea    0xceb(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1364 <main+0x224>
lea    0xcd1(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    137e <main+0x23e>
lea    0xcb7(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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