// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/edge264_headers.c
// Function: parse_nal_unit_header_extension_log
int ADD_VARIANT(parse_nal_unit_header_extension)(Edge264Decoder *dec, int non_blocking, void(*free_cb)(void*,int), void *free_arg) {
	unsigned u = get_uv(&dec->_gb, 24);
	if (u & 1 << 23)
		return ENOTSUP;
	dec->IdrPicFlag = u >> 22 & 1 ^ 1;
	log_dec(dec, "  idr_flag: %u\n"
		"  priority_id: %d\n"
		"  view_id: %d\n"
		"  temporal_id: %d\n"
		"  anchor_pic_flag: %u\n"
		"  inter_view_flag: %u\n",
		dec->IdrPicFlag,
		u >> 16 & 0x3f,
		u >> 6 & 0x3ff,
		u >> 3 & 7,
		u >> 2 & 1,
		u >> 1 & 1);
	if (dec->nal_unit_type == 20)
		return ADD_VARIANT(parse_slice_layer_without_partitioning)(dec, non_blocking, free_cb, free_arg);
	// spec doesn't mention rbsp_trailing_bits at the end of prefix_nal_unit_rbsp
	if (!rbsp_end(&dec->_gb))
		return EBADMSG;
	if (print_dec(dec))
		return ENOTSUP;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x20(%rbp)
movl %esi, -0x24(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movl $0x18, %esi
callq 0x65e90
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
andl $0x800000, %eax         # imm = 0x800000
cmpl $0x0, %eax
je 0x795a1
movl $0x5f, -0x14(%rbp)
jmp 0x79766
movl -0x3c(%rbp), %eax
shrl $0x16, %eax
andl $0x1, %eax
xorl $0x1, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x23(%rax)
movq -0x20(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x79671
movq -0x20(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x20(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x20(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movq -0x20(%rbp), %rax
movsbl 0x23(%rax), %ecx
movl -0x3c(%rbp), %r8d
shrl $0x10, %r8d
andl $0x3f, %r8d
movl -0x3c(%rbp), %r9d
shrl $0x6, %r9d
andl $0x3ff, %r9d            # imm = 0x3FF
movl -0x3c(%rbp), %r11d
shrl $0x3, %r11d
andl $0x7, %r11d
movl -0x3c(%rbp), %r10d
shrl $0x2, %r10d
andl $0x1, %r10d
movl -0x3c(%rbp), %eax
shrl %eax
andl $0x1, %eax
leaq 0x5692c(%rip), %rdx     # 0xcff73
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x20(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x20(%rbp), %rax
movsbl 0x22(%rax), %eax
cmpl $0x14, %eax
jne 0x7969a
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x7178
movl %eax, -0x14(%rbp)
jmp 0x79766
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
tzcntq %rax, %rax
movl %eax, %ecx
movl $0x7f, %eax
subl %ecx, %eax
subl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xc(%rbp), %ecx
shlq %cl, %rax
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x3d(%rbp)
jne 0x79732
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
andq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x3d(%rbp)
jne 0x79732
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl -0x10(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
addq %rcx, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x79748
movl $0x4a, -0x14(%rbp)
jmp 0x79766
movq -0x20(%rbp), %rdi
callq 0x65e20
cmpl $0x0, %eax
je 0x7975f
movl $0x5f, -0x14(%rbp)
jmp 0x79766
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop