	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function crystalhd_receive_frame
_crystalhd_receive_frame:               ## @crystalhd_receive_frame
	.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
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movq	(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	8(%rax), %r15d
	movl	$0, -44(%rbp)
	movaps	%xmm0, -64(%rbp)
	movq	_AV_LOG_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ff_decode_get_packet
	movl	%eax, %r12d
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	testl	%r12d, %r12d
	jns	LBB0_2
## %bb.1:
	cmpl	(%rax), %r12d
	jne	LBB0_20
LBB0_2:
	movq	-64(%rbp), %rbx
	movl	%r15d, %edi
	callq	_DtsTxFreeSize
	cmpq	%rax, %rbx
	jle	LBB0_5
## %bb.3:
	movq	_AV_LOG_TRACE@GOTPCREL(%rip), %r12
	leaq	L_.str.1(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	callq	_av_log
	movq	-64(%rbp), %rbx
	movl	%r15d, %edi
	callq	_DtsTxFreeSize
	cmpq	%rax, %rbx
	jg	LBB0_4
LBB0_5:
	leaq	-64(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_crystalhd_decode_packet
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_av_packet_unref
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	cmpl	%eax, %r12d
	jne	LBB0_7
## %bb.6:
	movq	_AVERROR_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_7:
	testl	%r12d, %r12d
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	jns	LBB0_9
## %bb.8:
	cmpl	(%rax), %r12d
	jne	LBB0_20
LBB0_9:
	leaq	-96(%rbp), %r12
	movq	_BC_STS_SUCCESS@GOTPCREL(%rip), %rbx
	movq	_RET_COPY_AGAIN@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_DtsGetDriverStatus
	cmpq	(%rbx), %rax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	$0, -96(%rbp)
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r14, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	leaq	-44(%rbp), %rdx
	callq	_receive_frame
	cmpq	(%r13), %rax
	je	LBB0_10
	jmp	LBB0_15
LBB0_11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movl	$-1, %r12d
	jmp	LBB0_20
LBB0_13:
	movq	_AV_LOG_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movl	$0, -44(%rbp)
	movq	_RET_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_15:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rdx
	movq	_EAGAIN@GOTPCREL(%rip), %rsi
	movq	_RET_ERROR@GOTPCREL(%rip), %rcx
	movl	$-1, %r12d
	cmpq	(%rcx), %rax
	je	LBB0_20
## %bb.16:
	xorl	%r12d, %r12d
	cmpl	$0, -44(%rbp)
	jne	LBB0_20
## %bb.17:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_19
## %bb.18:
	movl	(%rdx), %r12d
	jmp	LBB0_20
LBB0_19:
	movl	(%rsi), %edi
	callq	_AVERROR
	movl	%eax, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_VERBOSE,4,2             ## @AV_LOG_VERBOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CrystalHD: receive_frame\n"

	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_AV_LOG_TRACE,4,2               ## @AV_LOG_TRACE
L_.str.1:                               ## @.str.1
	.asciz	"CrystalHD: Waiting for space in input buffer\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_AVERROR_EXTERNAL,4,2           ## @AVERROR_EXTERNAL
	.comm	_BC_STS_SUCCESS,8,3             ## @BC_STS_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"CrystalHD: GetDriverStatus failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"CrystalHD: Insufficient frames ready. Returning\n"

	.comm	_RET_OK,8,3                     ## @RET_OK
	.comm	_RET_COPY_AGAIN,8,3             ## @RET_COPY_AGAIN
	.comm	_RET_ERROR,8,3                  ## @RET_ERROR
	.no_dead_strip	_crystalhd_receive_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function crystalhd_receive_frame
_crystalhd_receive_frame:               ; @crystalhd_receive_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x1
	mov	x19, x0
	stp	xzr, xzr, [sp, #32]
	ldr	x23, [x0]
	ldr	w21, [x23, #8]
	str	wzr, [sp, #28]
	stp	xzr, xzr, [sp, #8]
Lloh0:
	adrp	x25, _AV_LOG_VERBOSE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AV_LOG_VERBOSE@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
	add	x1, sp, #8
	mov	x0, x19
	bl	_ff_decode_get_packet
Lloh4:
	adrp	x24, _AVERROR_EOF@GOTPAGE
Lloh5:
	ldr	x24, [x24, _AVERROR_EOF@GOTPAGEOFF]
	tbz	w0, #31, LBB0_2
; %bb.1:
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_20
LBB0_2:
	ldr	x22, [sp, #8]
	mov	x0, x21
	bl	_DtsTxFreeSize
	cmp	x22, x0
	b.le	LBB0_5
; %bb.3:
Lloh6:
	adrp	x26, _AV_LOG_TRACE@GOTPAGE
Lloh7:
	ldr	x26, [x26, _AV_LOG_TRACE@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str.1@PAGE
Lloh9:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x22
	bl	_av_log
	ldr	x27, [sp, #8]
	mov	x0, x21
	bl	_DtsTxFreeSize
	cmp	x27, x0
	b.gt	LBB0_4
LBB0_5:
	add	x1, sp, #8
	mov	x0, x19
	bl	_crystalhd_decode_packet
	mov	x22, x0
	add	x0, sp, #8
	bl	_av_packet_unref
Lloh10:
	adrp	x26, _EAGAIN@GOTPAGE
Lloh11:
	ldr	x26, [x26, _EAGAIN@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_AVERROR
Lloh12:
	adrp	x8, _AVERROR_EXTERNAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AVERROR_EXTERNAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w22, w0
	csel	w0, w8, w22, eq
	tbz	w0, #31, LBB0_7
; %bb.6:
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_20
LBB0_7:
Lloh15:
	adrp	x22, _BC_STS_SUCCESS@GOTPAGE
Lloh16:
	ldr	x22, [x22, _BC_STS_SUCCESS@GOTPAGEOFF]
Lloh17:
	adrp	x27, _RET_COPY_AGAIN@GOTPAGE
Lloh18:
	ldr	x27, [x27, _RET_COPY_AGAIN@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #32
	mov	x0, x21
	bl	_DtsGetDriverStatus
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #32]
	cbz	x8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x2, sp, #28
	mov	x0, x19
	mov	x1, x20
	bl	_receive_frame
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_8
	b	LBB0_13
LBB0_11:
Lloh19:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, l_.str.2@PAGE
Lloh23:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	w0, #-1
	b	LBB0_20
LBB0_12:
	ldr	w1, [x25]
Lloh24:
	adrp	x2, l_.str.3@PAGE
Lloh25:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_av_log
	str	wzr, [sp, #28]
Lloh26:
	adrp	x8, _RET_OK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RET_OK@GOTPAGEOFF]
Lloh28:
	ldr	x0, [x8]
LBB0_13:
Lloh29:
	adrp	x8, _RET_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RET_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_15
; %bb.14:
	mov	w0, #-1
	b	LBB0_20
LBB0_15:
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_17
; %bb.16:
	mov	w0, #0
	b	LBB0_20
LBB0_17:
	ldr	x8, [x23]
	cbz	x8, LBB0_19
; %bb.18:
	ldr	w0, [x24]
	b	LBB0_20
LBB0_19:
	ldr	w0, [x26]
	bl	_AVERROR
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_VERBOSE,4,2             ; @AV_LOG_VERBOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CrystalHD: receive_frame\n"

	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_AV_LOG_TRACE,4,2               ; @AV_LOG_TRACE
l_.str.1:                               ; @.str.1
	.asciz	"CrystalHD: Waiting for space in input buffer\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_AVERROR_EXTERNAL,4,2           ; @AVERROR_EXTERNAL
	.comm	_BC_STS_SUCCESS,8,3             ; @BC_STS_SUCCESS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"CrystalHD: GetDriverStatus failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"CrystalHD: Insufficient frames ready. Returning\n"

	.comm	_RET_OK,8,3                     ; @RET_OK
	.comm	_RET_COPY_AGAIN,8,3             ; @RET_COPY_AGAIN
	.comm	_RET_ERROR,8,3                  ; @RET_ERROR
	.no_dead_strip	_crystalhd_receive_frame
.subsections_via_symbols
