#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 *);
void main(void) {
  int i = 0, n, j, a;
  printf("\n input number:");
  scanf("%d", &n);
  while (n > 0) {
    a = n / 10;
    j = n % 10;
    while (a > 0) {
      if (j == a % 10) {
        printf("\n %d", j);
        i = 1;
      }
      a = a / 10;
    }
    n = n / 10;
  }
  if (i == 0)
    printf("\n no equal digits");
}


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    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11d7 <main+0xb7>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11c4 <main+0xa4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
cmp    %edx,%eax
jne    11b1 <main+0x91>
mov    -0xc(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    1173 <main+0x53>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
cmpl   $0x0,-0x4(%rbp)
jne    11ef <main+0xcf>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebp
test   %ebp,%ebp
jle    1234 <main+0x114>
mov    $0xcccccccd,%r15d
lea    0xeac(%rip),%r14
xor    %eax,%eax
jmp    1197 <main+0x77>
nopl   0x0(%rax,%rax,1)
movslq 0xc(%rsp),%rcx
imul   $0x66666667,%rcx,%rbp
mov    %rbp,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rbp
add    %edx,%ebp
mov    %ebp,0xc(%rsp)
cmp    $0x9,%rcx
jle    1230 <main+0x110>
cmp    $0xa,%ebp
jl     1215 <main+0xf5>
mov    %ebp,%ecx
imul   %r15,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %ebp,%r12d
sub    %ecx,%r12d
jmp    11c7 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x63,%ebp
mov    %ebx,%ebp
jle    1170 <main+0x50>
movslq %ebp,%rcx
imul   $0x66666667,%rcx,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rbx
add    %ecx,%ebx
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
cmp    %ecx,%r12d
jne    11c0 <main+0xa0>
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    11c0 <main+0xa0>
movslq %ebp,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jne    1242 <main+0x122>
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A %d\00"
@.str.3 = [18 x i8] c"\0A no equal digits\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %32
7: ; preds = %0, %25
%8 = phi i32 [ %23, %25 ], [ 0, %0 ]
%9 = phi i32 [ %27, %25 ], [ %5, %0 ]
%10 = urem i32 %9, 10
%11 = icmp sgt i32 %9, 9
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = sdiv i32 %9, 10
store i32 %13, i32* %1
br label %29
14: ; preds = %7, %22
%15 = phi i32 [ %17, %22 ], [ %9, %7 ]
%16 = phi i32 [ %23, %22 ], [ %8, %7 ]
%17 = sdiv i32 %15, 10
%18 = srem i32 %17, 10
%19 = icmp eq i32 %10, %18
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %22
22: ; preds = %20, %14
%23 = phi i32 [ 1, %20 ], [ %16, %14 ]
%24 = icmp sgt i32 %15, 99
br i1 %24, label %14, label %25
25: ; preds = %22
%26 = load i32, i32* %1
%27 = sdiv i32 %26, 10
store i32 %27, i32* %1
%28 = icmp sgt i32 %26, 9
br i1 %28, label %7, label %29
29: ; preds = %25, %12
%30 = phi i32 [ %8, %12 ], [ %23, %25 ]
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %0, %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
ret void
}