// File: srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__jpeg_finish(stbi__jpeg*)
static void stbi__jpeg_finish(stbi__jpeg *z)
{
   if (z->progressive) {
      // dequantize and idct the data
      int i,j,n;
      for (n=0; n < z->s->img_n; ++n) {
         int w = (z->img_comp[n].x+7) >> 3;
         int h = (z->img_comp[n].y+7) >> 3;
         for (j=0; j < h; ++j) {
            for (i=0; i < w; ++i) {
               short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
               stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
               z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
            }
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4730(%rax)
je 0x2f1c4
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2f1c2
movq -0x8(%rbp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
addl $0x7, %eax
sarl $0x3, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
addl $0x7, %eax
sarl $0x3, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x2f1b2
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x2f1a2
movq -0x8(%rbp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rax
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %edx
movq -0x8(%rbp), %rsi
addq $0x45a0, %rsi           # imm = 0x45A0
movslq -0x14(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rsi
imull 0x58(%rsi), %edx
addl %edx, %ecx
shll $0x6, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x3488, %rsi           # imm = 0x3488
movq -0x8(%rbp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movslq 0xc(%rax), %rax
shlq $0x6, %rax
addq %rax, %rsi
callq 0x30070
movq -0x8(%rbp), %rax
movq 0x4768(%rax), %rax
movq -0x8(%rbp), %rcx
addq $0x45a0, %rcx           # imm = 0x45A0
movslq -0x14(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rcx
movq 0x30(%rcx), %rdi
movq -0x8(%rbp), %rcx
addq $0x45a0, %rcx           # imm = 0x45A0
movslq -0x14(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rcx
movl 0x24(%rcx), %ecx
imull -0x10(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addq %rcx, %rdi
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
movslq %ecx, %rcx
addq %rcx, %rdi
movq -0x8(%rbp), %rcx
addq $0x45a0, %rcx           # imm = 0x45A0
movslq -0x14(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rcx
movl 0x24(%rcx), %esi
movq -0x28(%rbp), %rdx
callq *%rax
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2f093
jmp 0x2f1a4
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2f080
jmp 0x2f1b4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2f024
jmp 0x2f1c4
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)