	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcxhr_prepare
_pcxhr_prepare:                         ## @pcxhr_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_snd_pcm_substream_chip
	movq	(%rax), %r14
	movq	(%r12), %rax
	movl	16(%rax), %esi
	movl	8(%rax), %ecx
	movl	12(%rax), %edx
	leaq	L_.str(%rip), %rdi
	callq	_snd_printdd
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	(%r12), %rax
	movq	(%rax), %rsi
	xorl	%ebx, %ebx
	cmpq	%rsi, (%r14)
	je	LBB0_5
## %bb.1:
	movq	%r14, %rdi
	callq	_pcxhr_set_clock
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_pcxhr_hardware_timer
	movl	%eax, %ebx
LBB0_4:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_5:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n"

	.no_dead_strip	_pcxhr_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcxhr_prepare
_pcxhr_prepare:                         ; @pcxhr_prepare
	.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, x0
	bl	_snd_pcm_substream_chip
	ldr	x20, [x0]
	ldr	x8, [x19]
	ldp	w2, w1, [x8, #12]
	ldr	w3, [x8, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_snd_printdd
	add	x21, x20, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x20]
	ldr	x9, [x19]
	ldr	x1, [x9]
	cmp	x8, x1
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_7
LBB0_2:
	mov	x0, x20
	bl	_pcxhr_set_clock
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
	mov	w22, #0
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	mov	w1, #1
	bl	_pcxhr_hardware_timer
	mov	x22, x0
LBB0_6:
	ldr	x8, [x19]
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_7:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x22
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n"

	.no_dead_strip	_pcxhr_prepare
.subsections_via_symbols
