#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 /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int micro_evaluate(unsigned char *, int const, int);
int /*<<< orphan*/ printf(char *, ...);
int micro_apply_bitmask(unsigned char *grid, const int size,
                        const int user_mask, const int debug_print) {
  int x, y;
  int r, k;
  int bit;
  int pattern, value[4];
  int best_pattern;
  int size_squared = size * size;
  unsigned char mask[size_squared];
  unsigned char eval[size_squared];
  memset(mask, 0, size_squared);
  for (y = 0; y < size; y++) {
    r = y * size;
    for (x = 0; x < size; x++) {
      if (!(grid[r + x] & 0xf0)) {
        if ((y & 1) == 0) {
          mask[r + x] |= 0x01;
        }
        if ((((y / 2) + (x / 3)) & 1) == 0) {
          mask[r + x] |= 0x02;
        }
        if (((((y * x) & 1) + ((y * x) % 3)) & 1) == 0) {
          mask[r + x] |= 0x04;
        }
        if (((((y + x) & 1) + ((y * x) % 3)) & 1) == 0) {
          mask[r + x] |= 0x08;
        }
      }
    }
  }
  if (user_mask) {
    best_pattern = user_mask - 1;
  } else {
    for (k = 0; k < size_squared; k++) {
      if (grid[k] & 0x01) {
        eval[k] = mask[k] ^ 0xff;
      } else {
        eval[k] = mask[k];
      }
    }
    best_pattern = 0;
    for (pattern = 0; pattern < 4; pattern++) {
      value[pattern] = micro_evaluate(eval, size, pattern);
      if (value[pattern] > value[best_pattern]) {
        best_pattern = pattern;
      }
    }
  }
  if (debug_print) {
    printf("Mask: %d (%s)", best_pattern,
           user_mask ? "specified" : "automatic");
    if (!user_mask) {
      for (pattern = 0; pattern < 4; pattern++)
        printf(" %d:%d", pattern, value[pattern]);
    }
    printf("\n");
  }
  bit = 1 << best_pattern;
  for (k = 0; k < size_squared; k++) {
    if (mask[k] & bit) {
      if (grid[k] & 0x01) {
        grid[k] = 0x00;
      } else {
        grid[k] = 0x01;
      }
    }
  }
  return best_pattern;
}


x86 assembly (clang, -O0):
<micro_apply_bitmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   %eax,%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x70(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    130a <micro_apply_bitmask+0x1da>
mov    -0x1c(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12f7 <micro_apply_bitmask+0x1c7>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
jne    12e4 <micro_apply_bitmask+0x1b4>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1215 <micro_apply_bitmask+0xe5>
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     $0x1,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x74(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
add    %ecx,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1258 <micro_apply_bitmask+0x128>
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     $0x2,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x78(%rbp),%eax
add    %edx,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    129c <micro_apply_bitmask+0x16c>
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     $0x4,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x7c(%rbp),%eax
add    %edx,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    12df <micro_apply_bitmask+0x1af>
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     $0x8,%edx
mov    %dl,(%rax,%rcx,1)
jmp    12e4 <micro_apply_bitmask+0x1b4>
jmp    12e9 <micro_apply_bitmask+0x1b9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c4 <micro_apply_bitmask+0x94>
jmp    12fc <micro_apply_bitmask+0x1cc>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <micro_apply_bitmask+0x77>
cmpl   $0x0,-0x10(%rbp)
je     1322 <micro_apply_bitmask+0x1f2>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13ff <micro_apply_bitmask+0x2cf>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    139a <micro_apply_bitmask+0x26a>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1371 <micro_apply_bitmask+0x241>
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    $0xff,%ecx
mov    %cl,%dl
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1387 <micro_apply_bitmask+0x257>
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    138c <micro_apply_bitmask+0x25c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1329 <micro_apply_bitmask+0x1f9>
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    13fa <micro_apply_bitmask+0x2ca>
mov    -0x68(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1050 <micro_evaluate@plt>
mov    %eax,%ecx
movslq -0x2c(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
movslq -0x2c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
movslq -0x44(%rbp),%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jle    13e7 <micro_apply_bitmask+0x2b7>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    13ec <micro_apply_bitmask+0x2bc>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13a8 <micro_apply_bitmask+0x278>
jmp    13ff <micro_apply_bitmask+0x2cf>
cmpl   $0x0,-0x14(%rbp)
je     1487 <micro_apply_bitmask+0x357>
mov    -0x44(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xc02(%rip),%rdx
lea    0xbf1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xbd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1479 <micro_apply_bitmask+0x349>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    1474 <micro_apply_bitmask+0x344>
mov    -0x2c(%rbp),%esi
movslq -0x2c(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xbc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1443 <micro_apply_bitmask+0x313>
jmp    1479 <micro_apply_bitmask+0x349>
lea    0xba9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    150c <micro_apply_bitmask+0x3dc>
mov    -0x70(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    -0x28(%rbp),%eax
cmp    $0x0,%eax
je     14f9 <micro_apply_bitmask+0x3c9>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14e8 <micro_apply_bitmask+0x3b8>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    14f4 <micro_apply_bitmask+0x3c4>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
jmp    14f9 <micro_apply_bitmask+0x3c9>
jmp    14fe <micro_apply_bitmask+0x3ce>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    149b <micro_apply_bitmask+0x36b>
mov    -0x44(%rbp),%eax
mov    -0x50(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<micro_apply_bitmask>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,-0x3c(%rbp)
mov    %rdx,-0x60(%rbp)
mov    %esi,%ebx
mov    %rdi,-0x50(%rbp)
mov    %rsp,-0x58(%rbp)
mov    %esi,%edx
imul   %edx,%edx
mov    %rsp,%rdi
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
xor    %r13d,%r13d
mov    %rdi,-0x48(%rbp)
xor    %esi,%esi
mov    %rdx,-0x38(%rbp)
call   1050 <memset@plt>
mov    %ebx,-0x2c(%rbp)
test   %ebx,%ebx
jle    1266 <micro_apply_bitmask+0x126>
mov    -0x2c(%rbp),%r10d
mov    $0x1,%r11d
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
xor    %ebx,%ebx
jmp    11db <micro_apply_bitmask+0x9b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0x1,%r11d
add    $0x2,%r13d
add    %r10,%r9
add    %r10,%r8
cmp    %r10,%rbx
je     1266 <micro_apply_bitmask+0x126>
mov    %ebx,%eax
shr    %eax
mov    %eax,-0x30(%rbp)
xor    %edx,%edx
xor    %eax,%eax
mov    %ebx,%ecx
xor    %r12d,%r12d
jmp    1201 <micro_apply_bitmask+0xc1>
nopl   (%rax)
add    $0x1,%r12
add    %r11d,%ecx
add    %ebx,%eax
add    %r13d,%edx
cmp    %r12,%r10
je     11c0 <micro_apply_bitmask+0x80>
cmpb   $0xf,(%r9,%r12,1)
ja     11f0 <micro_apply_bitmask+0xb0>
mov    %eax,%esi
mov    $0xaaaaaaab,%edi
imul   %rdi,%rsi
shr    $0x21,%rsi
test   $0x1,%bl
jne    1221 <micro_apply_bitmask+0xe1>
orb    $0x1,(%r8,%r12,1)
lea    (%rsi,%rsi,2),%r14d
mov    %edx,%r15d
sub    %r14d,%r15d
mov    %r12d,%esi
mov    $0xaaaaaaab,%edi
imul   %rdi,%rsi
shr    $0x21,%rsi
add    -0x30(%rbp),%esi
test   $0x1,%sil
jne    1249 <micro_apply_bitmask+0x109>
orb    $0x2,(%r8,%r12,1)
mov    %ecx,%esi
sub    %r14d,%esi
test   $0x1,%r15b
jne    1259 <micro_apply_bitmask+0x119>
orb    $0x4,(%r8,%r12,1)
test   $0x1,%sil
jne    11f0 <micro_apply_bitmask+0xb0>
orb    $0x8,(%r8,%r12,1)
jmp    11f0 <micro_apply_bitmask+0xb0>
mov    -0x60(%rbp),%r12
test   %r12d,%r12d
je     12a2 <micro_apply_bitmask+0x162>
add    $0xffffffff,%r12d
cmpl   $0x0,-0x3c(%rbp)
je     12ca <micro_apply_bitmask+0x18a>
lea    0xda0(%rip),%rdi
lea    0xda7(%rip),%rdx
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x50(%rbp),%r14
mov    -0x38(%rbp),%r15
mov    -0x48(%rbp),%r13
jmp    1577 <micro_apply_bitmask+0x437>
mov    -0x38(%rbp),%rdi
test   %rdi,%rdi
mov    -0x50(%rbp),%r14
mov    -0x48(%rbp),%r13
mov    -0x88(%rbp),%r12
je     147c <micro_apply_bitmask+0x33c>
cmp    $0x8,%edi
jae    12df <micro_apply_bitmask+0x19f>
xor    %eax,%eax
jmp    1460 <micro_apply_bitmask+0x320>
mov    -0x50(%rbp),%r14
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%r15
mov    -0x48(%rbp),%r13
jmp    1585 <micro_apply_bitmask+0x445>
cmp    $0x20,%edi
jae    12eb <micro_apply_bitmask+0x1ab>
xor    %eax,%eax
jmp    1408 <micro_apply_bitmask+0x2c8>
mov    %edi,%eax
and    $0x7fffffe0,%eax
lea    -0x20(%rax),%rcx
mov    %rcx,%rdx
shr    $0x5,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     162a <micro_apply_bitmask+0x4ea>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
movdqa 0xce5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movdqu (%r14,%rcx,1),%xmm1
movdqu 0x10(%r14,%rcx,1),%xmm2
pand   %xmm0,%xmm1
pand   %xmm0,%xmm2
pxor   %xmm3,%xmm3
psubb  %xmm1,%xmm3
pxor   %xmm1,%xmm1
psubb  %xmm2,%xmm1
pxor   0x0(%r13,%rcx,1),%xmm3
pxor   0x10(%r13,%rcx,1),%xmm1
movdqa %xmm3,(%r12,%rcx,1)
movdqa %xmm1,0x10(%r12,%rcx,1)
movdqu 0x20(%r14,%rcx,1),%xmm1
movdqu 0x30(%r14,%rcx,1),%xmm2
pand   %xmm0,%xmm1
pand   %xmm0,%xmm2
pxor   %xmm3,%xmm3
psubb  %xmm1,%xmm3
pxor   %xmm1,%xmm1
psubb  %xmm2,%xmm1
pxor   0x20(%r13,%rcx,1),%xmm3
pxor   0x30(%r13,%rcx,1),%xmm1
movdqa %xmm3,0x20(%r12,%rcx,1)
movdqa %xmm1,0x30(%r12,%rcx,1)
add    $0x40,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1320 <micro_apply_bitmask+0x1e0>
test   $0x1,%dl
je     13fd <micro_apply_bitmask+0x2bd>
movdqu (%r14,%rcx,1),%xmm0
movdqu 0x10(%r14,%rcx,1),%xmm1
movdqa 0xc36(%rip),%xmm2
pand   %xmm2,%xmm0
pand   %xmm2,%xmm1
pxor   %xmm2,%xmm2
pxor   %xmm3,%xmm3
psubb  %xmm0,%xmm3
psubb  %xmm1,%xmm2
pxor   0x0(%r13,%rcx,1),%xmm3
pxor   0x10(%r13,%rcx,1),%xmm2
movdqa %xmm3,(%r12,%rcx,1)
movdqa %xmm2,0x10(%r12,%rcx,1)
cmp    %rdi,%rax
je     147c <micro_apply_bitmask+0x33c>
test   $0x18,%dil
je     1460 <micro_apply_bitmask+0x320>
mov    %rax,%rcx
mov    %edi,%eax
and    $0x7ffffff8,%eax
movdqa 0xbf6(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movq   (%r14,%rcx,1),%xmm1
pand   %xmm0,%xmm1
pxor   %xmm2,%xmm2
psubb  %xmm1,%xmm2
movq   0x0(%r13,%rcx,1),%xmm1
pxor   %xmm2,%xmm1
movq   %xmm1,(%r12,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rax
jne    1420 <micro_apply_bitmask+0x2e0>
cmp    %rdi,%rax
je     147c <micro_apply_bitmask+0x33c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rax,1),%ecx
and    $0x1,%cl
neg    %cl
xor    0x0(%r13,%rax,1),%cl
mov    %cl,(%r12,%rax,1)
add    $0x1,%rax
cmp    %rax,%rdi
jne    1460 <micro_apply_bitmask+0x320>
mov    %r12,%rdi
mov    -0x2c(%rbp),%ebx
mov    %ebx,%esi
xor    %edx,%edx
call   1060 <micro_evaluate@plt>
mov    %eax,%r15d
mov    %eax,-0x80(%rbp)
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1060 <micro_evaluate@plt>
mov    %eax,-0x7c(%rbp)
xor    %r12d,%r12d
mov    %r15d,-0x30(%rbp)
mov    %eax,-0x60(%rbp)
cmp    %r15d,%eax
setg   %r12b
mov    -0x88(%rbp),%rbx
mov    %rbx,%rdi
mov    -0x2c(%rbp),%r15d
mov    %r15d,%esi
mov    $0x2,%edx
call   1060 <micro_evaluate@plt>
mov    %eax,-0x78(%rbp)
mov    %eax,-0x64(%rbp)
cmp    -0x80(%rbp,%r12,4),%eax
mov    $0x2,%eax
cmovg  %eax,%r12d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    $0x3,%edx
call   1060 <micro_evaluate@plt>
mov    %eax,%ebx
mov    %eax,-0x74(%rbp)
cmp    -0x80(%rbp,%r12,4),%eax
mov    $0x3,%eax
cmovg  %eax,%r12d
cmpl   $0x0,-0x3c(%rbp)
je     161d <micro_apply_bitmask+0x4dd>
lea    0xb09(%rip),%rdi
lea    0xb1a(%rip),%rdx
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb13(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    -0x30(%rbp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    -0x60(%rbp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    -0x64(%rbp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x38(%rbp),%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%rdi
mov    $0x1,%eax
mov    %r12d,%ecx
shl    %cl,%eax
test   %r15,%r15
je     15b8 <micro_apply_bitmask+0x478>
cmp    $0x1,%r15d
jne    15cd <micro_apply_bitmask+0x48d>
xor    %ecx,%ecx
test   $0x1,%r15b
je     15b8 <micro_apply_bitmask+0x478>
movzbl 0x0(%r13,%rcx,1),%edx
test   %edx,%eax
je     15b8 <micro_apply_bitmask+0x478>
mov    (%r14,%rcx,1),%al
not    %al
and    $0x1,%al
mov    %al,(%r14,%rcx,1)
mov    %rdi,%rsp
mov    %r12d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15d,%edx
and    $0x7ffffffe,%edx
xor    %ecx,%ecx
jmp    15e9 <micro_apply_bitmask+0x4a9>
nopw   0x0(%rax,%rax,1)
add    $0x2,%rcx
cmp    %rcx,%rdx
je     159c <micro_apply_bitmask+0x45c>
movzbl 0x0(%r13,%rcx,1),%esi
test   %esi,%eax
je     1601 <micro_apply_bitmask+0x4c1>
movzbl (%r14,%rcx,1),%ebx
not    %bl
and    $0x1,%bl
mov    %bl,(%r14,%rcx,1)
movzbl 0x1(%r13,%rcx,1),%esi
test   %esi,%eax
je     15e0 <micro_apply_bitmask+0x4a0>
movzbl 0x1(%r14,%rcx,1),%ebx
not    %bl
and    $0x1,%bl
mov    %bl,0x1(%r14,%rcx,1)
jmp    15e0 <micro_apply_bitmask+0x4a0>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%r15
jmp    1585 <micro_apply_bitmask+0x445>
xor    %ecx,%ecx
test   $0x1,%dl
jne    13b5 <micro_apply_bitmask+0x275>
jmp    13fd <micro_apply_bitmask+0x2bd>

LLVM IR (-O0):
@.str = [14 x i8] c"Mask: %d (%s)\00"
@.str.1 = [10 x i8] c"specified\00"
@.str.2 = [10 x i8] c"automatic\00"
@.str.3 = [7 x i8] c" %d:%d\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @micro_apply_bitmask(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [4 x i32]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i64
%20 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %17
%24 = load i32, i32* %17
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
store i8* %26, i8** %18
%27 = alloca i8, i64 %25
store i64 %25, i64* %19
%28 = load i32, i32* %17
%29 = zext i32 %28 to i64
%30 = alloca i8, i64 %29
store i64 %29, i64* %20
%31 = load i32, i32* %17
%32 = call i32 @memset(i8* %27, i32 0, i32 %31)
store i32 0, i32* %10
br label %33
33: ; preds = %138, %4
%34 = load i32, i32* %10
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %141
37: ; preds = %33
%38 = load i32, i32* %10
%39 = load i32, i32* %6
%40 = mul nsw i32 %38, %39
store i32 %40, i32* %11
store i32 0, i32* %9
br label %41
41: ; preds = %134, %37
%42 = load i32, i32* %9
%43 = load i32, i32* %6
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %137
45: ; preds = %41
%46 = load i8*, i8** %5
%47 = load i32, i32* %11
%48 = load i32, i32* %9
%49 = add nsw i32 %47, %48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %46, i64 %50
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = and i32 %53, 240
%55 = icmp ne i32 %54, 0
br i1 %55, label %133, label %56
56: ; preds = %45
%57 = load i32, i32* %10
%58 = and i32 %57, 1
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %70
60: ; preds = %56
%61 = load i32, i32* %11
%62 = load i32, i32* %9
%63 = add nsw i32 %61, %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %27, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = or i32 %67, 1
%69 = trunc i32 %68 to i8
store i8 %69, i8* %65
br label %70
70: ; preds = %60, %56
%71 = load i32, i32* %10
%72 = sdiv i32 %71, 2
%73 = load i32, i32* %9
%74 = sdiv i32 %73, 3
%75 = add nsw i32 %72, %74
%76 = and i32 %75, 1
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %88
78: ; preds = %70
%79 = load i32, i32* %11
%80 = load i32, i32* %9
%81 = add nsw i32 %79, %80
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %27, i64 %82
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = or i32 %85, 2
%87 = trunc i32 %86 to i8
store i8 %87, i8* %83
br label %88
88: ; preds = %78, %70
%89 = load i32, i32* %10
%90 = load i32, i32* %9
%91 = mul nsw i32 %89, %90
%92 = and i32 %91, 1
%93 = load i32, i32* %10
%94 = load i32, i32* %9
%95 = mul nsw i32 %93, %94
%96 = srem i32 %95, 3
%97 = add nsw i32 %92, %96
%98 = and i32 %97, 1
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %110
100: ; preds = %88
%101 = load i32, i32* %11
%102 = load i32, i32* %9
%103 = add nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %27, i64 %104
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = or i32 %107, 4
%109 = trunc i32 %108 to i8
store i8 %109, i8* %105
br label %110
110: ; preds = %100, %88
%111 = load i32, i32* %10
%112 = load i32, i32* %9
%113 = add nsw i32 %111, %112
%114 = and i32 %113, 1
%115 = load i32, i32* %10
%116 = load i32, i32* %9
%117 = mul nsw i32 %115, %116
%118 = srem i32 %117, 3
%119 = add nsw i32 %114, %118
%120 = and i32 %119, 1
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %132
122: ; preds = %110
%123 = load i32, i32* %11
%124 = load i32, i32* %9
%125 = add nsw i32 %123, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8, i8* %27, i64 %126
%128 = load i8, i8* %127
%129 = zext i8 %128 to i32
%130 = or i32 %129, 8
%131 = trunc i32 %130 to i8
store i8 %131, i8* %127
br label %132
132: ; preds = %122, %110
br label %133
133: ; preds = %132, %45
br label %134
134: ; preds = %133
%135 = load i32, i32* %9
%136 = add nsw i32 %135, 1
store i32 %136, i32* %9
br label %41
137: ; preds = %41
br label %138
138: ; preds = %137
%139 = load i32, i32* %10
%140 = add nsw i32 %139, 1
store i32 %140, i32* %10
br label %33
141: ; preds = %33
%142 = load i32, i32* %7
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %141
%145 = load i32, i32* %7
%146 = sub nsw i32 %145, 1
store i32 %146, i32* %16
br label %211
147: ; preds = %141
store i32 0, i32* %12
br label %148
148: ; preds = %181, %147
%149 = load i32, i32* %12
%150 = load i32, i32* %17
%151 = icmp slt i32 %149, %150
br i1 %151, label %152, label %184
152: ; preds = %148
%153 = load i8*, i8** %5
%154 = load i32, i32* %12
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = load i8, i8* %156
%158 = zext i8 %157 to i32
%159 = and i32 %158, 1
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %172
161: ; preds = %152
%162 = load i32, i32* %12
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %27, i64 %163
%165 = load i8, i8* %164
%166 = zext i8 %165 to i32
%167 = xor i32 %166, 255
%168 = trunc i32 %167 to i8
%169 = load i32, i32* %12
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i8, i8* %30, i64 %170
store i8 %168, i8* %171
br label %180
172: ; preds = %152
%173 = load i32, i32* %12
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %27, i64 %174
%176 = load i8, i8* %175
%177 = load i32, i32* %12
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8, i8* %30, i64 %178
store i8 %176, i8* %179
br label %180
180: ; preds = %172, %161
br label %181
181: ; preds = %180
%182 = load i32, i32* %12
%183 = add nsw i32 %182, 1
store i32 %183, i32* %12
br label %148
184: ; preds = %148
store i32 0, i32* %16
store i32 0, i32* %14
br label %185
185: ; preds = %207, %184
%186 = load i32, i32* %14
%187 = icmp slt i32 %186, 4
br i1 %187, label %188, label %210
188: ; preds = %185
%189 = load i32, i32* %6
%190 = load i32, i32* %14
%191 = call i32 @micro_evaluate(i8* %30, i32 %189, i32 %190)
%192 = load i32, i32* %14
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %193
store i32 %191, i32* %194
%195 = load i32, i32* %14
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %196
%198 = load i32, i32* %197
%199 = load i32, i32* %16
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %200
%202 = load i32, i32* %201
%203 = icmp sgt i32 %198, %202
br i1 %203, label %204, label %206
204: ; preds = %188
%205 = load i32, i32* %14
store i32 %205, i32* %16
br label %206
206: ; preds = %204, %188
br label %207
207: ; preds = %206
%208 = load i32, i32* %14
%209 = add nsw i32 %208, 1
store i32 %209, i32* %14
br label %185
210: ; preds = %185
br label %211
211: ; preds = %210, %144
%212 = load i32, i32* %8
%213 = icmp ne i32 %212, 0
br i1 %213, label %214, label %240
214: ; preds = %211
%215 = load i32, i32* %16
%216 = load i32, i32* %7
%217 = icmp ne i32 %216, 0
%218 = zext i1 %217 to i64
%219 = select i1 %217, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %215, i8* %219)
%221 = load i32, i32* %7
%222 = icmp ne i32 %221, 0
br i1 %222, label %238, label %223
223: ; preds = %214
store i32 0, i32* %14
br label %224
224: ; preds = %234, %223
%225 = load i32, i32* %14
%226 = icmp slt i32 %225, 4
br i1 %226, label %227, label %237
227: ; preds = %224
%228 = load i32, i32* %14
%229 = load i32, i32* %14
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 %230
%232 = load i32, i32* %231
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %228, i32 %232)
br label %234
234: ; preds = %227
%235 = load i32, i32* %14
%236 = add nsw i32 %235, 1
store i32 %236, i32* %14
br label %224
237: ; preds = %224
br label %238
238: ; preds = %237, %214
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %240
240: ; preds = %238, %211
%241 = load i32, i32* %16
%242 = shl i32 1, %241
store i32 %242, i32* %13
store i32 0, i32* %12
br label %243
243: ; preds = %277, %240
%244 = load i32, i32* %12
%245 = load i32, i32* %17
%246 = icmp slt i32 %244, %245
br i1 %246, label %247, label %280
247: ; preds = %243
%248 = load i32, i32* %12
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i8, i8* %27, i64 %249
%251 = load i8, i8* %250
%252 = zext i8 %251 to i32
%253 = load i32, i32* %13
%254 = and i32 %252, %253
%255 = icmp ne i32 %254, 0
br i1 %255, label %256, label %276
256: ; preds = %247
%257 = load i8*, i8** %5
%258 = load i32, i32* %12
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds i8, i8* %257, i64 %259
%261 = load i8, i8* %260
%262 = zext i8 %261 to i32
%263 = and i32 %262, 1
%264 = icmp ne i32 %263, 0
br i1 %264, label %265, label %270
265: ; preds = %256
%266 = load i8*, i8** %5
%267 = load i32, i32* %12
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %266, i64 %268
store i8 0, i8* %269
br label %275
270: ; preds = %256
%271 = load i8*, i8** %5
%272 = load i32, i32* %12
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds i8, i8* %271, i64 %273
store i8 1, i8* %274
br label %275
275: ; preds = %270, %265
br label %276
276: ; preds = %275, %247
br label %277
277: ; preds = %276
%278 = load i32, i32* %12
%279 = add nsw i32 %278, 1
store i32 %279, i32* %12
br label %243
280: ; preds = %243
%281 = load i32, i32* %16
%282 = load i8*, i8** %18
ret i32 %281
}

LLVM IR (-O2):
@.str = [14 x i8] c"Mask: %d (%s)\00"
@.str.1 = [10 x i8] c"specified\00"
@.str.2 = [10 x i8] c"automatic\00"
@.str.3 = [7 x i8] c" %d:%d\00"
define i32 @micro_apply_bitmask(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = mul nsw i32 %1, %1
%8 = zext i32 %7 to i64
%9 = tail call i8* @llvm.stacksave()
%10 = alloca i8, i64 %8
%11 = alloca i8, i64 %8
%12 = call i32 @memset(i8* %10, i32 0, i32 %7)
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %72
14: ; preds = %4
%15 = zext i32 %1 to i64
%16 = zext i32 %1 to i64
br label %17
17: ; preds = %69, %14
%18 = phi i64 [ 0, %14 ], [ %70, %69 ]
%19 = mul nsw i64 %18, %15
%20 = trunc i64 %18 to i32
%21 = and i32 %20, 1
%22 = icmp eq i32 %21, 0
%23 = lshr i32 %20, 1
br label %24
24: ; preds = %17, %66
%25 = phi i64 [ 0, %17 ], [ %67, %66 ]
%26 = add nuw nsw i64 %25, %19
%27 = getelementptr inbounds i8, i8* %0, i64 %26
%28 = load i8, i8* %27
%29 = icmp ult i8 %28, 16
br i1 %29, label %30, label %66
30: ; preds = %24
br i1 %22, label %31, label %35
31: ; preds = %30
%32 = getelementptr inbounds i8, i8* %10, i64 %26
%33 = load i8, i8* %32
%34 = or i8 %33, 1
store i8 %34, i8* %32
br label %35
35: ; preds = %31, %30
%36 = trunc i64 %25 to i32
%37 = udiv i32 %36, 3
%38 = add nuw nsw i32 %37, %23
%39 = and i32 %38, 1
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %35
%42 = getelementptr inbounds i8, i8* %10, i64 %26
%43 = load i8, i8* %42
%44 = or i8 %43, 2
store i8 %44, i8* %42
br label %45
45: ; preds = %41, %35
%46 = mul nuw nsw i64 %25, %18
%47 = trunc i64 %46 to i32
%48 = urem i32 %47, 3
%49 = add nuw i32 %48, %47
%50 = and i32 %49, 1
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %45
%53 = getelementptr inbounds i8, i8* %10, i64 %26
%54 = load i8, i8* %53
%55 = or i8 %54, 4
store i8 %55, i8* %53
br label %56
56: ; preds = %52, %45
%57 = add nuw nsw i64 %25, %18
%58 = trunc i64 %57 to i32
%59 = add nuw i32 %48, %58
%60 = and i32 %59, 1
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %56
%63 = getelementptr inbounds i8, i8* %10, i64 %26
%64 = load i8, i8* %63
%65 = or i8 %64, 8
store i8 %65, i8* %63
br label %66
66: ; preds = %24, %62, %56
%67 = add nuw nsw i64 %25, 1
%68 = icmp eq i64 %67, %16
br i1 %68, label %69, label %24
69: ; preds = %66
%70 = add nuw nsw i64 %18, 1
%71 = icmp eq i64 %70, %16
br i1 %71, label %72, label %17
72: ; preds = %69, %4
%73 = icmp eq i32 %2, 0
br i1 %73, label %74, label %227
74: ; preds = %72
%75 = icmp eq i32 %7, 0
br i1 %75, label %193, label %76
76: ; preds = %74
%77 = icmp ult i32 %7, 8
br i1 %77, label %191, label %78
78: ; preds = %76
%79 = icmp ult i32 %7, 32
br i1 %79, label %171, label %80
80: ; preds = %78
%81 = and i64 %8, 2147483616
%82 = add nsw i64 %81, -32
%83 = lshr exact i64 %82, 5
%84 = add nuw nsw i64 %83, 1
%85 = and i64 %84, 1
%86 = icmp eq i64 %82, 0
br i1 %86, label %140, label %87
87: ; preds = %80
%88 = and i64 %84, 1152921504606846974
br label %89
89: ; preds = %89, %87
%90 = phi i64 [ 0, %87 ], [ %137, %89 ]
%91 = phi i64 [ 0, %87 ], [ %138, %89 ]
%92 = getelementptr inbounds i8, i8* %0, i64 %90
%93 = bitcast i8* %92 to <16 x i8>*
%94 = load <16 x i8>, <16 x i8>* %93
%95 = getelementptr inbounds i8, i8* %92, i64 16
%96 = bitcast i8* %95 to <16 x i8>*
%97 = load <16 x i8>, <16 x i8>* %96
%98 = getelementptr inbounds i8, i8* %10, i64 %90
%99 = bitcast i8* %98 to <16 x i8>*
%100 = load <16 x i8>, <16 x i8>* %99
%101 = getelementptr inbounds i8, i8* %98, i64 16
%102 = bitcast i8* %101 to <16 x i8>*
%103 = load <16 x i8>, <16 x i8>* %102
%104 = and <16 x i8> %94, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%105 = and <16 x i8> %97, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%106 = sub nsw <16 x i8> zeroinitializer, %104
%107 = sub nsw <16 x i8> zeroinitializer, %105
%108 = xor <16 x i8> %100, %106
%109 = xor <16 x i8> %103, %107
%110 = getelementptr inbounds i8, i8* %11, i64 %90
%111 = bitcast i8* %110 to <16 x i8>*
store <16 x i8> %108, <16 x i8>* %111
%112 = getelementptr inbounds i8, i8* %110, i64 16
%113 = bitcast i8* %112 to <16 x i8>*
store <16 x i8> %109, <16 x i8>* %113
%114 = or i64 %90, 32
%115 = getelementptr inbounds i8, i8* %0, i64 %114
%116 = bitcast i8* %115 to <16 x i8>*
%117 = load <16 x i8>, <16 x i8>* %116
%118 = getelementptr inbounds i8, i8* %115, i64 16
%119 = bitcast i8* %118 to <16 x i8>*
%120 = load <16 x i8>, <16 x i8>* %119
%121 = getelementptr inbounds i8, i8* %10, i64 %114
%122 = bitcast i8* %121 to <16 x i8>*
%123 = load <16 x i8>, <16 x i8>* %122
%124 = getelementptr inbounds i8, i8* %121, i64 16
%125 = bitcast i8* %124 to <16 x i8>*
%126 = load <16 x i8>, <16 x i8>* %125
%127 = and <16 x i8> %117, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%128 = and <16 x i8> %120, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%129 = sub nsw <16 x i8> zeroinitializer, %127
%130 = sub nsw <16 x i8> zeroinitializer, %128
%131 = xor <16 x i8> %123, %129
%132 = xor <16 x i8> %126, %130
%133 = getelementptr inbounds i8, i8* %11, i64 %114
%134 = bitcast i8* %133 to <16 x i8>*
store <16 x i8> %131, <16 x i8>* %134
%135 = getelementptr inbounds i8, i8* %133, i64 16
%136 = bitcast i8* %135 to <16 x i8>*
store <16 x i8> %132, <16 x i8>* %136
%137 = add nuw i64 %90, 64
%138 = add i64 %91, 2
%139 = icmp eq i64 %138, %88
br i1 %139, label %140, label %89
140: ; preds = %89, %80
%141 = phi i64 [ 0, %80 ], [ %137, %89 ]
%142 = icmp eq i64 %85, 0
br i1 %142, label %166, label %143
143: ; preds = %140
%144 = getelementptr inbounds i8, i8* %0, i64 %141
%145 = bitcast i8* %144 to <16 x i8>*
%146 = load <16 x i8>, <16 x i8>* %145
%147 = getelementptr inbounds i8, i8* %144, i64 16
%148 = bitcast i8* %147 to <16 x i8>*
%149 = load <16 x i8>, <16 x i8>* %148
%150 = getelementptr inbounds i8, i8* %10, i64 %141
%151 = bitcast i8* %150 to <16 x i8>*
%152 = load <16 x i8>, <16 x i8>* %151
%153 = getelementptr inbounds i8, i8* %150, i64 16
%154 = bitcast i8* %153 to <16 x i8>*
%155 = load <16 x i8>, <16 x i8>* %154
%156 = and <16 x i8> %146, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%157 = and <16 x i8> %149, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%158 = sub nsw <16 x i8> zeroinitializer, %156
%159 = sub nsw <16 x i8> zeroinitializer, %157
%160 = xor <16 x i8> %152, %158
%161 = xor <16 x i8> %155, %159
%162 = getelementptr inbounds i8, i8* %11, i64 %141
%163 = bitcast i8* %162 to <16 x i8>*
store <16 x i8> %160, <16 x i8>* %163
%164 = getelementptr inbounds i8, i8* %162, i64 16
%165 = bitcast i8* %164 to <16 x i8>*
store <16 x i8> %161, <16 x i8>* %165
br label %166
166: ; preds = %140, %143
%167 = icmp eq i64 %81, %8
br i1 %167, label %193, label %168
168: ; preds = %166
%169 = and i64 %8, 24
%170 = icmp eq i64 %169, 0
br i1 %170, label %191, label %171
171: ; preds = %78, %168
%172 = phi i64 [ %81, %168 ], [ 0, %78 ]
%173 = and i64 %8, 2147483640
br label %174
174: ; preds = %174, %171
%175 = phi i64 [ %172, %171 ], [ %187, %174 ]
%176 = getelementptr inbounds i8, i8* %0, i64 %175
%177 = bitcast i8* %176 to <8 x i8>*
%178 = load <8 x i8>, <8 x i8>* %177
%179 = getelementptr inbounds i8, i8* %10, i64 %175
%180 = bitcast i8* %179 to <8 x i8>*
%181 = load <8 x i8>, <8 x i8>* %180
%182 = and <8 x i8> %178, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%183 = sub nsw <8 x i8> zeroinitializer, %182
%184 = xor <8 x i8> %181, %183
%185 = getelementptr inbounds i8, i8* %11, i64 %175
%186 = bitcast i8* %185 to <8 x i8>*
store <8 x i8> %184, <8 x i8>* %186
%187 = add nuw i64 %175, 8
%188 = icmp eq i64 %187, %173
br i1 %188, label %189, label %174
189: ; preds = %174
%190 = icmp eq i64 %173, %8
br i1 %190, label %193, label %191
191: ; preds = %76, %168, %189
%192 = phi i64 [ 0, %76 ], [ %81, %168 ], [ %173, %189 ]
br label %215
193: ; preds = %215, %166, %189, %74
%194 = call i32 @micro_evaluate(i8* %11, i32 %1, i32 0)
%195 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %194, i32* %195
%196 = call i32 @micro_evaluate(i8* %11, i32 %1, i32 1)
%197 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %196, i32* %197
%198 = icmp sgt i32 %196, %194
%199 = zext i1 %198 to i32
%200 = call i32 @micro_evaluate(i8* %11, i32 %1, i32 2)
%201 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %200, i32* %201
%202 = zext i1 %198 to i64
%203 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %202
%204 = load i32, i32* %203
%205 = icmp sgt i32 %200, %204
%206 = select i1 %205, i32 2, i32 %199
%207 = call i32 @micro_evaluate(i8* %11, i32 %1, i32 3)
%208 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %207, i32* %208
%209 = zext i32 %206 to i64
%210 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %209
%211 = load i32, i32* %210
%212 = icmp sgt i32 %207, %211
%213 = select i1 %212, i32 3, i32 %206
%214 = icmp eq i32 %3, 0
br i1 %214, label %241, label %232
215: ; preds = %191, %215
%216 = phi i64 [ %225, %215 ], [ %192, %191 ]
%217 = getelementptr inbounds i8, i8* %0, i64 %216
%218 = load i8, i8* %217
%219 = getelementptr inbounds i8, i8* %10, i64 %216
%220 = load i8, i8* %219
%221 = and i8 %218, 1
%222 = sub nsw i8 0, %221
%223 = xor i8 %220, %222
%224 = getelementptr inbounds i8, i8* %11, i64 %216
store i8 %223, i8* %224
%225 = add nuw nsw i64 %216, 1
%226 = icmp eq i64 %225, %8
br i1 %226, label %193, label %215
227: ; preds = %72
%228 = add nsw i32 %2, -1
%229 = icmp eq i32 %3, 0
br i1 %229, label %241, label %230
230: ; preds = %227
%231 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %228, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %238
232: ; preds = %193
%233 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %213, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%234 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %194)
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %196)
%236 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %200)
%237 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %207)
br label %238
238: ; preds = %232, %230
%239 = phi i32 [ %228, %230 ], [ %213, %232 ]
%240 = call i32 @putchar(i32 10)
br label %241
241: ; preds = %227, %238, %193
%242 = phi i32 [ %228, %227 ], [ %239, %238 ], [ %213, %193 ]
%243 = shl nuw i32 1, %242
%244 = icmp eq i32 %7, 0
br i1 %244, label %293, label %245
245: ; preds = %241
%246 = and i64 %8, 1
%247 = icmp eq i32 %7, 1
br i1 %247, label %279, label %248
248: ; preds = %245
%249 = and i64 %8, 2147483646
br label %250
250: ; preds = %275, %248
%251 = phi i64 [ 0, %248 ], [ %276, %275 ]
%252 = phi i64 [ 0, %248 ], [ %277, %275 ]
%253 = getelementptr inbounds i8, i8* %10, i64 %251
%254 = load i8, i8* %253
%255 = zext i8 %254 to i32
%256 = and i32 %243, %255
%257 = icmp eq i32 %256, 0
br i1 %257, label %263, label %258
258: ; preds = %250
%259 = getelementptr inbounds i8, i8* %0, i64 %251
%260 = load i8, i8* %259
%261 = and i8 %260, 1
%262 = xor i8 %261, 1
store i8 %262, i8* %259
br label %263
263: ; preds = %258, %250
%264 = or i64 %251, 1
%265 = getelementptr inbounds i8, i8* %10, i64 %264
%266 = load i8, i8* %265
%267 = zext i8 %266 to i32
%268 = and i32 %243, %267
%269 = icmp eq i32 %268, 0
br i1 %269, label %275, label %270
270: ; preds = %263
%271 = getelementptr inbounds i8, i8* %0, i64 %264
%272 = load i8, i8* %271
%273 = and i8 %272, 1
%274 = xor i8 %273, 1
store i8 %274, i8* %271
br label %275
275: ; preds = %270, %263
%276 = add nuw nsw i64 %251, 2
%277 = add i64 %252, 2
%278 = icmp eq i64 %277, %249
br i1 %278, label %279, label %250
279: ; preds = %275, %245
%280 = phi i64 [ 0, %245 ], [ %276, %275 ]
%281 = icmp eq i64 %246, 0
br i1 %281, label %293, label %282
282: ; preds = %279
%283 = getelementptr inbounds i8, i8* %10, i64 %280
%284 = load i8, i8* %283
%285 = zext i8 %284 to i32
%286 = and i32 %243, %285
%287 = icmp eq i32 %286, 0
br i1 %287, label %293, label %288
288: ; preds = %282
%289 = getelementptr inbounds i8, i8* %0, i64 %280
%290 = load i8, i8* %289
%291 = and i8 %290, 1
%292 = xor i8 %291, 1
store i8 %292, i8* %289
br label %293
293: ; preds = %279, %288, %282, %241
ret i32 %242
}