#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 *, int *);
void main(void) {
  int a, i, c, k = 0;
  scanf("%d", &a);
  do {
    c = a;
    i = 0;
    do {
      if (k == c % 10) {
        i++;
      }
      c = c / 10;
    } while (c >= 1);
    if (i > 1) {
      printf("chisloto %d \n", k);
    }
    k++;
  } while (k < 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
cmp    %edx,%eax
jne    1171 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    114c <main+0x2c>
cmpl   $0x1,-0x8(%rbp)
jle    11a2 <main+0x82>
mov    -0x10(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jl     113f <main+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
jmp    1148 <main+0x28>
add    $0x1,%ebx
cmp    $0xa,%ebx
je     1191 <main+0x71>
mov    0x4(%rsp),%ecx
xor    %eax,%eax
xchg   %ax,%ax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
xor    %esi,%esi
cmp    %edi,%ebx
sete   %sil
add    %esi,%eax
cmp    $0x9,%edx
jg     1150 <main+0x30>
cmp    $0x2,%eax
jb     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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