// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/edge264_headers.c
// Function: parse_seq_parameter_set_mvc_extension
static int parse_seq_parameter_set_mvc_extension(Edge264Decoder *dec, int profile_idc)
{
	// returning unsupported asap is more efficient than keeping tedious code afterwards
	int num_views = get_ue16(&dec->_gb, 1023) + 1;
	for (int i = 0; i < num_views; i++) {
		int view_id = get_ue16(&dec->_gb, 1023);
		log_dec(dec, i ? ",%u" : "  view_ids: [%u", view_id);
	}
	log_dec(dec, "]%s\n", unsup_if(num_views != 2));
	if (num_views != 2)
		return ENOTSUP;
	
	// inter-view refs are ignored since we always add them anyway
	int num_anchor_refs_l0 = get_ue16(&dec->_gb, 1);
	if (num_anchor_refs_l0)
		get_ue16(&dec->_gb, 1023);
	int num_anchor_refs_l1 = get_ue16(&dec->_gb, 1);
	if (num_anchor_refs_l1)
		get_ue16(&dec->_gb, 1023);
	int num_non_anchor_refs_l0 = get_ue16(&dec->_gb, 1);
	if (num_non_anchor_refs_l0)
		get_ue16(&dec->_gb, 1023);
	int num_non_anchor_refs_l1 = get_ue16(&dec->_gb, 1);
	if (num_non_anchor_refs_l1)
		get_ue16(&dec->_gb, 1023);
	log_dec(dec, "  num_anchor_refs: {l0: %u, l1: %u}\n"
		"  num_non_anchor_refs: {l0: %u, l1: %u}\n"
		"  level_values_signalled:\n",
		num_anchor_refs_l0, num_anchor_refs_l1,
		num_non_anchor_refs_l0, num_non_anchor_refs_l1);
	
	// level values and operation points are similarly ignored
	for (int i = get_ue16(&dec->_gb, 63); i >= 0; i--) {
		int level_idc = get_uv(&dec->_gb, 8);
		log_dec(dec, "    - idc: %.1f\n"
			"      operation_points: [", (float)level_idc / 10);
		for (int j = get_ue16(&dec->_gb, 1023); j >= 0; j--) {
			int applicable_op_temporal_id = get_uv(&dec->_gb, 3);
			log_dec(dec, "{temporal_id: %u, target_views: [", applicable_op_temporal_id);
			for (int k = get_ue16(&dec->_gb, 1023); k >= 0; k--) {
				int applicable_op_target_view_id = get_ue16(&dec->_gb, 1023);
				log_dec(dec, k ? "%u," : "%u], num_views: ", applicable_op_target_view_id);
			}
			int applicable_op_num_views = get_ue16(&dec->_gb, 1023) + 1;
			log_dec(dec, j ? "%u}," : "%u}]\n", applicable_op_num_views);
		}
	}
	return profile_idc == 134 ? ENOTSUP : 0; // MFC is unsupported until streams actually use it
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x7ceb2
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7cea2
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x1c(%rbp), %ecx
leaq 0x54241(%rip), %rdx     # 0xd10b5
leaq 0x53ec8(%rip), %rax     # 0xd0d43
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x20(%rbp), %ecx
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x7cea4
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7ce0a
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7cf40
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
cmpl $0x2, -0x18(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edx
leaq 0x53924(%rip), %rcx     # 0xd0832
leaq 0x50e6b(%rip), %rax     # 0xcdd80
cmpl $0x0, %edx
cmovneq %rax, %rcx
leaq 0x541a2(%rip), %rdx     # 0xd10c5
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
cmpl $0x2, -0x18(%rbp)
je 0x7cf52
movl $0x5f, -0x8(%rbp)
jmp 0x7d318
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76d10
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x7cf77
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76d10
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x7cf9c
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76d10
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x7cfc1
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x76d10
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x7cfe6
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7d05e
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movl -0x2c(%rbp), %r9d
movl -0x30(%rbp), %eax
leaq 0x5408c(%rip), %rdx     # 0xd10ca
movl %eax, (%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x10(%rbp), %rdi
movl $0x3f, %esi
callq 0x76d10
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x7d302
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x65e90
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7d106
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
vcvtsi2ssl -0x38(%rbp), %xmm0, %xmm0
vmovss 0x50cbe(%rip), %xmm1    # 0xcdd98
vdivss %xmm1, %xmm0, %xmm1
vcvtss2sd %xmm1, %xmm0, %xmm0
leaq 0x54048(%rip), %rdx     # 0xd1131
movb $0x1, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x7d2f2
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x65e90
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7d19c
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x40(%rbp), %ecx
leaq 0x53fdc(%rip), %rdx     # 0xd115b
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x7d253
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7d243
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x44(%rbp), %ecx
leaq 0x53f68(%rip), %rdx     # 0xd117d
leaq 0x5392b(%rip), %rax     # 0xd0b47
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x48(%rbp), %ecx
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x7d245
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7d1ad
movq -0x10(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x7d2e2
movq -0x10(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x3c(%rbp), %ecx
leaq 0x53edf(%rip), %rdx     # 0xd1193
leaq 0x53ed3(%rip), %rax     # 0xd118e
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movl -0x4c(%rbp), %ecx
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x10(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x7d2e4
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7d117
jmp 0x7d2f4
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7d06f
movl -0x14(%rbp), %edx
xorl %eax, %eax
movl $0x5f, %ecx
cmpl $0x86, %edx
cmovel %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)