// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/ogg.c
// Function: do_bitstream_page
static void do_bitstream_page(deark *c, lctx *d, struct page_info *pgi,
	struct stream_info *si)
{
	if(d->always_hexdump || (pgi->is_first_page && (c->debug_level>=2))) {
		de_dbg_hexdump(c, c->infile, pgi->dpos, pgi->dlen, 256, NULL, 0x1);
	}

	if(pgi->is_first_page) {
		do_identify_bitstream(c, d, si, pgi->dpos, pgi->dlen);

		if(d->total_page_count==0) {
			// This is the first stream in the file.
			if(si->sti && si->stream_type!=0) {
				// This stream's type is known. Remember it, for format declaration purpose.
				d->first_stream_type = si->stream_type;
				d->first_stream_sti = si->sti;
				d->first_stream_type_valid = 1;
			}
		}
		else {
			// Not the first stream in the file
			if(si->stream_type!=0 && d->first_stream_type_valid &&
				(si->stream_type==d->first_stream_type))
			{
				// This stream is the same type as the first stream. Do nothing.
			}
			else {
				d->has_unknown_or_multiple_stream_types = 1;
			}
		}

		if(si->stream_type==0) {
			d->has_unknown_or_multiple_stream_types = 1;
		}
	}
	else {
		if(!d->format_declared) declare_ogg_format(c, d);
	}

	if(si->sti && si->sti->page_fn) {
		si->sti->page_fn(c, d, pgi, si);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xc9ce4
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xc9d17
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jl 0xc9d17
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, (%rsp)
callq 0x15b840
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0xc9dd6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x28(%rax), %r8
callq 0xc9e30
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xc9d8f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xc9d8d
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0xc9d8d
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x28(%rax)
jmp 0xc9dc0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0xc9db3
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0xc9db3
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0xc9db3
jmp 0xc9dbe
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0xc9dc0
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xc9dd4
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0xc9def
movq -0x10(%rbp), %rax
cmpb $0x0, 0x20(%rax)
jne 0xc9ded
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xc9a70
jmp 0xc9def
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xc9e27
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0xc9e27
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)