#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 arr[10];
  int b[10];
  int i, c = -1, z, x;
  for (i = 1; i <= 10; i++) {
    scanf("%d", &arr[i]);
  }
  if (arr[1] == 0) {
    printf("error\n");
    return 0;
  } else {
    for (x = 0; x <= 10; x++) {
      for (i = 1; i <= 10; i++) {
        if (x == arr[i]) {
          c = c + 1;
        }
      }
      if (c > 1) {
        printf("%d : %d\n", x, c);
      }
      c = -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x68(%rbp)
movl   $0x1,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jg     1170 <main+0x50>
movslq -0x64(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x0,-0x2c(%rbp)
jne    1194 <main+0x74>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1222 <main+0x102>
movl   $0x0,-0x70(%rbp)
cmpl   $0xa,-0x70(%rbp)
jg     1216 <main+0xf6>
movl   $0x1,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jg     11e3 <main+0xc3>
mov    -0x70(%rbp),%eax
movslq -0x64(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11d0 <main+0xb0>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11d5 <main+0xb5>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11ac <main+0x8c>
cmpl   $0x1,-0x68(%rbp)
jle    1201 <main+0xe1>
mov    -0x70(%rbp),%esi
mov    -0x68(%rbp),%edx
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x68(%rbp)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    119b <main+0x7b>
jmp    121b <main+0xfb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x4(%rsp),%rsi
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     12a9 <main+0x179>
lea    0xe2d(%rip),%r14
xor    %r15d,%r15d
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    %eax,%r15d
setne  %cl
xor    %ebp,%ebp
cmp    0x8(%rsp),%r15d
sete   %bpl
sub    %ecx,%ebp
movdqu 0xc(%rsp),%xmm0
movdqu 0x1c(%rsp),%xmm1
movd   %r15d,%xmm2
pshufd $0x0,%xmm2,%xmm2
pcmpeqd %xmm2,%xmm1
pcmpeqd %xmm2,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%esi
mov    %esi,%edi
shr    $0x7,%dil
mov    %esi,%r8d
and    $0x40,%r8b
shr    $0x6,%r8b
mov    %esi,%r9d
and    $0x20,%r9b
shr    $0x5,%r9b
mov    %esi,%ecx
and    $0x10,%cl
shr    $0x4,%cl
mov    %esi,%eax
and    $0x8,%al
shr    $0x3,%al
mov    %esi,%edx
and    $0x4,%dl
shr    $0x2,%dl
mov    %esi,%ebx
and    $0x2,%bl
shr    %bl
and    $0x1,%esi
add    %ebp,%esi
movzbl %bl,%ebp
add    %esi,%ebp
movzbl %dl,%edx
add    %ebp,%edx
movzbl %al,%eax
add    %edx,%eax
movzbl %cl,%ecx
add    %eax,%ecx
movzbl %r9b,%eax
add    %ecx,%eax
movzbl %r8b,%ecx
add    %eax,%ecx
movzbl %dil,%edx
add    %ecx,%edx
cmp    $0x2,%edx
jl     1296 <main+0x166>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xa,%r15d
je     12b5 <main+0x185>
mov    0x4(%rsp),%eax
add    $0x1,%r15d
jmp    11e0 <main+0xb0>
lea    0xd5c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"error\0A\00"
@.str.2 = [9 x i8] c"%d : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %5
store i32 1, i32* %4
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 10
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %8
19: ; preds = %8
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %60
25: ; preds = %19
store i32 0, i32* %7
br label %26
26: ; preds = %55, %25
%27 = load i32, i32* %7
%28 = icmp sle i32 %27, 10
br i1 %28, label %29, label %58
29: ; preds = %26
store i32 1, i32* %4
br label %30
30: ; preds = %44, %29
%31 = load i32, i32* %4
%32 = icmp sle i32 %31, 10
br i1 %32, label %33, label %47
33: ; preds = %30
%34 = load i32, i32* %7
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp eq i32 %34, %38
br i1 %39, label %40, label %43
40: ; preds = %33
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %43
43: ; preds = %40, %33
br label %44
44: ; preds = %43
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %30
47: ; preds = %30
%48 = load i32, i32* %5
%49 = icmp sgt i32 %48, 1
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* %7
%52 = load i32, i32* %5
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %51, i32 %52)
br label %54
54: ; preds = %50, %47
store i32 -1, i32* %5
br label %55
55: ; preds = %54
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %26
58: ; preds = %26
br label %59
59: ; preds = %58
store i32 0, i32* %1
br label %60
60: ; preds = %59, %23
%61 = load i32, i32* %1
ret i32 %61
}

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