#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 a, n, b, f;
  printf("n=(do 10 cifreno chislo)  ");
  scanf("%d", &n);
  for (a = 0; a < 10; a++) {
    f = 0;
    b = n;
    do {
      if (a == b % 10) {
        f++;
      }
      b = b / 10;
    } while (b > 0);
    if (f != 0) {
      if (f == 1)
        printf("%d se povtarq  %d put\n", a, f);
      else
        printf("%d se povtarq  %d puti\n", a, f);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1201 <main+0xe1>
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
cmp    %edx,%eax
jne    1190 <main+0x70>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     116b <main+0x4b>
cmpl   $0x0,-0x14(%rbp)
je     11ee <main+0xce>
cmpl   $0x1,-0x14(%rbp)
jne    11d5 <main+0xb5>
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ee <main+0xce>
jmp    11f3 <main+0xd3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xed0(%rip),%r14
lea    0xee0(%rip),%rbx
xor    %ebp,%ebp
jmp    1174 <main+0x54>
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
je     11c5 <main+0xa5>
mov    0xc(%rsp),%eax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edi
sub    %esi,%edi
xor    %esi,%esi
cmp    %edi,%ebp
sete   %sil
add    %esi,%edx
cmp    $0x9,%ecx
jg     1180 <main+0x60>
test   %edx,%edx
je     116c <main+0x4c>
cmp    $0x1,%edx
jne    1160 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
jmp    1165 <main+0x45>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"n=(do 10 cifreno chislo) \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"%d se povtarq %d put\0A\00"
@.str.3 = [24 x i8] c"%d se povtarq %d puti\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %5
5: ; preds = %0, %22
%6 = phi i32 [ 0, %0 ], [ %23, %22 ]
%7 = load i32, i32* %1
br label %8
8: ; preds = %8, %5
%9 = phi i32 [ %7, %5 ], [ %15, %8 ]
%10 = phi i32 [ 0, %5 ], [ %14, %8 ]
%11 = srem i32 %9, 10
%12 = icmp eq i32 %6, %11
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %10, %13
%15 = sdiv i32 %9, 10
%16 = icmp sgt i32 %9, 9
br i1 %16, label %8, label %17
17: ; preds = %8
switch i32 %14, label %20 [
i32 0, label %22
i32 1, label %18
]
18: ; preds = %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 1)
br label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %14)
br label %22
22: ; preds = %17, %20, %18
%23 = add nuw nsw i32 %6, 1
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %5
25: ; preds = %22
ret i32 0
}