	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onyx_snd_inputgain_put
_onyx_snd_inputgain_put:                ## @onyx_snd_inputgain_put
	.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	%rsi, %r14
	callq	_snd_kcontrol_chip
	movq	%rax, %r15
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	_INPUTGAIN_RANGE_SHIFT@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	leaq	3(%rcx), %rdx
	cmpq	%rdx, %rax
	jl	LBB0_2
## %bb.1:
	addq	$28, %rcx
	cmpq	%rcx, %rax
	jg	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_ONYX_REG_ADC_CONTROL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_onyx_read_register
	movq	-48(%rbp), %rax
	movq	_ONYX_ADC_PGA_GAIN_MASK@GOTPCREL(%rip), %rcx
	movq	(%r14), %rdx
	movq	(%rdx), %rbx
	subq	(%r12), %rbx
	xorq	%rax, %rbx
	andq	(%rcx), %rbx
	xorq	%rax, %rbx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_onyx_write_register
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	cmpq	-48(%rbp), %rbx
	setne	%al
	jmp	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INPUTGAIN_RANGE_SHIFT,8,3      ## @INPUTGAIN_RANGE_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ONYX_REG_ADC_CONTROL,4,2       ## @ONYX_REG_ADC_CONTROL
	.comm	_ONYX_ADC_PGA_GAIN_MASK,8,3     ## @ONYX_ADC_PGA_GAIN_MASK
	.no_dead_strip	_onyx_snd_inputgain_put
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onyx_snd_inputgain_put
_onyx_snd_inputgain_put:                ; @onyx_snd_inputgain_put
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	bl	_snd_kcontrol_chip
	ldr	x8, [x20]
Lloh0:
	adrp	x21, _INPUTGAIN_RANGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _INPUTGAIN_RANGE_SHIFT@GOTPAGEOFF]
	ldr	x8, [x8]
	ldr	x9, [x21]
	add	x10, x9, #3
	add	x9, x9, #28
	cmp	x8, x10
	ccmp	x8, x9, #0, ge
	b.le	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x19, x0
	bl	_mutex_lock
Lloh5:
	adrp	x22, _ONYX_REG_ADC_CONTROL@GOTPAGE
Lloh6:
	ldr	x22, [x22, _ONYX_REG_ADC_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x19
	bl	_onyx_read_register
	ldr	x8, [sp, #8]
Lloh7:
	adrp	x9, _ONYX_ADC_PGA_GAIN_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ONYX_ADC_PGA_GAIN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	bic	x8, x8, x9
	ldr	x10, [x20]
	ldr	x10, [x10]
	ldr	x11, [x21]
	sub	x10, x10, x11
	and	x9, x10, x9
	orr	x20, x9, x8
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x20
	bl	_onyx_write_register
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x8, [sp, #8]
	cmp	x20, x8
	cset	w0, ne
LBB0_3:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_INPUTGAIN_RANGE_SHIFT,8,3      ; @INPUTGAIN_RANGE_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ONYX_REG_ADC_CONTROL,4,2       ; @ONYX_REG_ADC_CONTROL
	.comm	_ONYX_ADC_PGA_GAIN_MASK,8,3     ; @ONYX_ADC_PGA_GAIN_MASK
	.no_dead_strip	_onyx_snd_inputgain_put
.subsections_via_symbols
