#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 *, short);
int /*<<< orphan*/ scanf(char *, short *);
int main() {
  char i, mod[42] = {};
  short a;
  for (i = 0; i < 10; i++) {
    scanf("%hd", &a);
    mod[a % 42]++;
  }
  a = 0;
  for (i = 0; i < 42; i++)
    if (mod[i])
      a++;
  printf("%hd\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2a,%edx
call   1040 <memset@plt>
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jge    1197 <main+0x67>
lea    0xe99(%rip),%rdi
lea    -0x32(%rbp),%rsi
call   1050 <scanf@plt>
movswl -0x32(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1153 <main+0x23>
movw   $0x0,-0x32(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jge    11dc <main+0xac>
movsbq -0x5(%rbp),%rax
cmpb   $0x0,-0x30(%rbp,%rax,1)
je     11ca <main+0x9a>
mov    -0x32(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x32(%rbp)
jmp    11cf <main+0x9f>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    11a1 <main+0x71>
lea    0xe21(%rip),%rdi
movswl -0x32(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x2a(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xec0(%rip),%rbx
lea    0xe(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movswl 0xe(%rsp),%eax
imul   $0xffffc30d,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x2a,%edx,%ecx
sub    %ecx,%eax
movswq %ax,%rax
addb   $0x1,0x10(%rsp,%rax,1)
movw   $0x0,0xe(%rsp)
mov    $0x2,%ecx
xor    %eax,%eax
jmp    138a <main+0x26a>
nopl   0x0(%rax,%rax,1)
add    $0x3,%rcx
cmp    $0x2c,%rcx
je     13b9 <main+0x299>
cmpb   $0x0,0xe(%rsp,%rcx,1)
je     1399 <main+0x279>
add    $0x1,%eax
mov    %ax,0xe(%rsp)
cmpb   $0x0,0xf(%rsp,%rcx,1)
je     13a8 <main+0x288>
add    $0x1,%eax
mov    %ax,0xe(%rsp)
cmpb   $0x0,0x10(%rsp,%rcx,1)
je     1380 <main+0x260>
add    $0x1,%eax
mov    %ax,0xe(%rsp)
jmp    1380 <main+0x260>
movswl %ax,%esi
lea    0xc41(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca [42 x i8]
%2 = alloca i16
%3 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 0
%4 = bitcast i16* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%6 = load i16, i16* %2
%7 = srem i16 %6, 42
%8 = sext i16 %7 to i64
%9 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = add i8 %10, 1
store i8 %11, i8* %9
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%13 = load i16, i16* %2
%14 = srem i16 %13, 42
%15 = sext i16 %14 to i64
%16 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = add i8 %17, 1
store i8 %18, i8* %16
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%20 = load i16, i16* %2
%21 = srem i16 %20, 42
%22 = sext i16 %21 to i64
%23 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = add i8 %24, 1
store i8 %25, i8* %23
%26 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%27 = load i16, i16* %2
%28 = srem i16 %27, 42
%29 = sext i16 %28 to i64
%30 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = add i8 %31, 1
store i8 %32, i8* %30
%33 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%34 = load i16, i16* %2
%35 = srem i16 %34, 42
%36 = sext i16 %35 to i64
%37 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = add i8 %38, 1
store i8 %39, i8* %37
%40 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%41 = load i16, i16* %2
%42 = srem i16 %41, 42
%43 = sext i16 %42 to i64
%44 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = add i8 %45, 1
store i8 %46, i8* %44
%47 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%48 = load i16, i16* %2
%49 = srem i16 %48, 42
%50 = sext i16 %49 to i64
%51 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = add i8 %52, 1
store i8 %53, i8* %51
%54 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%55 = load i16, i16* %2
%56 = srem i16 %55, 42
%57 = sext i16 %56 to i64
%58 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = add i8 %59, 1
store i8 %60, i8* %58
%61 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%62 = load i16, i16* %2
%63 = srem i16 %62, 42
%64 = sext i16 %63 to i64
%65 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = add i8 %66, 1
store i8 %67, i8* %65
%68 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%69 = load i16, i16* %2
%70 = srem i16 %69, 42
%71 = sext i16 %70 to i64
%72 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = add i8 %73, 1
store i8 %74, i8* %72
store i16 0, i16* %2
br label %75
75: ; preds = %99, %0
%76 = phi i64 [ 0, %0 ], [ %101, %99 ]
%77 = phi i16 [ 0, %0 ], [ %100, %99 ]
%78 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %76
%79 = load i8, i8* %78
%80 = icmp eq i8 %79, 0
br i1 %80, label %83, label %81
81: ; preds = %75
%82 = add i16 %77, 1
store i16 %82, i16* %2
br label %83
83: ; preds = %75, %81
%84 = phi i16 [ %77, %75 ], [ %82, %81 ]
%85 = add nuw nsw i64 %76, 1
%86 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = icmp eq i8 %87, 0
br i1 %88, label %91, label %89
89: ; preds = %83
%90 = add i16 %84, 1
store i16 %90, i16* %2
br label %91
91: ; preds = %89, %83
%92 = phi i16 [ %84, %83 ], [ %90, %89 ]
%93 = add nuw nsw i64 %76, 2
%94 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 %93
%95 = load i8, i8* %94
%96 = icmp eq i8 %95, 0
br i1 %96, label %99, label %97
97: ; preds = %91
%98 = add i16 %92, 1
store i16 %98, i16* %2
br label %99
99: ; preds = %97, %91
%100 = phi i16 [ %92, %91 ], [ %98, %97 ]
%101 = add nuw nsw i64 %76, 3
%102 = icmp eq i64 %101, 42
br i1 %102, label %103, label %75
103: ; preds = %99
%104 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16 signext %100)
ret i32 0
}