#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 */
char get_piece(char *, char, char);
int can_capture(char *board, int isWhitesTurn) {
  int x, y;
  char kx, ky;
  for (y = 0; y < 8; y++) {
    for (x = 0; x < 8; x++) {
      if ((board[y * 8 + x] == 'K') && (isWhitesTurn == 1)) {
        kx = x + 'a';
        ky = 7 - y + '1';
      } else if ((board[y * 8 + x] == 'k') && (isWhitesTurn == 0)) {
        kx = x + 'a';
        ky = 7 - y + '1';
      }
    }
  }
  int canCap = 0;
  if (isWhitesTurn == 1) {
    if ((kx > 'a') && (ky < '7') && (get_piece(board, kx - 1, ky + 1) == 'p')) {
      canCap = 1;
    }
    if ((kx < 'h') && (ky < '7') && (get_piece(board, kx + 1, ky + 1) == 'p')) {
      canCap = 1;
    }
    if (kx < 'h') {
      char tmpx = kx + 1, tmpy = ky;
      int keepGoing = 1;
      while ((keepGoing == 1) && (tmpx <= 'h')) {
        char p = get_piece(board, tmpx, tmpy);
        if ((p == 'q') || (p == 'r')) {
          canCap = 1;
          keepGoing = 0;
        } else if (p != ' ') {
          keepGoing = 0;
        }
        tmpx++;
      }
    }
    if (kx > 'a') {
      char tmpx = kx - 1, tmpy = ky;
      int keepGoing = 1;
      while ((keepGoing == 1) && (tmpx >= 'a')) {
        char p = get_piece(board, tmpx, tmpy);
        if ((p == 'q') || (p == 'r')) {
          canCap = 1;
          keepGoing = 0;
        } else if (p != ' ') {
          keepGoing = 0;
        }
        tmpx--;
      }
    }
    if (ky < '8') {
      char tmpx = kx, tmpy = ky + 1;
      int keepGoing = 1;
      while ((keepGoing == 1) && (tmpy <= '8')) {
        char p = get_piece(board, tmpx, tmpy);
        if ((p == 'q') || (p == 'r')) {
          canCap = 1;
          keepGoing = 0;
        } else if (p != ' ') {
          keepGoing = 0;
        }
        tmpy++;
      }
    }
    if (ky > '1') {
      char tmpx = kx, tmpy = ky - 1;
      int keepGoing = 1;
      while ((keepGoing = 1) && (tmpy >= '1')) {
        char p = get_piece(board, tmpx, tmpy);
        if ((p == 'q') || (p == 'r')) {
          canCap = 1;
          keepGoing = 0;
        } else if (p != ' ') {
          keepGoing = 0;
        }
        tmpy--;
      }
    }
  }
  return canCap;
}


x86 assembly (clang, -O0):
<can_capture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11ed <can_capture+0xdd>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11da <can_capture+0xca>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4b,%eax
jne    1184 <can_capture+0x74>
cmpl   $0x1,-0xc(%rbp)
jne    1184 <can_capture+0x74>
mov    -0x10(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x15(%rbp)
mov    $0x7,%eax
sub    -0x14(%rbp),%eax
add    $0x31,%eax
mov    %al,-0x16(%rbp)
jmp    11c7 <can_capture+0xb7>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6b,%eax
jne    11c2 <can_capture+0xb2>
cmpl   $0x0,-0xc(%rbp)
jne    11c2 <can_capture+0xb2>
mov    -0x10(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x15(%rbp)
mov    $0x7,%eax
sub    -0x14(%rbp),%eax
add    $0x31,%eax
mov    %al,-0x16(%rbp)
jmp    11c7 <can_capture+0xb7>
jmp    11cc <can_capture+0xbc>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <can_capture+0x27>
jmp    11df <can_capture+0xcf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <can_capture+0x16>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    15a0 <can_capture+0x490>
movsbl -0x15(%rbp),%eax
cmp    $0x61,%eax
jle    124a <can_capture+0x13a>
movsbl -0x16(%rbp),%eax
cmp    $0x37,%eax
jge    124a <can_capture+0x13a>
mov    -0x8(%rbp),%rdi
movsbl -0x15(%rbp),%eax
sub    $0x1,%eax
mov    %al,%cl
movsbl -0x16(%rbp),%eax
add    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <get_piece@plt>
movsbl %al,%eax
cmp    $0x70,%eax
jne    124a <can_capture+0x13a>
movl   $0x1,-0x1c(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x68,%eax
jge    1296 <can_capture+0x186>
movsbl -0x16(%rbp),%eax
cmp    $0x37,%eax
jge    1296 <can_capture+0x186>
mov    -0x8(%rbp),%rdi
movsbl -0x15(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
movsbl -0x16(%rbp),%eax
add    $0x1,%eax
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <get_piece@plt>
movsbl %al,%eax
cmp    $0x70,%eax
jne    1296 <can_capture+0x186>
movl   $0x1,-0x1c(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x68,%eax
jge    1354 <can_capture+0x244>
movsbl -0x15(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1d(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x1e(%rbp)
movl   $0x1,-0x24(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x24(%rbp)
mov    %al,-0x3e(%rbp)
jne    12d6 <can_capture+0x1c6>
movsbl -0x1d(%rbp),%eax
cmp    $0x68,%eax
setle  %al
mov    %al,-0x3e(%rbp)
mov    -0x3e(%rbp),%al
test   $0x1,%al
jne    12e6 <can_capture+0x1d6>
jmp    134f <can_capture+0x23f>
mov    -0x8(%rbp),%rdi
mov    -0x1d(%rbp),%al
movsbl %al,%esi
movsbl -0x1e(%rbp),%edx
call   1030 <get_piece@plt>
mov    %al,-0x25(%rbp)
movsbl -0x25(%rbp),%eax
cmp    $0x71,%eax
je     1316 <can_capture+0x206>
movsbl -0x25(%rbp),%eax
cmp    $0x72,%eax
jne    1329 <can_capture+0x219>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    1342 <can_capture+0x232>
movsbl -0x25(%rbp),%eax
cmp    $0x20,%eax
je     133d <can_capture+0x22d>
movl   $0x0,-0x24(%rbp)
jmp    1342 <can_capture+0x232>
mov    -0x1d(%rbp),%al
add    $0x1,%al
mov    %al,-0x1d(%rbp)
jmp    12ba <can_capture+0x1aa>
jmp    1354 <can_capture+0x244>
movsbl -0x15(%rbp),%eax
cmp    $0x61,%eax
jle    1412 <can_capture+0x302>
movsbl -0x15(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x26(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x27(%rbp)
movl   $0x1,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x2c(%rbp)
mov    %al,-0x3f(%rbp)
jne    1394 <can_capture+0x284>
movsbl -0x26(%rbp),%eax
cmp    $0x61,%eax
setge  %al
mov    %al,-0x3f(%rbp)
mov    -0x3f(%rbp),%al
test   $0x1,%al
jne    13a4 <can_capture+0x294>
jmp    140d <can_capture+0x2fd>
mov    -0x8(%rbp),%rdi
mov    -0x26(%rbp),%al
movsbl %al,%esi
movsbl -0x27(%rbp),%edx
call   1030 <get_piece@plt>
mov    %al,-0x2d(%rbp)
movsbl -0x2d(%rbp),%eax
cmp    $0x71,%eax
je     13d4 <can_capture+0x2c4>
movsbl -0x2d(%rbp),%eax
cmp    $0x72,%eax
jne    13e7 <can_capture+0x2d7>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    1400 <can_capture+0x2f0>
movsbl -0x2d(%rbp),%eax
cmp    $0x20,%eax
je     13fb <can_capture+0x2eb>
movl   $0x0,-0x2c(%rbp)
jmp    1400 <can_capture+0x2f0>
mov    -0x26(%rbp),%al
add    $0xff,%al
mov    %al,-0x26(%rbp)
jmp    1378 <can_capture+0x268>
jmp    1412 <can_capture+0x302>
movsbl -0x16(%rbp),%eax
cmp    $0x38,%eax
jge    14d0 <can_capture+0x3c0>
mov    -0x15(%rbp),%al
mov    %al,-0x2e(%rbp)
movsbl -0x16(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x2f(%rbp)
movl   $0x1,-0x34(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x34(%rbp)
mov    %al,-0x40(%rbp)
jne    1452 <can_capture+0x342>
movsbl -0x2f(%rbp),%eax
cmp    $0x38,%eax
setle  %al
mov    %al,-0x40(%rbp)
mov    -0x40(%rbp),%al
test   $0x1,%al
jne    1462 <can_capture+0x352>
jmp    14cb <can_capture+0x3bb>
mov    -0x8(%rbp),%rdi
mov    -0x2e(%rbp),%al
movsbl %al,%esi
movsbl -0x2f(%rbp),%edx
call   1030 <get_piece@plt>
mov    %al,-0x35(%rbp)
movsbl -0x35(%rbp),%eax
cmp    $0x71,%eax
je     1492 <can_capture+0x382>
movsbl -0x35(%rbp),%eax
cmp    $0x72,%eax
jne    14a5 <can_capture+0x395>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x34(%rbp)
jmp    14be <can_capture+0x3ae>
movsbl -0x35(%rbp),%eax
cmp    $0x20,%eax
je     14b9 <can_capture+0x3a9>
movl   $0x0,-0x34(%rbp)
jmp    14be <can_capture+0x3ae>
mov    -0x2f(%rbp),%al
add    $0x1,%al
mov    %al,-0x2f(%rbp)
jmp    1436 <can_capture+0x326>
jmp    14d0 <can_capture+0x3c0>
movsbl -0x16(%rbp),%eax
cmp    $0x31,%eax
jle    159b <can_capture+0x48b>
mov    -0x15(%rbp),%al
mov    %al,-0x36(%rbp)
movsbl -0x16(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x37(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x1,-0x3c(%rbp)
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x41(%rbp)
jne    1510 <can_capture+0x400>
jmp    151d <can_capture+0x40d>
movsbl -0x37(%rbp),%eax
cmp    $0x31,%eax
setge  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    152d <can_capture+0x41d>
jmp    1596 <can_capture+0x486>
mov    -0x8(%rbp),%rdi
mov    -0x36(%rbp),%al
movsbl %al,%esi
movsbl -0x37(%rbp),%edx
call   1030 <get_piece@plt>
mov    %al,-0x3d(%rbp)
movsbl -0x3d(%rbp),%eax
cmp    $0x71,%eax
je     155d <can_capture+0x44d>
movsbl -0x3d(%rbp),%eax
cmp    $0x72,%eax
jne    1570 <can_capture+0x460>
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x3c(%rbp)
jmp    1589 <can_capture+0x479>
movsbl -0x3d(%rbp),%eax
cmp    $0x20,%eax
je     1584 <can_capture+0x474>
movl   $0x0,-0x3c(%rbp)
jmp    1589 <can_capture+0x479>
mov    -0x37(%rbp),%al
add    $0xff,%al
mov    %al,-0x37(%rbp)
jmp    14f4 <can_capture+0x3e4>
jmp    159b <can_capture+0x48b>
jmp    15a0 <can_capture+0x490>
mov    -0x1c(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_capture>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
mov    $0x38,%al
xor    %r10d,%r10d
mov    %rdi,0x8(%rsp)
nopl   0x0(%rax)
mov    0x14(%rsp),%ecx
test   %ecx,%ecx
sete   %sil
cmp    $0x1,%ecx
sete   %r8b
movzbl (%rdi,%r10,8),%r9d
mov    0x8(%rsp),%rcx
movzbl 0x1(%rcx,%r10,8),%edi
cmp    $0x4b,%r9b
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%r9b
sete   %dl
and    %sil,%dl
or     %cl,%dl
cmp    $0x4b,%dil
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%dil
sete   %r9b
and    %sil,%r9b
or     %cl,%r9b
mov    0x8(%rsp),%rcx
movzbl 0x2(%rcx,%r10,8),%edi
cmp    $0x4b,%dil
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%dil
sete   %r11b
and    %sil,%r11b
or     %cl,%r11b
mov    0x8(%rsp),%rcx
movzbl 0x3(%rcx,%r10,8),%edi
cmp    $0x4b,%dil
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%dil
sete   %r15b
and    %sil,%r15b
or     %cl,%r15b
mov    0x8(%rsp),%rcx
movzbl 0x4(%rcx,%r10,8),%edi
cmp    $0x4b,%dil
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%dil
sete   %r12b
and    %sil,%r12b
or     %cl,%r12b
mov    0x8(%rsp),%rcx
movzbl 0x5(%rcx,%r10,8),%edi
cmp    $0x4b,%dil
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%dil
sete   %r13b
and    %sil,%r13b
or     %cl,%r13b
mov    0x8(%rsp),%rcx
movzbl 0x6(%rcx,%r10,8),%ecx
cmp    $0x4b,%cl
sete   %r14b
and    %r8b,%r14b
cmp    $0x6b,%cl
sete   %dil
and    %sil,%dil
or     %r14b,%dil
mov    0x8(%rsp),%rcx
movzbl 0x7(%rcx,%r10,8),%r14d
cmp    $0x4b,%r14b
sete   %cl
and    %r8b,%cl
cmp    $0x6b,%r14b
sete   %r8b
and    %sil,%r8b
or     %cl,%r8b
test   %dl,%dl
movzbl %bpl,%ebp
mov    $0x61,%ecx
cmovne %ecx,%ebp
movzbl %al,%eax
movzbl %bl,%ebx
cmovne %eax,%ebx
test   %r9b,%r9b
mov    $0x62,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %r11b,%r11b
mov    $0x63,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %r15b,%r15b
mov    $0x64,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %r12b,%r12b
mov    $0x65,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %r13b,%r13b
mov    $0x66,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %dil,%dil
mov    0x8(%rsp),%rdi
mov    $0x67,%ecx
cmovne %ecx,%ebp
cmovne %eax,%ebx
test   %r8b,%r8b
cmovne %eax,%ebx
mov    $0x68,%ecx
cmovne %ecx,%ebp
add    $0x1,%r10
add    $0xff,%al
cmp    $0x8,%r10
jne    1130 <can_capture+0x20>
xor    %r12d,%r12d
cmpl   $0x1,0x14(%rsp)
jne    1470 <can_capture+0x360>
xor    %r12d,%r12d
cmp    $0x62,%bpl
jl     1319 <can_capture+0x209>
cmp    $0x36,%bl
jg     1319 <can_capture+0x209>
lea    -0x1(%rbp),%eax
lea    0x1(%rbx),%ecx
movsbl %al,%esi
movsbl %cl,%edx
mov    0x8(%rsp),%rdi
call   1030 <get_piece@plt>
xor    %r12d,%r12d
cmp    $0x70,%al
sete   %r12b
cmp    $0x67,%bpl
jg     1345 <can_capture+0x235>
cmp    $0x36,%bl
jg     1345 <can_capture+0x235>
lea    0x1(%rbp),%eax
lea    0x1(%rbx),%ecx
movsbl %al,%esi
movsbl %cl,%edx
mov    0x8(%rsp),%rdi
call   1030 <get_piece@plt>
cmp    $0x70,%al
mov    $0x1,%eax
cmove  %eax,%r12d
movsbl %bl,%r15d
cmp    $0x67,%bpl
jg     1399 <can_capture+0x289>
lea    0x2(%rbp),%r14d
mov    $0x1,%r13d
mov    0x8(%rsp),%rdi
xchg   %ax,%ax
lea    -0x1(%r14),%eax
movsbl %al,%esi
mov    %r15d,%edx
call   1030 <get_piece@plt>
lea    -0x71(%rax),%ecx
cmp    $0x2,%cl
cmovb  %r13d,%r12d
jb     13e3 <can_capture+0x2d3>
cmp    $0x20,%al
jne    1399 <can_capture+0x289>
lea    0x1(%r14),%eax
cmp    $0x69,%r14b
mov    %eax,%r14d
mov    0x8(%rsp),%rdi
jl     1360 <can_capture+0x250>
cmp    $0x62,%bpl
jl     13ee <can_capture+0x2de>
jmp    13a4 <can_capture+0x294>
mov    0x8(%rsp),%rdi
cmp    $0x62,%bpl
jl     13ee <can_capture+0x2de>
lea    -0x2(%rbp),%r14d
mov    $0x1,%r13d
xchg   %ax,%ax
lea    0x1(%r14),%eax
movsbl %al,%esi
mov    %r15d,%edx
call   1030 <get_piece@plt>
lea    -0x71(%rax),%ecx
cmp    $0x2,%cl
cmovb  %r13d,%r12d
jb     13ee <can_capture+0x2de>
cmp    $0x20,%al
jne    13ee <can_capture+0x2de>
lea    -0x1(%r14),%eax
cmp    $0x60,%r14b
mov    %eax,%r14d
mov    0x8(%rsp),%rdi
ja     13b0 <can_capture+0x2a0>
jmp    13ee <can_capture+0x2de>
mov    0x8(%rsp),%rdi
cmp    $0x62,%bpl
jge    13a4 <can_capture+0x294>
movsbl %bpl,%r15d
cmp    $0x37,%bl
jg     143a <can_capture+0x32a>
mov    $0x1,%r14d
mov    %ebx,%r13d
lea    0x1(%r13),%ebp
movsbl %bpl,%edx
mov    0x8(%rsp),%rdi
mov    %r15d,%esi
call   1030 <get_piece@plt>
lea    -0x71(%rax),%ecx
cmp    $0x2,%cl
cmovb  %r14d,%r12d
jb     142e <can_capture+0x31e>
cmp    $0x20,%al
jne    142e <can_capture+0x31e>
cmp    $0x37,%r13b
mov    %ebp,%r13d
jl     1400 <can_capture+0x2f0>
cmp    $0x32,%bl
mov    0x8(%rsp),%rbp
jge    143f <can_capture+0x32f>
jmp    1470 <can_capture+0x360>
mov    0x8(%rsp),%rbp
add    $0xff,%bl
mov    $0x1,%r14d
nopl   0x0(%rax,%rax,1)
movsbl %bl,%ebx
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1030 <get_piece@plt>
add    $0x8f,%al
cmp    $0x2,%al
cmovb  %r14d,%r12d
add    $0xff,%bl
cmp    $0x30,%bl
ja     1450 <can_capture+0x340>
mov    %r12d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @can_capture(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = icmp eq i32 %1, 0
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %100, %5 ]
%7 = phi i32 [ 0, %2 ], [ %101, %5 ]
%8 = phi i8 [ undef, %2 ], [ %99, %5 ]
%9 = phi i8 [ undef, %2 ], [ %97, %5 ]
%10 = shl nsw i64 %6, 3
%11 = trunc i32 %7 to i8
%12 = sub i8 56, %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 75
%16 = and i1 %3, %15
%17 = icmp eq i8 %14, 107
%18 = and i1 %4, %17
%19 = or i1 %16, %18
%20 = or i1 %16, %18
%21 = select i1 %20, i8 97, i8 %8
%22 = or i64 %10, 1
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 75
%26 = and i1 %3, %25
%27 = icmp eq i8 %24, 107
%28 = and i1 %4, %27
%29 = or i1 %26, %28
%30 = or i1 %26, %28
%31 = select i1 %30, i8 98, i8 %21
%32 = or i64 %10, 2
%33 = getelementptr inbounds i8, i8* %0, i64 %32
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 75
%36 = and i1 %3, %35
%37 = icmp eq i8 %34, 107
%38 = and i1 %4, %37
%39 = or i1 %36, %38
%40 = or i1 %36, %38
%41 = select i1 %40, i8 99, i8 %31
%42 = or i64 %10, 3
%43 = getelementptr inbounds i8, i8* %0, i64 %42
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 75
%46 = and i1 %3, %45
%47 = icmp eq i8 %44, 107
%48 = and i1 %4, %47
%49 = or i1 %46, %48
%50 = or i1 %46, %48
%51 = select i1 %50, i8 100, i8 %41
%52 = or i64 %10, 4
%53 = getelementptr inbounds i8, i8* %0, i64 %52
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, 75
%56 = and i1 %3, %55
%57 = icmp eq i8 %54, 107
%58 = and i1 %4, %57
%59 = or i1 %56, %58
%60 = or i1 %56, %58
%61 = select i1 %60, i8 101, i8 %51
%62 = or i64 %10, 5
%63 = getelementptr inbounds i8, i8* %0, i64 %62
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 75
%66 = and i1 %3, %65
%67 = icmp eq i8 %64, 107
%68 = and i1 %4, %67
%69 = or i1 %66, %68
%70 = or i1 %66, %68
%71 = select i1 %70, i8 102, i8 %61
%72 = or i64 %10, 6
%73 = getelementptr inbounds i8, i8* %0, i64 %72
%74 = load i8, i8* %73
%75 = icmp eq i8 %74, 75
%76 = and i1 %3, %75
%77 = icmp eq i8 %74, 107
%78 = and i1 %4, %77
%79 = or i1 %76, %78
%80 = or i1 %76, %78
%81 = select i1 %80, i8 103, i8 %71
%82 = or i64 %10, 7
%83 = getelementptr inbounds i8, i8* %0, i64 %82
%84 = load i8, i8* %83
%85 = icmp eq i8 %84, 75
%86 = and i1 %3, %85
%87 = icmp eq i8 %84, 107
%88 = and i1 %4, %87
%89 = or i1 %86, %88
%90 = select i1 %89, i1 true, i1 %79
%91 = select i1 %90, i1 true, i1 %69
%92 = select i1 %91, i1 true, i1 %59
%93 = select i1 %92, i1 true, i1 %49
%94 = select i1 %93, i1 true, i1 %39
%95 = select i1 %94, i1 true, i1 %29
%96 = select i1 %95, i1 true, i1 %19
%97 = select i1 %96, i8 %12, i8 %9
%98 = or i1 %86, %88
%99 = select i1 %98, i8 104, i8 %81
%100 = add nuw nsw i64 %6, 1
%101 = add nuw nsw i32 %7, 1
%102 = icmp eq i64 %100, 8
br i1 %102, label %103, label %5
103: ; preds = %5
br i1 %3, label %104, label %186
104: ; preds = %103
%105 = icmp sgt i8 %99, 97
%106 = icmp slt i8 %97, 55
%107 = select i1 %105, i1 %106, i1 false
br i1 %107, label %108, label %114
108: ; preds = %104
%109 = add nsw i8 %99, -1
%110 = add nsw i8 %97, 1
%111 = tail call signext i8 @get_piece(i8* %0, i8 signext %109, i8 signext %110)
%112 = icmp eq i8 %111, 112
%113 = zext i1 %112 to i32
br label %114
114: ; preds = %108, %104
%115 = phi i32 [ 0, %104 ], [ %113, %108 ]
%116 = icmp slt i8 %99, 104
%117 = select i1 %116, i1 %106, i1 false
%118 = add i8 %99, 1
br i1 %117, label %119, label %124
119: ; preds = %114
%120 = add nsw i8 %97, 1
%121 = tail call signext i8 @get_piece(i8* %0, i8 signext %118, i8 signext %120)
%122 = icmp eq i8 %121, 112
%123 = select i1 %122, i32 1, i32 %115
br label %124
124: ; preds = %114, %119
%125 = phi i32 [ %123, %119 ], [ %115, %114 ]
br i1 %116, label %126, label %139
126: ; preds = %124, %126
%127 = phi i8 [ %136, %126 ], [ %118, %124 ]
%128 = phi i32 [ %135, %126 ], [ %125, %124 ]
%129 = tail call signext i8 @get_piece(i8* %0, i8 signext %127, i8 signext %97)
%130 = add i8 %129, -113
%131 = icmp ult i8 %130, 2
%132 = icmp eq i8 %129, 32
%133 = xor i1 %131, true
%134 = select i1 %133, i1 %132, i1 false
%135 = select i1 %131, i32 1, i32 %128
%136 = add i8 %127, 1
%137 = icmp slt i8 %136, 105
%138 = and i1 %134, %137
br i1 %138, label %126, label %139
139: ; preds = %126, %124
%140 = phi i32 [ %125, %124 ], [ %135, %126 ]
br i1 %105, label %141, label %156
141: ; preds = %139
%142 = add nsw i8 %99, -1
br label %143
143: ; preds = %141, %143
%144 = phi i8 [ %153, %143 ], [ %142, %141 ]
%145 = phi i32 [ %152, %143 ], [ %140, %141 ]
%146 = tail call signext i8 @get_piece(i8* %0, i8 signext %144, i8 signext %97)
%147 = add i8 %146, -113
%148 = icmp ult i8 %147, 2
%149 = icmp eq i8 %146, 32
%150 = xor i1 %148, true
%151 = select i1 %150, i1 %149, i1 false
%152 = select i1 %148, i32 1, i32 %145
%153 = add nsw i8 %144, -1
%154 = icmp ugt i8 %153, 96
%155 = and i1 %151, %154
br i1 %155, label %143, label %156
156: ; preds = %143, %139
%157 = phi i32 [ %140, %139 ], [ %152, %143 ]
%158 = icmp slt i8 %97, 56
br i1 %158, label %159, label %174
159: ; preds = %156, %159
%160 = phi i8 [ %162, %159 ], [ %97, %156 ]
%161 = phi i32 [ %167, %159 ], [ %157, %156 ]
%162 = add nsw i8 %160, 1
%163 = tail call signext i8 @get_piece(i8* %0, i8 signext %99, i8 signext %162)
%164 = add i8 %163, -113
%165 = icmp ult i8 %164, 2
%166 = icmp eq i8 %163, 32
%167 = select i1 %165, i32 1, i32 %161
%168 = xor i1 %165, true
%169 = select i1 %168, i1 %166, i1 false
%170 = icmp slt i8 %160, 55
%171 = and i1 %169, %170
br i1 %171, label %159, label %172
172: ; preds = %159
%173 = icmp sgt i8 %97, 49
br i1 %173, label %174, label %186
174: ; preds = %156, %172
%175 = phi i32 [ %167, %172 ], [ %157, %156 ]
%176 = add nsw i8 %97, -1
br label %177
177: ; preds = %174, %177
%178 = phi i8 [ %184, %177 ], [ %176, %174 ]
%179 = phi i32 [ %183, %177 ], [ %175, %174 ]
%180 = tail call signext i8 @get_piece(i8* %0, i8 signext %99, i8 signext %178)
%181 = add i8 %180, -113
%182 = icmp ult i8 %181, 2
%183 = select i1 %182, i32 1, i32 %179
%184 = add nsw i8 %178, -1
%185 = icmp ugt i8 %184, 48
br i1 %185, label %177, label %186
186: ; preds = %177, %172, %103
%187 = phi i32 [ %167, %172 ], [ 0, %103 ], [ %183, %177 ]
ret i32 %187
}