	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvdsub_parse
_dvdsub_parse:                          ## @dvdsub_parse
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movq	%r8, %r12
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	(%rdi), %r13
	movq	%r8, (%rdx)
	movl	%r9d, (%rcx)
	cmpl	$0, (%r13)
	je	LBB0_4
## %bb.1:
	movq	8(%r13), %rax
	testq	%rax, %rax
	je	LBB0_7
LBB0_2:
	movslq	(%r13), %rcx
	leal	(%rcx,%rbx), %edx
	cmpl	4(%r13), %edx
	jle	LBB0_6
## %bb.3:
	movl	$0, (%r13)
	jmp	LBB0_7
LBB0_4:
	movq	%rsi, %rcx
	cmpl	$2, %ebx
	jge	LBB0_8
## %bb.5:
	testl	%ebx, %ebx
	jne	LBB0_10
	jmp	LBB0_17
LBB0_6:
	leaq	(%rax,%rcx,4), %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	(%r13), %ecx
	addl	%ebx, %ecx
	movl	%ecx, (%r13)
	movl	4(%r13), %eax
	cmpl	%eax, %ecx
	jge	LBB0_11
LBB0_7:
	movq	$0, (%r15)
	movl	$0, (%r14)
	jmp	LBB0_17
LBB0_8:
	movq	%r12, %rdi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	callq	_AV_RB16
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$5, %ebx
	ja	LBB0_12
## %bb.9:
	testl	%eax, %eax
	je	LBB0_12
LBB0_10:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rcx, %rdi
	movl	%ebx, %ecx
LBB0_16:
	callq	_av_log
	jmp	LBB0_17
LBB0_11:
	movq	8(%r13), %rcx
	movq	%rcx, (%r15)
	movl	%eax, (%r14)
	movl	$0, (%r13)
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r12, %rdi
	callq	_AV_RB16
	movl	%eax, 4(%r13)
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	leaq	8(%r12), %rdi
	callq	_AV_RB32
	movl	%eax, 4(%r13)
LBB0_14:
	leaq	8(%r13), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_av_freep
	movl	4(%r13), %ecx
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	subl	%edi, %eax
	cmpl	%eax, %ecx
	jbe	LBB0_18
## %bb.15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_18:
	addl	%ecx, %edi
	callq	_av_malloc
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Parser input %d too small\n"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"packet length %d is invalid\n"

	.no_dead_strip	_dvdsub_parse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvdsub_parse
_dvdsub_parse:                          ; @dvdsub_parse
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x5
	mov	x22, x4
	mov	x20, x3
	mov	x21, x2
	ldr	x25, [x0]
	str	x4, [x2]
	str	w5, [x3]
	ldr	w8, [x25]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x0, [x25, #8]
	cbz	x0, LBB0_7
LBB0_2:
	ldp	w8, w9, [x25]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	w10, w8, w19
	cmp	w10, w9
	b.le	LBB0_6
; %bb.3:
	str	wzr, [x25]
	b	LBB0_7
LBB0_4:
	mov	x23, x1
	cmp	w19, #2
	b.ge	LBB0_8
; %bb.5:
	cbnz	w19, LBB0_10
	b	LBB0_13
LBB0_6:
	add	x0, x0, x8, lsl #2
	mov	x1, x22
	mov	x2, x19
	bl	_memcpy
	ldp	w9, w8, [x25]
	add	w9, w9, w19
	cmp	w9, w8
	str	w9, [x25]
	b.ge	LBB0_12
LBB0_7:
	str	xzr, [x21]
	str	wzr, [x20]
	b	LBB0_13
LBB0_8:
	mov	x0, x22
	bl	_AV_RB16
	cmp	w19, #5
	b.hi	LBB0_14
; %bb.9:
	cbz	w0, LBB0_14
LBB0_10:
Lloh0:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	mov	x3, x19
LBB0_11:
	bl	_av_log
	b	LBB0_13
LBB0_12:
	ldr	x9, [x25, #8]
	str	x9, [x21]
	str	w8, [x20]
	str	wzr, [x25]
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
	mov	x0, x22
	bl	_AV_RB16
	str	w0, [x25, #4]
	cbnz	w0, LBB0_16
; %bb.15:
	add	x0, x22, #8
	bl	_AV_RB32
	str	w0, [x25, #4]
LBB0_16:
	add	x24, x25, #8
	mov	x0, x24
	bl	_av_freep
	ldr	w3, [x25, #4]
Lloh5:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
Lloh8:
	adrp	x8, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	sub	w9, w9, w8
	cmp	w3, w9
	b.ls	LBB0_18
; %bb.17:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	b	LBB0_11
LBB0_18:
	add	w0, w8, w3
	bl	_av_malloc
	str	x0, [x24]
	cbnz	x0, LBB0_2
	b	LBB0_7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Parser input %d too small\n"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"packet length %d is invalid\n"

	.no_dead_strip	_dvdsub_parse
.subsections_via_symbols
