// File: /workspace/github_c_makefile_star2_O1/tvlabs[P]edge264/./edge264_sei.c
// Function: parse_pan_scan_rect
static int parse_pan_scan_rect(Edge264Decoder *dec) {
	int pan_scan_rect_id = get_ue32(&dec->_gb, 4294967294);
	int pan_scan_rect_cancel_flag = get_u1(&dec->_gb);
	log_dec(dec, "    pan_scan_rect_id: %u\n"
		"    pan_scan_rect_cancel_flag: %u\n",
		pan_scan_rect_id, pan_scan_rect_cancel_flag);
	if (!pan_scan_rect_cancel_flag) {
		log_dec(dec, "    fields:\n");
		for (int i = get_ue16(&dec->_gb, 2) + 1; i--; ) {
			int pan_scan_rect_left_offset = get_se32(&dec->_gb, -2147483647, 2147483647);
			int pan_scan_rect_right_offset = get_se32(&dec->_gb, -2147483647, 2147483647);
			int pan_scan_rect_top_offset = get_se32(&dec->_gb, -2147483647, 2147483647);
			int pan_scan_rect_bottom_offset = get_se32(&dec->_gb, -2147483647, 2147483647);
			log_dec(dec, "      - {left: %d, right: %d, top: %d, bottom: %d}\n",
				pan_scan_rect_left_offset, pan_scan_rect_right_offset, pan_scan_rect_top_offset, pan_scan_rect_bottom_offset);
		}
		int pan_scan_rect_repetition_period = get_ue16(&dec->_gb, 16384);
		log_dec(dec, "    pan_scan_rect_repetition_period: %u\n",
			pan_scan_rect_repetition_period);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2536c
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2551d
movl %eax, %ebp
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x184ac
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movswq %cx, %rsi
leaq 0x22033(%rip), %rdx     # 0x3a4cb
movl %r14d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
testl %ebp, %ebp
jne 0x185f4
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x184ee
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movswq %cx, %rsi
leaq 0x22027(%rip), %rdx     # 0x3a507
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x2536c
cmpl $-0x1, %eax
je 0x185aa
movl %eax, %ebp
leaq 0x7cb2(%rbx), %r14
incl %ebp
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x2555d
movl %eax, %r15d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x2555d
movl %eax, %r12d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x2555d
movl %eax, %r13d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x2555d
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x185a2
movq %rcx, %rdi
addq %r14, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movswq %dx, %rsi
movl %eax, (%rsp)
leaq 0x21f89(%rip), %rdx     # 0x3a514
movl %r15d, %ecx
movl %r12d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %ebp
jne 0x1850f
movq %rbx, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x2536c
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2542, %rcx           # imm = 0x2542
jae 0x185f4
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movswq %dx, %rsi
leaq 0x21f64(%rip), %rdx     # 0x3a548
movl %eax, %ecx
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq