	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmv_read_packet
_bmv_read_packet:                       ## @bmv_read_packet
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %r13
	movq	_BMV_NOP@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r13)
	je	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r15), %rdi
	cmpq	$0, (%rdi)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_avio_r8
	cmpl	(%r12), %eax
	je	LBB0_1
## %bb.4:
	movl	%eax, %ebx
	movq	_BMV_END@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_10
LBB0_5:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %eax
	jmp	LBB0_23
LBB0_6:
	movl	4(%r13), %eax
LBB0_7:
	incl	%eax
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_17
## %bb.8:
	movl	$0, 4(%r14)
	movl	$1, (%r13)
	movl	(%r14), %edx
	movl	16(%r14), %edi
	movq	8(%r13), %rsi
	callq	_memcpy
LBB0_9:
	movl	(%r14), %eax
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	(%r15), %rdi
	callq	_avio_rl24
	movl	%eax, 4(%r13)
	testl	%eax, %eax
	je	LBB0_21
## %bb.11:
	leaq	8(%r13), %r12
	incl	%eax
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_av_reallocp
	testl	%eax, %eax
	js	LBB0_23
## %bb.12:
	movq	8(%r13), %rsi
	movl	%ebx, (%rsi)
	movq	(%r15), %rdi
	addq	$4, %rsi
	movl	4(%r13), %edx
	callq	_avio_read
	cmpl	4(%r13), %eax
	jne	LBB0_19
## %bb.13:
	movq	_BMV_AUDIO@GOTPCREL(%rip), %rcx
	testl	%ebx, (%rcx)
	je	LBB0_7
## %bb.14:
	movq	(%r12), %rcx
	movl	4(%rcx), %ecx
	movl	%ecx, %edx
	shll	$6, %edx
	addl	%edx, %ecx
	incl	%ecx
	cmpl	%eax, %ecx
	jge	LBB0_20
## %bb.15:
	movq	%r14, %rdi
	movl	%ecx, %esi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_17
## %bb.16:
	movl	(%r14), %edx
	movl	16(%r14), %edi
	movq	8(%r13), %rsi
	addq	$4, %rsi
	callq	_memcpy
	movl	$1, 4(%r14)
	movl	16(%r13), %eax
	movl	%eax, 8(%r14)
	movq	8(%r13), %rcx
	movl	4(%rcx), %ecx
	shll	$5, %ecx
	movl	%ecx, 12(%r14)
	addl	%eax, %ecx
	movl	%ecx, 16(%r13)
	movl	$0, (%r13)
	jmp	LBB0_9
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_19:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_20:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%eax, %r8d
	callq	_av_log
LBB0_21:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_BMV_NOP,4,2                    ## @BMV_NOP
	.comm	_BMV_END,4,2                    ## @BMV_END
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_EIO,4,2                        ## @EIO
	.comm	_BMV_AUDIO,4,2                  ## @BMV_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reported audio size %d is bigger than packet size (%d)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_bmv_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmv_read_packet
_bmv_read_packet:                       ; @bmv_read_packet
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
Lloh0:
	adrp	x22, _BMV_NOP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BMV_NOP@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	cbz	w8, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x20]
	ldr	x8, [x0]
	cbnz	x8, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_avio_r8
	ldr	w8, [x22]
	cmp	w0, w8
	b.eq	LBB0_1
; %bb.4:
	mov	x21, x0
Lloh2:
	adrp	x8, _BMV_END@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BMV_END@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_12
LBB0_5:
Lloh5:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_7:
	ldr	w4, [x23, #4]
LBB0_8:
	add	w1, w4, #1
	mov	x0, x19
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_19
; %bb.9:
	str	wzr, [x19, #4]
	mov	w8, #1
	str	w8, [x23]
	ldr	w0, [x19, #16]
	ldr	x1, [x23, #8]
	ldr	w2, [x19]
	bl	_memcpy
LBB0_10:
	ldr	w0, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x0, [x20]
	bl	_avio_rl24
	str	w0, [x23, #4]
	cbz	w0, LBB0_23
; %bb.13:
	add	x22, x23, #8
	add	w1, w0, #1
	mov	x0, x22
	bl	_av_reallocp
	tbnz	w0, #31, LBB0_11
; %bb.14:
	ldr	x1, [x23, #8]
	str	w21, [x1], #4
	ldr	x0, [x20]
	ldr	w2, [x23, #4]
	bl	_avio_read
	ldr	w8, [x23, #4]
	cmp	w0, w8
	b.ne	LBB0_21
; %bb.15:
	mov	x4, x0
Lloh7:
	adrp	x8, _BMV_AUDIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BMV_AUDIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_8
; %bb.16:
	ldr	x8, [x22]
	ldr	w8, [x8, #4]
	add	w8, w8, w8, lsl #6
	add	w3, w8, #1
	cmp	w3, w4
	b.ge	LBB0_22
; %bb.17:
	mov	x0, x19
	mov	x1, x3
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_19
; %bb.18:
	ldr	w0, [x19, #16]
	ldr	x8, [x23, #8]
	add	x1, x8, #4
	ldr	w2, [x19]
	bl	_memcpy
	mov	w8, #1
	ldr	w9, [x23, #16]
	stp	w8, w9, [x19, #4]
	ldr	x8, [x23, #8]
	ldr	w8, [x8, #4]
	lsl	w8, w8, #5
	str	w8, [x19, #12]
	add	w8, w8, w9
	str	w8, [x23, #16]
	str	wzr, [x23]
	b	LBB0_10
LBB0_19:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_21:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_20
LBB0_22:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
LBB0_23:
Lloh19:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_BMV_NOP,4,2                    ; @BMV_NOP
	.comm	_BMV_END,4,2                    ; @BMV_END
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_EIO,4,2                        ; @EIO
	.comm	_BMV_AUDIO,4,2                  ; @BMV_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reported audio size %d is bigger than packet size (%d)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_bmv_read_packet
.subsections_via_symbols
