#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*/ abort();
__attribute__((no)) void foo(unsigned char *src, unsigned char *dst) {
  unsigned char *s = src;
  unsigned short *d = (unsigned short *)dst;
  int i;
  for (i = 0; i < 128 / 4; i++) {
    const int b = *s++;
    const int g = *s++;
    const int r = *s++;
    const int a = *s++;
    *d = ((b >> 3) | ((g & 0xFFC) << 3) | ((r + 0xF8) >> 8) | (a << 9));
    d++;
  }
  s = src;
  d = (unsigned short *)dst;
  for (i = 0; i < 128 / 4; i++) {
    const int b = *s++;
    const int g = *s++;
    const int r = *s++;
    const int a = *s++;
    unsigned short expected =
        ((b >> 3) | ((g & 0xFFC) << 3) | ((r + 0xF8) >> 8) | (a << 9));
    if (*d != expected)
      abort();
    d++;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
jge    11e3 <foo+0xd3>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
sar    $0x3,%eax
mov    -0x2c(%rbp),%ecx
and    $0xffc,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0x30(%rbp),%ecx
add    $0xf8,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x34(%rbp),%ecx
shl    $0x9,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x20(%rbp),%rax
mov    %cx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1137 <foo+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
jge    12ba <foo+0x1aa>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x3,%eax
mov    -0x3c(%rbp),%ecx
and    $0xffc,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0x40(%rbp),%ecx
add    $0xf8,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x44(%rbp),%ecx
shl    $0x9,%ecx
or     %ecx,%eax
mov    %ax,-0x46(%rbp)
mov    -0x20(%rbp),%rax
movzwl (%rax),%eax
movzwl -0x46(%rbp),%ecx
cmp    %ecx,%eax
je     12a0 <foo+0x190>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11fa <foo+0xea>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0x80(%rdi),%rax
cmp    %rsi,%rax
jbe    1174 <foo+0x64>
lea    0x40(%rsi),%rax
cmp    %rdi,%rax
jbe    1174 <foo+0x64>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,4),%r8d
movzbl 0x1(%rdi,%rax,4),%r9d
movzbl 0x2(%rdi,%rax,4),%ecx
movzbl 0x3(%rdi,%rax,4),%edx
shr    $0x3,%r8d
and    $0xfffffffc,%r9d
lea    (%r8,%r9,8),%r8d
add    $0xf8,%ecx
shr    $0x8,%ecx
or     %r8d,%ecx
shl    $0x9,%edx
or     %ecx,%edx
mov    %dx,(%rsi,%rax,2)
add    $0x1,%rax
cmp    $0x20,%eax
jne    1130 <foo+0x20>
jmp    16a5 <foo+0x595>
movdqu (%rdi),%xmm3
movdqu 0x10(%rdi),%xmm7
movdqa 0xe7a(%rip),%xmm13
movdqa %xmm7,%xmm0
pand   %xmm13,%xmm0
movdqa %xmm3,%xmm5
pand   %xmm13,%xmm5
packuswb %xmm0,%xmm5
packuswb %xmm5,%xmm5
pxor   %xmm11,%xmm11
movdqa %xmm7,%xmm9
punpckhbw %xmm11,%xmm9
pshufd $0xe8,%xmm9,%xmm0
pshuflw $0xd4,%xmm0,%xmm0
movdqa %xmm7,%xmm2
punpcklbw %xmm11,%xmm2
pshufd $0xe8,%xmm2,%xmm1
pshuflw $0xd4,%xmm1,%xmm6
punpckldq %xmm0,%xmm6
movdqa %xmm3,%xmm1
punpckhbw %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm0
pshuflw $0xed,%xmm0,%xmm8
movdqa %xmm3,%xmm0
punpcklbw %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm4
pshuflw $0xed,%xmm4,%xmm4
punpckldq %xmm8,%xmm4
packuswb %xmm6,%xmm4
pshufd $0xec,%xmm4,%xmm6
movdqa 0xe01(%rip),%xmm10
pand   %xmm10,%xmm7
pshuflw $0xe7,%xmm7,%xmm4
pshufhw $0xe7,%xmm4,%xmm4
pshufd $0x24,%xmm4,%xmm4
pshufhw $0x1b,%xmm4,%xmm4
pand   %xmm10,%xmm3
pshuflw $0xe7,%xmm3,%xmm3
pshufhw $0xe7,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshuflw $0xb1,%xmm3,%xmm3
packuswb %xmm4,%xmm3
pshufd $0xec,%xmm3,%xmm7
pshufd $0xe7,%xmm9,%xmm3
pshuflw $0x74,%xmm3,%xmm3
pshufd $0xe7,%xmm2,%xmm2
pshuflw $0x74,%xmm2,%xmm2
punpckldq %xmm3,%xmm2
pshufd $0xe7,%xmm1,%xmm1
pshuflw $0xe7,%xmm1,%xmm1
pshufd $0xe7,%xmm0,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
punpckldq %xmm1,%xmm0
packuswb %xmm2,%xmm0
pshufd $0xec,%xmm0,%xmm0
punpcklbw %xmm11,%xmm7
punpcklbw %xmm0,%xmm0
psrlw  $0x3,%xmm5
movdqa 0xd85(%rip),%xmm8
pand   %xmm8,%xmm5
punpcklbw %xmm11,%xmm5
movdqa 0xd82(%rip),%xmm9
pand   %xmm9,%xmm6
punpcklbw %xmm11,%xmm6
psllw  $0x3,%xmm6
por    %xmm5,%xmm6
movdqa 0xd76(%rip),%xmm12
paddw  %xmm12,%xmm7
psrlw  $0x8,%xmm7
por    %xmm6,%xmm7
psllw  $0x9,%xmm0
por    %xmm7,%xmm0
movdqu %xmm0,(%rsi)
movdqu 0x20(%rdi),%xmm3
movdqu 0x30(%rdi),%xmm4
movdqa %xmm4,%xmm0
pand   %xmm13,%xmm0
movdqa %xmm3,%xmm6
pand   %xmm13,%xmm6
packuswb %xmm0,%xmm6
packuswb %xmm6,%xmm6
movdqa %xmm4,%xmm15
punpckhbw %xmm11,%xmm15
pshufd $0xe8,%xmm15,%xmm0
pshuflw $0xd4,%xmm0,%xmm0
movdqa %xmm4,%xmm2
punpcklbw %xmm11,%xmm2
pshufd $0xe8,%xmm2,%xmm1
pshuflw $0xd4,%xmm1,%xmm7
punpckldq %xmm0,%xmm7
movdqa %xmm3,%xmm1
punpckhbw %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm0
pshuflw $0xed,%xmm0,%xmm14
movdqa %xmm3,%xmm0
punpcklbw %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm5
pshuflw $0xed,%xmm5,%xmm5
punpckldq %xmm14,%xmm5
packuswb %xmm7,%xmm5
pshufd $0xec,%xmm5,%xmm7
pand   %xmm10,%xmm4
pshuflw $0xe7,%xmm4,%xmm4
pshufhw $0xe7,%xmm4,%xmm4
pshufd $0x24,%xmm4,%xmm4
pshufhw $0x1b,%xmm4,%xmm4
pand   %xmm10,%xmm3
pshuflw $0xe7,%xmm3,%xmm3
pshufhw $0xe7,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshuflw $0xb1,%xmm3,%xmm3
packuswb %xmm4,%xmm3
pshufd $0xec,%xmm3,%xmm3
pshufd $0xe7,%xmm15,%xmm4
pshuflw $0x74,%xmm4,%xmm4
pshufd $0xe7,%xmm2,%xmm2
pshuflw $0x74,%xmm2,%xmm2
punpckldq %xmm4,%xmm2
pshufd $0xe7,%xmm1,%xmm1
pshuflw $0xe7,%xmm1,%xmm1
pshufd $0xe7,%xmm0,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
punpckldq %xmm1,%xmm0
packuswb %xmm2,%xmm0
pshufd $0xec,%xmm0,%xmm0
punpcklbw %xmm11,%xmm3
punpcklbw %xmm0,%xmm0
psrlw  $0x3,%xmm6
pand   %xmm8,%xmm6
punpcklbw %xmm11,%xmm6
pand   %xmm9,%xmm7
punpcklbw %xmm11,%xmm7
psllw  $0x3,%xmm7
por    %xmm6,%xmm7
paddw  %xmm12,%xmm3
psrlw  $0x8,%xmm3
por    %xmm7,%xmm3
psllw  $0x9,%xmm0
por    %xmm3,%xmm0
movdqu %xmm0,0x10(%rsi)
movdqu 0x40(%rdi),%xmm3
movdqu 0x50(%rdi),%xmm5
movdqa %xmm5,%xmm0
pand   %xmm13,%xmm0
movdqa %xmm3,%xmm6
pand   %xmm13,%xmm6
packuswb %xmm0,%xmm6
packuswb %xmm6,%xmm6
movdqa %xmm5,%xmm15
punpckhbw %xmm11,%xmm15
pshufd $0xe8,%xmm15,%xmm0
pshuflw $0xd4,%xmm0,%xmm0
movdqa %xmm5,%xmm2
punpcklbw %xmm11,%xmm2
pshufd $0xe8,%xmm2,%xmm1
pshuflw $0xd4,%xmm1,%xmm7
punpckldq %xmm0,%xmm7
movdqa %xmm3,%xmm1
punpckhbw %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm0
pshuflw $0xed,%xmm0,%xmm14
movdqa %xmm3,%xmm0
punpcklbw %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm4
pshuflw $0xed,%xmm4,%xmm4
punpckldq %xmm14,%xmm4
packuswb %xmm7,%xmm4
pshufd $0xec,%xmm4,%xmm7
pand   %xmm10,%xmm5
pshuflw $0xe7,%xmm5,%xmm4
pshufhw $0xe7,%xmm4,%xmm4
pshufd $0x24,%xmm4,%xmm4
pshufhw $0x1b,%xmm4,%xmm4
pand   %xmm10,%xmm3
pshuflw $0xe7,%xmm3,%xmm3
pshufhw $0xe7,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshuflw $0xb1,%xmm3,%xmm3
packuswb %xmm4,%xmm3
pshufd $0xec,%xmm3,%xmm3
pshufd $0xe7,%xmm15,%xmm4
pshuflw $0x74,%xmm4,%xmm4
pshufd $0xe7,%xmm2,%xmm2
pshuflw $0x74,%xmm2,%xmm2
punpckldq %xmm4,%xmm2
pshufd $0xe7,%xmm1,%xmm1
pshuflw $0xe7,%xmm1,%xmm1
pshufd $0xe7,%xmm0,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
punpckldq %xmm1,%xmm0
packuswb %xmm2,%xmm0
pshufd $0xec,%xmm0,%xmm0
punpcklbw %xmm11,%xmm3
punpcklbw %xmm0,%xmm0
psrlw  $0x3,%xmm6
pand   %xmm8,%xmm6
punpcklbw %xmm11,%xmm6
pand   %xmm9,%xmm7
punpcklbw %xmm11,%xmm7
psllw  $0x3,%xmm7
por    %xmm6,%xmm7
paddw  %xmm12,%xmm3
psrlw  $0x8,%xmm3
por    %xmm7,%xmm3
psllw  $0x9,%xmm0
por    %xmm3,%xmm0
movdqu %xmm0,0x20(%rsi)
movdqu 0x60(%rdi),%xmm3
movdqu 0x70(%rdi),%xmm2
movdqa %xmm2,%xmm0
pand   %xmm13,%xmm0
pand   %xmm3,%xmm13
packuswb %xmm0,%xmm13
packuswb %xmm13,%xmm13
movdqa %xmm2,%xmm4
punpckhbw %xmm11,%xmm4
pshufd $0xe8,%xmm4,%xmm0
pshuflw $0xd4,%xmm0,%xmm0
movdqa %xmm2,%xmm7
punpcklbw %xmm11,%xmm7
pshufd $0xe8,%xmm7,%xmm1
pshuflw $0xd4,%xmm1,%xmm5
punpckldq %xmm0,%xmm5
movdqa %xmm3,%xmm1
punpckhbw %xmm11,%xmm1
pshufd $0xe8,%xmm1,%xmm0
pshuflw $0xed,%xmm0,%xmm14
movdqa %xmm3,%xmm0
punpcklbw %xmm11,%xmm0
pshufd $0xe8,%xmm0,%xmm6
pshuflw $0xed,%xmm6,%xmm6
punpckldq %xmm14,%xmm6
packuswb %xmm5,%xmm6
pshufd $0xec,%xmm6,%xmm6
pand   %xmm10,%xmm2
pshuflw $0xe7,%xmm2,%xmm2
pshufhw $0xe7,%xmm2,%xmm2
pshufd $0x24,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
pand   %xmm10,%xmm3
pshuflw $0xe7,%xmm3,%xmm3
pshufhw $0xe7,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pshuflw $0xb1,%xmm3,%xmm3
packuswb %xmm2,%xmm3
pshufd $0xec,%xmm3,%xmm2
pshufd $0xe7,%xmm4,%xmm3
pshuflw $0x74,%xmm3,%xmm3
pshufd $0xe7,%xmm7,%xmm4
pshuflw $0x74,%xmm4,%xmm4
punpckldq %xmm3,%xmm4
pshufd $0xe7,%xmm1,%xmm1
pshuflw $0xe7,%xmm1,%xmm1
pshufd $0xe7,%xmm0,%xmm0
pshuflw $0xe7,%xmm0,%xmm0
punpckldq %xmm1,%xmm0
packuswb %xmm4,%xmm0
pshufd $0xec,%xmm0,%xmm0
punpcklbw %xmm11,%xmm2
punpcklbw %xmm0,%xmm0
psrlw  $0x3,%xmm13
pand   %xmm8,%xmm13
punpcklbw %xmm11,%xmm13
pand   %xmm9,%xmm6
punpcklbw %xmm11,%xmm6
psllw  $0x3,%xmm6
por    %xmm13,%xmm6
paddw  %xmm12,%xmm2
psrlw  $0x8,%xmm2
por    %xmm6,%xmm2
psllw  $0x9,%xmm0
por    %xmm2,%xmm0
movdqu %xmm0,0x30(%rsi)
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,4),%r8d
movzbl 0x1(%rdi,%rax,4),%r9d
movzbl 0x2(%rdi,%rax,4),%ecx
movzbl 0x3(%rdi,%rax,4),%edx
shr    $0x3,%r8d
and    $0xfffffffc,%r9d
lea    (%r8,%r9,8),%r8d
add    $0xf8,%ecx
shr    $0x8,%ecx
or     %r8d,%ecx
shl    $0x9,%edx
or     %ecx,%edx
cmp    %dx,(%rsi,%rax,2)
jne    16f3 <foo+0x5e3>
add    $0x1,%rax
cmp    $0x20,%eax
jne    16b0 <foo+0x5a0>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16*
%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 i32
%16 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%17 = load i8*, i8** %3
store i8* %17, i8** %5
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i16*
store i16* %19, i16** %6
store i32 0, i32* %7
br label %20
20: ; preds = %57, %2
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 32
br i1 %22, label %23, label %60
23: ; preds = %20
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
%26 = load i8, i8* %24
%27 = zext i8 %26 to i32
store i32 %27, i32* %8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %5
%30 = load i8, i8* %28
%31 = zext i8 %30 to i32
store i32 %31, i32* %9
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %5
%34 = load i8, i8* %32
%35 = zext i8 %34 to i32
store i32 %35, i32* %10
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %5
%38 = load i8, i8* %36
%39 = zext i8 %38 to i32
store i32 %39, i32* %11
%40 = load i32, i32* %8
%41 = ashr i32 %40, 3
%42 = load i32, i32* %9
%43 = and i32 %42, 4092
%44 = shl i32 %43, 3
%45 = or i32 %41, %44
%46 = load i32, i32* %10
%47 = add nsw i32 %46, 248
%48 = ashr i32 %47, 8
%49 = or i32 %45, %48
%50 = load i32, i32* %11
%51 = shl i32 %50, 9
%52 = or i32 %49, %51
%53 = trunc i32 %52 to i16
%54 = load i16*, i16** %6
store i16 %53, i16* %54
%55 = load i16*, i16** %6
%56 = getelementptr inbounds i16, i16* %55, i32 1
store i16* %56, i16** %6
br label %57
57: ; preds = %23
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %20
60: ; preds = %20
%61 = load i8*, i8** %3
store i8* %61, i8** %5
%62 = load i8*, i8** %4
%63 = bitcast i8* %62 to i16*
store i16* %63, i16** %6
store i32 0, i32* %7
br label %64
64: ; preds = %109, %60
%65 = load i32, i32* %7
%66 = icmp slt i32 %65, 32
br i1 %66, label %67, label %112
67: ; preds = %64
%68 = load i8*, i8** %5
%69 = getelementptr inbounds i8, i8* %68, i32 1
store i8* %69, i8** %5
%70 = load i8, i8* %68
%71 = zext i8 %70 to i32
store i32 %71, i32* %12
%72 = load i8*, i8** %5
%73 = getelementptr inbounds i8, i8* %72, i32 1
store i8* %73, i8** %5
%74 = load i8, i8* %72
%75 = zext i8 %74 to i32
store i32 %75, i32* %13
%76 = load i8*, i8** %5
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %5
%78 = load i8, i8* %76
%79 = zext i8 %78 to i32
store i32 %79, i32* %14
%80 = load i8*, i8** %5
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %5
%82 = load i8, i8* %80
%83 = zext i8 %82 to i32
store i32 %83, i32* %15
%84 = load i32, i32* %12
%85 = ashr i32 %84, 3
%86 = load i32, i32* %13
%87 = and i32 %86, 4092
%88 = shl i32 %87, 3
%89 = or i32 %85, %88
%90 = load i32, i32* %14
%91 = add nsw i32 %90, 248
%92 = ashr i32 %91, 8
%93 = or i32 %89, %92
%94 = load i32, i32* %15
%95 = shl i32 %94, 9
%96 = or i32 %93, %95
%97 = trunc i32 %96 to i16
store i16 %97, i16* %16
%98 = load i16*, i16** %6
%99 = load i16, i16* %98
%100 = zext i16 %99 to i32
%101 = load i16, i16* %16
%102 = zext i16 %101 to i32
%103 = icmp ne i32 %100, %102
br i1 %103, label %104, label %106
104: ; preds = %67
%105 = call i32 (...) @abort()
unreachable
106: ; preds = %67
%107 = load i16*, i16** %6
%108 = getelementptr inbounds i16, i16* %107, i32 1
store i16* %108, i16** %6
br label %109
109: ; preds = %106
%110 = load i32, i32* %7
%111 = add nsw i32 %110, 1
store i32 %111, i32* %7
br label %64
112: ; preds = %64
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i16*
%4 = getelementptr i8, i8* %1, i64 64
%5 = getelementptr i8, i8* %0, i64 128
%6 = icmp ugt i8* %5, %1
%7 = icmp ugt i8* %4, %0
%8 = and i1 %6, %7
br i1 %8, label %96, label %9
9: ; preds = %2
%10 = bitcast i8* %0 to <32 x i8>*
%11 = load <32 x i8>, <32 x i8>* %10
%12 = shufflevector <32 x i8> %11, <32 x i8> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
%13 = shufflevector <32 x i8> %11, <32 x i8> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
%14 = shufflevector <32 x i8> %11, <32 x i8> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
%15 = shufflevector <32 x i8> %11, <32 x i8> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
%16 = zext <8 x i8> %14 to <8 x i16>
%17 = zext <8 x i8> %15 to <8 x i16>
%18 = lshr <8 x i8> %12, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%19 = zext <8 x i8> %18 to <8 x i16>
%20 = and <8 x i8> %13, <i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4>
%21 = zext <8 x i8> %20 to <8 x i16>
%22 = shl nuw nsw <8 x i16> %21, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
%23 = or <8 x i16> %22, %19
%24 = add nuw nsw <8 x i16> %16, <i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248>
%25 = lshr <8 x i16> %24, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%26 = or <8 x i16> %23, %25
%27 = shl <8 x i16> %17, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
%28 = or <8 x i16> %26, %27
%29 = bitcast i8* %1 to <8 x i16>*
store <8 x i16> %28, <8 x i16>* %29
%30 = getelementptr i8, i8* %0, i64 32
%31 = getelementptr i8, i8* %1, i64 16
%32 = bitcast i8* %30 to <32 x i8>*
%33 = load <32 x i8>, <32 x i8>* %32
%34 = shufflevector <32 x i8> %33, <32 x i8> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
%35 = shufflevector <32 x i8> %33, <32 x i8> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
%36 = shufflevector <32 x i8> %33, <32 x i8> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
%37 = shufflevector <32 x i8> %33, <32 x i8> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
%38 = zext <8 x i8> %36 to <8 x i16>
%39 = zext <8 x i8> %37 to <8 x i16>
%40 = lshr <8 x i8> %34, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%41 = zext <8 x i8> %40 to <8 x i16>
%42 = and <8 x i8> %35, <i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4>
%43 = zext <8 x i8> %42 to <8 x i16>
%44 = shl nuw nsw <8 x i16> %43, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
%45 = or <8 x i16> %44, %41
%46 = add nuw nsw <8 x i16> %38, <i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248>
%47 = lshr <8 x i16> %46, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%48 = or <8 x i16> %45, %47
%49 = shl <8 x i16> %39, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
%50 = or <8 x i16> %48, %49
%51 = bitcast i8* %31 to <8 x i16>*
store <8 x i16> %50, <8 x i16>* %51
%52 = getelementptr i8, i8* %0, i64 64
%53 = getelementptr i8, i8* %1, i64 32
%54 = bitcast i8* %52 to <32 x i8>*
%55 = load <32 x i8>, <32 x i8>* %54
%56 = shufflevector <32 x i8> %55, <32 x i8> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
%57 = shufflevector <32 x i8> %55, <32 x i8> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
%58 = shufflevector <32 x i8> %55, <32 x i8> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
%59 = shufflevector <32 x i8> %55, <32 x i8> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
%60 = zext <8 x i8> %58 to <8 x i16>
%61 = zext <8 x i8> %59 to <8 x i16>
%62 = lshr <8 x i8> %56, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%63 = zext <8 x i8> %62 to <8 x i16>
%64 = and <8 x i8> %57, <i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4>
%65 = zext <8 x i8> %64 to <8 x i16>
%66 = shl nuw nsw <8 x i16> %65, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
%67 = or <8 x i16> %66, %63
%68 = add nuw nsw <8 x i16> %60, <i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248>
%69 = lshr <8 x i16> %68, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%70 = or <8 x i16> %67, %69
%71 = shl <8 x i16> %61, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
%72 = or <8 x i16> %70, %71
%73 = bitcast i8* %53 to <8 x i16>*
store <8 x i16> %72, <8 x i16>* %73
%74 = getelementptr i8, i8* %0, i64 96
%75 = getelementptr i8, i8* %1, i64 48
%76 = bitcast i8* %74 to <32 x i8>*
%77 = load <32 x i8>, <32 x i8>* %76
%78 = shufflevector <32 x i8> %77, <32 x i8> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28>
%79 = shufflevector <32 x i8> %77, <32 x i8> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
%80 = shufflevector <32 x i8> %77, <32 x i8> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30>
%81 = shufflevector <32 x i8> %77, <32 x i8> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
%82 = zext <8 x i8> %80 to <8 x i16>
%83 = zext <8 x i8> %81 to <8 x i16>
%84 = lshr <8 x i8> %78, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%85 = zext <8 x i8> %84 to <8 x i16>
%86 = and <8 x i8> %79, <i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4, i8 -4>
%87 = zext <8 x i8> %86 to <8 x i16>
%88 = shl nuw nsw <8 x i16> %87, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
%89 = or <8 x i16> %88, %85
%90 = add nuw nsw <8 x i16> %82, <i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248, i16 248>
%91 = lshr <8 x i16> %90, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%92 = or <8 x i16> %89, %91
%93 = shl <8 x i16> %83, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
%94 = or <8 x i16> %92, %93
%95 = bitcast i8* %75 to <8 x i16>*
store <8 x i16> %94, <8 x i16>* %95
br label %124
96: ; preds = %2, %96
%97 = phi i8* [ %107, %96 ], [ %0, %2 ]
%98 = phi i16* [ %121, %96 ], [ %3, %2 ]
%99 = phi i32 [ %122, %96 ], [ 0, %2 ]
%100 = getelementptr inbounds i8, i8* %97, i64 1
%101 = load i8, i8* %97
%102 = getelementptr inbounds i8, i8* %97, i64 2
%103 = load i8, i8* %100
%104 = getelementptr inbounds i8, i8* %97, i64 3
%105 = load i8, i8* %102
%106 = zext i8 %105 to i16
%107 = getelementptr inbounds i8, i8* %97, i64 4
%108 = load i8, i8* %104
%109 = zext i8 %108 to i16
%110 = lshr i8 %101, 3
%111 = zext i8 %110 to i16
%112 = and i8 %103, -4
%113 = zext i8 %112 to i16
%114 = shl nuw nsw i16 %113, 3
%115 = or i16 %114, %111
%116 = add nuw nsw i16 %106, 248
%117 = lshr i16 %116, 8
%118 = or i16 %115, %117
%119 = shl i16 %109, 9
%120 = or i16 %118, %119
store i16 %120, i16* %98
%121 = getelementptr inbounds i16, i16* %98, i64 1
%122 = add nuw nsw i32 %99, 1
%123 = icmp eq i32 %122, 32
br i1 %123, label %124, label %96
124: ; preds = %96, %9
br label %125
125: ; preds = %124, %153
%126 = phi i8* [ %154, %153 ], [ %0, %124 ]
%127 = phi i16* [ %155, %153 ], [ %3, %124 ]
%128 = phi i32 [ %156, %153 ], [ 0, %124 ]
%129 = getelementptr inbounds i8, i8* %126, i64 1
%130 = load i8, i8* %126
%131 = getelementptr inbounds i8, i8* %126, i64 2
%132 = load i8, i8* %129
%133 = getelementptr inbounds i8, i8* %126, i64 3
%134 = load i8, i8* %131
%135 = zext i8 %134 to i16
%136 = load i8, i8* %133
%137 = zext i8 %136 to i16
%138 = lshr i8 %130, 3
%139 = zext i8 %138 to i16
%140 = and i8 %132, -4
%141 = zext i8 %140 to i16
%142 = shl nuw nsw i16 %141, 3
%143 = or i16 %142, %139
%144 = add nuw nsw i16 %135, 248
%145 = lshr i16 %144, 8
%146 = or i16 %143, %145
%147 = shl i16 %137, 9
%148 = or i16 %146, %147
%149 = load i16, i16* %127
%150 = icmp eq i16 %149, %148
br i1 %150, label %153, label %151
151: ; preds = %125
%152 = tail call i32 (...) @abort()
unreachable
153: ; preds = %125
%154 = getelementptr inbounds i8, i8* %126, i64 4
%155 = getelementptr inbounds i16, i16* %127, i64 1
%156 = add nuw nsw i32 %128, 1
%157 = icmp eq i32 %156, 32
br i1 %157, label %158, label %125
158: ; preds = %153
ret void
}