// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x76d10
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x77060
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x65b87
movq -0x8(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
leaq 0x6acc9(%rip), %rdx     # 0xd0833
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
cmpl $0x0, -0x10(%rbp)
jne 0x65d72
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x65bf8
movq -0x8(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
leaq 0x6ac94(%rip), %rdx     # 0xd086f
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x76d10
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
je 0x65cf5
movq -0x8(%rbp), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x770f0
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x770f0
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x770f0
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0x80000001, %esi       # imm = 0x80000001
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x770f0
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x65cf0
movq -0x8(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
movl -0x24(%rbp), %eax
leaq 0x6abac(%rip), %rdx     # 0xd087c
movl %eax, (%rsp)
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x65c0c
movq -0x8(%rbp), %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x76d10
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
cmpq $0x2542, %rax           # imm = 0x2542
jae 0x65d70
movq -0x8(%rbp), %rdi
addq $0x7ca2, %rdi           # imm = 0x7CA2
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x8(%rbp), %rax
movswq 0x7ca0(%rax), %rax
movl $0x2542, %esi           # imm = 0x2542
subq %rax, %rsi
movl -0x28(%rbp), %ecx
leaq 0x6ab5d(%rip), %rdx     # 0xd08b0
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x8(%rbp), %rax
movswl 0x7ca0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x7ca0(%rax)
jmp 0x65d72
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)