void iquant1_intra(signed short int *src, signed short int *dst,
                   signed int dc_prec, unsigned char *quant_mat,
                   signed int mquant) {
  signed int i;
  signed int val;
  dst[(signed long int)0] =
      (signed short int)((signed int)src[(signed long int)0] << 3 - dc_prec);
  i = 1;
  while (i < 64) {
    val = (signed int)((signed int)src[(signed long int)i] *
                       (signed int)quant_mat[(signed long int)i] * mquant) /
          16;
    if ((1 & val) == 0) {
      if (!(val == 0))
        val = val + (val > 0 ? -1 : 1);
    }
    dst[(signed long int)i] =
        (signed short int)(val > 2047 ? 2047 : (val < -2048 ? -2048 : val));
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<iquant1_intra>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movl   $0x1,-0x28(%rbp)
cmpl   $0x40,-0x28(%rbp)
jge    1206 <iquant1_intra+0x106>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
imul   -0x24(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    11a6 <iquant1_intra+0xa6>
cmpl   $0x0,-0x2c(%rbp)
je     11a1 <iquant1_intra+0xa1>
mov    -0x2c(%rbp),%eax
mov    -0x2c(%rbp),%esi
mov    $0x1,%ecx
mov    $0xffffffff,%edx
cmp    $0x0,%esi
cmovg  %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a6 <iquant1_intra+0xa6>
cmpl   $0x7ff,-0x2c(%rbp)
jle    11c0 <iquant1_intra+0xc0>
mov    $0x7ff,%eax
mov    %eax,-0x30(%rbp)
jmp    11e6 <iquant1_intra+0xe6>
cmpl   $0xfffff800,-0x2c(%rbp)
jge    11da <iquant1_intra+0xda>
mov    $0xfffff800,%eax
mov    %eax,-0x34(%rbp)
jmp    11e0 <iquant1_intra+0xe0>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1139 <iquant1_intra+0x39>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iquant1_intra>:
push   %rbp
push   %rbx
mov    %rcx,%r9
movzwl (%rdi),%eax
mov    $0x3,%cl
sub    %dl,%cl
shl    %cl,%eax
mov    %ax,(%rsi)
lea    0x2(%rsi),%rax
lea    0x80(%rsi),%rcx
lea    0x2(%rdi),%r10
lea    0x80(%rdi),%rdx
lea    0x1(%r9),%r11
lea    0x40(%r9),%rbx
cmp    %rdx,%rax
setb   %bpl
cmp    %rcx,%r10
setb   %dl
cmp    %rax,%rbx
seta   %al
cmp    %rcx,%r11
setb   %bl
mov    $0x1,%ecx
test   %dl,%bpl
jne    1d79 <iquant1_intra+0xc79>
and    %bl,%al
jne    1d79 <iquant1_intra+0xc79>
movd   %r8d,%xmm0
pshufd $0x0,%xmm0,%xmm13
movdqu 0x2(%rdi),%xmm0
punpckhwd %xmm0,%xmm2
psrad  $0x10,%xmm2
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x1(%r9),%xmm4
pxor   %xmm10,%xmm10
punpcklbw %xmm10,%xmm4
movdqa %xmm4,%xmm5
punpcklwd %xmm10,%xmm5
punpckhwd %xmm10,%xmm4
pshufd $0xf5,%xmm0,%xmm7
pmuludq %xmm13,%xmm7
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm2,%xmm6
pmuludq %xmm13,%xmm6
pmuludq %xmm13,%xmm2
pmuludq %xmm4,%xmm2
pshufd $0xe8,%xmm2,%xmm3
pshufd $0xf5,%xmm4,%xmm2
pmuludq %xmm6,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm3
pmuludq %xmm5,%xmm0
pshufd $0xe8,%xmm0,%xmm6
pshufd $0xf5,%xmm5,%xmm0
pmuludq %xmm7,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm6
movdqa %xmm6,%xmm4
psrad  $0x1f,%xmm4
psrld  $0x1c,%xmm4
paddd  %xmm6,%xmm4
psrad  $0x4,%xmm4
movdqa %xmm3,%xmm5
psrad  $0x1f,%xmm5
psrld  $0x1c,%xmm5
paddd  %xmm3,%xmm5
psrad  $0x4,%xmm5
pshuflw $0xe8,%xmm5,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm4,%xmm2
pshufhw $0xe8,%xmm2,%xmm2
pshufd $0xe8,%xmm2,%xmm7
punpcklqdq %xmm0,%xmm7
movdqa 0xdb5(%rip),%xmm11
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
movdqa %xmm3,%xmm2
paddd  %xmm11,%xmm2
movdqa 0xdaa(%rip),%xmm8
pxor   %xmm8,%xmm2
movdqa 0xdac(%rip),%xmm12
movdqa %xmm12,%xmm1
pcmpgtd %xmm2,%xmm1
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm2
pcmpgtd %xmm0,%xmm2
packssdw %xmm1,%xmm2
por    %xmm7,%xmm2
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm3
movdqa 0xd8a(%rip),%xmm9
por    %xmm9,%xmm3
por    %xmm9,%xmm6
movdqa %xmm2,%xmm0
punpcklwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
punpckhwd %xmm2,%xmm2
pslld  $0x1f,%xmm2
psrad  $0x1f,%xmm2
pandn  %xmm3,%xmm2
paddd  %xmm5,%xmm2
paddd  %xmm4,%xmm0
movdqa 0xd57(%rip),%xmm14
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm2,%xmm0
pcmpgtd %xmm14,%xmm0
pand   %xmm0,%xmm2
pandn  %xmm14,%xmm0
por    %xmm2,%xmm0
movdqa 0xd32(%rip),%xmm15
movdqa %xmm15,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm15,%xmm2
por    %xmm0,%xmm2
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
packssdw %xmm2,%xmm0
movdqu %xmm0,0x2(%rsi)
movdqu 0x12(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x9(%r9),%xmm5
punpcklbw %xmm10,%xmm5
movdqa %xmm5,%xmm6
punpcklwd %xmm10,%xmm6
punpckhwd %xmm10,%xmm5
pshufd $0xf5,%xmm0,%xmm3
pmuludq %xmm13,%xmm3
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm7
pmuludq %xmm13,%xmm7
pmuludq %xmm13,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm2
pshufd $0xf5,%xmm5,%xmm1
pmuludq %xmm7,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm2
pmuludq %xmm6,%xmm0
pshufd $0xe8,%xmm0,%xmm7
pshufd $0xf5,%xmm6,%xmm0
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm7
movdqa %xmm7,%xmm5
psrad  $0x1f,%xmm5
psrld  $0x1c,%xmm5
paddd  %xmm7,%xmm5
psrad  $0x4,%xmm5
movdqa %xmm2,%xmm6
psrad  $0x1f,%xmm6
psrld  $0x1c,%xmm6
paddd  %xmm2,%xmm6
psrad  $0x4,%xmm6
pshuflw $0xe8,%xmm6,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm5,%xmm1
pshufhw $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm7,%xmm3
paddd  %xmm11,%xmm3
movdqa %xmm2,%xmm0
paddd  %xmm11,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm4
pcmpgtd %xmm0,%xmm4
pxor   %xmm8,%xmm3
movdqa %xmm12,%xmm0
pcmpgtd %xmm3,%xmm0
packssdw %xmm4,%xmm0
por    %xmm1,%xmm0
pcmpgtd %xmm11,%xmm7
pcmpgtd %xmm11,%xmm2
por    %xmm9,%xmm2
por    %xmm9,%xmm7
movdqa %xmm0,%xmm1
punpcklwd %xmm1,%xmm1
pslld  $0x1f,%xmm1
psrad  $0x1f,%xmm1
pandn  %xmm7,%xmm1
punpckhwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm2,%xmm0
paddd  %xmm6,%xmm0
paddd  %xmm5,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm14,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm14,%xmm2
por    %xmm1,%xmm2
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
movdqa %xmm15,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm15,%xmm1
por    %xmm2,%xmm1
packssdw %xmm0,%xmm1
movdqu %xmm1,0x12(%rsi)
movdqu 0x22(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x11(%r9),%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
pshufd $0xf5,%xmm0,%xmm4
pmuludq %xmm13,%xmm4
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm13,%xmm5
pmuludq %xmm13,%xmm1
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm6
pshufd $0xf5,%xmm2,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm6
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm5
pshufd $0xf5,%xmm3,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm5
movdqa %xmm5,%xmm7
psrad  $0x1f,%xmm7
psrld  $0x1c,%xmm7
paddd  %xmm5,%xmm7
psrad  $0x4,%xmm7
movdqa %xmm6,%xmm2
psrad  $0x1f,%xmm2
psrld  $0x1c,%xmm2
paddd  %xmm6,%xmm2
psrad  $0x4,%xmm2
pshuflw $0xe8,%xmm2,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm7,%xmm1
pshufhw $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm5,%xmm3
paddd  %xmm11,%xmm3
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm4
pcmpgtd %xmm0,%xmm4
pxor   %xmm8,%xmm3
movdqa %xmm12,%xmm0
pcmpgtd %xmm3,%xmm0
packssdw %xmm4,%xmm0
por    %xmm1,%xmm0
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm6
por    %xmm9,%xmm6
por    %xmm9,%xmm5
movdqa %xmm0,%xmm1
punpcklwd %xmm1,%xmm1
pslld  $0x1f,%xmm1
psrad  $0x1f,%xmm1
pandn  %xmm5,%xmm1
punpckhwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm7,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm14,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm14,%xmm2
por    %xmm1,%xmm2
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
movdqa %xmm15,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm15,%xmm1
por    %xmm2,%xmm1
packssdw %xmm0,%xmm1
movdqu %xmm1,0x22(%rsi)
movdqu 0x32(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x19(%r9),%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
pshufd $0xf5,%xmm0,%xmm4
pmuludq %xmm13,%xmm4
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm13,%xmm5
pmuludq %xmm13,%xmm1
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm6
pshufd $0xf5,%xmm2,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm6
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm5
pshufd $0xf5,%xmm3,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm5
movdqa %xmm5,%xmm7
psrad  $0x1f,%xmm7
psrld  $0x1c,%xmm7
paddd  %xmm5,%xmm7
psrad  $0x4,%xmm7
movdqa %xmm6,%xmm2
psrad  $0x1f,%xmm2
psrld  $0x1c,%xmm2
paddd  %xmm6,%xmm2
psrad  $0x4,%xmm2
pshuflw $0xe8,%xmm2,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm7,%xmm1
pshufhw $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm5,%xmm3
paddd  %xmm11,%xmm3
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm4
pcmpgtd %xmm0,%xmm4
pxor   %xmm8,%xmm3
movdqa %xmm12,%xmm0
pcmpgtd %xmm3,%xmm0
packssdw %xmm4,%xmm0
por    %xmm1,%xmm0
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm6
por    %xmm9,%xmm6
por    %xmm9,%xmm5
movdqa %xmm0,%xmm1
punpcklwd %xmm1,%xmm1
pslld  $0x1f,%xmm1
psrad  $0x1f,%xmm1
pandn  %xmm5,%xmm1
punpckhwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm7,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm14,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm14,%xmm2
por    %xmm1,%xmm2
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
movdqa %xmm15,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm15,%xmm1
por    %xmm2,%xmm1
packssdw %xmm0,%xmm1
movdqu %xmm1,0x32(%rsi)
movdqu 0x42(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x21(%r9),%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
pshufd $0xf5,%xmm0,%xmm4
pmuludq %xmm13,%xmm4
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm13,%xmm5
pmuludq %xmm13,%xmm1
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm6
pshufd $0xf5,%xmm2,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm6
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm5
pshufd $0xf5,%xmm3,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm5
movdqa %xmm5,%xmm7
psrad  $0x1f,%xmm7
psrld  $0x1c,%xmm7
paddd  %xmm5,%xmm7
psrad  $0x4,%xmm7
movdqa %xmm6,%xmm2
psrad  $0x1f,%xmm2
psrld  $0x1c,%xmm2
paddd  %xmm6,%xmm2
psrad  $0x4,%xmm2
pshuflw $0xe8,%xmm2,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm7,%xmm1
pshufhw $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm5,%xmm3
paddd  %xmm11,%xmm3
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm4
pcmpgtd %xmm0,%xmm4
pxor   %xmm8,%xmm3
movdqa %xmm12,%xmm0
pcmpgtd %xmm3,%xmm0
packssdw %xmm4,%xmm0
por    %xmm1,%xmm0
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm6
por    %xmm9,%xmm6
por    %xmm9,%xmm5
movdqa %xmm0,%xmm1
punpcklwd %xmm1,%xmm1
pslld  $0x1f,%xmm1
psrad  $0x1f,%xmm1
pandn  %xmm5,%xmm1
punpckhwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm7,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm14,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm14,%xmm2
por    %xmm1,%xmm2
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
movdqa %xmm15,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm15,%xmm1
por    %xmm2,%xmm1
packssdw %xmm0,%xmm1
movdqu %xmm1,0x42(%rsi)
movdqu 0x52(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x29(%r9),%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
pshufd $0xf5,%xmm0,%xmm4
pmuludq %xmm13,%xmm4
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm13,%xmm5
pmuludq %xmm13,%xmm1
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm6
pshufd $0xf5,%xmm2,%xmm1
pmuludq %xmm5,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpckldq %xmm1,%xmm6
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm5
pshufd $0xf5,%xmm3,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm5
movdqa %xmm5,%xmm7
psrad  $0x1f,%xmm7
psrld  $0x1c,%xmm7
paddd  %xmm5,%xmm7
psrad  $0x4,%xmm7
movdqa %xmm6,%xmm2
psrad  $0x1f,%xmm2
psrld  $0x1c,%xmm2
paddd  %xmm6,%xmm2
psrad  $0x4,%xmm2
pshuflw $0xe8,%xmm2,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm7,%xmm1
pshufhw $0xe8,%xmm1,%xmm1
pshufd $0xe8,%xmm1,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm5,%xmm3
paddd  %xmm11,%xmm3
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm12,%xmm4
pcmpgtd %xmm0,%xmm4
pxor   %xmm8,%xmm3
movdqa %xmm12,%xmm0
pcmpgtd %xmm3,%xmm0
packssdw %xmm4,%xmm0
por    %xmm1,%xmm0
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm6
por    %xmm9,%xmm6
por    %xmm9,%xmm5
movdqa %xmm0,%xmm1
punpcklwd %xmm1,%xmm1
pslld  $0x1f,%xmm1
psrad  $0x1f,%xmm1
pandn  %xmm5,%xmm1
punpckhwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm7,%xmm1
movdqa %xmm1,%xmm2
pcmpgtd %xmm14,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm14,%xmm2
por    %xmm1,%xmm2
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
movdqa %xmm15,%xmm1
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm2
pandn  %xmm15,%xmm1
por    %xmm2,%xmm1
packssdw %xmm0,%xmm1
movdqu %xmm1,0x52(%rsi)
movdqu 0x62(%rdi),%xmm0
punpckhwd %xmm0,%xmm1
psrad  $0x10,%xmm1
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
movq   0x31(%r9),%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
pshufd $0xf5,%xmm0,%xmm4
pmuludq %xmm13,%xmm4
pmuludq %xmm13,%xmm0
pshufd $0xf5,%xmm1,%xmm5
pmuludq %xmm13,%xmm5
pmuludq %xmm13,%xmm1
pmuludq %xmm2,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm2,%xmm2
pmuludq %xmm5,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm1
pmuludq %xmm3,%xmm0
pshufd $0xe8,%xmm0,%xmm6
pshufd $0xf5,%xmm3,%xmm0
pmuludq %xmm4,%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm6
movdqa %xmm6,%xmm5
psrad  $0x1f,%xmm5
psrld  $0x1c,%xmm5
paddd  %xmm6,%xmm5
psrad  $0x4,%xmm5
movdqa %xmm1,%xmm2
psrad  $0x1f,%xmm2
psrld  $0x1c,%xmm2
paddd  %xmm1,%xmm2
psrad  $0x4,%xmm2
pshuflw $0xe8,%xmm2,%xmm0
pshufhw $0xe8,%xmm0,%xmm0
pshufd $0xe8,%xmm0,%xmm0
pshuflw $0xe8,%xmm5,%xmm3
pshufhw $0xe8,%xmm3,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpcklqdq %xmm0,%xmm3
movdqa %xmm6,%xmm0
paddd  %xmm11,%xmm0
movdqa %xmm1,%xmm4
paddd  %xmm11,%xmm4
pxor   %xmm8,%xmm4
movdqa %xmm12,%xmm7
pcmpgtd %xmm4,%xmm7
pxor   %xmm8,%xmm0
pcmpgtd %xmm0,%xmm12
packssdw %xmm7,%xmm12
por    %xmm3,%xmm12
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm1
por    %xmm9,%xmm1
por    %xmm9,%xmm6
movdqa %xmm12,%xmm0
punpcklwd %xmm0,%xmm0
pslld  $0x1f,%xmm0
psrad  $0x1f,%xmm0
pandn  %xmm6,%xmm0
punpckhwd %xmm12,%xmm12
pslld  $0x1f,%xmm12
psrad  $0x1f,%xmm12
pandn  %xmm1,%xmm12
paddd  %xmm2,%xmm12
paddd  %xmm5,%xmm0
movdqa %xmm0,%xmm1
pcmpgtd %xmm14,%xmm1
pand   %xmm1,%xmm0
pandn  %xmm14,%xmm1
por    %xmm0,%xmm1
movdqa %xmm12,%xmm0
pcmpgtd %xmm14,%xmm0
pand   %xmm0,%xmm12
pandn  %xmm14,%xmm0
por    %xmm12,%xmm0
movdqa %xmm15,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm0
pandn  %xmm15,%xmm2
por    %xmm0,%xmm2
movdqa %xmm15,%xmm0
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm1
pandn  %xmm15,%xmm0
por    %xmm1,%xmm0
packssdw %xmm2,%xmm0
movdqu %xmm0,0x62(%rsi)
mov    $0x39,%ecx
xor    %r10d,%r10d
jmp    1d8e <iquant1_intra+0xc8e>
xchg   %ax,%ax
mov    %ax,(%rsi,%rcx,2)
add    $0x1,%rcx
cmp    $0x40,%rcx
je     1de1 <iquant1_intra+0xce1>
movswl (%rdi,%rcx,2),%eax
movzbl (%r9,%rcx,1),%ebp
imul   %r8d,%eax
imul   %ebp,%eax
lea    0xf(%rax),%ebp
test   %eax,%eax
mov    %eax,%ebx
cmovs  %ebp,%ebx
sar    $0x4,%ebx
xor    %edx,%edx
cmp    $0x10,%eax
setl   %dl
cmp    $0x1f,%ebp
lea    -0x1(%rdx,%rdx,1),%eax
cmovb  %r10d,%eax
test   $0x1,%bl
cmovne %r10d,%eax
add    %ebx,%eax
cmp    $0xfffff801,%eax
jge    1dd3 <iquant1_intra+0xcd3>
mov    $0xfffff800,%eax
cmp    $0x7ff,%eax
jl     1d80 <iquant1_intra+0xc80>
mov    $0x7ff,%eax
jmp    1d80 <iquant1_intra+0xc80>
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @iquant1_intra(i16* %0, i16* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i16* %0, i16** %6
store i16* %1, i16** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%13 = load i16*, i16** %6
%14 = getelementptr inbounds i16, i16* %13, i64 0
%15 = load i16, i16* %14
%16 = sext i16 %15 to i32
%17 = load i32, i32* %8
%18 = sub nsw i32 3, %17
%19 = shl i32 %16, %18
%20 = trunc i32 %19 to i16
%21 = load i16*, i16** %7
%22 = getelementptr inbounds i16, i16* %21, i64 0
store i16 %20, i16* %22
store i32 1, i32* %11
br label %23
23: ; preds = %69, %5
%24 = load i32, i32* %11
%25 = icmp slt i32 %24, 64
br i1 %25, label %26, label %78
26: ; preds = %23
%27 = load i16*, i16** %6
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i16, i16* %27, i64 %29
%31 = load i16, i16* %30
%32 = sext i16 %31 to i32
%33 = load i8*, i8** %9
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = mul nsw i32 %32, %38
%40 = load i32, i32* %10
%41 = mul nsw i32 %39, %40
%42 = sdiv i32 %41, 16
store i32 %42, i32* %12
%43 = load i32, i32* %12
%44 = and i32 1, %43
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %57
46: ; preds = %26
%47 = load i32, i32* %12
%48 = icmp eq i32 %47, 0
br i1 %48, label %56, label %49
49: ; preds = %46
%50 = load i32, i32* %12
%51 = load i32, i32* %12
%52 = icmp sgt i32 %51, 0
%53 = zext i1 %52 to i64
%54 = select i1 %52, i32 -1, i32 1
%55 = add nsw i32 %50, %54
store i32 %55, i32* %12
br label %56
56: ; preds = %49, %46
br label %57
57: ; preds = %56, %26
%58 = load i32, i32* %12
%59 = icmp sgt i32 %58, 2047
br i1 %59, label %60, label %61
60: ; preds = %57
br label %69
61: ; preds = %57
%62 = load i32, i32* %12
%63 = icmp slt i32 %62, -2048
br i1 %63, label %64, label %65
64: ; preds = %61
br label %67
65: ; preds = %61
%66 = load i32, i32* %12
br label %67
67: ; preds = %65, %64
%68 = phi i32 [ -2048, %64 ], [ %66, %65 ]
br label %69
69: ; preds = %67, %60
%70 = phi i32 [ 2047, %60 ], [ %68, %67 ]
%71 = trunc i32 %70 to i16
%72 = load i16*, i16** %7
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i16, i16* %72, i64 %74
store i16 %71, i16* %75
%76 = load i32, i32* %11
%77 = add nsw i32 %76, 1
store i32 %77, i32* %11
br label %23
78: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @iquant1_intra(i16* nocapture %0, i16* nocapture writeonly %1, i32 %2, i8* nocapture %3, i32 %4) {
%6 = load i16, i16* %0
%7 = zext i16 %6 to i32
%8 = sub nsw i32 3, %2
%9 = shl i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = getelementptr i16, i16* %1, i64 1
%12 = bitcast i16* %11 to i8*
%13 = getelementptr i16, i16* %1, i64 64
%14 = bitcast i16* %13 to i8*
%15 = getelementptr i16, i16* %0, i64 1
%16 = getelementptr i16, i16* %0, i64 64
%17 = getelementptr i8, i8* %3, i64 1
%18 = getelementptr i8, i8* %3, i64 64
%19 = icmp ult i16* %11, %16
%20 = icmp ult i16* %15, %13
%21 = and i1 %19, %20
%22 = icmp ugt i8* %18, %12
%23 = icmp ult i8* %17, %14
%24 = and i1 %22, %23
%25 = or i1 %21, %24
br i1 %25, label %211, label %26
26: ; preds = %5
%27 = insertelement <8 x i32> poison, i32 %4, i64 0
%28 = shufflevector <8 x i32> %27, <8 x i32> poison, <8 x i32> zeroinitializer
%29 = getelementptr inbounds i16, i16* %0, i64 1
%30 = bitcast i16* %29 to <8 x i16>*
%31 = load <8 x i16>, <8 x i16>* %30
%32 = sext <8 x i16> %31 to <8 x i32>
%33 = getelementptr inbounds i8, i8* %3, i64 1
%34 = bitcast i8* %33 to <8 x i8>*
%35 = load <8 x i8>, <8 x i8>* %34
%36 = zext <8 x i8> %35 to <8 x i32>
%37 = mul <8 x i32> %28, %32
%38 = mul <8 x i32> %37, %36
%39 = sdiv <8 x i32> %38, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%40 = trunc <8 x i32> %39 to <8 x i1>
%41 = add <8 x i32> %38, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%42 = icmp ult <8 x i32> %41, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%43 = or <8 x i1> %42, %40
%44 = icmp sgt <8 x i32> %38, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%45 = select <8 x i1> %44, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%46 = select <8 x i1> %43, <8 x i32> zeroinitializer, <8 x i32> %45
%47 = add nsw <8 x i32> %46, %39
%48 = icmp sgt <8 x i32> %47, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%49 = select <8 x i1> %48, <8 x i32> %47, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%50 = icmp slt <8 x i32> %49, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%51 = select <8 x i1> %50, <8 x i32> %49, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%52 = trunc <8 x i32> %51 to <8 x i16>
%53 = getelementptr inbounds i16, i16* %1, i64 1
%54 = bitcast i16* %53 to <8 x i16>*
store <8 x i16> %52, <8 x i16>* %54
%55 = getelementptr inbounds i16, i16* %0, i64 9
%56 = bitcast i16* %55 to <8 x i16>*
%57 = load <8 x i16>, <8 x i16>* %56
%58 = sext <8 x i16> %57 to <8 x i32>
%59 = getelementptr inbounds i8, i8* %3, i64 9
%60 = bitcast i8* %59 to <8 x i8>*
%61 = load <8 x i8>, <8 x i8>* %60
%62 = zext <8 x i8> %61 to <8 x i32>
%63 = mul <8 x i32> %28, %58
%64 = mul <8 x i32> %63, %62
%65 = sdiv <8 x i32> %64, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%66 = trunc <8 x i32> %65 to <8 x i1>
%67 = add <8 x i32> %64, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%68 = icmp ult <8 x i32> %67, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%69 = or <8 x i1> %68, %66
%70 = icmp sgt <8 x i32> %64, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%71 = select <8 x i1> %70, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%72 = select <8 x i1> %69, <8 x i32> zeroinitializer, <8 x i32> %71
%73 = add nsw <8 x i32> %72, %65
%74 = icmp sgt <8 x i32> %73, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%75 = select <8 x i1> %74, <8 x i32> %73, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%76 = icmp slt <8 x i32> %75, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%77 = select <8 x i1> %76, <8 x i32> %75, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%78 = trunc <8 x i32> %77 to <8 x i16>
%79 = getelementptr inbounds i16, i16* %1, i64 9
%80 = bitcast i16* %79 to <8 x i16>*
store <8 x i16> %78, <8 x i16>* %80
%81 = getelementptr inbounds i16, i16* %0, i64 17
%82 = bitcast i16* %81 to <8 x i16>*
%83 = load <8 x i16>, <8 x i16>* %82
%84 = sext <8 x i16> %83 to <8 x i32>
%85 = getelementptr inbounds i8, i8* %3, i64 17
%86 = bitcast i8* %85 to <8 x i8>*
%87 = load <8 x i8>, <8 x i8>* %86
%88 = zext <8 x i8> %87 to <8 x i32>
%89 = mul <8 x i32> %28, %84
%90 = mul <8 x i32> %89, %88
%91 = sdiv <8 x i32> %90, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%92 = trunc <8 x i32> %91 to <8 x i1>
%93 = add <8 x i32> %90, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%94 = icmp ult <8 x i32> %93, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%95 = or <8 x i1> %94, %92
%96 = icmp sgt <8 x i32> %90, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%97 = select <8 x i1> %96, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%98 = select <8 x i1> %95, <8 x i32> zeroinitializer, <8 x i32> %97
%99 = add nsw <8 x i32> %98, %91
%100 = icmp sgt <8 x i32> %99, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%101 = select <8 x i1> %100, <8 x i32> %99, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%102 = icmp slt <8 x i32> %101, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%103 = select <8 x i1> %102, <8 x i32> %101, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%104 = trunc <8 x i32> %103 to <8 x i16>
%105 = getelementptr inbounds i16, i16* %1, i64 17
%106 = bitcast i16* %105 to <8 x i16>*
store <8 x i16> %104, <8 x i16>* %106
%107 = getelementptr inbounds i16, i16* %0, i64 25
%108 = bitcast i16* %107 to <8 x i16>*
%109 = load <8 x i16>, <8 x i16>* %108
%110 = sext <8 x i16> %109 to <8 x i32>
%111 = getelementptr inbounds i8, i8* %3, i64 25
%112 = bitcast i8* %111 to <8 x i8>*
%113 = load <8 x i8>, <8 x i8>* %112
%114 = zext <8 x i8> %113 to <8 x i32>
%115 = mul <8 x i32> %28, %110
%116 = mul <8 x i32> %115, %114
%117 = sdiv <8 x i32> %116, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%118 = trunc <8 x i32> %117 to <8 x i1>
%119 = add <8 x i32> %116, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%120 = icmp ult <8 x i32> %119, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%121 = or <8 x i1> %120, %118
%122 = icmp sgt <8 x i32> %116, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%123 = select <8 x i1> %122, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%124 = select <8 x i1> %121, <8 x i32> zeroinitializer, <8 x i32> %123
%125 = add nsw <8 x i32> %124, %117
%126 = icmp sgt <8 x i32> %125, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%127 = select <8 x i1> %126, <8 x i32> %125, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%128 = icmp slt <8 x i32> %127, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%129 = select <8 x i1> %128, <8 x i32> %127, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%130 = trunc <8 x i32> %129 to <8 x i16>
%131 = getelementptr inbounds i16, i16* %1, i64 25
%132 = bitcast i16* %131 to <8 x i16>*
store <8 x i16> %130, <8 x i16>* %132
%133 = getelementptr inbounds i16, i16* %0, i64 33
%134 = bitcast i16* %133 to <8 x i16>*
%135 = load <8 x i16>, <8 x i16>* %134
%136 = sext <8 x i16> %135 to <8 x i32>
%137 = getelementptr inbounds i8, i8* %3, i64 33
%138 = bitcast i8* %137 to <8 x i8>*
%139 = load <8 x i8>, <8 x i8>* %138
%140 = zext <8 x i8> %139 to <8 x i32>
%141 = mul <8 x i32> %28, %136
%142 = mul <8 x i32> %141, %140
%143 = sdiv <8 x i32> %142, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%144 = trunc <8 x i32> %143 to <8 x i1>
%145 = add <8 x i32> %142, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%146 = icmp ult <8 x i32> %145, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%147 = or <8 x i1> %146, %144
%148 = icmp sgt <8 x i32> %142, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%149 = select <8 x i1> %148, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%150 = select <8 x i1> %147, <8 x i32> zeroinitializer, <8 x i32> %149
%151 = add nsw <8 x i32> %150, %143
%152 = icmp sgt <8 x i32> %151, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%153 = select <8 x i1> %152, <8 x i32> %151, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%154 = icmp slt <8 x i32> %153, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%155 = select <8 x i1> %154, <8 x i32> %153, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%156 = trunc <8 x i32> %155 to <8 x i16>
%157 = getelementptr inbounds i16, i16* %1, i64 33
%158 = bitcast i16* %157 to <8 x i16>*
store <8 x i16> %156, <8 x i16>* %158
%159 = getelementptr inbounds i16, i16* %0, i64 41
%160 = bitcast i16* %159 to <8 x i16>*
%161 = load <8 x i16>, <8 x i16>* %160
%162 = sext <8 x i16> %161 to <8 x i32>
%163 = getelementptr inbounds i8, i8* %3, i64 41
%164 = bitcast i8* %163 to <8 x i8>*
%165 = load <8 x i8>, <8 x i8>* %164
%166 = zext <8 x i8> %165 to <8 x i32>
%167 = mul <8 x i32> %28, %162
%168 = mul <8 x i32> %167, %166
%169 = sdiv <8 x i32> %168, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%170 = trunc <8 x i32> %169 to <8 x i1>
%171 = add <8 x i32> %168, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%172 = icmp ult <8 x i32> %171, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%173 = or <8 x i1> %172, %170
%174 = icmp sgt <8 x i32> %168, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%175 = select <8 x i1> %174, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%176 = select <8 x i1> %173, <8 x i32> zeroinitializer, <8 x i32> %175
%177 = add nsw <8 x i32> %176, %169
%178 = icmp sgt <8 x i32> %177, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%179 = select <8 x i1> %178, <8 x i32> %177, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%180 = icmp slt <8 x i32> %179, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%181 = select <8 x i1> %180, <8 x i32> %179, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%182 = trunc <8 x i32> %181 to <8 x i16>
%183 = getelementptr inbounds i16, i16* %1, i64 41
%184 = bitcast i16* %183 to <8 x i16>*
store <8 x i16> %182, <8 x i16>* %184
%185 = getelementptr inbounds i16, i16* %0, i64 49
%186 = bitcast i16* %185 to <8 x i16>*
%187 = load <8 x i16>, <8 x i16>* %186
%188 = sext <8 x i16> %187 to <8 x i32>
%189 = getelementptr inbounds i8, i8* %3, i64 49
%190 = bitcast i8* %189 to <8 x i8>*
%191 = load <8 x i8>, <8 x i8>* %190
%192 = zext <8 x i8> %191 to <8 x i32>
%193 = mul <8 x i32> %28, %188
%194 = mul <8 x i32> %193, %192
%195 = sdiv <8 x i32> %194, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
%196 = trunc <8 x i32> %195 to <8 x i1>
%197 = add <8 x i32> %194, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%198 = icmp ult <8 x i32> %197, <i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31, i32 31>
%199 = or <8 x i1> %198, %196
%200 = icmp sgt <8 x i32> %194, <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%201 = select <8 x i1> %200, <8 x i32> <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
%202 = select <8 x i1> %199, <8 x i32> zeroinitializer, <8 x i32> %201
%203 = add nsw <8 x i32> %202, %195
%204 = icmp sgt <8 x i32> %203, <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%205 = select <8 x i1> %204, <8 x i32> %203, <8 x i32> <i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048, i32 -2048>
%206 = icmp slt <8 x i32> %205, <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%207 = select <8 x i1> %206, <8 x i32> %205, <8 x i32> <i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047, i32 2047>
%208 = trunc <8 x i32> %207 to <8 x i16>
%209 = getelementptr inbounds i16, i16* %1, i64 49
%210 = bitcast i16* %209 to <8 x i16>*
store <8 x i16> %208, <8 x i16>* %210
br label %211
211: ; preds = %26, %5
%212 = phi i64 [ 1, %5 ], [ 57, %26 ]
br label %213
213: ; preds = %211, %213
%214 = phi i64 [ %239, %213 ], [ %212, %211 ]
%215 = getelementptr inbounds i16, i16* %0, i64 %214
%216 = load i16, i16* %215
%217 = sext i16 %216 to i32
%218 = getelementptr inbounds i8, i8* %3, i64 %214
%219 = load i8, i8* %218
%220 = zext i8 %219 to i32
%221 = mul i32 %217, %4
%222 = mul i32 %221, %220
%223 = sdiv i32 %222, 16
%224 = and i32 %223, 1
%225 = icmp ne i32 %224, 0
%226 = add i32 %222, 15
%227 = icmp ult i32 %226, 31
%228 = select i1 %225, i1 true, i1 %227
%229 = icmp sgt i32 %222, 15
%230 = select i1 %229, i32 -1, i32 1
%231 = select i1 %228, i32 0, i32 %230
%232 = add nsw i32 %231, %223
%233 = icmp sgt i32 %232, -2048
%234 = select i1 %233, i32 %232, i32 -2048
%235 = icmp slt i32 %234, 2047
%236 = select i1 %235, i32 %234, i32 2047
%237 = trunc i32 %236 to i16
%238 = getelementptr inbounds i16, i16* %1, i64 %214
store i16 %237, i16* %238
%239 = add nuw nsw i64 %214, 1
%240 = icmp eq i64 %239, 64
br i1 %240, label %241, label %213
241: ; preds = %213
ret void
}