#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, a1, check = 0, times;
  scanf("%d", &a);
  while (check < 10) {
    a1 = a;
    times = 0;
    while (a1 > 1) {
      if (check == a1 % 10) {
        times++;
      }
      a1 /= 10;
    }
    if (times > 1)
      printf("%d times %d numbers\n", times, check);
    check++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,-0x10(%rbp)
jge    11c9 <main+0xa9>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    119f <main+0x7f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
cmp    %edx,%eax
jne    118c <main+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    115d <main+0x3d>
cmpl   $0x1,-0x14(%rbp)
jle    11bb <main+0x9b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
mov    $0xcccccccd,%r15d
lea    0xeba(%rip),%r14
jmp    1158 <main+0x38>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0xa,%ebx
je     11a5 <main+0x85>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
jl     1150 <main+0x30>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
imul   %r15,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %eax,%edi
sub    %edx,%edi
xor    %edx,%edx
cmp    %edi,%ebx
sete   %dl
add    %edx,%esi
cmp    $0x13,%eax
mov    %ecx,%eax
ja     1170 <main+0x50>
cmp    $0x2,%esi
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [21 x i8] c"%d times %d numbers\0A\00"
define i32 @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 = %0, %21
%5 = phi i32 [ 0, %0 ], [ %22, %21 ]
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %21
8: ; preds = %4, %8
%9 = phi i32 [ %14, %8 ], [ 0, %4 ]
%10 = phi i32 [ %15, %8 ], [ %6, %4 ]
%11 = urem i32 %10, 10
%12 = icmp eq i32 %5, %11
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %9, %13
%15 = udiv i32 %10, 10
%16 = icmp ugt i32 %10, 19
br i1 %16, label %8, label %17
17: ; preds = %8
%18 = icmp ugt i32 %14, 1
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %5)
br label %21
21: ; preds = %4, %19, %17
%22 = add nuw nsw i32 %5, 1
%23 = icmp eq i32 %22, 10
br i1 %23, label %24, label %4
24: ; preds = %21
ret i32 0
}