void RGB32toRGB444_ROW_STRETCH2X(unsigned char *dest_ptr, int dest_dx,
                                 unsigned char *src_ptr, int src_dx) {
  register unsigned char *d = dest_ptr;
  register unsigned char *s = src_ptr;
  register int count = src_dx;
  if (count) {
    register unsigned int da_rgb;
    register unsigned int sa_rgb;
    sa_rgb = *(unsigned int *)(s);
    da_rgb =
        ((8 + 4 < 8) ? (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                           (0x100 - (1U << (8 - 8))))
                                        : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                           (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4)))) >>
                        ((8 - (8 + 4)) & 0x1F))
                     : (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                           (0x100 - (1U << (8 - 8))))
                                        : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                           (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4))))
                        << (((8 + 4) - 8) & 0x1F))) |
        ((4 + 4 < 8) ? (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8))))
                                       : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4)))) >>
                        ((8 - (4 + 4)) & 0x1F))
                     : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8))))
                                       : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4))))
                        << (((4 + 4) - 8) & 0x1F))) |
        ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8))))
                                       : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4)))) >>
                        ((8 - (0 + 4)) & 0x1F))
                     : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8))))
                                       : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                          (0x100 - (1U << (8 - 8)))))) &
                         (0x100 - (1U << (8 - 4))))
                        << (((0 + 4) - 8) & 0x1F)));
    s += 4;
    count--;
    *(unsigned short *)(d) = da_rgb;
    d += 2;
    while (count >= 2) {
      register unsigned int db_rgb;
      register unsigned int sa_rgb;
      sa_rgb = *(unsigned int *)(s);
      db_rgb =
          ((8 + 4 < 8)
               ? (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4)))) >>
                  ((8 - (8 + 4)) & 0x1F))
               : (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4))))
                  << (((8 + 4) - 8) & 0x1F))) |
          ((4 + 4 < 8) ? (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (4 + 4)) & 0x1F))
                       : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((4 + 4) - 8) & 0x1F))) |
          ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (0 + 4)) & 0x1F))
                       : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((0 + 4) - 8) & 0x1F)));
      da_rgb =
          (((da_rgb ^ db_rgb) >> 1) & (((1U << (8 + 4 - 1)) - (1U << 8)) |
                                       ((1U << (4 + 4 - 1)) - (1U << 4)) |
                                       ((1U << (0 + 4 - 1)) - (1U << 0)))) +
          (da_rgb & db_rgb);
      *(unsigned short *)(d) = da_rgb;
      *(unsigned short *)(d + 2) = db_rgb;
      sa_rgb = *(unsigned int *)(s + 4);
      da_rgb =
          ((8 + 4 < 8)
               ? (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4)))) >>
                  ((8 - (8 + 4)) & 0x1F))
               : (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4))))
                  << (((8 + 4) - 8) & 0x1F))) |
          ((4 + 4 < 8) ? (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (4 + 4)) & 0x1F))
                       : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((4 + 4) - 8) & 0x1F))) |
          ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (0 + 4)) & 0x1F))
                       : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((0 + 4) - 8) & 0x1F)));
      db_rgb =
          (((db_rgb ^ da_rgb) >> 1) & (((1U << (8 + 4 - 1)) - (1U << 8)) |
                                       ((1U << (4 + 4 - 1)) - (1U << 4)) |
                                       ((1U << (0 + 4 - 1)) - (1U << 0)))) +
          (db_rgb & da_rgb);
      *(unsigned short *)(d + 2 * 2) = db_rgb;
      *(unsigned short *)(d + 3 * 2) = da_rgb;
      s += 2 * 4;
      d += 4 * 2;
      count -= 2;
    }
    if (count) {
      register unsigned int db_rgb;
      register unsigned int sa_rgb;
      sa_rgb = *(unsigned int *)(s);
      db_rgb =
          ((8 + 4 < 8)
               ? (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4)))) >>
                  ((8 - (8 + 4)) & 0x1F))
               : (((((16 + 8 < 8) ? ((sa_rgb << ((8 - (16 + 8)) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8))))
                                  : ((sa_rgb >> (((16 + 8) - 8) & 0x1F)) &
                                     (0x100 - (1U << (8 - 8)))))) &
                   (0x100 - (1U << (8 - 4))))
                  << (((8 + 4) - 8) & 0x1F))) |
          ((4 + 4 < 8) ? (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (4 + 4)) & 0x1F))
                       : (((((8 + 8 < 8) ? ((sa_rgb << ((8 - (8 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((8 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((4 + 4) - 8) & 0x1F))) |
          ((0 + 4 < 8) ? (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4)))) >>
                          ((8 - (0 + 4)) & 0x1F))
                       : (((((0 + 8 < 8) ? ((sa_rgb << ((8 - (0 + 8)) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8))))
                                         : ((sa_rgb >> (((0 + 8) - 8) & 0x1F)) &
                                            (0x100 - (1U << (8 - 8)))))) &
                           (0x100 - (1U << (8 - 4))))
                          << (((0 + 4) - 8) & 0x1F)));
      da_rgb =
          (((da_rgb ^ db_rgb) >> 1) & (((1U << (8 + 4 - 1)) - (1U << 8)) |
                                       ((1U << (4 + 4 - 1)) - (1U << 4)) |
                                       ((1U << (0 + 4 - 1)) - (1U << 0)))) +
          (da_rgb & db_rgb);
      *(unsigned short *)(d) = da_rgb;
      *(unsigned short *)(d + 2) = db_rgb;
      *(unsigned short *)(d + 2 * 2) = db_rgb;
    } else {
      *(unsigned short *)(d) = da_rgb;
    }
  }
}


x86 assembly (clang, -O0):
<RGB32toRGB444_ROW_STRETCH2X>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1391 <RGB32toRGB444_ROW_STRETCH2X+0x291>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
and    $0xf0,%eax
shl    $0x4,%eax
mov    -0x3c(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x3c(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x34(%rbp)
jl     12e1 <RGB32toRGB444_ROW_STRETCH2X+0x1e1>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
and    $0xf0,%eax
shl    $0x4,%eax
mov    -0x44(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x44(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
xor    -0x40(%rbp),%eax
shr    $0x1,%eax
and    $0x777,%eax
mov    -0x38(%rbp),%ecx
and    -0x40(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,(%rax)
mov    -0x40(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
and    $0xf0,%eax
shl    $0x4,%eax
mov    -0x44(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x44(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x40(%rbp),%eax
xor    -0x38(%rbp),%eax
shr    $0x1,%eax
and    $0x777,%eax
mov    -0x40(%rbp),%ecx
and    -0x38(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x38(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,0x6(%rax)
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x34(%rbp)
jmp    11ad <RGB32toRGB444_ROW_STRETCH2X+0xad>
cmpl   $0x0,-0x34(%rbp)
je     137f <RGB32toRGB444_ROW_STRETCH2X+0x27f>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
and    $0xf0,%eax
shl    $0x4,%eax
mov    -0x4c(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x4c(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%eax
xor    -0x48(%rbp),%eax
shr    $0x1,%eax
and    $0x777,%eax
mov    -0x38(%rbp),%ecx
and    -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,(%rax)
mov    -0x48(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0x48(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,0x4(%rax)
jmp    138c <RGB32toRGB444_ROW_STRETCH2X+0x28c>
mov    -0x38(%rbp),%eax
mov    %ax,%cx
mov    -0x28(%rbp),%rax
mov    %cx,(%rax)
jmp    1391 <RGB32toRGB444_ROW_STRETCH2X+0x291>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB32toRGB444_ROW_STRETCH2X>:
test   %ecx,%ecx
je     1241 <RGB32toRGB444_ROW_STRETCH2X+0x141>
mov    (%rdx),%r9d
mov    %r9d,%r8d
shr    $0xc,%r8d
and    $0xf00,%r8d
mov    %r9d,%esi
shr    $0x8,%esi
and    $0xf0,%esi
or     %r8d,%esi
shr    $0x4,%r9d
and    $0xf,%r9d
or     %esi,%r9d
add    $0x4,%rdx
mov    %r9w,(%rdi)
add    $0x2,%rdi
cmp    $0x3,%ecx
jl     1234 <RGB32toRGB444_ROW_STRETCH2X+0x134>
add    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    (%rdx),%eax
mov    %eax,%r8d
shr    $0xc,%r8d
and    $0xf00,%r8d
mov    %eax,%esi
shr    $0x8,%esi
and    $0xf0,%esi
or     %r8d,%esi
shr    $0x4,%eax
and    $0xf,%eax
or     %esi,%eax
mov    %eax,%esi
xor    %r9d,%esi
shr    %esi
and    $0x777,%esi
and    %eax,%r9d
add    %esi,%r9d
mov    %r9w,(%rdi)
mov    %ax,0x2(%rdi)
mov    0x4(%rdx),%r9d
mov    %r9d,%r8d
shr    $0xc,%r8d
and    $0xf00,%r8d
mov    %r9d,%esi
shr    $0x8,%esi
and    $0xf0,%esi
or     %r8d,%esi
shr    $0x4,%r9d
and    $0xf,%r9d
or     %esi,%r9d
mov    %r9d,%esi
xor    %eax,%esi
shr    %esi
and    $0x777,%esi
and    %r9d,%eax
add    %esi,%eax
mov    %ax,0x4(%rdi)
mov    %r9w,0x6(%rdi)
add    $0x8,%rdx
add    $0x8,%rdi
add    $0xfffffffe,%ecx
cmp    $0x3,%ecx
ja     1150 <RGB32toRGB444_ROW_STRETCH2X+0x50>
add    $0xfffffffe,%ecx
test   %ecx,%ecx
je     123b <RGB32toRGB444_ROW_STRETCH2X+0x13b>
mov    (%rdx),%ecx
mov    %ecx,%eax
shr    $0xc,%eax
and    $0xf00,%eax
mov    %ecx,%edx
shr    $0x8,%edx
and    $0xf0,%edx
or     %eax,%edx
shr    $0x4,%ecx
and    $0xf,%ecx
or     %edx,%ecx
mov    %ecx,%eax
xor    %r9d,%eax
shr    %eax
and    $0x777,%eax
and    %ecx,%r9d
add    %eax,%r9d
mov    %r9w,(%rdi)
mov    %cx,0x2(%rdi)
add    $0x4,%rdi
jmp    123e <RGB32toRGB444_ROW_STRETCH2X+0x13e>
add    $0xffffffff,%ecx
test   %ecx,%ecx
jne    11f3 <RGB32toRGB444_ROW_STRETCH2X+0xf3>
mov    %r9d,%ecx
mov    %cx,(%rdi)
ret

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

LLVM IR (-O2):
define void @RGB32toRGB444_ROW_STRETCH2X(i8* nocapture writeonly %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %108, label %6
6: ; preds = %4
%7 = bitcast i8* %2 to i32*
%8 = load i32, i32* %7
%9 = lshr i32 %8, 12
%10 = and i32 %9, 3840
%11 = lshr i32 %8, 8
%12 = and i32 %11, 240
%13 = or i32 %10, %12
%14 = lshr i32 %8, 4
%15 = and i32 %14, 15
%16 = or i32 %13, %15
%17 = getelementptr inbounds i8, i8* %2, i64 4
%18 = add nsw i32 %3, -1
%19 = trunc i32 %16 to i16
%20 = bitcast i8* %0 to i16*
store i16 %19, i16* %20
%21 = getelementptr inbounds i8, i8* %0, i64 2
%22 = icmp sgt i32 %3, 2
br i1 %22, label %23, label %74
23: ; preds = %6, %23
%24 = phi i8* [ %71, %23 ], [ %21, %6 ]
%25 = phi i8* [ %70, %23 ], [ %17, %6 ]
%26 = phi i32 [ %72, %23 ], [ %18, %6 ]
%27 = phi i32 [ %58, %23 ], [ %16, %6 ]
%28 = bitcast i8* %25 to i32*
%29 = load i32, i32* %28
%30 = lshr i32 %29, 12
%31 = and i32 %30, 3840
%32 = lshr i32 %29, 8
%33 = and i32 %32, 240
%34 = or i32 %31, %33
%35 = lshr i32 %29, 4
%36 = and i32 %35, 15
%37 = or i32 %34, %36
%38 = xor i32 %37, %27
%39 = lshr i32 %38, 1
%40 = and i32 %39, 1911
%41 = and i32 %37, %27
%42 = add nuw nsw i32 %40, %41
%43 = trunc i32 %42 to i16
%44 = bitcast i8* %24 to i16*
store i16 %43, i16* %44
%45 = trunc i32 %37 to i16
%46 = getelementptr inbounds i8, i8* %24, i64 2
%47 = bitcast i8* %46 to i16*
store i16 %45, i16* %47
%48 = getelementptr inbounds i8, i8* %25, i64 4
%49 = bitcast i8* %48 to i32*
%50 = load i32, i32* %49
%51 = lshr i32 %50, 12
%52 = and i32 %51, 3840
%53 = lshr i32 %50, 8
%54 = and i32 %53, 240
%55 = or i32 %52, %54
%56 = lshr i32 %50, 4
%57 = and i32 %56, 15
%58 = or i32 %55, %57
%59 = xor i32 %58, %37
%60 = lshr i32 %59, 1
%61 = and i32 %60, 1911
%62 = and i32 %58, %37
%63 = add nuw nsw i32 %61, %62
%64 = trunc i32 %63 to i16
%65 = getelementptr inbounds i8, i8* %24, i64 4
%66 = bitcast i8* %65 to i16*
store i16 %64, i16* %66
%67 = trunc i32 %58 to i16
%68 = getelementptr inbounds i8, i8* %24, i64 6
%69 = bitcast i8* %68 to i16*
store i16 %67, i16* %69
%70 = getelementptr inbounds i8, i8* %25, i64 8
%71 = getelementptr inbounds i8, i8* %24, i64 8
%72 = add nsw i32 %26, -2
%73 = icmp ugt i32 %26, 3
br i1 %73, label %23, label %74
74: ; preds = %23, %6
%75 = phi i32 [ %16, %6 ], [ %58, %23 ]
%76 = phi i32 [ %18, %6 ], [ %72, %23 ]
%77 = phi i8* [ %17, %6 ], [ %70, %23 ]
%78 = phi i8* [ %21, %6 ], [ %71, %23 ]
%79 = icmp eq i32 %76, 0
br i1 %79, label %102, label %80
80: ; preds = %74
%81 = bitcast i8* %77 to i32*
%82 = load i32, i32* %81
%83 = lshr i32 %82, 12
%84 = and i32 %83, 3840
%85 = lshr i32 %82, 8
%86 = and i32 %85, 240
%87 = or i32 %84, %86
%88 = lshr i32 %82, 4
%89 = and i32 %88, 15
%90 = or i32 %87, %89
%91 = xor i32 %90, %75
%92 = lshr i32 %91, 1
%93 = and i32 %92, 1911
%94 = and i32 %90, %75
%95 = add nuw nsw i32 %93, %94
%96 = trunc i32 %95 to i16
%97 = bitcast i8* %78 to i16*
store i16 %96, i16* %97
%98 = trunc i32 %90 to i16
%99 = getelementptr inbounds i8, i8* %78, i64 2
%100 = bitcast i8* %99 to i16*
store i16 %98, i16* %100
%101 = getelementptr inbounds i8, i8* %78, i64 4
br label %104
102: ; preds = %74
%103 = trunc i32 %75 to i16
br label %104
104: ; preds = %102, %80
%105 = phi i8* [ %101, %80 ], [ %78, %102 ]
%106 = phi i16 [ %98, %80 ], [ %103, %102 ]
%107 = bitcast i8* %105 to i16*
store i16 %106, i16* %107
br label %108
108: ; preds = %104, %4
ret void
}