// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x2
popq %rsi
callq 0x1f4be
movl %eax, %r14d
movq %rbx, %rdi
callq 0x1f662
movl %eax, %ebp
movzwl 0x7cb0(%rbx), %eax
cmpq $0x2541, %rax           # imm = 0x2541
ja 0x151e4
leaq (%rbx,%rax), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x1f332(%rip), %rdx     # 0x344fb
movl %r14d, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
addw 0x7cb0(%rbx), %ax
movw %ax, 0x7cb0(%rbx)
testl %ebp, %ebp
jne 0x15316
cmpw $0x2541, %ax            # imm = 0x2541
ja 0x1521f
movzwl %ax, %ecx
leaq (%rbx,%rcx), %rdi
addq $0x7cb2, %rdi           # imm = 0x7CB2
movl $0x2542, %ecx           # imm = 0x2542
subl %eax, %ecx
movzwl %cx, %esi
leaq 0x1f326(%rip), %rdx     # 0x34537
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1f4be
movl %eax, %ebp
incl %ebp
leaq 0x7cb2(%rbx), %r14
movq %rbx, %rdi
subl $0x1, %ebp
jb 0x152d5
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x1f6a0
movl %eax, %r12d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x1f6a0
movl %eax, %r13d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x1f6a0
movl %eax, %r15d
movq %rbx, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x1f6a0
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2541, %rcx           # imm = 0x2541
ja 0x15235
movq %rcx, %rdi
addq %r14, %rdi
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
movl %eax, (%rsp)
leaq 0x1f28b(%rip), %rdx     # 0x34544
movl %r12d, %ecx
movl %r13d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x1070
addw %ax, 0x7cb0(%rbx)
jmp 0x15235
movl $0x4000, %esi           # imm = 0x4000
callq 0x1f4be
movzwl 0x7cb0(%rbx), %ecx
cmpq $0x2542, %rcx           # imm = 0x2542
jae 0x15316
addq %rcx, %r14
movl $0x2542, %edx           # imm = 0x2542
subl %ecx, %edx
movzwl %dx, %esi
leaq 0x1f275(%rip), %rdx     # 0x34578
movq %r14, %rdi
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