#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 *);
int main(void) {
  int inp[10];
  int count = 1;
  int tmp;
  for (int i = 0; i < 10; i++) {
    scanf("%d", &tmp);
    inp[i] = tmp % 42;
    for (int j = 0; j < i; j++) {
      if (inp[j] == inp[i]) {
        break;
      } else if (j == i - 1) {
        count++;
      }
    }
  }
  printf("\n%d", count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11dd <main+0xbd>
lea    0xeb3(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq -0x3c(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    11ca <main+0xaa>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
movslq -0x3c(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    1198 <main+0x78>
jmp    11ca <main+0xaa>
mov    -0x40(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11b2 <main+0x92>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b7 <main+0x97>
jmp    11bc <main+0x9c>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1171 <main+0x51>
jmp    11cf <main+0xaf>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    113d <main+0x1d>
mov    -0x34(%rbp),%esi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    $0x1,%ebx
mov    $0xffffffff,%r12d
xor    %r13d,%r13d
lea    0xebf(%rip),%r14
lea    0xc(%rsp),%r15
jmp    115e <main+0x3e>
nopl   0x0(%rax)
add    $0x1,%r13
add    $0x1,%r12d
cmp    $0xa,%r13
je     11bb <main+0x9b>
mov    %r12d,%r12d
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x10(%rsp,%r13,4)
test   %r13,%r13
je     1150 <main+0x30>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    %eax,0x10(%rsp,%rcx,4)
je     1150 <main+0x30>
xor    %edx,%edx
cmp    %rcx,%r12
sete   %dl
add    %edx,%ebx
add    $0x1,%rcx
cmp    %rcx,%r13
jne    11a0 <main+0x80>
jmp    1150 <main+0x30>
lea    0xe3e(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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