// File: /workspace/github_c_makefile_star2_O0/yui0[P]img2vec/./stb_image_write.h
// Function: stbiw__jpg_processDU
static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int *bitCnt, float *CDU, int du_stride, float *fdtbl, int DC, const unsigned short HTDC[256][2], const unsigned short HTAC[256][2]) {
   const unsigned short EOB[2] = { HTAC[0x00][0], HTAC[0x00][1] };
   const unsigned short M16zeroes[2] = { HTAC[0xF0][0], HTAC[0xF0][1] };
   int dataOff, i, j, n, diff, end0pos, x, y;
   int DU[64];

   // DCT rows
   for(dataOff=0, n=du_stride*8; dataOff<n; dataOff+=du_stride) {
      stbiw__jpg_DCT(&CDU[dataOff], &CDU[dataOff+1], &CDU[dataOff+2], &CDU[dataOff+3], &CDU[dataOff+4], &CDU[dataOff+5], &CDU[dataOff+6], &CDU[dataOff+7]);
   }
   // DCT columns
   for(dataOff=0; dataOff<8; ++dataOff) {
      stbiw__jpg_DCT(&CDU[dataOff], &CDU[dataOff+du_stride], &CDU[dataOff+du_stride*2], &CDU[dataOff+du_stride*3], &CDU[dataOff+du_stride*4],
                     &CDU[dataOff+du_stride*5], &CDU[dataOff+du_stride*6], &CDU[dataOff+du_stride*7]);
   }
   // Quantize/descale/zigzag the coefficients
   for(y = 0, j=0; y < 8; ++y) {
      for(x = 0; x < 8; ++x,++j) {
         float v;
         i = y*du_stride+x;
         v = CDU[i]*fdtbl[j];
         // DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? ceilf(v - 0.5f) : floorf(v + 0.5f));
         // ceilf() and floorf() are C99, not C89, but I /think/ they're not needed here anyway?
         DU[stbiw__jpg_ZigZag[j]] = (int)(v < 0 ? v - 0.5f : v + 0.5f);
      }
   }

   // Encode DC
   diff = DU[0] - DC;
   if (diff == 0) {
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTDC[0]);
   } else {
      unsigned short bits[2];
      stbiw__jpg_calcBits(diff, bits);
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTDC[bits[1]]);
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, bits);
   }
   // Encode ACs
   end0pos = 63;
   for(; (end0pos>0)&&(DU[end0pos]==0); --end0pos) {
   }
   // end0pos = first element in reverse order !=0
   if(end0pos == 0) {
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB);
      return DU[0];
   }
   for(i = 1; i <= end0pos; ++i) {
      int startpos = i;
      int nrzeroes;
      unsigned short bits[2];
      for (; DU[i]==0 && i<=end0pos; ++i) {
      }
      nrzeroes = i-startpos;
      if ( nrzeroes >= 16 ) {
         int lng = nrzeroes>>4;
         int nrmarker;
         for (nrmarker=1; nrmarker <= lng; ++nrmarker)
            stbiw__jpg_writeBits(s, bitBuf, bitCnt, M16zeroes);
         nrzeroes &= 15;
      }
      stbiw__jpg_calcBits(DU[i], bits);
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTAC[(nrzeroes<<4)+bits[1]]);
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, bits);
   }
   if(end0pos != 63) {
      stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB);
   }
   return DU[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movq %r9, -0x40(%rbp)
movq 0x20(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x44(%rbp)
movq 0x20(%rbp), %rax
movw 0x2(%rax), %ax
movw %ax, -0x42(%rbp)
movq 0x20(%rbp), %rax
movw 0x3c0(%rax), %ax
movw %ax, -0x48(%rbp)
movq 0x20(%rbp), %rax
movw 0x3c2(%rax), %ax
movw %ax, -0x46(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x34(%rbp), %eax
shll $0x3, %eax
movl %eax, -0x58(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x26683
movq -0x30(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
movl -0x4c(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movl -0x4c(%rbp), %eax
addl $0x2, %eax
cltq
shlq $0x2, %rax
addq %rax, %rdx
movq -0x30(%rbp), %rcx
movl -0x4c(%rbp), %eax
addl $0x3, %eax
cltq
shlq $0x2, %rax
addq %rax, %rcx
movq -0x30(%rbp), %r8
movl -0x4c(%rbp), %eax
addl $0x4, %eax
cltq
shlq $0x2, %rax
addq %rax, %r8
movq -0x30(%rbp), %r9
movl -0x4c(%rbp), %eax
addl $0x5, %eax
cltq
shlq $0x2, %rax
addq %rax, %r9
movq -0x30(%rbp), %r10
movl -0x4c(%rbp), %eax
addl $0x6, %eax
cltq
shlq $0x2, %rax
addq %rax, %r10
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %r11d
addl $0x7, %r11d
movslq %r11d, %r11
shlq $0x2, %r11
addq %r11, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x26b60
movl -0x34(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x265c4
movl $0x0, -0x4c(%rbp)
cmpl $0x8, -0x4c(%rbp)
jge 0x26765
movq -0x30(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
movl -0x4c(%rbp), %eax
addl -0x34(%rbp), %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movl -0x4c(%rbp), %eax
movl -0x34(%rbp), %ecx
shll %ecx
addl %ecx, %eax
cltq
shlq $0x2, %rax
addq %rax, %rdx
movq -0x30(%rbp), %rcx
movl -0x4c(%rbp), %eax
imull $0x3, -0x34(%rbp), %r8d
addl %r8d, %eax
cltq
shlq $0x2, %rax
addq %rax, %rcx
movq -0x30(%rbp), %r8
movl -0x4c(%rbp), %eax
movl -0x34(%rbp), %r9d
shll $0x2, %r9d
addl %r9d, %eax
cltq
shlq $0x2, %rax
addq %rax, %r8
movq -0x30(%rbp), %r9
movl -0x4c(%rbp), %eax
imull $0x5, -0x34(%rbp), %r10d
addl %r10d, %eax
cltq
shlq $0x2, %rax
addq %rax, %r9
movq -0x30(%rbp), %r10
movl -0x4c(%rbp), %eax
imull $0x6, -0x34(%rbp), %r11d
addl %r11d, %eax
cltq
shlq $0x2, %rax
addq %rax, %r10
movq -0x30(%rbp), %rax
movl -0x4c(%rbp), %r11d
imull $0x7, -0x34(%rbp), %ebx
addl %ebx, %r11d
movslq %r11d, %r11
shlq $0x2, %r11
addq %r11, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x26b60
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x2668a
movl $0x0, -0x68(%rbp)
movl $0x0, -0x54(%rbp)
cmpl $0x8, -0x68(%rbp)
jge 0x26848
movl $0x0, -0x64(%rbp)
cmpl $0x8, -0x64(%rbp)
jge 0x26838
movl -0x68(%rbp), %eax
imull -0x34(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movslq -0x50(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x40(%rbp), %rax
movslq -0x54(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x174(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x174(%rbp), %xmm0
jbe 0x267e7
movss -0x174(%rbp), %xmm0
movss 0x9833(%rip), %xmm1     # 0x3000c
subss %xmm1, %xmm0
movss %xmm0, -0x190(%rbp)
jmp 0x267ff
movss 0x981d(%rip), %xmm0     # 0x3000c
addss -0x174(%rbp), %xmm0
movss %xmm0, -0x190(%rbp)
movss -0x190(%rbp), %xmm0
cvttss2si %xmm0, %ecx
movslq -0x54(%rbp), %rdx
leaq 0xb4ba(%rip), %rax      # 0x31cd0
movzbl (%rax,%rdx), %eax
movl %ecx, -0x170(%rbp,%rax,4)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x26784
jmp 0x2683a
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x26773
movl -0x170(%rbp), %eax
subl 0x10(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x26871
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x18(%rbp), %rcx
callq 0x26aa0
jmp 0x268bb
movl -0x5c(%rbp), %edi
leaq -0x178(%rbp), %rsi
callq 0x26e90
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x18(%rbp), %rcx
movzwl -0x176(%rbp), %eax
shlq $0x2, %rax
addq %rax, %rcx
callq 0x26aa0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x178(%rbp), %rcx
callq 0x26aa0
movl $0x3f, -0x60(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x60(%rbp)
movb %al, -0x191(%rbp)
jle 0x268e5
movslq -0x60(%rbp), %rax
cmpl $0x0, -0x170(%rbp,%rax,4)
sete %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x268f1
jmp 0x268fe
jmp 0x268f3
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x268c2
cmpl $0x0, -0x60(%rbp)
jne 0x26927
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x44(%rbp), %rcx
callq 0x26aa0
movl -0x170(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x26a88
movl $0x1, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x60(%rbp), %eax
jg 0x26a64
movl -0x50(%rbp), %eax
movl %eax, -0x17c(%rbp)
movslq -0x50(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, -0x170(%rbp,%rcx,4)
movb %al, -0x192(%rbp)
jne 0x26968
movl -0x50(%rbp), %eax
cmpl -0x60(%rbp), %eax
setle %al
movb %al, -0x192(%rbp)
movb -0x192(%rbp), %al
testb $0x1, %al
jne 0x26974
jmp 0x26981
jmp 0x26976
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x26943
movl -0x50(%rbp), %eax
subl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
cmpl $0x10, -0x180(%rbp)
jl 0x269f5
movl -0x180(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x188(%rbp)
movl $0x1, -0x18c(%rbp)
movl -0x18c(%rbp), %eax
cmpl -0x188(%rbp), %eax
jg 0x269e6
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x26aa0
movl -0x18c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18c(%rbp)
jmp 0x269b2
movl -0x180(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x180(%rbp)
movslq -0x50(%rbp), %rax
movl -0x170(%rbp,%rax,4), %edi
leaq -0x184(%rbp), %rsi
callq 0x26e90
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x20(%rbp), %rcx
movl -0x180(%rbp), %eax
shll $0x4, %eax
movzwl -0x182(%rbp), %r8d
addl %r8d, %eax
cltq
shlq $0x2, %rax
addq %rax, %rcx
callq 0x26aa0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x184(%rbp), %rcx
callq 0x26aa0
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2692e
cmpl $0x3f, -0x60(%rbp)
je 0x26a7f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x44(%rbp), %rcx
callq 0x26aa0
movl -0x170(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)