// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/edge264_headers.c
// Function: parse_hrd_parameters
static void parse_hrd_parameters(Edge264Decoder *dec, Edge264SeqParameterSet *sps, int8_t *cpb_cnt, const char *indent) {
	*cpb_cnt = get_ue16(&dec->_gb, 31) + 1;
	int bit_rate_scale = get_uv(&dec->_gb, 4);
	int cpb_size_scale = get_uv(&dec->_gb, 4);
	log_dec(dec, "%sCPBs:\n", indent);
	for (int i = 0; i < *cpb_cnt; i++) {
		uint64_t bit_rate_value = get_ue32(&dec->_gb, 4294967294) + 1;
		uint64_t cpb_size_value = get_ue32(&dec->_gb, 4294967294) + 1;
		int cbr_flag = get_u1(&dec->_gb);
		log_dec(dec, "%s  - {bit_rate: %llu, size: %llu, cbr_flag: %u}\n",
			indent, bit_rate_value << (6 + bit_rate_scale), cpb_size_value << (4 + cpb_size_scale), cbr_flag);
	}
	unsigned delays = get_uv(&dec->_gb, 20);
	sps->initial_cpb_removal_delay_length = (delays >> 15) + 1;
	sps->cpb_removal_delay_length = ((delays >> 10) & 0x1f) + 1;
	sps->dpb_output_delay_length = ((delays >> 5) & 0x1f) + 1;
	sps->time_offset_length = delays & 0x1f;
	log_dec(dec, "%sinitial_cpb_removal_delay_length: %u\n"
		"%scpb_removal_delay_length: %u\n"
		"%sdpb_output_delay_length: %u\n"
		"%stime_offset_length: %u\n",
		indent, sps->initial_cpb_removal_delay_length,
		indent, sps->cpb_removal_delay_length,
		indent, sps->dpb_output_delay_length,
		indent, sps->time_offset_length);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1f, %esi
callq 0x76d10
addl $0x1, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x65e90
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x65e90
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0xc8aa4
movq -0x18(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movq -0x30(%rbp), %rcx
leaq 0x8575(%rip), %rdx      # 0xd0ffc
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0xc8ba6
movq -0x18(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x76d10
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x76d10
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x77060
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0xc8b96
movq -0x18(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %r8
movl -0x34(%rbp), %eax
addl $0x6, %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %r8
movq -0x50(%rbp), %r9
movl -0x38(%rbp), %eax
addl $0x4, %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %r9
movq -0x60(%rbp), %rcx
movl -0x54(%rbp), %eax
leaq 0x848f(%rip), %rdx      # 0xd1005
movl %eax, (%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0xc8b98
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc8aab
movq -0x18(%rbp), %rdi
movl $0x14, %esi
callq 0x65e90
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
shrl $0xf, %eax
addl $0x1, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x17(%rax)
movl -0x58(%rbp), %eax
shrl $0xa, %eax
andl $0x1f, %eax
addl $0x1, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x18(%rax)
movl -0x58(%rbp), %eax
shrl $0x5, %eax
andl $0x1f, %eax
addl $0x1, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x19(%rax)
movl -0x58(%rbp), %eax
andl $0x1f, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x1a(%rax)
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0xc8cb7
movq -0x18(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x18(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl 0x17(%rax), %r8d
movq -0x30(%rbp), %r9
movq -0x20(%rbp), %rax
movsbl 0x18(%rax), %r14d
movq -0x30(%rbp), %rbx
movq -0x20(%rbp), %rax
movsbl 0x19(%rax), %r11d
movq -0x30(%rbp), %r10
movq -0x20(%rbp), %rax
movsbl 0x1a(%rax), %eax
leaq 0x83b4(%rip), %rdx      # 0xd1037
movl %r14d, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x18(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)