// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdinput.c
// Function: consume_markers
METHODDEF(int)
consume_markers (j_decompress_ptr cinfo)
{
  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
  int val;

  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
    return JPEG_REACHED_EOI;

  val = (*cinfo->marker->read_markers) (cinfo);

  switch (val) {
  case JPEG_REACHED_SOS:	/* Found SOS */
    if (inputctl->inheaders) {	/* 1st SOS */
      initial_setup(cinfo);
      inputctl->inheaders = FALSE;
      /* Note: start_input_pass must be called by jdmaster.c
       * before any more input can be consumed.  jdapimin.c is
       * responsible for enforcing this sequencing.
       */
    } else {			/* 2nd or later SOS marker */
      if (! inputctl->pub.has_multiple_scans)
	ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
      start_input_pass(cinfo);
    }
    break;
  case JPEG_REACHED_EOI:	/* Found EOI */
    inputctl->pub.eoi_reached = TRUE;
    if (inputctl->inheaders) {	/* Tables-only datastream, apparently */
      if (cinfo->marker->saw_SOF)
	ERREXIT(cinfo, JERR_SOF_NO_SOS);
    } else {
      /* Prevent infinite loop in coef ctlr's decompress_data routine
       * if user set output_scan_number larger than number of scans.
       */
      if (cinfo->output_scan_number > cinfo->input_scan_number)
	cinfo->output_scan_number = cinfo->input_scan_number;
    }
    break;
  case JPEG_SUSPENDED:
    break;
  }

  return val;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x240(%rdi), %r14
pushq $0x2
popq %rbp
cmpl $0x0, 0x24(%r14)
je 0x6fbe4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movq 0x248(%rdi), %rax
callq *0x8(%rax)
cmpl $0x2, %eax
je 0x6fd07
movl %eax, %ebp
cmpl $0x1, %eax
jne 0x6fbd7
cmpl $0x0, 0x28(%r14)
je 0x6fe3c
cmpl $0xffdc, 0x34(%rbx)     # imm = 0xFFDC
ja 0x6fc1e
cmpl $0xffdd, 0x30(%rbx)     # imm = 0xFFDD
jb 0x6fc37
movq (%rbx), %rax
movabsq $0xffdc00000029, %rcx   # imm = 0xFFDC00000029
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x128(%rbx), %eax
cmpl $0x8, %eax
je 0x6fc57
movq (%rbx), %rcx
movl $0xf, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x38(%rbx), %eax
cmpl $0xb, %eax
jl 0x6fc7e
movq (%rbx), %rcx
movl $0x1a, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movl $0xa, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x198(%rbx)
movq 0x130(%rbx), %r15
addq $0xc, %r15
xorl %ebp, %ebp
pushq $0x1
popq %rax
movl %eax, %ecx
movl 0x38(%rbx), %edx
cmpl %edx, %ebp
jge 0x6fd3f
movl -0x4(%r15), %edx
leal -0x5(%rdx), %esi
cmpl $-0x4, %esi
jb 0x6fcc3
movl (%r15), %esi
leal -0x5(%rsi), %edi
cmpl $-0x5, %edi
ja 0x6fce5
movq (%rbx), %rax
movl $0x12, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movl 0x198(%rbx), %ecx
movl 0x19c(%rbx), %eax
movl -0x4(%r15), %edx
movl (%r15), %esi
cmpl %edx, %ecx
cmovgl %ecx, %edx
movl %edx, 0x198(%rbx)
cmpl %esi, %eax
cmovgl %eax, %esi
movl %esi, 0x19c(%rbx)
incl %ebp
addq $0x60, %r15
movl %esi, %eax
movl %edx, %ecx
jmp 0x6fca1
movl $0x1, 0x24(%r14)
cmpl $0x0, 0x28(%r14)
je 0x6fe62
movq 0x248(%rbx), %rax
cmpl $0x0, 0x1c(%rax)
je 0x6fbd7
movq (%rbx), %rax
movl $0x3b, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
jmp 0x6fbd7
movl $0x8, 0x1a0(%rbx)
movq 0x130(%rbx), %r15
addq $0x8, %r15
xorl %ebp, %ebp
cmpl %edx, %ebp
jge 0x6fdf3
movl $0x8, 0x1c(%r15)
movl 0x30(%rbx), %eax
movslq (%r15), %rdi
imulq %rax, %rdi
movslq 0x198(%rbx), %rsi
shlq $0x3, %rsi
callq 0x79150
movl %eax, 0x14(%r15)
movl 0x34(%rbx), %eax
movslq 0x4(%r15), %rdi
imulq %rax, %rdi
movslq 0x19c(%rbx), %rsi
shlq $0x3, %rsi
callq 0x79150
movl %eax, 0x18(%r15)
movl 0x30(%rbx), %eax
movslq (%r15), %rdi
imulq %rax, %rdi
movslq 0x198(%rbx), %rsi
callq 0x79150
movl %eax, 0x20(%r15)
movl 0x34(%rbx), %eax
movslq 0x4(%r15), %rdi
imulq %rax, %rdi
movslq 0x19c(%rbx), %rsi
callq 0x79150
movl %eax, 0x24(%r15)
movl $0x1, 0x28(%r15)
andq $0x0, 0x48(%r15)
incl %ebp
movl 0x38(%rbx), %edx
addq $0x60, %r15
jmp 0x6fd56
movl 0x34(%rbx), %edi
movslq 0x19c(%rbx), %rsi
shlq $0x3, %rsi
callq 0x79150
movl %eax, 0x1a4(%rbx)
movl 0x1b0(%rbx), %ecx
pushq $0x1
popq %rbp
movl %ebp, %eax
cmpl 0x38(%rbx), %ecx
jl 0x6fe28
xorl %eax, %eax
cmpl $0x0, 0x138(%rbx)
setne %al
movq 0x240(%rbx), %rcx
movl %eax, 0x20(%rcx)
andl $0x0, 0x28(%r14)
jmp 0x6fbd7
cmpl $0x0, 0x20(%r14)
jne 0x6fe52
movq (%rbx), %rax
movl $0x23, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x6febc
pushq $0x1
popq %rbp
jmp 0x6fbd7
movl 0xac(%rbx), %eax
cmpl %eax, 0xb4(%rbx)
jle 0x6fbd7
movl %eax, 0xb4(%rbx)
jmp 0x6fbd7