signed int dist2(unsigned char *blk1, unsigned char *blk2, signed int lx,
                 signed int hx, signed int hy, signed int h) {
  unsigned char *p1;
  unsigned char *p1a;
  unsigned char *p2;
  signed int i;
  signed int j;
  signed int s;
  signed int v;
  signed int sa = 0;
  if (hx == 0) {
    if (hy != 0)
      goto __CPROVER_DUMP_L5;
    s = 0;
    p1 = blk1;
    p2 = blk2;
    j = 0;
    while (!(j >= h)) {
      i = 0;
      while (i < 16) {
        v = (signed int)p1[(signed long int)i] -
            (signed int)p2[(signed long int)i];
        s = s + v * v;
        i = i + 1;
      }
      p1 = p1 + (signed long int)lx;
      p2 = p2 + (signed long int)lx;
      j = j + 1;
    }
  } else {
  __CPROVER_DUMP_L5:;
    if (!(hx == 0)) {
      if (hy != 0)
        goto __CPROVER_DUMP_L10;
      s = 0;
      p1 = blk1;
      p2 = blk2;
      j = 0;
      while (!(j >= h)) {
        i = 0;
        while (i < 16) {
          v = (signed int)(((unsigned int)((signed int)p1[(signed long int)i] +
                                           (signed int)
                                               p1[(signed long int)(i + 1)] +
                                           1) >>
                            1) -
                           (unsigned int)p2[(signed long int)i]);
          s = s + v * v;
          i = i + 1;
        }
        p1 = p1 + (signed long int)lx;
        p2 = p2 + (signed long int)lx;
        j = j + 1;
      }
    } else {
    __CPROVER_DUMP_L10:;
      if (hx == 0) {
        if (hy == 0)
          goto __CPROVER_DUMP_L15;
        s = 0;
        p1 = blk1;
        p2 = blk2;
        p1a = p1 + (signed long int)lx;
        j = 0;
        while (!(j >= h)) {
          i = 0;
          while (i < 16) {
            v = (signed int)(((unsigned int)((signed int)
                                                 p1[(signed long int)i] +
                                             (signed int)
                                                 p1a[(signed long int)i] +
                                             1) >>
                              1) -
                             (unsigned int)p2[(signed long int)i]);
            s = s + v * v;
            i = i + 1;
          }
          p1 = p1a;
          p1a = p1a + (signed long int)lx;
          p2 = p2 + (signed long int)lx;
          j = j + 1;
        }
      } else {
      __CPROVER_DUMP_L15:;
        s = 0;
        p1 = blk1;
        p2 = blk2;
        p1a = p1 + (signed long int)lx;
        j = 0;
        while (!(j >= h)) {
          i = 0;
          while (i < 16) {
            v = (signed int)(((unsigned int)((signed int)
                                                 p1[(signed long int)i] +
                                             (signed int)
                                                 p1[(signed long int)(i + 1)] +
                                             (signed int)
                                                 p1a[(signed long int)i] +
                                             (signed int)
                                                 p1a[(signed long int)(i + 1)] +
                                             2) >>
                              2) -
                             (unsigned int)p2[(signed long int)i]);
            s = s + v * v;
            i = i + 1;
          }
          p1 = p1a;
          p1a = p1a + (signed long int)lx;
          p2 = p2 + (signed long int)lx;
          j = j + 1;
        }
      }
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<dist2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    11ec <dist2+0xec>
cmpl   $0x0,-0x1c(%rbp)
je     113a <dist2+0x3a>
jmp    11f1 <dist2+0xf1>
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x20(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    1170 <dist2+0x70>
jmp    11e7 <dist2+0xe7>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x10,-0x3c(%rbp)
jge    11bb <dist2+0xbb>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x38(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1177 <dist2+0x77>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1158 <dist2+0x58>
jmp    14e2 <dist2+0x3e2>
jmp    11f1 <dist2+0xf1>
cmpl   $0x0,-0x18(%rbp)
je     12d5 <dist2+0x1d5>
cmpl   $0x0,-0x1c(%rbp)
je     120a <dist2+0x10a>
jmp    12da <dist2+0x1da>
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x20(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    1240 <dist2+0x140>
jmp    12d0 <dist2+0x1d0>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x10,-0x3c(%rbp)
jge    12a4 <dist2+0x1a4>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x28(%rbp),%rcx
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
add    $0x1,%eax
shr    $0x1,%eax
mov    -0x38(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1247 <dist2+0x147>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1228 <dist2+0x128>
jmp    14dd <dist2+0x3dd>
jmp    12da <dist2+0x1da>
cmpl   $0x0,-0x18(%rbp)
jne    13d0 <dist2+0x2d0>
cmpl   $0x0,-0x1c(%rbp)
jne    12f3 <dist2+0x1f3>
jmp    13d5 <dist2+0x2d5>
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x20(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    1338 <dist2+0x238>
jmp    13cb <dist2+0x2cb>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x10,-0x3c(%rbp)
jge    1397 <dist2+0x297>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x30(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
add    $0x1,%eax
shr    $0x1,%eax
mov    -0x38(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    133f <dist2+0x23f>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1320 <dist2+0x220>
jmp    14d8 <dist2+0x3d8>
jmp    13d5 <dist2+0x2d5>
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x20(%rbp),%eax
setge  %al
xor    $0xff,%al
test   $0x1,%al
jne    141a <dist2+0x31a>
jmp    14d3 <dist2+0x3d3>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x10,-0x3c(%rbp)
jge    149f <dist2+0x39f>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x28(%rbp),%rcx
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    -0x30(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    -0x30(%rbp),%rcx
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
add    $0x2,%eax
shr    $0x2,%eax
mov    -0x38(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1421 <dist2+0x321>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1402 <dist2+0x302>
jmp    14d8 <dist2+0x3d8>
jmp    14dd <dist2+0x3dd>
jmp    14e2 <dist2+0x3e2>
mov    -0x44(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist2>:
mov    %r8d,%eax
or     %ecx,%eax
je     134e <dist2+0x24e>
test   %ecx,%ecx
je     1410 <dist2+0x310>
test   %r8d,%r8d
jne    1410 <dist2+0x310>
test   %r9d,%r9d
jle    195c <dist2+0x85c>
movslq %edx,%r8
xor    %edx,%edx
movaps 0xece(%rip),%xmm8
pxor   %xmm13,%xmm13
pcmpeqd %xmm9,%xmm9
xor    %eax,%eax
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
movd   %ecx,%xmm0
pslld  $0x18,%xmm0
movss  0x1(%rdi,%rdx,1),%xmm10
xorps  %xmm12,%xmm12
movss  %xmm0,%xmm12
movaps %xmm10,%xmm14
movaps %xmm10,%xmm3
movss  0x5(%rdi,%rdx,1),%xmm11
movaps %xmm11,%xmm15
movaps %xmm11,%xmm7
movss  0x9(%rdi,%rdx,1),%xmm1
movaps %xmm1,%xmm2
movaps %xmm1,%xmm4
movss  0xd(%rdi,%rdx,1),%xmm5
movaps %xmm5,%xmm6
andps  %xmm8,%xmm6
orps   %xmm1,%xmm6
andps  %xmm8,%xmm1
orps   %xmm11,%xmm1
andps  %xmm8,%xmm11
orps   %xmm10,%xmm11
andps  %xmm8,%xmm10
orps   %xmm10,%xmm12
psrld  $0x18,%xmm12
pslld  $0x8,%xmm14
por    %xmm12,%xmm14
punpcklbw %xmm13,%xmm14
punpcklwd %xmm13,%xmm14
punpcklbw %xmm13,%xmm3
punpcklwd %xmm13,%xmm3
paddd  %xmm14,%xmm3
psubd  %xmm9,%xmm3
psrld  $0x1,%xmm3
movd   (%rsi,%rdx,1),%xmm0
punpcklbw %xmm13,%xmm0
punpcklwd %xmm13,%xmm0
psubd  %xmm0,%xmm3
packssdw %xmm3,%xmm3
movdqa %xmm3,%xmm0
pmulhw %xmm3,%xmm0
pmullw %xmm3,%xmm3
punpcklwd %xmm0,%xmm3
psrld  $0x18,%xmm11
pslld  $0x8,%xmm15
por    %xmm11,%xmm15
punpcklbw %xmm13,%xmm15
punpcklwd %xmm13,%xmm15
punpcklbw %xmm13,%xmm7
punpcklwd %xmm13,%xmm7
paddd  %xmm15,%xmm7
psubd  %xmm9,%xmm7
psrld  $0x1,%xmm7
movd   0x4(%rsi,%rdx,1),%xmm0
punpcklbw %xmm13,%xmm0
punpcklwd %xmm13,%xmm0
psubd  %xmm0,%xmm7
packssdw %xmm7,%xmm7
movdqa %xmm7,%xmm0
pmulhw %xmm7,%xmm0
pmullw %xmm7,%xmm7
punpcklwd %xmm0,%xmm7
movd   %eax,%xmm0
paddd  %xmm0,%xmm7
paddd  %xmm3,%xmm7
psrld  $0x18,%xmm1
pslld  $0x8,%xmm2
por    %xmm1,%xmm2
punpcklbw %xmm13,%xmm2
punpcklwd %xmm13,%xmm2
punpcklbw %xmm13,%xmm4
punpcklwd %xmm13,%xmm4
paddd  %xmm2,%xmm4
psubd  %xmm9,%xmm4
psrld  $0x1,%xmm4
movd   0x8(%rsi,%rdx,1),%xmm0
punpcklbw %xmm13,%xmm0
punpcklwd %xmm13,%xmm0
psubd  %xmm0,%xmm4
packssdw %xmm4,%xmm4
movdqa %xmm4,%xmm0
pmulhw %xmm4,%xmm0
pmullw %xmm4,%xmm4
punpcklwd %xmm0,%xmm4
psrld  $0x18,%xmm6
movaps %xmm5,%xmm0
pslld  $0x8,%xmm0
por    %xmm6,%xmm0
punpcklbw %xmm13,%xmm0
punpcklwd %xmm13,%xmm0
punpcklbw %xmm13,%xmm5
punpcklwd %xmm13,%xmm5
paddd  %xmm0,%xmm5
psubd  %xmm9,%xmm5
psrld  $0x1,%xmm5
movd   0xc(%rsi,%rdx,1),%xmm0
punpcklbw %xmm13,%xmm0
punpcklwd %xmm13,%xmm0
psubd  %xmm0,%xmm5
packssdw %xmm5,%xmm5
movdqa %xmm5,%xmm0
pmulhw %xmm5,%xmm0
pmullw %xmm5,%xmm5
punpcklwd %xmm0,%xmm5
paddd  %xmm4,%xmm5
paddd  %xmm7,%xmm5
pshufd $0xee,%xmm5,%xmm0
paddd  %xmm5,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    %r8,%rdx
add    $0xffffffff,%r9d
jne    1140 <dist2+0x40>
jmp    195b <dist2+0x85b>
test   %r9d,%r9d
jle    195c <dist2+0x85c>
movslq %edx,%r8
xor    %edx,%edx
pxor   %xmm0,%xmm0
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqu (%rdi,%rdx,1),%xmm2
movdqa %xmm2,%xmm4
punpckhbw %xmm0,%xmm4
movdqa %xmm4,%xmm1
punpcklwd %xmm0,%xmm1
punpckhwd %xmm0,%xmm4
punpcklbw %xmm0,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm0,%xmm3
punpckhwd %xmm0,%xmm2
movdqu (%rsi,%rdx,1),%xmm5
movdqa %xmm5,%xmm6
punpckhbw %xmm0,%xmm6
movdqa %xmm6,%xmm7
punpcklwd %xmm0,%xmm7
psubd  %xmm7,%xmm1
punpckhwd %xmm0,%xmm6
psubd  %xmm6,%xmm4
packssdw %xmm4,%xmm1
punpcklbw %xmm0,%xmm5
movdqa %xmm5,%xmm4
punpcklwd %xmm0,%xmm4
psubd  %xmm4,%xmm3
punpckhwd %xmm0,%xmm5
psubd  %xmm5,%xmm2
packssdw %xmm2,%xmm3
pmaddwd %xmm1,%xmm1
pmaddwd %xmm3,%xmm3
paddd  %xmm1,%xmm3
pshufd $0xee,%xmm3,%xmm1
paddd  %xmm3,%xmm1
pshufd $0x55,%xmm1,%xmm2
paddd  %xmm1,%xmm2
movd   %xmm2,%ecx
add    %ecx,%eax
add    %r8,%rdx
add    $0xffffffff,%r9d
jne    1370 <dist2+0x270>
jmp    195b <dist2+0x85b>
movslq %edx,%r10
test   %ecx,%ecx
jne    15b5 <dist2+0x4b5>
test   %r8d,%r8d
je     15b5 <dist2+0x4b5>
test   %r9d,%r9d
jle    195c <dist2+0x85c>
add    $0xc,%rdi
add    $0xc,%rsi
xor    %eax,%eax
pxor   %xmm0,%xmm0
pcmpeqd %xmm1,%xmm1
nop
movd   %eax,%xmm3
movd   -0xc(%rdi),%xmm4
punpcklbw %xmm0,%xmm4
punpcklwd %xmm0,%xmm4
movd   -0xc(%rdi,%r10,1),%xmm2
punpcklbw %xmm0,%xmm2
punpcklwd %xmm0,%xmm2
paddd  %xmm4,%xmm2
psubd  %xmm1,%xmm2
psrld  $0x1,%xmm2
movd   -0xc(%rsi),%xmm4
punpcklbw %xmm0,%xmm4
punpcklwd %xmm0,%xmm4
psubd  %xmm4,%xmm2
packssdw %xmm2,%xmm2
movdqa %xmm2,%xmm4
pmulhw %xmm2,%xmm4
pmullw %xmm2,%xmm2
punpcklwd %xmm4,%xmm2
paddd  %xmm3,%xmm2
movd   -0x8(%rdi),%xmm3
punpcklbw %xmm0,%xmm3
punpcklwd %xmm0,%xmm3
movd   -0x8(%rdi,%r10,1),%xmm4
punpcklbw %xmm0,%xmm4
punpcklwd %xmm0,%xmm4
paddd  %xmm3,%xmm4
psubd  %xmm1,%xmm4
psrld  $0x1,%xmm4
movd   -0x8(%rsi),%xmm3
punpcklbw %xmm0,%xmm3
punpcklwd %xmm0,%xmm3
psubd  %xmm3,%xmm4
packssdw %xmm4,%xmm4
movdqa %xmm4,%xmm3
pmulhw %xmm4,%xmm3
pmullw %xmm4,%xmm4
punpcklwd %xmm3,%xmm4
movd   -0x4(%rdi),%xmm5
punpcklbw %xmm0,%xmm5
punpcklwd %xmm0,%xmm5
movd   -0x4(%rdi,%r10,1),%xmm3
punpcklbw %xmm0,%xmm3
punpcklwd %xmm0,%xmm3
paddd  %xmm5,%xmm3
psubd  %xmm1,%xmm3
psrld  $0x1,%xmm3
movd   -0x4(%rsi),%xmm5
punpcklbw %xmm0,%xmm5
punpcklwd %xmm0,%xmm5
psubd  %xmm5,%xmm3
packssdw %xmm3,%xmm3
movdqa %xmm3,%xmm5
pmulhw %xmm3,%xmm5
pmullw %xmm3,%xmm3
punpcklwd %xmm5,%xmm3
paddd  %xmm4,%xmm3
movd   (%rdi),%xmm4
movd   (%rdi,%r10,1),%xmm5
lea    (%rdi,%r10,1),%rdi
paddd  %xmm2,%xmm3
punpcklbw %xmm0,%xmm4
punpcklwd %xmm0,%xmm4
punpcklbw %xmm0,%xmm5
punpcklwd %xmm0,%xmm5
paddd  %xmm4,%xmm5
psubd  %xmm1,%xmm5
psrld  $0x1,%xmm5
movd   (%rsi),%xmm2
punpcklbw %xmm0,%xmm2
punpcklwd %xmm0,%xmm2
psubd  %xmm2,%xmm5
packssdw %xmm5,%xmm5
movdqa %xmm5,%xmm2
pmulhw %xmm5,%xmm2
pmullw %xmm5,%xmm5
punpcklwd %xmm2,%xmm5
paddd  %xmm3,%xmm5
pshufd $0xee,%xmm5,%xmm2
paddd  %xmm5,%xmm2
pshufd $0x55,%xmm2,%xmm3
paddd  %xmm2,%xmm3
movd   %xmm3,%eax
add    %r10,%rsi
add    $0xffffffff,%r9d
jne    1440 <dist2+0x340>
jmp    195b <dist2+0x85b>
test   %r9d,%r9d
jle    195c <dist2+0x85c>
mov    (%rdi),%cl
lea    (%rdi,%r10,1),%r11
xor    %edx,%edx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
movd   %ecx,%xmm3
movzbl (%r11,%rdx,1),%r8d
pslld  $0x18,%xmm3
movd   %r8d,%xmm5
pslld  $0x18,%xmm5
movss  0x1(%rdi,%rdx,1),%xmm0
movaps %xmm0,%xmm2
movaps %xmm0,%xmm15
movss  0x5(%rdi,%rdx,1),%xmm7
movaps %xmm7,-0x38(%rsp)
movaps %xmm7,-0x18(%rsp)
movss  0x9(%rdi,%rdx,1),%xmm14
movaps %xmm14,%xmm11
movaps %xmm14,%xmm4
movaps 0x9e1(%rip),%xmm10
andps  %xmm10,%xmm4
orps   %xmm7,%xmm4
movaps %xmm4,-0x28(%rsp)
movaps %xmm7,%xmm13
andps  %xmm10,%xmm13
orps   %xmm0,%xmm13
andps  %xmm10,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm3,%xmm1
orps   %xmm0,%xmm1
psrld  $0x18,%xmm1
pslld  $0x8,%xmm2
por    %xmm1,%xmm2
xorps  %xmm7,%xmm7
punpcklbw %xmm7,%xmm2
punpcklwd %xmm7,%xmm2
punpcklbw %xmm7,%xmm15
punpcklwd %xmm7,%xmm15
paddd  %xmm2,%xmm15
movss  0x1(%r11,%rdx,1),%xmm8
pxor   %xmm1,%xmm1
movss  %xmm5,%xmm1
movaps %xmm8,%xmm9
movaps %xmm8,%xmm2
movss  0x5(%r11,%rdx,1),%xmm5
movaps %xmm5,%xmm3
movaps %xmm5,%xmm0
movss  0x9(%r11,%rdx,1),%xmm6
movaps %xmm6,%xmm12
movaps %xmm6,-0x48(%rsp)
andps  %xmm10,%xmm12
orps   %xmm5,%xmm12
movaps %xmm5,%xmm4
andps  %xmm10,%xmm4
orps   %xmm8,%xmm4
andps  %xmm10,%xmm8
orps   %xmm8,%xmm1
psrld  $0x18,%xmm1
pslld  $0x8,%xmm9
por    %xmm1,%xmm9
movss  0xd(%rdi,%rdx,1),%xmm8
movaps %xmm8,%xmm5
andps  %xmm10,%xmm5
orps   %xmm14,%xmm5
punpcklbw %xmm7,%xmm9
punpcklwd %xmm7,%xmm9
paddd  %xmm15,%xmm9
movaps %xmm6,%xmm10
punpcklbw %xmm7,%xmm2
punpcklwd %xmm7,%xmm2
movdqa 0x90e(%rip),%xmm6
paddd  %xmm6,%xmm2
paddd  %xmm9,%xmm2
psrld  $0x2,%xmm2
movd   (%rsi,%rdx,1),%xmm6
punpcklbw %xmm7,%xmm6
punpcklwd %xmm7,%xmm6
psubd  %xmm6,%xmm2
pshufd $0xf5,%xmm2,%xmm6
pmuludq %xmm2,%xmm2
pshufd $0xe8,%xmm2,%xmm9
pmuludq %xmm6,%xmm6
pshufd $0xe8,%xmm6,%xmm2
punpckldq %xmm2,%xmm9
movd   %eax,%xmm2
paddd  %xmm2,%xmm9
psrld  $0x18,%xmm13
movdqa -0x38(%rsp),%xmm15
pslld  $0x8,%xmm15
por    %xmm13,%xmm15
movdqa %xmm15,%xmm13
movd   0xd(%r11,%rdx,1),%xmm2
movdqa %xmm2,%xmm1
pand   0x889(%rip),%xmm1
movdqa -0x48(%rsp),%xmm6
por    %xmm6,%xmm1
punpcklbw %xmm7,%xmm13
punpcklwd %xmm7,%xmm13
movdqa -0x18(%rsp),%xmm15
punpcklbw %xmm7,%xmm15
punpcklwd %xmm7,%xmm15
paddd  %xmm13,%xmm15
psrld  $0x18,%xmm4
pslld  $0x8,%xmm3
por    %xmm4,%xmm3
punpcklbw %xmm7,%xmm3
punpcklwd %xmm7,%xmm3
punpcklbw %xmm7,%xmm0
punpcklwd %xmm7,%xmm0
paddd  %xmm3,%xmm0
paddd  %xmm15,%xmm0
movdqa 0x840(%rip),%xmm4
paddd  %xmm4,%xmm0
psrld  $0x2,%xmm0
movd   0x4(%rsi,%rdx,1),%xmm3
punpcklbw %xmm7,%xmm3
punpcklwd %xmm7,%xmm3
psubd  %xmm3,%xmm0
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pmuludq %xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm0
movdqa -0x28(%rsp),%xmm3
psrld  $0x18,%xmm3
pslld  $0x8,%xmm11
por    %xmm3,%xmm11
punpcklbw %xmm7,%xmm11
punpcklwd %xmm7,%xmm11
punpcklbw %xmm7,%xmm14
punpcklwd %xmm7,%xmm14
paddd  %xmm11,%xmm14
psrld  $0x18,%xmm12
pslld  $0x8,%xmm10
por    %xmm12,%xmm10
punpcklbw %xmm7,%xmm10
punpcklwd %xmm7,%xmm10
punpcklbw %xmm7,%xmm6
punpcklwd %xmm7,%xmm6
paddd  %xmm10,%xmm6
paddd  %xmm14,%xmm6
paddd  %xmm4,%xmm6
movdqa %xmm4,%xmm10
psrld  $0x2,%xmm6
movd   0x8(%rsi,%rdx,1),%xmm3
punpcklbw %xmm7,%xmm3
punpcklwd %xmm7,%xmm3
psubd  %xmm3,%xmm6
pshufd $0xf5,%xmm6,%xmm3
pmuludq %xmm6,%xmm6
pshufd $0xe8,%xmm6,%xmm4
pmuludq %xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm4
paddd  %xmm0,%xmm4
paddd  %xmm9,%xmm4
psrld  $0x18,%xmm5
movaps %xmm8,%xmm0
pslld  $0x8,%xmm0
por    %xmm5,%xmm0
punpcklbw %xmm7,%xmm0
punpcklwd %xmm7,%xmm0
punpcklbw %xmm7,%xmm8
punpcklwd %xmm7,%xmm8
paddd  %xmm0,%xmm8
psrld  $0x18,%xmm1
movdqa %xmm2,%xmm0
pslld  $0x8,%xmm0
por    %xmm1,%xmm0
punpcklbw %xmm7,%xmm0
punpcklwd %xmm7,%xmm0
punpcklbw %xmm7,%xmm2
punpcklwd %xmm7,%xmm2
paddd  %xmm0,%xmm2
paddd  %xmm8,%xmm2
paddd  %xmm10,%xmm2
psrld  $0x2,%xmm2
movd   0xc(%rsi,%rdx,1),%xmm0
punpcklbw %xmm7,%xmm0
punpcklwd %xmm7,%xmm0
psubd  %xmm0,%xmm2
pshufd $0xf5,%xmm2,%xmm0
pmuludq %xmm2,%xmm2
pshufd $0xe8,%xmm2,%xmm1
pmuludq %xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm1
paddd  %xmm4,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    %r10,%rdx
mov    %r8d,%ecx
add    $0xffffffff,%r9d
jne    15d0 <dist2+0x4d0>
ret
xor    %eax,%eax
ret

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

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