// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: jinit_merged_upsampler
GLOBAL(void)
jinit_merged_upsampler (j_decompress_ptr cinfo)
{
  my_upsample_ptr upsample;

  upsample = (my_upsample_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_upsampler));
  cinfo->upsample = (struct jpeg_upsampler *) upsample;
  upsample->pub.start_pass = start_pass_merged_upsample;
  upsample->pub.need_context_rows = FALSE;

  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;

  if (cinfo->max_v_samp_factor == 2) {
    upsample->pub.upsample = merged_2v_upsample;
    upsample->upmethod = h2v2_merged_upsample;
    /* Allocate a spare row buffer */
    upsample->spare_row = (JSAMPROW)
      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
		(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
  } else {
    upsample->pub.upsample = merged_1v_upsample;
    upsample->upmethod = h2v1_merged_upsample;
    /* No spare row needed */
    upsample->spare_row = NULL;
  }

  build_ycc_rgb_table(cinfo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
pushq $0x58
popq %rdx
callq *(%rax)
movq %rax, %r14
movq %rax, 0x260(%rbx)
leaq 0x13e(%rip), %rax       # 0x78c95
movq %rax, (%r14)
andl $0x0, 0x10(%r14)
movl 0x90(%rbx), %eax
imull 0x88(%rbx), %eax
movl %eax, 0x4c(%r14)
cmpl $0x2, 0x19c(%rbx)
jne 0x78ba7
leaq 0x12a(%rip), %rcx       # 0x78caa
movq %rcx, 0x8(%r14)
leaq 0x1c3(%rip), %rcx       # 0x78d4e
movq %rcx, 0x18(%r14)
movq 0x8(%rbx), %rcx
movl %eax, %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rcx)
movq 0x260(%rbx), %r15
jmp 0x78bc2
leaq 0x3b0(%rip), %rax       # 0x78f5e
movq %rax, 0x8(%r14)
leaq 0x3cf(%rip), %rax       # 0x78f88
movq %rax, 0x18(%r14)
xorl %eax, %eax
movq %r14, %r15
movq %rax, 0x40(%r14)
movq 0x8(%rbx), %rax
pushq $0x1
popq %rbp
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, 0x20(%r15)
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, 0x28(%r15)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, 0x30(%r15)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, 0x38(%r15)
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rsi
movl $0x2c8d00, %edi         # imm = 0x2C8D00
movl $0x5b6900, %r8d         # imm = 0x5B6900
movq $-0xe25100, %r9         # imm = 0xFF1DAF00
movq $-0xb2f480, %r10        # imm = 0xFF4D0B80
xorl %r11d, %r11d
cmpq $0x400, %r11            # imm = 0x400
je 0x78c8a
movq %r10, %rbx
shrq $0x10, %rbx
movl %ebx, (%rcx,%r11)
movq %r9, %rbx
shrq $0x10, %rbx
movl %ebx, (%rdx,%r11)
movq %r8, (%rsi,%r11,2)
movq %rdi, (%rax,%r11,2)
addq $0x4, %r11
addq $-0x581a, %rdi          # imm = 0xA7E6
addq $-0xb6d2, %r8           # imm = 0xFFFF492E
addq $0x1c5a2, %r9           # imm = 0x1C5A2
addq $0x166e9, %r10          # imm = 0x166E9
jmp 0x78c41
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq