#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EXIT_SUCCESS;
int nth_position(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *, ...);
int main() {
  uint64_t number;
  int countOfSieves;
  scanf("%lu %d", &number, &countOfSieves);
  int i;
  for (i = 0; i < countOfSieves; i++) {
    uint64_t currentSieve;
    scanf("%lu", &currentSieve);
    number ^= currentSieve;
    number &= ~currentSieve;
  }
  int onesCounter = 0;
  for (i = 0; i < sizeof(uint64_t) * 8; i++) {
    if (nth_position(number, i) == 1) {
      onesCounter++;
    }
  }
  printf("%d", onesCounter);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119d <main+0x6d>
lea    0xe98(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <main+0x2c>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x20,%rax
jae    11e9 <main+0xb9>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <nth_position@plt>
cmp    $0x1,%eax
jne    11d6 <main+0xa6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11db <main+0xab>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ab <main+0x7b>
mov    -0x18(%rbp),%esi
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xebf(%rip),%rdi
xor    %ebx,%ebx
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1190 <main+0x60>
lea    0xea5(%rip),%r14
lea    0x14(%rsp),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
not    %eax
and    %eax,0x10(%rsp)
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1170 <main+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rsp),%edi
mov    %ebp,%esi
call   1050 <nth_position@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    11a0 <main+0x70>
lea    0xe40(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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