#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 */
size_t atoi(char *);
size_t getchar();
int *malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  const char *trans =
      "                                                0123456789       "
      "2223334445556667 77888999                                       ";
  int *dict, n, i, l, no_duplicates = 1;
  char num_str[7];
  dict = malloc(sizeof(int[10000000]));
  memset(dict, 0, sizeof(int[10000000]));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    l = 0;
    while (l < 7) {
      num_str[l] = trans[getchar()];
      if (num_str[l] != ' ')
        l++;
    }
    dict[atoi(num_str)]++;
  }
  for (i = 0; i < 10000000; i++)
    if (dict[i] > 1) {
      printf("%03d-%04d %d\n", i / 10000, i % 10000, dict[i]);
      no_duplicates = 0;
    }
  if (no_duplicates)
    printf("No duplicates.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x28(%rbp)
mov    $0x2625a00,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x2625a00,%edx
call   1040 <memset@plt>
lea    0xedc(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1070 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1243 <main+0xe3>
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    1214 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    (%rax,%rcx,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x2f(%rbp,%rax,1)
movslq -0x24(%rbp),%rax
movsbl -0x2f(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     120f <main+0xaf>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c9 <main+0x69>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x2f(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11b6 <main+0x56>
movl   $0x0,-0x20(%rbp)
cmpl   $0x989680,-0x20(%rbp)
jge    12b4 <main+0x154>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jle    12a1 <main+0x141>
mov    -0x20(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x20(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
jmp    12a6 <main+0x146>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    124a <main+0xea>
cmpl   $0x0,-0x28(%rbp)
je     12cc <main+0x16c>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x2625a00,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2625a00,%edx
call   1040 <memset@plt>
lea    0xef3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11f7 <main+0x97>
lea    0xe59(%rip),%rbx
lea    0x9(%rsp),%r14
xor    %r15d,%r15d
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
movzbl (%rax,%rbx,1),%eax
mov    %ebp,%ecx
mov    %al,0x9(%rsp,%rcx,1)
xor    %ecx,%ecx
cmp    $0x20,%al
setne  %cl
add    %ecx,%ebp
cmp    $0x7,%ebp
jb     11c0 <main+0x60>
mov    %r14,%rdi
call   1080 <atoi@plt>
addl   $0x1,(%r12,%rax,4)
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jl     11b0 <main+0x50>
mov    $0xd1b71759,%r15d
lea    0xe81(%rip),%r14
xor    %ebx,%ebx
xor    %eax,%eax
mov    %ebx,%edx
add    $0x1,%rbx
xchg   %ax,%ax
mov    -0x4(%r12,%rbx,4),%ecx
cmp    $0x1,%ecx
jg     1230 <main+0xd0>
add    $0x1,%rbx
add    $0x1,%edx
cmp    $0x989681,%rbx
jne    1210 <main+0xb0>
jmp    1268 <main+0x108>
nopl   0x0(%rax)
lea    -0x1(%rbx),%esi
imul   %r15,%rsi
shr    $0x2d,%rsi
mov    %edx,%eax
imul   %r15,%rax
shr    $0x2d,%rax
imul   $0xffffd8f0,%eax,%eax
lea    (%rax,%rbx,1),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%al
cmp    $0x989680,%rbx
jne    1208 <main+0xa8>
jmp    127a <main+0x11a>
test   $0x1,%al
jne    127a <main+0x11a>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [130 x i8] c" 0123456789 2223334445556667 77888999 \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"%03d-%04d %d\0A\00"
@.str.3 = [15 x i8] c"No duplicates.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [7 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 1, i32* %7
%9 = call i32* @malloc(i32 40000000)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 @memset(i32* %10, i32 0, i32 40000000)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %5
br label %13
13: ; preds = %46, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %49
17: ; preds = %13
store i32 0, i32* %6
br label %18
18: ; preds = %38, %17
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 7
br i1 %20, label %21, label %39
21: ; preds = %18
%22 = load i8*, i8** %2
%23 = call i64 (...) @getchar()
%24 = getelementptr inbounds i8, i8* %22, i64 %23
%25 = load i8, i8* %24
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 %27
store i8 %25, i8* %28
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 32
br i1 %34, label %35, label %38
35: ; preds = %21
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %38
38: ; preds = %35, %21
br label %18
39: ; preds = %18
%40 = load i32*, i32** %3
%41 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%42 = call i64 @atoi(i8* %41)
%43 = getelementptr inbounds i32, i32* %40, i64 %42
%44 = load i32, i32* %43
%45 = add nsw i32 %44, 1
store i32 %45, i32* %43
br label %46
46: ; preds = %39
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %13
49: ; preds = %13
store i32 0, i32* %5
br label %50
50: ; preds = %72, %49
%51 = load i32, i32* %5
%52 = icmp slt i32 %51, 10000000
br i1 %52, label %53, label %75
53: ; preds = %50
%54 = load i32*, i32** %3
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = icmp sgt i32 %58, 1
br i1 %59, label %60, label %71
60: ; preds = %53
%61 = load i32, i32* %5
%62 = sdiv i32 %61, 10000
%63 = load i32, i32* %5
%64 = srem i32 %63, 10000
%65 = load i32*, i32** %3
%66 = load i32, i32* %5
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %65, i64 %67
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %62, i32 %64, i32 %69)
store i32 0, i32* %7
br label %71
71: ; preds = %60, %53
br label %72
72: ; preds = %71
%73 = load i32, i32* %5
%74 = add nsw i32 %73, 1
store i32 %74, i32* %5
br label %50
75: ; preds = %50
%76 = load i32, i32* %7
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %80
80: ; preds = %78, %75
ret i32 0
}

LLVM IR (-O2):
@.str = [130 x i8] c" 0123456789 2223334445556667 77888999 \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"%03d-%04d %d\0A\00"
@.str.3 = [15 x i8] c"No duplicates.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @malloc(i32 40000000)
%6 = tail call i32 @memset(i32* %5, i32 0, i32 40000000)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %34
10: ; preds = %0, %26
%11 = phi i32 [ %31, %26 ], [ 0, %0 ]
br label %15
12: ; preds = %34, %43
%13 = phi i64 [ %48, %43 ], [ 0, %34 ]
%14 = phi i1 [ true, %43 ], [ false, %34 ]
br label %35
15: ; preds = %10, %15
%16 = phi i32 [ 0, %10 ], [ %24, %15 ]
%17 = call i64 (...) @getchar()
%18 = getelementptr inbounds [130 x i8], [130 x i8]* @.str, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = zext i32 %16 to i64
%21 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 %20
store i8 %19, i8* %21
%22 = icmp ne i8 %19, 32
%23 = zext i1 %22 to i32
%24 = add nuw nsw i32 %16, %23
%25 = icmp ult i32 %24, 7
br i1 %25, label %15, label %26
26: ; preds = %15
%27 = call i64 @atoi(i8* %4)
%28 = getelementptr inbounds i32, i32* %5, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
%31 = add nuw nsw i32 %11, 1
%32 = load i32, i32* %1
%33 = icmp slt i32 %31, %32
br i1 %33, label %10, label %34
34: ; preds = %26, %0
br label %12
35: ; preds = %12, %40
%36 = phi i64 [ %41, %40 ], [ %13, %12 ]
%37 = getelementptr inbounds i32, i32* %5, i64 %36
%38 = load i32, i32* %37
%39 = icmp sgt i32 %38, 1
br i1 %39, label %43, label %40
40: ; preds = %35
%41 = add nuw nsw i64 %36, 1
%42 = icmp eq i64 %41, 10000000
br i1 %42, label %50, label %35
43: ; preds = %35
%44 = trunc i64 %36 to i32
%45 = udiv i32 %44, 10000
%46 = urem i32 %44, 10000
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %45, i32 %46, i32 %38)
%48 = add nuw nsw i64 %36, 1
%49 = icmp eq i64 %48, 10000000
br i1 %49, label %53, label %12
50: ; preds = %40
br i1 %14, label %53, label %51
51: ; preds = %50
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %43, %51, %50
ret i32 0
}