	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function librav1e_receive_packet
_librav1e_receive_packet:               ## @librav1e_receive_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	16(%rdi), %r13
	movq	$0, -48(%rbp)
	movq	_AV_CODEC_FLAG_PASS1@GOTPCREL(%rip), %r14
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %eax
	testl	%eax, (%r14)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_get_stats
	testl	%eax, %eax
	jns	LBB0_5
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_AV_CODEC_FLAG_PASS2@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	callq	_set_stats
	testl	%eax, %eax
	js	LBB0_25
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r13), %edi
	movq	%r12, %rsi
	callq	_rav1e_receive_packet
	cmpl	$132, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %rax
	cmpl	$0, (%rax)
	jne	LBB0_1
	jmp	LBB0_19
LBB0_7:
	movl	%eax, %ebx
	leal	-128(%rbx), %eax
	cmpl	$3, %eax
	ja	LBB0_16
## %bb.8:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_9:
	movq	-48(%rbp), %rax
	movl	12(%rax), %esi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_26
## %bb.10:
	movl	12(%r14), %edi
	movq	-48(%rbp), %rax
	movl	12(%rax), %edx
	movl	16(%rax), %esi
	callq	_memcpy
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	movq	_RA_FRAME_TYPE_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r14)
LBB0_12:
	movl	4(%r15), %eax
	imull	8(%rdi), %eax
	movl	%eax, 4(%r14)
	movl	%eax, (%r14)
	callq	_rav1e_packet_unref
	movq	_AV_CODEC_FLAG_GLOBAL_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r15)
	je	LBB0_31
## %bb.13:
	movl	(%r13), %edi
	movq	%r14, %rsi
	callq	_av_bsf_send_packet
	testl	%eax, %eax
	js	LBB0_29
## %bb.14:
	movl	(%r13), %edi
	movq	%r14, %rsi
	callq	_av_bsf_receive_packet
	testl	%eax, %eax
	jns	LBB0_31
## %bb.15:
	movl	%eax, %r12d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_30
LBB0_16:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_rav1e_status_to_str
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_31
LBB0_17:
	movq	8(%r15), %rax
	cmpl	$0, (%rax)
	je	LBB0_19
## %bb.18:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_24
LBB0_19:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_31
LBB0_20:
	movl	(%r14), %eax
	testl	%eax, (%r15)
	je	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_get_stats
	testl	%eax, %eax
	js	LBB0_25
LBB0_22:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_31
LBB0_25:
	movl	%eax, %ebx
	jmp	LBB0_31
LBB0_23:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$131, %edi
	callq	_rav1e_status_to_str
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_24:
	movq	_AVERROR_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_31:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movl	%eax, %ebx
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rdi
	callq	_rav1e_packet_unref
	jmp	LBB0_31
LBB0_29:
	movl	%eax, %r12d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
LBB0_30:
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	%r14, %rdi
	callq	_av_packet_unref
	movl	%r12d, %ebx
	jmp	LBB0_31
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_17
	.long	L0_0_set_20
	.long	L0_0_set_23
	.end_data_region
                                        ## -- End function
	.comm	_AV_CODEC_FLAG_PASS1,4,2        ## @AV_CODEC_FLAG_PASS1
	.comm	_AV_CODEC_FLAG_PASS2,4,2        ## @AV_CODEC_FLAG_PASS2
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected error when receiving packet after EOF.\n"

	.comm	_AVERROR_EXTERNAL,4,2           ## @AVERROR_EXTERNAL
L_.str.1:                               ## @.str.1
	.asciz	"Could not encode frame: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unknown return code %d from rav1e_receive_packet: %s\n"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
L_.str.3:                               ## @.str.3
	.asciz	"Could not allocate packet.\n"

	.comm	_RA_FRAME_TYPE_KEY,8,3          ## @RA_FRAME_TYPE_KEY
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ## @AV_CODEC_FLAG_GLOBAL_HEADER
L_.str.4:                               ## @.str.4
	.asciz	"extradata extraction send failed.\n"

L_.str.5:                               ## @.str.5
	.asciz	"extradata extraction receive failed.\n"

	.no_dead_strip	_librav1e_receive_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function librav1e_receive_packet
_librav1e_receive_packet:               ; @librav1e_receive_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
	str	xzr, [sp, #24]
Lloh0:
	adrp	x23, _AV_CODEC_FLAG_PASS1@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AV_CODEC_FLAG_PASS1@GOTPAGEOFF]
Lloh2:
	adrp	x24, _AV_CODEC_FLAG_PASS2@GOTPAGE
Lloh3:
	ldr	x24, [x24, _AV_CODEC_FLAG_PASS2@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	mov	w1, #0
	bl	_get_stats
	tbz	w0, #31, LBB0_5
	b	LBB0_23
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_set_stats
	tbnz	w0, #31, LBB0_23
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x22, #4]
	add	x1, sp, #24
	bl	_rav1e_receive_packet
	cmp	w0, #132
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cbnz	w8, LBB0_1
	b	LBB0_19
LBB0_7:
	mov	x21, x0
	sub	w8, w0, #128
	cmp	w8, #3
	b.hi	LBB0_16
; %bb.8:
Lloh4:
	adrp	x9, lJTI0_0@PAGE
Lloh5:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_9
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_9:
	ldr	x8, [sp, #24]
	ldr	w1, [x8, #12]
	mov	x0, x20
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_27
; %bb.10:
	ldr	w0, [x20, #12]
	ldr	x8, [sp, #24]
	ldp	w2, w1, [x8, #12]
	bl	_memcpy
	ldr	x0, [sp, #24]
	ldr	x8, [x0]
Lloh6:
	adrp	x9, _RA_FRAME_TYPE_KEY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RA_FRAME_TYPE_KEY@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
Lloh9:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	str	w8, [x20, #8]
LBB0_12:
	ldr	w8, [x0, #8]
	ldr	w9, [x19, #4]
	mul	w8, w9, w8
	stp	w8, w8, [x20]
	bl	_rav1e_packet_unref
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AV_CODEC_FLAG_GLOBAL_HEADER@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	ldr	w0, [x22]
	mov	x1, x20
	bl	_av_bsf_send_packet
	tbnz	w0, #31, LBB0_28
; %bb.14:
	ldr	w0, [x22]
	mov	x1, x20
	bl	_av_bsf_receive_packet
	tbnz	w0, #31, LBB0_29
LBB0_15:
	mov	w21, #0
	b	LBB0_26
LBB0_16:
Lloh15:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
	mov	x0, x21
	bl	_rav1e_status_to_str
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh18:
	adrp	x2, l_.str.2@PAGE
Lloh19:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_av_log
Lloh20:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	b	LBB0_26
LBB0_17:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cbz	w8, LBB0_19
; %bb.18:
Lloh23:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x2, l_.str@PAGE
Lloh27:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_25
LBB0_19:
Lloh28:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_26
LBB0_20:
	ldr	w8, [x19]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.21:
	mov	x0, x19
	mov	w1, #1
	bl	_get_stats
	tbnz	w0, #31, LBB0_23
LBB0_22:
Lloh31:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh33:
	ldr	w21, [x8]
	b	LBB0_26
LBB0_23:
	mov	x21, x0
	b	LBB0_26
LBB0_24:
Lloh34:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w20, [x8]
	mov	w0, #131
	bl	_rav1e_status_to_str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh37:
	adrp	x2, l_.str.1@PAGE
Lloh38:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x20
LBB0_25:
	bl	_av_log
Lloh39:
	adrp	x8, _AVERROR_EXTERNAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _AVERROR_EXTERNAL@GOTPAGEOFF]
Lloh41:
	ldr	w21, [x8]
LBB0_26:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_27:
	mov	x21, x0
Lloh42:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh43:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x2, l_.str.3@PAGE
Lloh46:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x0, [sp, #24]
	bl	_rav1e_packet_unref
	b	LBB0_26
LBB0_28:
	mov	x21, x0
Lloh47:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
Lloh50:
	adrp	x2, l_.str.4@PAGE
Lloh51:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_30
LBB0_29:
	mov	x21, x0
Lloh52:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh53:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh54:
	ldr	w1, [x8]
Lloh55:
	adrp	x2, l_.str.5@PAGE
Lloh56:
	add	x2, x2, l_.str.5@PAGEOFF
LBB0_30:
	mov	x0, x19
	bl	_av_log
	mov	x0, x20
	bl	_av_packet_unref
	b	LBB0_26
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_17-LBB0_9)>>2
	.byte	(LBB0_20-LBB0_9)>>2
	.byte	(LBB0_24-LBB0_9)>>2
                                        ; -- End function
	.comm	_AV_CODEC_FLAG_PASS1,4,2        ; @AV_CODEC_FLAG_PASS1
	.comm	_AV_CODEC_FLAG_PASS2,4,2        ; @AV_CODEC_FLAG_PASS2
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected error when receiving packet after EOF.\n"

	.comm	_AVERROR_EXTERNAL,4,2           ; @AVERROR_EXTERNAL
l_.str.1:                               ; @.str.1
	.asciz	"Could not encode frame: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unknown return code %d from rav1e_receive_packet: %s\n"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
l_.str.3:                               ; @.str.3
	.asciz	"Could not allocate packet.\n"

	.comm	_RA_FRAME_TYPE_KEY,8,3          ; @RA_FRAME_TYPE_KEY
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.comm	_AV_CODEC_FLAG_GLOBAL_HEADER,4,2 ; @AV_CODEC_FLAG_GLOBAL_HEADER
l_.str.4:                               ; @.str.4
	.asciz	"extradata extraction send failed.\n"

l_.str.5:                               ; @.str.5
	.asciz	"extradata extraction receive failed.\n"

	.no_dead_strip	_librav1e_receive_packet
.subsections_via_symbols
