// File: /workspace/github_c_makefile_star2_O3/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 0x25872
movl %eax, %r14d
movq %rbx, %rdi
callq 0x25dac
movl %eax, %ebp
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x18848
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x21e1e(%rip), %rdx     # 0x3a64b
movl %r14d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
testl %ebp, %ebp
jne 0x18988
movzwl %ax, %eax
cmpl $0x2541, %eax           # imm = 0x2541
ja 0x18884
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x21e11(%rip), %rdx     # 0x3a687
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25872
cmpl $-0x1, %eax
je 0x1893f
movl %eax, %ebp
leaq 0x7cb2(%rbx), %r14
incl %ebp
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x25dec
movl %eax, %r15d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x25dec
movl %eax, %r12d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x25dec
movl %eax, %r13d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x25dec
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x18937
movq %rcx, %rdi
addq %r14, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movl %eax, (%rsp)
leaq 0x21d74(%rip), %rdx     # 0x3a694
movl %r15d, %ecx
movl %r12d, %r8d
movl %r13d, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
decl %ebp
jne 0x188a5
movq %rbx, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x25872
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2542, %rcx           # imm = 0x2542
jae 0x18988
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x21d50(%rip), %rdx     # 0x3a6c8
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