// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdcoefct.c
// Function: jinit_d_coef_controller
GLOBAL(void)
jinit_d_coef_controller (j_decompress_ptr cinfo, jboolean need_full_buffer)
{
  my_coef_ptr coef;

  coef = (my_coef_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_coef_controller));
  cinfo->coef = (struct jpeg_d_coef_controller *) coef;
  coef->pub.start_input_pass = start_input_pass;
  coef->pub.start_output_pass = start_output_pass;
#ifdef BLOCK_SMOOTHING_SUPPORTED
  coef->coef_bits_latch = NULL;
#endif

  /* Create the coefficient buffer. */
  if (need_full_buffer) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
    /* Allocate a full-image virtual array for each component, */
    /* padded to a multiple of samp_factor DCT blocks in each direction. */
    /* Note we ask for a pre-zeroed array. */
    int ci, access_rows;
    jpeg_component_info *compptr;

    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      access_rows = compptr->v_samp_factor;
#ifdef BLOCK_SMOOTHING_SUPPORTED
      /* If block smoothing could be used, need a bigger window */
      if (cinfo->progressive_mode)
	access_rows *= 3;
#endif
      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
	((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
				(long) compptr->h_samp_factor),
	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
				(long) compptr->v_samp_factor),
	 (JDIMENSION) access_rows);
    }
    coef->pub.consume_data = consume_data;
    coef->pub.decompress_data = decompress_data;
    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    /* We only need a single-MCU buffer. */
    JBLOCKROW buffer;
    int i;

    buffer = (JBLOCKROW)
      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
      coef->MCU_buffer[i] = buffer + i;
    }
    coef->pub.consume_data = dummy_consume_data;
    coef->pub.decompress_data = decompress_onepass;
    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
movl $0xe0, %edx
callq *(%rax)
movq %rax, %r15
movq %rax, 0x230(%r14)
leaq 0x112(%rip), %rax       # 0x73acc
movq %rax, (%r15)
leaq 0x114(%rip), %rax       # 0x73ad8
movq %rax, 0x10(%r15)
andq $0x0, 0xd8(%r15)
testl %ebp, %ebp
je 0x73a8d
movq 0x130(%r14), %rbx
movq %r15, 0x10(%rsp)
addq $0x88, %r15
movq %r15, 0x8(%rsp)
addq $0x8, %rbx
xorl %r13d, %r13d
movslq 0x38(%r14), %rax
cmpq %rax, %r13
jge 0x73a5a
cmpl $0x0, 0x138(%r14)
movl 0x4(%rbx), %eax
leal (%rax,%rax,2), %r15d
cmovel %eax, %r15d
movl 0x14(%rbx), %edi
movq 0x8(%r14), %rax
movq 0x28(%rax), %rbp
movslq (%rbx), %rsi
callq 0x7915d
movq %rax, %r12
movl 0x18(%rbx), %edi
movslq 0x4(%rbx), %rsi
callq 0x7915d
movq %r14, %rdi
pushq $0x1
popq %rdx
movl %edx, %esi
movl %r12d, %ecx
movl %eax, %r8d
movl %r15d, %r9d
callq *%rbp
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
addq $0x60, %rbx
jmp 0x739f7
movq 0x10(%rsp), %r15
leaq 0x33b(%rip), %rdx       # 0x73da1
leaq 0x1a2(%rip), %rsi       # 0x73c0f
movq %rsi, 0x8(%r15)
movq %rdx, 0x18(%r15)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
pushq $0x1
popq %rsi
movl $0x500, %edx            # imm = 0x500
movq %r14, %rdi
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
leaq 0x497(%rip), %rdx       # 0x73f46
leaq 0x48d(%rip), %rsi       # 0x73f43
xorl %ecx, %ecx
cmpq $0xa, %rcx
je 0x73a6d
movq %rax, 0x38(%r15,%rcx,8)
incq %rcx
subq $-0x80, %rax
jmp 0x73ab8