void clear_flags(char *map) {
  int cur;
  for (cur = 0; cur < 22 * 80; cur++)
    map[cur] = map[cur] & (3 | (1 << 3));
}


x86 assembly (clang, -O0):
<clear_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6e0,-0xc(%rbp)
jge    1146 <clear_flags+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xb,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_flags+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_flags>:
mov    $0x30,%eax
movaps 0xef4(%rip),%xmm0
nopl   0x0(%rax)
movups -0x30(%rdi,%rax,1),%xmm1
movups -0x20(%rdi,%rax,1),%xmm2
andps  %xmm0,%xmm1
andps  %xmm0,%xmm2
movups %xmm1,-0x30(%rdi,%rax,1)
movups %xmm2,-0x20(%rdi,%rax,1)
cmp    $0x6f0,%rax
je     1150 <clear_flags+0x50>
movups -0x10(%rdi,%rax,1),%xmm1
movups (%rdi,%rax,1),%xmm2
andps  %xmm0,%xmm1
andps  %xmm0,%xmm2
movups %xmm1,-0x10(%rdi,%rax,1)
movups %xmm2,(%rdi,%rax,1)
add    $0x40,%rax
jmp    1110 <clear_flags+0x10>
ret

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

LLVM IR (-O2):
define void @clear_flags(i8* nocapture %0) {
br label %2
2: ; preds = %16, %1
%3 = phi i64 [ 0, %1 ], [ %27, %16 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to <16 x i8>*
%6 = load <16 x i8>, <16 x i8>* %5
%7 = getelementptr inbounds i8, i8* %4, i64 16
%8 = bitcast i8* %7 to <16 x i8>*
%9 = load <16 x i8>, <16 x i8>* %8
%10 = and <16 x i8> %6, <i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11>
%11 = and <16 x i8> %9, <i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11>
%12 = bitcast i8* %4 to <16 x i8>*
store <16 x i8> %10, <16 x i8>* %12
%13 = bitcast i8* %7 to <16 x i8>*
store <16 x i8> %11, <16 x i8>* %13
%14 = or i64 %3, 32
%15 = icmp eq i64 %14, 1760
br i1 %15, label %28, label %16
16: ; preds = %2
%17 = getelementptr inbounds i8, i8* %0, i64 %14
%18 = bitcast i8* %17 to <16 x i8>*
%19 = load <16 x i8>, <16 x i8>* %18
%20 = getelementptr inbounds i8, i8* %17, i64 16
%21 = bitcast i8* %20 to <16 x i8>*
%22 = load <16 x i8>, <16 x i8>* %21
%23 = and <16 x i8> %19, <i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11>
%24 = and <16 x i8> %22, <i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11, i8 11>
%25 = bitcast i8* %17 to <16 x i8>*
store <16 x i8> %23, <16 x i8>* %25
%26 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> %24, <16 x i8>* %26
%27 = add nuw nsw i64 %3, 64
br label %2
28: ; preds = %2
ret void
}