	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdv_read_packet
_gdv_read_packet:                       ## @gdv_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	movq	8(%rdi), %r15
	movq	%rbx, %rdi
	callq	_avio_feof
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %ebx
	testl	%ebx, %ebx
	jne	LBB0_15
## %bb.2:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_3:
	movl	(%r15), %edx
	testl	%edx, %edx
	je	LBB0_7
## %bb.4:
	cmpl	$0, 4(%r15)
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_14
## %bb.6:
	movl	$1, (%r14)
	movl	$0, 4(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_7:
	movq	%rbx, %rdi
	callq	_avio_rl16
	cmpl	$4869, %eax                     ## imm = 0x1305
	jne	LBB0_12
## %bb.8:
	movq	%rbx, %rdi
	callq	_avio_rl16
                                        ## kill: def $eax killed $eax def $rax
	leal	4(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	movl	$0, (%r14)
	movl	$1, 4(%r15)
	xorl	%ebx, %ebx
	cmpq	$0, 8(%r15)
	je	LBB0_15
## %bb.10:
	movq	_AV_PKT_DATA_PALETTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r14, %rdi
	callq	_av_packet_new_side_data
	testq	%rax, %rax
	je	LBB0_16
## %bb.11:
	movl	16(%r15), %esi
	movl	(%r12), %edx
	movq	%rax, %rdi
	callq	_memcpy
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r14)
	movq	$0, 8(%r15)
	jmp	LBB0_15
LBB0_12:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r14, %rdi
	callq	_av_packet_unref
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_PKT_DATA_PALETTE,4,2        ## @AV_PKT_DATA_PALETTE
	.comm	_AVPALETTE_SIZE,4,2             ## @AVPALETTE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_gdv_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdv_read_packet
_gdv_read_packet:                       ; @gdv_read_packet
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	ldp	x20, x21, [x0]
	mov	x0, x20
	bl	_avio_feof
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVERROR_EOF@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w0, w9, w8, eq
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	w2, [x21]
	cbz	w2, LBB0_7
; %bb.4:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_7
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_2
; %bb.6:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	str	wzr, [x21, #4]
	b	LBB0_2
LBB0_7:
	mov	x0, x20
	bl	_avio_rl16
	mov	w8, #4869
	cmp	w0, w8
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_avio_rl16
	add	w2, w0, #4
	mov	x0, x20
	mov	x1, x19
	bl	_av_get_packet
	tbnz	w0, #31, LBB0_2
; %bb.9:
	str	wzr, [x19]
	mov	w8, #1
	str	w8, [x21, #4]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_13
; %bb.10:
Lloh3:
	adrp	x8, _AV_PKT_DATA_PALETTE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PKT_DATA_PALETTE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x20, _AVPALETTE_SIZE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _AVPALETTE_SIZE@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_av_packet_new_side_data
	cbz	x0, LBB0_14
; %bb.11:
	ldr	w1, [x21, #16]
	ldr	w2, [x20]
	bl	_memcpy
	mov	w0, #0
Lloh8:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	str	xzr, [x21, #8]
	b	LBB0_2
LBB0_12:
Lloh11:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_2
LBB0_13:
	mov	w0, #0
	b	LBB0_2
LBB0_14:
	mov	x0, x19
	bl	_av_packet_unref
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_PKT_DATA_PALETTE,4,2        ; @AV_PKT_DATA_PALETTE
	.comm	_AVPALETTE_SIZE,4,2             ; @AVPALETTE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_gdv_read_packet
.subsections_via_symbols
