// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/select-codec.c
// Function: check_opus
static void check_opus(ogg_page *og) {
	if (og->body_len < 19) {
		opuserror(err_opus_bad_content);
	}
	if ((og->body[8] & 0xf0) != 0) {
		opuserror(err_opus_version);
	}
	if (O.gain_put) {
		if (O.gain_q78) {
			fprintf(stderr, "%d", (int16_t)oi16(*(int16_t*)(&og->body[16])));
		}
		else {
			fprintf(stderr, "%.8g", (int16_t)oi16(*(int16_t*)(&og->body[16])) / 256.0);
		}
	}
	if (O.gain_fix) {
		int16_t gi;
		if (O.gain_relative) {
			int gain = (int16_t)oi16(*(int16_t*)(&og->body[16]));
			gain += O.gain_val;
			if (gain > 32767) {
				gain = 32767;
			}
			else if (gain < -32768) {
				gain = -32768;
			}
			gi = gain;
		}
		else {
			gi = O.gain_val;
		}
		if (O.gain_not_zero && gi == 0) {
			gi = O.gain_val_sign ? -1 : 1;
		}
		
		*(int16_t*)(&og->body[16]) = oi16(gi);
		ogg_page_checksum_set(og);
		
		if (O.gain_put) {
			if (O.gain_q78) {
				fprintf(stderr, "\t%d", (int)gi);
			}
			else {
				fprintf(stderr, "\t%.8g", gi / 256.0);
			}
		}
	}
	if (O.gain_put) {
		fputc('\n', stderr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x13, 0x18(%rax)
jge 0x7ff3
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x8(%rax), %eax
andl $0xf0, %eax
cmpl $0x0, %eax
je 0x8015
movl $0x6, %edi
movb $0x0, %al
callq 0x8690
leaq 0x156ac(%rip), %rax     # 0x1d6c8
testb $0x1, 0xd(%rax)
je 0x80ad
leaq 0x1569b(%rip), %rax     # 0x1d6c8
testb $0x1, 0x7(%rax)
je 0x8069
movq 0x4fbe(%rip), %rax      # 0xcff8
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x10(%rax), %edi
callq 0x84d0
movq -0x18(%rbp), %rdi
movswl %ax, %edx
leaq 0x21c6(%rip), %rsi      # 0xa226
movb $0x0, %al
callq 0x2290
jmp 0x80ab
movq 0x4f88(%rip), %rax      # 0xcff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x10(%rax), %edi
callq 0x84d0
movq -0x20(%rbp), %rdi
cwtl
cvtsi2sd %eax, %xmm0
movsd 0x2087(%rip), %xmm1     # 0xa120
divsd %xmm1, %xmm0
leaq 0x2186(%rip), %rsi      # 0xa22a
movb $0x1, %al
callq 0x2290
jmp 0x80ad
leaq 0x15614(%rip), %rax     # 0x1d6c8
testb $0x1, 0x4(%rax)
je 0x81e8
leaq 0x15603(%rip), %rax     # 0x1d6c8
testb $0x1, 0x5(%rax)
je 0x811d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x10(%rax), %edi
callq 0x84d0
cwtl
movl %eax, -0x10(%rbp)
leaq 0x155e1(%rip), %rax     # 0x1d6c8
movl 0x8(%rax), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x7fff, -0x10(%rbp)    # imm = 0x7FFF
jle 0x8102
movl $0x7fff, -0x10(%rbp)    # imm = 0x7FFF
jmp 0x8114
cmpl $0xffff8000, -0x10(%rbp) # imm = 0xFFFF8000
jge 0x8112
movl $0xffff8000, -0x10(%rbp) # imm = 0xFFFF8000
jmp 0x8114
movl -0x10(%rbp), %eax
movw %ax, -0xa(%rbp)
jmp 0x812b
leaq 0x155a4(%rip), %rax     # 0x1d6c8
movl 0x8(%rax), %eax
movw %ax, -0xa(%rbp)
leaq 0x15596(%rip), %rax     # 0x1d6c8
testb $0x1, 0x6(%rax)
je 0x815f
movswl -0xa(%rbp), %eax
cmpl $0x0, %eax
jne 0x815f
leaq 0x15580(%rip), %rax     # 0x1d6c8
movb 0xc(%rax), %dl
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %edi
callq 0x84d0
movw %ax, %cx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movw %cx, 0x10(%rax)
movq -0x8(%rbp), %rdi
callq 0x2110
leaq 0x15541(%rip), %rax     # 0x1d6c8
testb $0x1, 0xd(%rax)
je 0x81e6
leaq 0x15534(%rip), %rax     # 0x1d6c8
testb $0x1, 0x7(%rax)
je 0x81b8
movq 0x4e57(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movswl -0xa(%rbp), %edx
leaq 0x2076(%rip), %rsi      # 0xa225
movb $0x0, %al
callq 0x2290
jmp 0x81e4
movq 0x4e39(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movswl -0xa(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x1f4e(%rip), %xmm1     # 0xa120
divsd %xmm1, %xmm0
leaq 0x204c(%rip), %rsi      # 0xa229
movb $0x1, %al
callq 0x2290
jmp 0x81e6
jmp 0x81e8
leaq 0x154d9(%rip), %rax     # 0x1d6c8
testb $0x1, 0xd(%rax)
je 0x8209
movq 0x4dfc(%rip), %rax      # 0xcff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2210
addq $0x20, %rsp
popq %rbp
retq
nop