// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/read.c
// Function: parse_info
bool parse_info(ogg_page *og) {
	static int osidx = 0;
	if (!ogg_page_bos(og) || ogg_page_eos(og)) {
		if (ogg_page_pageno(og) == 0) {
			opuserror(err_opus_bad_stream);
		}
		opuserror(err_opus_no_target_codec);
	}
	if (ogg_page_pageno(og) != 0) {
		// BOSがあるのにページが0でない
		opuserror(err_opus_bad_stream);
	}
	if (ogg_page_granulepos(og) != 0) {
		// ヘッダのgranuleposは必ず0
		opuserror(err_opus_bad_stream);
	}
	check_header_is_single_page(og);
	
	if (og->body_len < codec->headmagic_len || memcmp(og->body, codec->headmagic, codec->headmagic_len) != 0) {
// 		have_multi_streams = true;
		return false;
	}
	osidx++;
	if (O.target_idx && O.target_idx != osidx) {
// 		have_multi_streams = true;
		return false;
	}
	opus_sno = ogg_page_serialno(og);
	header_packet_len = og->header_len + og->body_len;
	header_packet_pos = seeked_len - header_packet_len;
	built_header_pos = ftell(built_stream);
	codec->parse(og);
	if (O.edit != EDIT_LIST && codec->type != CODEC_FLAC) {
		write_page(og, built_stream);
	}
	opus_idx++;
	opst = PAGE_INFO_BORDER;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2040
testl %eax, %eax
je 0x4414
movq %rbx, %rdi
callq 0x24a0
testl %eax, %eax
je 0x4435
movq %rbx, %rdi
callq 0x2080
testq %rax, %rax
jne 0x442b
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x6639
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x6639
movq %rbx, %rdi
callq 0x2080
testq %rax, %rax
je 0x444c
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x6639
movq %rbx, %rdi
callq 0x22b0
testq %rax, %rax
je 0x4463
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x6639
movq (%rbx), %r14
movb 0x1a(%r14), %bpl
testb %bpl, %bpl
jne 0x447c
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x6639
movq (%rbx), %r14
movzbl %bpl, %eax
cmpb $0x2, %bpl
pushq $0x1
popq %rcx
cmovael %eax, %ecx
movzbl %cl, %r15d
leaq -0x1(%r15), %r12
pushq $0x3
popq %rbp
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x44b3
cmpb $-0x1, 0x1b(%r14,%r13)
je 0x44ae
movl %ebp, %edi
xorl %eax, %eax
callq 0x6639
incq %r13
jmp 0x4498
cmpb $-0x1, 0x1a(%r14,%r15)
jne 0x44c5
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x6639
leaq 0x181a4(%rip), %r14     # 0x1c670
movq (%r14), %rax
movq 0x18(%rax), %rdx
cmpq %rdx, 0x18(%rbx)
jb 0x45a4
movq 0x10(%rbx), %rdi
movq 0x20(%rax), %rsi
callq 0x2300
testl %eax, %eax
jne 0x45a4
movl 0x80f0(%rip), %eax      # 0xc5e8
incl %eax
movl %eax, 0x80e8(%rip)      # 0xc5e8
leaq 0x18181(%rip), %r15     # 0x1c688
movl 0x24(%r15), %ecx
testl %ecx, %ecx
sete %dl
cmpl %eax, %ecx
sete %al
orb %dl, %al
cmpb $0x1, %al
jne 0x45a4
movq %rbx, %rdi
callq 0x2420
leaq 0x181a6(%rip), %rcx     # 0x1c6d4
movl %eax, (%rcx)
movq 0x18(%rbx), %rax
addq 0x8(%rbx), %rax
movq %rax, 0x80b1(%rip)      # 0xc5f0
movq 0x80b2(%rip), %rcx      # 0xc5f8
subq %rax, %rcx
movq %rcx, 0x80b0(%rip)      # 0xc600
leaq 0x18189(%rip), %r12     # 0x1c6e0
movq (%r12), %rdi
callq 0x2280
movq %rax, 0x80a1(%rip)      # 0xc608
movq (%r14), %rax
movq %rbx, %rdi
callq *0x28(%rax)
cmpl $0x1, (%r15)
je 0x458a
movq (%r14), %rax
cmpl $0x2, (%rax)
je 0x458a
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x5583
leaq 0x1813f(%rip), %rax     # 0x1c6d0
incl (%rax)
leaq 0x18132(%rip), %rax     # 0x1c6cc
movl $0x1, (%rax)
movb $0x1, %al
jmp 0x45a6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq