#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 */
void bimaru_clear(char *fields) {
  register size_t x;
  for (x = 0; x < 9 * 9; x++)
    fields[x] &= 2;
}


x86 assembly (clang, -O0):
<bimaru_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x51,-0x10(%rbp)
jae    113e <bimaru_clear+0x3e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
and    $0x2,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <bimaru_clear+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bimaru_clear>:
movaps 0xef9(%rip),%xmm0
movups (%rdi),%xmm1
movups 0x10(%rdi),%xmm2
movups 0x20(%rdi),%xmm3
movups 0x30(%rdi),%xmm4
andps  %xmm0,%xmm1
movups %xmm1,(%rdi)
andps  %xmm0,%xmm2
movups %xmm2,0x10(%rdi)
andps  %xmm0,%xmm3
movups %xmm3,0x20(%rdi)
andps  %xmm0,%xmm4
movups %xmm4,0x30(%rdi)
movups 0x40(%rdi),%xmm1
andps  %xmm0,%xmm1
movups %xmm1,0x40(%rdi)
andb   $0x2,0x50(%rdi)
ret

LLVM IR (-O0):
define void @bimaru_clear(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %15, %1
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 81
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 2
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
br label %15
15: ; preds = %7
%16 = load i64, i64* %3
%17 = add i64 %16, 1
store i64 %17, i64* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @bimaru_clear(i8* nocapture %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = and <16 x i8> %3, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%5 = bitcast i8* %0 to <16 x i8>*
store <16 x i8> %4, <16 x i8>* %5
%6 = getelementptr inbounds i8, i8* %0, i64 16
%7 = bitcast i8* %6 to <16 x i8>*
%8 = load <16 x i8>, <16 x i8>* %7
%9 = and <16 x i8> %8, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%10 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> %9, <16 x i8>* %10
%11 = getelementptr inbounds i8, i8* %0, i64 32
%12 = bitcast i8* %11 to <16 x i8>*
%13 = load <16 x i8>, <16 x i8>* %12
%14 = and <16 x i8> %13, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%15 = bitcast i8* %11 to <16 x i8>*
store <16 x i8> %14, <16 x i8>* %15
%16 = getelementptr inbounds i8, i8* %0, i64 48
%17 = bitcast i8* %16 to <16 x i8>*
%18 = load <16 x i8>, <16 x i8>* %17
%19 = and <16 x i8> %18, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%20 = bitcast i8* %16 to <16 x i8>*
store <16 x i8> %19, <16 x i8>* %20
%21 = getelementptr inbounds i8, i8* %0, i64 64
%22 = bitcast i8* %21 to <16 x i8>*
%23 = load <16 x i8>, <16 x i8>* %22
%24 = and <16 x i8> %23, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
%25 = bitcast i8* %21 to <16 x i8>*
store <16 x i8> %24, <16 x i8>* %25
%26 = getelementptr inbounds i8, i8* %0, i64 80
%27 = load i8, i8* %26
%28 = and i8 %27, 2
store i8 %28, i8* %26
ret void
}