	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onyx_prepare
_onyx_prepare:                          ## @onyx_prepare
	.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	%rdx, %rbx
	movq	%rdi, %r13
	movq	(%rdi), %r15
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	(%rbx), %rax
	movl	8(%rax), %eax
	xorl	%r14d, %r14d
	cmpl	$32000, %eax                    ## imm = 0x7D00
	je	LBB0_6
## %bb.1:
	cmpl	$44100, %eax                    ## imm = 0xAC44
	je	LBB0_6
## %bb.2:
	cmpl	$48000, %eax                    ## imm = 0xBB80
	je	LBB0_6
## %bb.3:
	movq	(%r13), %rdi
	movq	_ONYX_REG_DIG_INFO4@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-48(%rbp), %rdx
	callq	_onyx_read_register
	movl	(%rbx), %esi
	movq	_ONYX_SPDIF_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-48(%rbp), %edx
	movq	%r15, %rdi
	callq	_onyx_write_register
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	negl	%r14d
	jmp	LBB0_6
LBB0_5:
	movl	$1, 4(%r15)
LBB0_6:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ONYX_REG_DIG_INFO4,4,2         ## @ONYX_REG_DIG_INFO4
	.comm	_ONYX_SPDIF_ENABLE,4,2          ## @ONYX_SPDIF_ENABLE
	.comm	_ONYX_MUTE_LEFT,4,2             ## @ONYX_MUTE_LEFT
	.comm	_ONYX_MUTE_RIGHT,4,2            ## @ONYX_MUTE_RIGHT
	.comm	_ONYX_REG_DAC_CONTROL,4,2       ## @ONYX_REG_DAC_CONTROL
	.comm	_SNDRV_PCM_FMTBIT_COMPRESSED_16BE,8,3 ## @SNDRV_PCM_FMTBIT_COMPRESSED_16BE
	.no_dead_strip	_onyx_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onyx_prepare
_onyx_prepare:                          ; @onyx_prepare
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x22, x2
	mov	x21, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x22]
	ldr	w8, [x8, #8]
	mov	w9, #32000
	cmp	w8, w9
	mov	w9, #44100
	ccmp	w8, w9, #4, ne
	mov	w9, #48000
	ccmp	w8, w9, #4, ne
	b.ne	LBB0_3
; %bb.1:
	mov	w21, #0
LBB0_2:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_3:
	ldr	x0, [x21]
Lloh3:
	adrp	x21, _ONYX_REG_DIG_INFO4@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ONYX_REG_DIG_INFO4@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_onyx_read_register
	ldr	w1, [x21]
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _ONYX_SPDIF_ENABLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ONYX_SPDIF_ENABLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	bic	w2, w8, w9
	mov	x0, x20
	bl	_onyx_write_register
	cbz	x0, LBB0_5
; %bb.4:
	neg	w21, w23
	b	LBB0_2
LBB0_5:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20, #4]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ONYX_REG_DIG_INFO4,4,2         ; @ONYX_REG_DIG_INFO4
	.comm	_ONYX_SPDIF_ENABLE,4,2          ; @ONYX_SPDIF_ENABLE
	.comm	_ONYX_MUTE_LEFT,4,2             ; @ONYX_MUTE_LEFT
	.comm	_ONYX_MUTE_RIGHT,4,2            ; @ONYX_MUTE_RIGHT
	.comm	_ONYX_REG_DAC_CONTROL,4,2       ; @ONYX_REG_DAC_CONTROL
	.comm	_SNDRV_PCM_FMTBIT_COMPRESSED_16BE,8,3 ; @SNDRV_PCM_FMTBIT_COMPRESSED_16BE
	.no_dead_strip	_onyx_prepare
.subsections_via_symbols
