// File: /workspace/github_c_makefile_star2_O3/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 0x47c7
movq %rbx, %rdi
callq 0x24a0
testl %eax, %eax
je 0x47ec
movq %rbx, %rdi
callq 0x2080
testq %rax, %rax
jne 0x47e0
movl $0x5, %edi
xorl %eax, %eax
callq 0x6dcc
movl $0x4, %edi
xorl %eax, %eax
callq 0x6dcc
movq %rbx, %rdi
callq 0x2080
testq %rax, %rax
je 0x4805
movl $0x5, %edi
xorl %eax, %eax
callq 0x6dcc
movq %rbx, %rdi
callq 0x22b0
testq %rax, %rax
je 0x481e
movl $0x5, %edi
xorl %eax, %eax
callq 0x6dcc
movq (%rbx), %r15
movzbl 0x1a(%r15), %r12d
testq %r12, %r12
je 0x4861
leaq 0x1b(%r15), %r14
cmpl $0x1, %r12d
je 0x4874
leaq -0x1(%r12), %r13
xorl %ebp, %ebp
cmpb $-0x1, (%r14,%rbp)
je 0x484f
movl $0x3, %edi
xorl %eax, %eax
callq 0x6dcc
incq %rbp
cmpq %rbp, %r13
jne 0x483c
leaq (%r15,%r12), %r14
addq $0x1a, %r14
jmp 0x4874
movl $0x3, %edi
xorl %eax, %eax
callq 0x6dcc
movq (%rbx), %r14
addq $0x1b, %r14
cmpb $-0x1, (%r14)
jne 0x4886
movl $0x3, %edi
xorl %eax, %eax
callq 0x6dcc
leaq 0x17de3(%rip), %r14     # 0x1c670
movq (%r14), %rax
movq 0x18(%rax), %rdx
cmpq %rdx, 0x18(%rbx)
jb 0x4965
movq 0x10(%rbx), %rdi
movq 0x20(%rax), %rsi
callq 0x2300
testl %eax, %eax
jne 0x4965
movl 0x7d2f(%rip), %eax      # 0xc5e8
incl %eax
movl %eax, 0x7d27(%rip)      # 0xc5e8
leaq 0x17dc0(%rip), %r15     # 0x1c688
movl 0x24(%r15), %ecx
testl %ecx, %ecx
sete %dl
cmpl %eax, %ecx
sete %al
orb %dl, %al
cmpb $0x1, %al
jne 0x4965
movq %rbx, %rdi
callq 0x2420
leaq 0x17de5(%rip), %rcx     # 0x1c6d4
movl %eax, (%rcx)
movq 0x18(%rbx), %rax
addq 0x8(%rbx), %rax
movq %rax, 0x7cf0(%rip)      # 0xc5f0
movq 0x7cf1(%rip), %rcx      # 0xc5f8
subq %rax, %rcx
movq %rcx, 0x7cef(%rip)      # 0xc600
leaq 0x17dc8(%rip), %r12     # 0x1c6e0
movq (%r12), %rdi
callq 0x2280
movq %rax, 0x7ce0(%rip)      # 0xc608
movq (%r14), %rax
movq %rbx, %rdi
callq *0x28(%rax)
cmpl $0x1, (%r15)
je 0x494b
movq (%r14), %rax
cmpl $0x2, (%rax)
je 0x494b
movq (%r12), %rsi
movq %rbx, %rdi
callq 0x5b2b
leaq 0x17d7e(%rip), %rax     # 0x1c6d0
incl (%rax)
leaq 0x17d71(%rip), %rax     # 0x1c6cc
movl $0x1, (%rax)
movb $0x1, %al
jmp 0x4967
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq