	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvbsub_parse_page_segment
_dvbsub_parse_page_segment:             ## @dvbsub_parse_page_segment
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	movl	4(%rsi), %r12d
	movl	%r12d, %eax
	shrl	$4, %eax
	andl	$15, %eax
	xorl	%r13d, %r13d
	cmpl	%eax, (%r14)
	je	LBB0_29
## %bb.3:
	movq	%rsi, %r15
	movq	%rcx, %r13
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movl	%edx, -72(%rbp)                 ## 4-byte Spill
	shrl	$2, %r12d
	andl	$3, %r12d
	movl	(%rsi), %edx
	movl	%edx, 4(%r14)
	movl	%eax, (%r14)
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_ff_dlog
	cmpl	$1, 8(%r14)
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_save_subtitle_set
LBB0_5:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	decl	%r12d
	cmpl	$1, %r12d
	ja	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_delete_regions
	movq	%r14, %rdi
	callq	_delete_objects
	movq	%r14, %rdi
	callq	_delete_cluts
LBB0_7:
	movq	16(%r14), %rbx
	movq	%rbx, -56(%rbp)
	movq	$0, 16(%r14)
	movl	-72(%rbp), %r13d                ## 4-byte Reload
	cmpl	$8, %r13d
	jb	LBB0_26
## %bb.8:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movslq	%r13d, %rax
	leaq	(%r15,%rax,4), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	-56(%rbp), %rcx
	xorl	%eax, %eax
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
	movl	8(%r15), %ebx
	testq	%rax, %rax
	je	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%ebx, (%rax)
	je	LBB0_24
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r12
	movq	%rcx, %r15
	testq	%r12, %r12
	je	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rcx, %r15
	cmpl	%ebx, (%r12)
	je	LBB0_21
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %r15
	movq	8(%r12), %r12
	testq	%r12, %r12
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_16 Depth=2
	cmpl	%ebx, (%r12)
	jne	LBB0_16
## %bb.20:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	$8, %r15
LBB0_21:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, -64(%rbp)
	jmp	LBB0_22
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	addq	$8, %r15
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	$32, %edi
	callq	_av_mallocz
	movq	%rax, %r12
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_19
LBB0_22:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	leaq	16(%r13), %rdi
	movl	%ebx, (%r12)
	callq	_AV_RB16
	movq	%rax, 24(%r12)
	leaq	24(%r13), %r14
	movq	%r14, %rdi
	callq	_AV_RB16
	movq	%rax, 16(%r12)
	movq	8(%r12), %rax
	movq	%rax, (%r15)
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	16(%r15), %rax
	movq	%rax, 8(%r12)
	movq	%r12, 16(%r15)
	movl	24(%r12), %ecx
	movq	16(%r12), %r8
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_ff_dlog
	addq	$52, %r13
	cmpq	-80(%rbp), %r13                 ## 8-byte Folded Reload
	jae	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%r15), %rax
	movq	%r14, %r15
	leaq	-56(%rbp), %rcx
	jmp	LBB0_9
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_29
LBB0_24:
	movq	%rax, -64(%rbp)
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_log
LBB0_25:
	movq	-56(%rbp), %rbx
LBB0_26:
	xorl	%r13d, %r13d
	testq	%rbx, %rbx
	je	LBB0_29
## %bb.27:
	leaq	-64(%rbp), %r15
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -64(%rbp)
	movq	8(%rbx), %rbx
	movq	%r15, %rdi
	callq	_av_freep
	testq	%rbx, %rbx
	jne	LBB0_28
LBB0_29:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Page time out %ds, state %d\n"

	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"duplicate region\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Region %d, (%d,%d)\n"

	.no_dead_strip	_dvbsub_parse_page_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvbsub_parse_page_segment
_dvbsub_parse_page_segment:             ; @dvbsub_parse_page_segment
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	w2, #0
	b.le	LBB0_22
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
	ldr	w9, [x1, #4]
	ubfx	w8, w9, #4, #4
	ldr	w10, [x20]
	cmp	w10, w8
	b.eq	LBB0_27
; %bb.2:
	mov	x23, x4
	mov	x24, x3
	mov	x22, x2
	ldr	w2, [x21]
	ubfx	w25, w9, #2, #2
	stp	w8, w2, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x25
	bl	_ff_dlog
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	bl	_save_subtitle_set
LBB0_4:
	sub	w8, w25, #1
	cmp	w8, #1
	b.hi	LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_delete_regions
	mov	x0, x20
	bl	_delete_objects
	mov	x0, x20
	bl	_delete_cluts
LBB0_6:
	ldr	x23, [x20, #16]
	str	x23, [sp, #16]
	str	xzr, [x20, #16]
	cmp	w22, #8
	b.lo	LBB0_25
; %bb.7:
	mov	x8, #0
	add	x26, x21, w22, sxtw #2
Lloh2:
	adrp	x22, l_.str.2@PAGE
Lloh3:
	add	x22, x22, l_.str.2@PAGEOFF
	ldr	w23, [x21, #8]
	cbz	x8, LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x8]
	cmp	w9, w23
	b.eq	LBB0_23
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_8
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x24, [sp, #16]
	cbz	x24, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x24]
	cmp	w8, w23
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x27, sp, #16
	b	LBB0_16
LBB0_13:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x8, x24
	ldr	x24, [x24, #8]
	cbz	x24, LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	w9, [x24]
	cmp	w9, w23
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x27, x8, #8
LBB0_16:                                ;   in Loop: Header=BB0_10 Depth=1
	str	x24, [sp, #24]
	b	LBB0_20
LBB0_17:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x27, sp, #16
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x27, x8, #8
LBB0_19:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #32
	bl	_av_mallocz
	mov	x24, x0
	str	x0, [sp, #24]
	cbz	x0, LBB0_29
LBB0_20:                                ;   in Loop: Header=BB0_10 Depth=1
	add	x0, x21, #16
	str	w23, [x24]
	bl	_AV_RB16
	str	x0, [x24, #24]
	add	x25, x21, #24
	mov	x0, x25
	bl	_AV_RB16
	str	x0, [x24, #16]
	ldr	x8, [x24, #8]
	str	x8, [x27]
	ldr	x8, [x20, #16]
	str	x8, [x24, #8]
	str	x24, [x20, #16]
	ldr	w3, [x24, #24]
	ldr	x8, [x24, #16]
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_ff_dlog
	add	x8, x21, #52
	cmp	x8, x26
	b.hs	LBB0_24
; %bb.21:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x20, #16]
	mov	x21, x25
	ldr	w23, [x21, #8]
	cbnz	x8, LBB0_8
	b	LBB0_10
LBB0_22:
Lloh4:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	b	LBB0_28
LBB0_23:
	str	x8, [sp, #24]
Lloh7:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_24:
	ldr	x23, [sp, #16]
LBB0_25:
	cbz	x23, LBB0_27
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	str	x23, [sp, #24]
	ldr	x23, [x23, #8]
	add	x0, sp, #24
	bl	_av_freep
	cbnz	x23, LBB0_26
LBB0_27:
	mov	w0, #0
LBB0_28:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_29:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_AVERROR
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Page time out %ds, state %d\n"

	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"duplicate region\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Region %d, (%d,%d)\n"

	.no_dead_strip	_dvbsub_parse_page_segment
.subsections_via_symbols
