#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 getNofCorrect(const bool *mask) {
  int ret = 0;
  for (int i = 0; i < 26; i++) {
    if (mask[i]) {
      ret++;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<getNofCorrect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1a,-0x10(%rbp)
jge    114e <getNofCorrect+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113b <getNofCorrect+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <getNofCorrect+0x40>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <getNofCorrect+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNofCorrect>:
movdqu (%rdi),%xmm4
movdqu 0x10(%rdi),%xmm5
movdqu 0x20(%rdi),%xmm6
movdqu 0x30(%rdi),%xmm7
movdqu 0x40(%rdi),%xmm0
movdqu 0x50(%rdi),%xmm1
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm7
pcmpeqd %xmm3,%xmm3
pxor   %xmm3,%xmm7
pcmpeqd %xmm2,%xmm6
pxor   %xmm3,%xmm6
packssdw %xmm7,%xmm6
pcmpeqd %xmm2,%xmm5
pxor   %xmm3,%xmm5
pcmpeqd %xmm2,%xmm4
pxor   %xmm3,%xmm4
packssdw %xmm5,%xmm4
packsswb %xmm6,%xmm4
pmovmskb %xmm4,%eax
mov    %eax,%ecx
shr    %ecx
and    $0x5555,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
and    $0xf0f,%ecx
mov    %ecx,%eax
shl    $0x8,%eax
add    %ecx,%eax
movzbl %ah,%ecx
pcmpeqd %xmm2,%xmm1
pxor   %xmm3,%xmm1
pcmpeqd %xmm2,%xmm0
pxor   %xmm3,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%eax
mov    %eax,%edx
shr    %dl
and    $0x55,%dl
sub    %dl,%al
mov    %eax,%edx
and    $0x33,%dl
shr    $0x2,%al
and    $0x33,%al
add    %dl,%al
mov    %eax,%edx
shr    $0x4,%dl
add    %al,%dl
and    $0xf,%dl
movzbl %dl,%eax
add    %ecx,%eax
cmpl   $0x1,0x60(%rdi)
sbb    $0xffffffff,%eax
cmpl   $0x1,0x64(%rdi)
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @getNofCorrect(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 26
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @getNofCorrect(i32* nocapture %0) {
%2 = bitcast i32* %0 to <16 x i32>*
%3 = load <16 x i32>, <16 x i32>* %2
%4 = icmp ne <16 x i32> %3, zeroinitializer
%5 = getelementptr inbounds i32, i32* %0, i64 16
%6 = bitcast i32* %5 to <8 x i32>*
%7 = load <8 x i32>, <8 x i32>* %6
%8 = icmp ne <8 x i32> %7, zeroinitializer
%9 = getelementptr inbounds i32, i32* %0, i64 24
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = getelementptr inbounds i32, i32* %0, i64 25
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
%17 = bitcast <16 x i1> %4 to i16
%18 = call i16 @llvm.ctpop.i16(i16 %17)
%19 = zext i16 %18 to i32
%20 = bitcast <8 x i1> %8 to i8
%21 = call i8 @llvm.ctpop.i8(i8 %20)
%22 = zext i8 %21 to i32
%23 = add nuw nsw i32 %19, %22
%24 = add nuw nsw i32 %23, %12
%25 = add nuw nsw i32 %24, %16
ret i32 %25
}