#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 *, int *);
int main() {
  int i, n, k;
  int cifri[10] = {0};
  printf("vuvedi chislo");
  scanf("%d", &n);
  while (n > 0) {
    k = n % 10;
    cifri[k]++;
    n = n / 10;
  }
  for (i = 0; i <= 10; i++)
    if (cifri[i] > 1)
      printf("cifrata %d se povtarq\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    11a7 <main+0x77>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x3d>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     11eb <main+0xbb>
movslq -0x8(%rbp),%rax
cmpl   $0x1,-0x40(%rbp,%rax,4)
jle    11d8 <main+0xa8>
mov    -0x8(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <main+0xad>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ae <main+0x7e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11ab <main+0x8b>
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
addl   $0x1,0x10(%rsp,%rdi,4)
cmp    $0xa,%edx
jae    1170 <main+0x50>
mov    %eax,0xc(%rsp)
cmpl   $0x1,0x10(%rsp)
jle    11ab <main+0x8b>
lea    0xe6f(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x14(%rsp)
jge    121c <main+0xfc>
cmpl   $0x2,0x18(%rsp)
jge    1236 <main+0x116>
cmpl   $0x2,0x1c(%rsp)
jge    1254 <main+0x134>
cmpl   $0x2,0x20(%rsp)
jge    1272 <main+0x152>
cmpl   $0x2,0x24(%rsp)
jge    1290 <main+0x170>
cmpl   $0x2,0x28(%rsp)
jge    12ae <main+0x18e>
cmpl   $0x2,0x2c(%rsp)
jge    12cc <main+0x1ac>
cmpl   $0x2,0x30(%rsp)
jge    12ea <main+0x1ca>
cmpl   $0x2,0x34(%rsp)
jl     1215 <main+0xf5>
lea    0xe08(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret
lea    0xdee(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x18(%rsp)
jl     11b9 <main+0x99>
lea    0xdd4(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x1c(%rsp)
jl     11c4 <main+0xa4>
lea    0xdb6(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x20(%rsp)
jl     11cf <main+0xaf>
lea    0xd98(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x24(%rsp)
jl     11da <main+0xba>
lea    0xd7a(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x28(%rsp)
jl     11e5 <main+0xc5>
lea    0xd5c(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x2c(%rsp)
jl     11f0 <main+0xd0>
lea    0xd3e(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x30(%rsp)
jl     11fb <main+0xdb>
lea    0xd20(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x34(%rsp)
jge    1202 <main+0xe2>
jmp    1215 <main+0xf5>

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

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