	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rme9652_set_rate
_rme9652_set_rate:                      ## @rme9652_set_rate
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_snd_rme9652_use_is_exclusive
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	leaq	32(%r15), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	movq	%r15, %rdi
	callq	_rme9652_adat_sample_rate
	cmpl	$88199, %ebx                    ## imm = 0x15887
	jg	LBB0_7
## %bb.4:
	cmpl	$44100, %ebx                    ## imm = 0xAC44
	je	LBB0_10
## %bb.5:
	cmpl	$48000, %ebx                    ## imm = 0xBB80
	jne	LBB0_23
## %bb.6:
	movq	_RME9652_freq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	$48000, %eax                    ## imm = 0xBB80
	jg	LBB0_20
	jmp	LBB0_12
LBB0_7:
	cmpl	$88200, %ebx                    ## imm = 0x15888
	je	LBB0_18
## %bb.8:
	cmpl	$96000, %ebx                    ## imm = 0x17700
	jne	LBB0_23
## %bb.9:
	movq	_RME9652_DS@GOTPCREL(%rip), %rcx
	movq	_RME9652_freq@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	(%rcx), %ebx
	cmpl	$48000, %eax                    ## imm = 0xBB80
	jl	LBB0_20
	jmp	LBB0_12
LBB0_10:
	xorl	%ebx, %ebx
	cmpl	$48000, %eax                    ## imm = 0xBB80
	jg	LBB0_20
	jmp	LBB0_12
LBB0_18:
	movq	_RME9652_DS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	cmpl	$48000, %eax                    ## imm = 0xBB80
	jge	LBB0_12
LBB0_20:
	cmpq	$0, (%r15)
	jns	LBB0_22
## %bb.21:
	cmpq	$0, 8(%r15)
	js	LBB0_12
LBB0_22:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_12:
	movl	16(%r15), %r12d
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	callq	_rme9652_stop
LBB0_14:
	movq	_RME9652_freq@GOTPCREL(%rip), %rax
	movq	_RME9652_DS@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	orl	(%rax), %edx
	notl	%edx
	andl	20(%r15), %edx
	orl	%ebx, %edx
	movl	%edx, 20(%r15)
	movq	_RME9652_control_register@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rme9652_write
	testl	%r12d, %r12d
	je	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_rme9652_start
LBB0_16:
	andl	(%r13), %ebx
	movq	24(%r15), %rax
	movq	_RME9652_NCHANNELS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	_channel_map_9636_ss@GOTPCREL(%rip), %rax
	cmoveq	_channel_map_9652_ss@GOTPCREL(%rip), %rax
	movq	_channel_map_9636_ds@GOTPCREL(%rip), %rcx
	cmoveq	_channel_map_9652_ds@GOTPCREL(%rip), %rcx
	testl	%ebx, %ebx
	cmoveq	%rax, %rcx
	movl	(%rcx), %eax
	movl	%eax, 36(%r15)
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RME9652_freq,4,2               ## @RME9652_freq
	.comm	_RME9652_DS,4,2                 ## @RME9652_DS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RME9652_control_register,4,2   ## @RME9652_control_register
	.comm	_RME9652_NCHANNELS,8,3          ## @RME9652_NCHANNELS
	.comm	_channel_map_9652_ds,4,2        ## @channel_map_9652_ds
	.comm	_channel_map_9636_ds,4,2        ## @channel_map_9636_ds
	.comm	_channel_map_9652_ss,4,2        ## @channel_map_9652_ss
	.comm	_channel_map_9636_ss,4,2        ## @channel_map_9636_ss
	.no_dead_strip	_rme9652_set_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rme9652_set_rate
_rme9652_set_rate:                      ; @rme9652_set_rate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x19, x0
	bl	_snd_rme9652_use_is_exclusive
	cbz	w0, LBB0_14
; %bb.1:
	add	x20, x19, #32
	mov	x0, x20
	bl	_spin_lock_irq
	mov	x0, x19
	bl	_rme9652_adat_sample_rate
	mov	w8, #22663
	movk	w8, #1, lsl #16
	cmp	w21, w8
	b.gt	LBB0_5
; %bb.2:
	mov	w8, #44100
	cmp	w21, w8
	b.eq	LBB0_8
; %bb.3:
	mov	w8, #48000
	cmp	w21, w8
	b.ne	LBB0_22
; %bb.4:
Lloh0:
	adrp	x9, _RME9652_freq@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RME9652_freq@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x9]
	cmp	w0, w8
	b.gt	LBB0_11
	b	LBB0_16
LBB0_5:
	mov	w8, #22664
	movk	w8, #1, lsl #16
	cmp	w21, w8
	b.eq	LBB0_9
; %bb.6:
	mov	w8, #30464
	movk	w8, #1, lsl #16
	cmp	w21, w8
	b.ne	LBB0_22
; %bb.7:
Lloh3:
	adrp	x8, _RME9652_DS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RME9652_DS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _RME9652_freq@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RME9652_freq@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w21, w9, w8
	b	LBB0_10
LBB0_8:
	mov	w21, #0
	mov	w8, #48000
	cmp	w0, w8
	b.gt	LBB0_11
	b	LBB0_16
LBB0_9:
Lloh9:
	adrp	x8, _RME9652_DS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RME9652_DS@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
LBB0_10:
	mov	w8, #48000
	cmp	w0, w8
	b.ge	LBB0_16
LBB0_11:
	ldr	x8, [x19]
	tbz	x8, #63, LBB0_13
; %bb.12:
	ldr	x8, [x19, #8]
	tbnz	x8, #63, LBB0_16
LBB0_13:
	mov	x0, x20
	bl	_spin_unlock_irq
LBB0_14:
Lloh12:
	adrp	x8, _EBUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_16:
	ldr	w22, [x19, #16]
	cbz	w22, LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_rme9652_stop
LBB0_18:
Lloh14:
	adrp	x8, _RME9652_freq@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RME9652_freq@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x23, _RME9652_DS@GOTPAGE
Lloh18:
	ldr	x23, [x23, _RME9652_DS@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	w9, [x19, #20]
	bic	w8, w9, w8
	orr	w2, w8, w21
	str	w2, [x19, #20]
Lloh19:
	adrp	x8, _RME9652_control_register@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RME9652_control_register@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rme9652_write
	cbz	w22, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_rme9652_start
LBB0_20:
	ldr	w8, [x23]
	ldr	x9, [x19, #24]
Lloh22:
	adrp	x10, _RME9652_NCHANNELS@GOTPAGE
Lloh23:
	ldr	x10, [x10, _RME9652_NCHANNELS@GOTPAGEOFF]
Lloh24:
	adrp	x11, _channel_map_9652_ss@GOTPAGE
Lloh25:
	ldr	x11, [x11, _channel_map_9652_ss@GOTPAGEOFF]
Lloh26:
	adrp	x12, _channel_map_9636_ss@GOTPAGE
Lloh27:
	ldr	x12, [x12, _channel_map_9636_ss@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
Lloh29:
	adrp	x13, _channel_map_9652_ds@GOTPAGE
Lloh30:
	ldr	x13, [x13, _channel_map_9652_ds@GOTPAGEOFF]
Lloh31:
	adrp	x14, _channel_map_9636_ds@GOTPAGE
Lloh32:
	ldr	x14, [x14, _channel_map_9636_ds@GOTPAGEOFF]
	cmp	x9, x10
	csel	x9, x11, x12, eq
	csel	x10, x13, x14, eq
	tst	w8, w21
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x19, #36]
	mov	x0, x20
	bl	_spin_unlock_irq
	mov	w0, #0
LBB0_21:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_22:
	mov	x0, x20
	bl	_spin_unlock_irq
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh28
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RME9652_freq,4,2               ; @RME9652_freq
	.comm	_RME9652_DS,4,2                 ; @RME9652_DS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RME9652_control_register,4,2   ; @RME9652_control_register
	.comm	_RME9652_NCHANNELS,8,3          ; @RME9652_NCHANNELS
	.comm	_channel_map_9652_ds,4,2        ; @channel_map_9652_ds
	.comm	_channel_map_9636_ds,4,2        ; @channel_map_9636_ds
	.comm	_channel_map_9652_ss,4,2        ; @channel_map_9652_ss
	.comm	_channel_map_9636_ss,4,2        ; @channel_map_9636_ss
	.no_dead_strip	_rme9652_set_rate
.subsections_via_symbols
