// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcprepct.c
// Function: jinit_c_prep_controller
GLOBAL(void)
jinit_c_prep_controller (j_compress_ptr cinfo, jboolean need_full_buffer)
{
  my_prep_ptr prep;
  int ci;
  jpeg_component_info * compptr;

  if (need_full_buffer)		/* safety check */
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);

  prep = (my_prep_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_prep_controller));
  cinfo->prep = (struct jpeg_c_prep_controller *) prep;
  prep->pub.start_pass = start_pass_prep;

  /* Allocate the color conversion buffer.
   * We make the buffer wide enough to allow the downsampler to edge-expand
   * horizontally within the buffer, if it so chooses.
   */
  if (cinfo->downsample->need_context_rows) {
    /* Set up to provide context rows */
#ifdef CONTEXT_ROWS_SUPPORTED
    prep->pub.pre_process_data = pre_process_context;
    create_context_buffer(cinfo);
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    /* No context, just make it tall enough for one row group */
    prep->pub.pre_process_data = pre_process_data;
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
			cinfo->max_h_samp_factor) / compptr->h_samp_factor),
	 (JDIMENSION) cinfo->max_v_samp_factor);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r12
testl %esi, %esi
je 0x746a9
movq (%r12), %rax
movl $0x4, 0x28(%rax)
movq %r12, %rdi
callq *(%rax)
movq 0x8(%r12), %rax
movl $0x70, %edx
movq %r12, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x1c0(%r12)
leaq 0x1e2(%rip), %rcx       # 0x748ae
movq %rcx, (%rax)
movq 0x1e0(%r12), %rcx
cmpl $0x0, 0x10(%rcx)
je 0x74831
leaq 0x20a(%rip), %rcx       # 0x748f2
movq %rcx, 0x8(%rax)
movslq 0x13c(%r12), %rcx
movq 0x8(%r12), %r8
movq %rcx, (%rsp)
leal (%rcx,%rcx,4), %ebx
movq %rax, %r13
movl 0x4c(%r12), %ecx
imull %ebx, %ecx
movslq %ecx, %rdx
shlq $0x3, %rdx
movq %r12, %rdi
movl $0x1, %esi
callq *(%r8)
cmpl $0x0, 0x4c(%r12)
jle 0x7489f
movq %rax, %r15
movq 0x58(%r12), %rdx
movq (%rsp), %rcx
leaq (%rcx,%rcx,2), %rax
movq %rax, 0x20(%rsp)
shlq $0x3, %rax
movq %rax, 0x18(%rsp)
leal (%rcx,%rcx), %esi
leal (,%rcx,4), %eax
movslq %ebx, %rdi
movl %ecx, %r14d
leaq (%r15,%rax,8), %rbx
shlq $0x3, %rdi
movq %rdi, 0x10(%rsp)
shlq $0x3, %rsi
movq %rsi, 0x8(%rsp)
xorl %ebp, %ebp
movq %r12, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq 0x8(%r12), %r8
movl 0x1c(%rdx), %ecx
movslq 0x138(%r12), %rax
imulq %rcx, %rax
shlq $0x3, %rax
movq %rdx, 0x40(%rsp)
movslq 0x8(%rdx), %rcx
cqto
idivq %rcx
movq %r12, %rdi
movl $0x1, %esi
movl %eax, %edx
movq 0x20(%rsp), %rcx
callq *0x10(%r8)
movq %rax, %r12
movq (%rsp), %r13
leaq (%r15,%r13,8), %rdi
movq %rdi, 0x38(%rsp)
movq %rax, %rsi
movq 0x18(%rsp), %rdx
callq 0xe370
testl %r13d, %r13d
jle 0x747f6
movq %r12, %rax
addq 0x8(%rsp), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq %rdx, (%r15,%rcx,8)
movq (%r12,%rcx,8), %rdx
movq %rdx, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x747de
movq 0x28(%rsp), %r13
movq 0x38(%rsp), %rax
movq %rax, 0x10(%r13,%rbp,8)
movq 0x10(%rsp), %rcx
addq %rcx, %r15
incq %rbp
movq 0x40(%rsp), %rdx
addq $0x60, %rdx
movq 0x30(%rsp), %r12
movslq 0x4c(%r12), %rax
addq %rcx, %rbx
cmpq %rax, %rbp
jl 0x74779
jmp 0x7489f
leaq 0x308(%rip), %rcx       # 0x74b40
movq %rcx, 0x8(%rax)
cmpl $0x0, 0x4c(%r12)
jle 0x7489f
movq %rax, %r15
movq 0x58(%r12), %rbx
addq $0x1c, %rbx
xorl %r14d, %r14d
movq 0x8(%r12), %r8
movl (%rbx), %ecx
movslq 0x138(%r12), %rax
imulq %rcx, %rax
shlq $0x3, %rax
movslq -0x14(%rbx), %rcx
cqto
idivq %rcx
movl 0x13c(%r12), %ecx
movq %r12, %rdi
movl $0x1, %esi
movl %eax, %edx
callq *0x10(%r8)
movq %rax, 0x10(%r15,%r14,8)
incq %r14
movslq 0x4c(%r12), %rax
addq $0x60, %rbx
cmpq %rax, %r14
jl 0x74853
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq