int countCellToSolve(int sudoku[9][9]) {
  int i, j, c = 0;
  for (i = 0; i < 9; i++) {
    for (j = 0; j < 9; j++) {
      if (sudoku[i][j] == 0) {
        c++;
      }
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<countCellToSolve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    117d <countCellToSolve+0x7d>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    116a <countCellToSolve+0x6a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1157 <countCellToSolve+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <countCellToSolve+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <countCellToSolve+0x27>
jmp    116f <countCellToSolve+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <countCellToSolve+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countCellToSolve>:
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
pxor   %xmm0,%xmm0
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
mov    %eax,%ecx
shr    %cl
and    $0x55,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%ecx
cmpl   $0x1,0x20(%rdi)
adc    $0x0,%ecx
movdqu 0x24(%rdi),%xmm1
movdqu 0x34(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%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
cmpl   $0x1,0x44(%rdi)
adc    $0x0,%eax
add    %ecx,%eax
movdqu 0x48(%rdi),%xmm1
movdqu 0x58(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x55,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
cmpl   $0x1,0x68(%rdi)
adc    $0x0,%ecx
add    %eax,%ecx
movdqu 0x6c(%rdi),%xmm1
movdqu 0x7c(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%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
cmpl   $0x1,0x8c(%rdi)
adc    $0x0,%eax
add    %ecx,%eax
movdqu 0x90(%rdi),%xmm1
movdqu 0xa0(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x55,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
cmpl   $0x1,0xb0(%rdi)
adc    $0x0,%ecx
add    %eax,%ecx
movdqu 0xb4(%rdi),%xmm1
movdqu 0xc4(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%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
cmpl   $0x1,0xd4(%rdi)
adc    $0x0,%eax
add    %ecx,%eax
movdqu 0xd8(%rdi),%xmm1
movdqu 0xe8(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x55,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
cmpl   $0x1,0xf8(%rdi)
adc    $0x0,%ecx
add    %eax,%ecx
movdqu 0xfc(%rdi),%xmm1
movdqu 0x10c(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%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,%edx
cmpl   $0x1,0x11c(%rdi)
adc    $0x0,%edx
add    %ecx,%edx
movdqu 0x120(%rdi),%xmm1
movdqu 0x130(%rdi),%xmm2
pcmpeqd %xmm0,%xmm2
pcmpeqd %xmm0,%xmm1
packssdw %xmm2,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
mov    %eax,%ecx
shr    %cl
and    $0x55,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
cmpl   $0x1,0x140(%rdi)
movzbl %cl,%eax
adc    $0x0,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @countCellToSolve([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %5
store i32 0, i32* %3
br label %6
6: ; preds = %31, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %34
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %27, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 9
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load [9 x i32]*, [9 x i32]** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %14, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [9 x i32], [9 x i32]* %17, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %13
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %10
30: ; preds = %10
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %6
34: ; preds = %6
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @countCellToSolve([9 x i32]* nocapture %0) {
%2 = bitcast [9 x i32]* %0 to <8 x i32>*
%3 = load <8 x i32>, <8 x i32>* %2
%4 = icmp eq <8 x i32> %3, zeroinitializer
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 0, i64 8
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = bitcast <8 x i1> %4 to i8
%10 = call i8 @llvm.ctpop.i8(i8 %9)
%11 = zext i8 %10 to i32
%12 = add nuw nsw i32 %11, %8
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 1, i64 0
%14 = bitcast i32* %13 to <8 x i32>*
%15 = load <8 x i32>, <8 x i32>* %14
%16 = icmp eq <8 x i32> %15, zeroinitializer
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 1, i64 8
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = bitcast <8 x i1> %16 to i8
%22 = call i8 @llvm.ctpop.i8(i8 %21)
%23 = zext i8 %22 to i32
%24 = add nuw nsw i32 %23, %20
%25 = add nuw nsw i32 %24, %12
%26 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 2, i64 0
%27 = bitcast i32* %26 to <8 x i32>*
%28 = load <8 x i32>, <8 x i32>* %27
%29 = icmp eq <8 x i32> %28, zeroinitializer
%30 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 2, i64 8
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 0
%33 = zext i1 %32 to i32
%34 = bitcast <8 x i1> %29 to i8
%35 = call i8 @llvm.ctpop.i8(i8 %34)
%36 = zext i8 %35 to i32
%37 = add nuw nsw i32 %36, %33
%38 = add nuw nsw i32 %37, %25
%39 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 3, i64 0
%40 = bitcast i32* %39 to <8 x i32>*
%41 = load <8 x i32>, <8 x i32>* %40
%42 = icmp eq <8 x i32> %41, zeroinitializer
%43 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 3, i64 8
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, 0
%46 = zext i1 %45 to i32
%47 = bitcast <8 x i1> %42 to i8
%48 = call i8 @llvm.ctpop.i8(i8 %47)
%49 = zext i8 %48 to i32
%50 = add nuw nsw i32 %49, %46
%51 = add nuw nsw i32 %50, %38
%52 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 4, i64 0
%53 = bitcast i32* %52 to <8 x i32>*
%54 = load <8 x i32>, <8 x i32>* %53
%55 = icmp eq <8 x i32> %54, zeroinitializer
%56 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 4, i64 8
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, 0
%59 = zext i1 %58 to i32
%60 = bitcast <8 x i1> %55 to i8
%61 = call i8 @llvm.ctpop.i8(i8 %60)
%62 = zext i8 %61 to i32
%63 = add nuw nsw i32 %62, %59
%64 = add nuw nsw i32 %63, %51
%65 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 5, i64 0
%66 = bitcast i32* %65 to <8 x i32>*
%67 = load <8 x i32>, <8 x i32>* %66
%68 = icmp eq <8 x i32> %67, zeroinitializer
%69 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 5, i64 8
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
%72 = zext i1 %71 to i32
%73 = bitcast <8 x i1> %68 to i8
%74 = call i8 @llvm.ctpop.i8(i8 %73)
%75 = zext i8 %74 to i32
%76 = add nuw nsw i32 %75, %72
%77 = add nuw nsw i32 %76, %64
%78 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 6, i64 0
%79 = bitcast i32* %78 to <8 x i32>*
%80 = load <8 x i32>, <8 x i32>* %79
%81 = icmp eq <8 x i32> %80, zeroinitializer
%82 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 6, i64 8
%83 = load i32, i32* %82
%84 = icmp eq i32 %83, 0
%85 = zext i1 %84 to i32
%86 = bitcast <8 x i1> %81 to i8
%87 = call i8 @llvm.ctpop.i8(i8 %86)
%88 = zext i8 %87 to i32
%89 = add nuw nsw i32 %88, %85
%90 = add nuw nsw i32 %89, %77
%91 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 7, i64 0
%92 = bitcast i32* %91 to <8 x i32>*
%93 = load <8 x i32>, <8 x i32>* %92
%94 = icmp eq <8 x i32> %93, zeroinitializer
%95 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 7, i64 8
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 0
%98 = zext i1 %97 to i32
%99 = bitcast <8 x i1> %94 to i8
%100 = call i8 @llvm.ctpop.i8(i8 %99)
%101 = zext i8 %100 to i32
%102 = add nuw nsw i32 %101, %98
%103 = add nuw nsw i32 %102, %90
%104 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 8, i64 0
%105 = bitcast i32* %104 to <8 x i32>*
%106 = load <8 x i32>, <8 x i32>* %105
%107 = icmp eq <8 x i32> %106, zeroinitializer
%108 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 8, i64 8
%109 = load i32, i32* %108
%110 = icmp eq i32 %109, 0
%111 = zext i1 %110 to i32
%112 = bitcast <8 x i1> %107 to i8
%113 = call i8 @llvm.ctpop.i8(i8 %112)
%114 = zext i8 %113 to i32
%115 = add nuw nsw i32 %114, %111
%116 = add nuw nsw i32 %115, %103
ret i32 %116
}