// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jfdctfst.c
// Function: jpeg_fdct_ifast
GLOBAL(void)
jpeg_fdct_ifast (DCTELEM * data)
{
  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
  DCTELEM tmp10, tmp11, tmp12, tmp13;
  DCTELEM z1, z2, z3, z4, z5, z11, z13;
  DCTELEM *dataptr;
  int ctr;
  SHIFT_TEMPS

  /* Pass 1: process rows. */

  dataptr = data;
  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
    tmp0 = dataptr[0] + dataptr[7];
    tmp7 = dataptr[0] - dataptr[7];
    tmp1 = dataptr[1] + dataptr[6];
    tmp6 = dataptr[1] - dataptr[6];
    tmp2 = dataptr[2] + dataptr[5];
    tmp5 = dataptr[2] - dataptr[5];
    tmp3 = dataptr[3] + dataptr[4];
    tmp4 = dataptr[3] - dataptr[4];
    
    /* Even part */
    
    tmp10 = tmp0 + tmp3;	/* phase 2 */
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2;
    tmp12 = tmp1 - tmp2;
    
    dataptr[0] = tmp10 + tmp11; /* phase 3 */
    dataptr[4] = tmp10 - tmp11;
    
    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
    dataptr[2] = tmp13 + z1;	/* phase 5 */
    dataptr[6] = tmp13 - z1;
    
    /* Odd part */

    tmp10 = tmp4 + tmp5;	/* phase 2 */
    tmp11 = tmp5 + tmp6;
    tmp12 = tmp6 + tmp7;

    /* The rotator is modified from fig 4-8 to avoid extra negations. */
    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */

    z11 = tmp7 + z3;		/* phase 5 */
    z13 = tmp7 - z3;

    dataptr[5] = z13 + z2;	/* phase 6 */
    dataptr[3] = z13 - z2;
    dataptr[1] = z11 + z4;
    dataptr[7] = z11 - z4;

    dataptr += DCTSIZE;		/* advance pointer to next row */
  }

  /* Pass 2: process columns. */

  dataptr = data;
  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
    
    /* Even part */
    
    tmp10 = tmp0 + tmp3;	/* phase 2 */
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2;
    tmp12 = tmp1 - tmp2;
    
    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
    dataptr[DCTSIZE*4] = tmp10 - tmp11;
    
    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
    dataptr[DCTSIZE*6] = tmp13 - z1;
    
    /* Odd part */

    tmp10 = tmp4 + tmp5;	/* phase 2 */
    tmp11 = tmp5 + tmp6;
    tmp12 = tmp6 + tmp7;

    /* The rotator is modified from fig 4-8 to avoid extra negations. */
    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */

    z11 = tmp7 + z3;		/* phase 5 */
    z13 = tmp7 - z3;

    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
    dataptr[DCTSIZE*3] = z13 - z2;
    dataptr[DCTSIZE*1] = z11 + z4;
    dataptr[DCTSIZE*7] = z11 - z4;

    dataptr++;			/* advance pointer to next column */
  }
}

// Assembly:
pushq %r14
pushq %rbx
xorl %eax, %eax
movl 0x1c(%rdi,%rax), %esi
movl (%rdi,%rax), %ecx
movl 0x4(%rdi,%rax), %edx
leal (%rsi,%rcx), %r8d
subl %esi, %ecx
movl 0x18(%rdi,%rax), %esi
leal (%rsi,%rdx), %r10d
subl %esi, %edx
movl 0x8(%rdi,%rax), %esi
movl 0x14(%rdi,%rax), %r9d
leal (%r9,%rsi), %r11d
subl %r9d, %esi
movl 0xc(%rdi,%rax), %r9d
movl 0x10(%rdi,%rax), %ebx
leal (%rbx,%r9), %r14d
subl %ebx, %r9d
leal (%r14,%r8), %ebx
subl %r14d, %r8d
leal (%r11,%r10), %r14d
subl %r11d, %r10d
leal (%rbx,%r14), %r11d
movl %r11d, (%rdi,%rax)
subl %r14d, %ebx
movl %ebx, 0x10(%rdi,%rax)
addl %r8d, %r10d
movslq %r10d, %r10
imulq $0xb5, %r10, %r10
shrq $0x8, %r10
leal (%r8,%r10), %r11d
movl %r11d, 0x8(%rdi,%rax)
subl %r10d, %r8d
movl %r8d, 0x18(%rdi,%rax)
addl %esi, %r9d
addl %edx, %esi
addl %ecx, %edx
movslq %r9d, %r8
subl %edx, %r9d
movslq %r9d, %r9
imulq $0x62, %r9, %r9
shrq $0x8, %r9
imulq $0x8b, %r8, %r8
shrq $0x8, %r8
addl %r9d, %r8d
movslq %edx, %rdx
imulq $0x14e, %rdx, %rdx      # imm = 0x14E
shrq $0x8, %rdx
addl %r9d, %edx
movslq %esi, %rsi
imulq $0xb5, %rsi, %rsi
shrq $0x8, %rsi
leal (%rcx,%rsi), %r9d
subl %esi, %ecx
leal (%r8,%rcx), %esi
movl %esi, 0x14(%rdi,%rax)
subl %r8d, %ecx
movl %ecx, 0xc(%rdi,%rax)
leal (%rdx,%r9), %ecx
movl %ecx, 0x4(%rdi,%rax)
subl %edx, %r9d
movl %r9d, 0x1c(%rdi,%rax)
addq $0x20, %rax
cmpl $0x100, %eax            # imm = 0x100
jne 0x797ed
movq $-0x8, %rax
movdqa 0x30d71(%rip), %xmm0    # 0xaa660
movdqa 0x30d79(%rip), %xmm1    # 0xaa670
movdqa 0x30d81(%rip), %xmm2    # 0xaa680
movdqa 0x30d89(%rip), %xmm3    # 0xaa690
movdqu 0x100(%rdi,%rax,4), %xmm9
movdqu 0x20(%rdi,%rax,4), %xmm4
movdqu 0x40(%rdi,%rax,4), %xmm6
movdqu 0x60(%rdi,%rax,4), %xmm5
movdqu 0x80(%rdi,%rax,4), %xmm7
movdqa %xmm9, %xmm8
paddd %xmm4, %xmm8
psubd %xmm9, %xmm4
movdqu 0xe0(%rdi,%rax,4), %xmm9
movdqa %xmm9, %xmm10
paddd %xmm6, %xmm10
psubd %xmm9, %xmm6
movdqu 0xc0(%rdi,%rax,4), %xmm9
movdqa %xmm9, %xmm11
paddd %xmm5, %xmm11
psubd %xmm9, %xmm5
movdqu 0xa0(%rdi,%rax,4), %xmm9
movdqa %xmm9, %xmm12
paddd %xmm7, %xmm12
psubd %xmm9, %xmm7
movdqa %xmm12, %xmm9
paddd %xmm8, %xmm9
psubd %xmm12, %xmm8
movdqa %xmm11, %xmm12
paddd %xmm10, %xmm12
psubd %xmm11, %xmm10
movdqa %xmm9, %xmm11
paddd %xmm12, %xmm11
movdqu %xmm11, 0x20(%rdi,%rax,4)
psubd %xmm12, %xmm9
movdqu %xmm9, 0xa0(%rdi,%rax,4)
paddd %xmm8, %xmm10
pshufd $0xfe, %xmm10, %xmm9    # xmm9 = xmm10[2,3,3,3]
pshufd $0xd4, %xmm10, %xmm10   # xmm10 = xmm10[0,1,1,3]
pxor %xmm11, %xmm11
pcmpgtd %xmm10, %xmm11
pmuludq %xmm0, %xmm10
pmuludq %xmm0, %xmm11
psllq $0x20, %xmm11
paddq %xmm10, %xmm11
pxor %xmm10, %xmm10
pcmpgtd %xmm9, %xmm10
pmuludq %xmm0, %xmm9
pmuludq %xmm0, %xmm10
psllq $0x20, %xmm10
paddq %xmm9, %xmm10
psrlq $0x8, %xmm10
psrlq $0x8, %xmm11
shufps $0x88, %xmm10, %xmm11   # xmm11 = xmm11[0,2],xmm10[0,2]
movdqa %xmm8, %xmm9
paddd %xmm11, %xmm9
movdqu %xmm9, 0x60(%rdi,%rax,4)
psubd %xmm11, %xmm8
movdqu %xmm8, 0xe0(%rdi,%rax,4)
paddd %xmm5, %xmm7
paddd %xmm6, %xmm5
paddd %xmm4, %xmm6
pshufd $0xfe, %xmm7, %xmm9     # xmm9 = xmm7[2,3,3,3]
pshufd $0xd4, %xmm7, %xmm10    # xmm10 = xmm7[0,1,1,3]
psubd %xmm6, %xmm7
pshufd $0xfe, %xmm7, %xmm11    # xmm11 = xmm7[2,3,3,3]
pshufd $0xd4, %xmm7, %xmm7     # xmm7 = xmm7[0,1,1,3]
pxor %xmm8, %xmm8
pcmpgtd %xmm7, %xmm8
pmuludq %xmm1, %xmm7
pmuludq %xmm1, %xmm8
psllq $0x20, %xmm8
paddq %xmm7, %xmm8
pxor %xmm7, %xmm7
pcmpgtd %xmm11, %xmm7
pmuludq %xmm1, %xmm11
pmuludq %xmm1, %xmm7
psllq $0x20, %xmm7
paddq %xmm11, %xmm7
psrlq $0x8, %xmm7
psrlq $0x8, %xmm8
shufps $0x88, %xmm7, %xmm8     # xmm8 = xmm8[0,2],xmm7[0,2]
pxor %xmm7, %xmm7
pcmpgtd %xmm10, %xmm7
pmuludq %xmm2, %xmm10
pmuludq %xmm2, %xmm7
psllq $0x20, %xmm7
paddq %xmm10, %xmm7
pxor %xmm10, %xmm10
pcmpgtd %xmm9, %xmm10
pmuludq %xmm2, %xmm9
pmuludq %xmm2, %xmm10
psllq $0x20, %xmm10
paddq %xmm9, %xmm10
psrlq $0x8, %xmm10
psrlq $0x8, %xmm7
shufps $0x88, %xmm10, %xmm7    # xmm7 = xmm7[0,2],xmm10[0,2]
paddd %xmm8, %xmm7
pshufd $0xfe, %xmm6, %xmm9     # xmm9 = xmm6[2,3,3,3]
pshufd $0xd4, %xmm6, %xmm10    # xmm10 = xmm6[0,1,1,3]
pxor %xmm6, %xmm6
pcmpgtd %xmm10, %xmm6
pmuludq %xmm3, %xmm10
pmuludq %xmm3, %xmm6
psllq $0x20, %xmm6
paddq %xmm10, %xmm6
pxor %xmm10, %xmm10
pcmpgtd %xmm9, %xmm10
pmuludq %xmm3, %xmm9
pmuludq %xmm3, %xmm10
psllq $0x20, %xmm10
paddq %xmm9, %xmm10
psrlq $0x8, %xmm10
psrlq $0x8, %xmm6
shufps $0x88, %xmm10, %xmm6    # xmm6 = xmm6[0,2],xmm10[0,2]
paddd %xmm8, %xmm6
pshufd $0xfe, %xmm5, %xmm8     # xmm8 = xmm5[2,3,3,3]
pshufd $0xd4, %xmm5, %xmm5     # xmm5 = xmm5[0,1,1,3]
pxor %xmm9, %xmm9
pcmpgtd %xmm5, %xmm9
pmuludq %xmm0, %xmm5
pmuludq %xmm0, %xmm9
psllq $0x20, %xmm9
paddq %xmm5, %xmm9
pxor %xmm5, %xmm5
pcmpgtd %xmm8, %xmm5
pmuludq %xmm0, %xmm8
pmuludq %xmm0, %xmm5
psllq $0x20, %xmm5
paddq %xmm8, %xmm5
psrlq $0x8, %xmm5
psrlq $0x8, %xmm9
shufps $0x88, %xmm5, %xmm9     # xmm9 = xmm9[0,2],xmm5[0,2]
movdqa %xmm4, %xmm5
paddd %xmm9, %xmm5
psubd %xmm9, %xmm4
movdqa %xmm7, %xmm8
paddd %xmm4, %xmm8
movdqu %xmm8, 0xc0(%rdi,%rax,4)
psubd %xmm7, %xmm4
movdqu %xmm4, 0x80(%rdi,%rax,4)
movdqa %xmm6, %xmm4
paddd %xmm5, %xmm4
movdqu %xmm4, 0x40(%rdi,%rax,4)
psubd %xmm6, %xmm5
movdqu %xmm5, 0x100(%rdi,%rax,4)
addq $0x4, %rax
jne 0x79907
popq %rbx
popq %r14
retq
nop