	.file	"extr_onyx.c_onyx_snd_vol_put.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	onyx_snd_vol_put, @function
onyx_snd_vol_put:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 40
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	snd_kcontrol_chip@PLT
	mov	rsi, QWORD PTR [rbx]
	mov	rbp, rax
	mov	rax, QWORD PTR VOLUME_RANGE_SHIFT[rip]
	mov	rdx, QWORD PTR [rsi]
	lea	rcx, -128[rax]
	cmp	rdx, rcx
	jl	.L5
	cmp	rdx, rax
	jge	.L5
	mov	rdx, QWORD PTR 8[rsi]
	cmp	rcx, rdx
	jg	.L5
	cmp	rax, rdx
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L11
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rdi, rbp
	call	mutex_lock@PLT
	mov	esi, DWORD PTR ONYX_REG_DAC_ATTEN_LEFT[rip]
	lea	rdx, 8[rsp]
	mov	rdi, rbp
	call	onyx_read_register@PLT
	mov	esi, DWORD PTR ONYX_REG_DAC_ATTEN_RIGHT[rip]
	lea	rdx, 16[rsp]
	mov	rdi, rbp
	call	onyx_read_register@PLT
	mov	rcx, QWORD PTR [rbx]
	mov	rsi, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR VOLUME_RANGE_SHIFT[rip]
	mov	rdx, QWORD PTR [rcx]
	add	rsi, rax
	cmp	rsi, rdx
	jne	.L6
	mov	rsi, QWORD PTR 16[rsp]
	add	rsi, rax
	cmp	rsi, QWORD PTR 8[rcx]
	je	.L12
.L6:
	mov	esi, DWORD PTR ONYX_REG_DAC_ATTEN_LEFT[rip]
	sub	rdx, rax
	mov	rdi, rbp
	call	onyx_write_register@PLT
	mov	rax, QWORD PTR [rbx]
	mov	esi, DWORD PTR ONYX_REG_DAC_ATTEN_RIGHT[rip]
	mov	rdi, rbp
	mov	rdx, QWORD PTR 8[rax]
	sub	rdx, QWORD PTR VOLUME_RANGE_SHIFT[rip]
	call	onyx_write_register@PLT
	mov	rdi, rbp
	call	mutex_unlock@PLT
	mov	eax, 1
	jmp	.L1
.L12:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	xor	eax, eax
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	onyx_snd_vol_put, .-onyx_snd_vol_put
	.comm	VOLUME_RANGE_SHIFT,8,8
	.comm	ONYX_REG_DAC_ATTEN_RIGHT,4,4
	.comm	ONYX_REG_DAC_ATTEN_LEFT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_onyx.c_onyx_snd_vol_put.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	onyx_snd_vol_put, %function
onyx_snd_vol_put:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r1
	ldr	r3, .L11
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r6, .L11+4
	bl	snd_kcontrol_chip
	ldr	ip, [r5]
	ldr	r3, [r6]
	ldr	r1, [ip]
	sub	r4, r3, #128
	cmp	r1, r3
	movlt	r2, #0
	movge	r2, #1
	cmp	r1, r4
	orrlt	r2, r2, #1
	cmp	r2, #0
	beq	.L2
.L4:
	ldr	r3, .L11+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L9
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	ldr	r2, [ip, #4]
	cmp	r3, r2
	movgt	r3, #0
	movle	r3, #1
	cmp	r4, r2
	movle	r4, r3
	orrgt	r4, r3, #1
	cmp	r4, #0
	bne	.L4
	mov	r7, r0
	ldr	r9, .L11+12
	ldr	r8, .L11+16
	bl	mutex_lock
	ldr	r1, [r9]
	add	r2, sp, #4
	mov	r0, r7
	bl	onyx_read_register
	ldr	r1, [r8]
	add	r2, sp, #8
	mov	r0, r7
	bl	onyx_read_register
	ldr	r0, [r5]
	ldr	r2, [r6]
	ldr	r3, [sp, #4]
	ldr	r1, [r0]
	add	r3, r2, r3
	cmp	r3, r1
	bne	.L5
	ldr	r3, [sp, #8]
	ldr	r0, [r0, #4]
	add	r3, r2, r3
	cmp	r3, r0
	beq	.L10
.L5:
	sub	r2, r1, r2
	mov	r0, r7
	ldr	r1, [r9]
	bl	onyx_write_register
	ldr	r2, [r5]
	ldr	r3, [r6]
	ldr	r2, [r2, #4]
	ldr	r1, [r8]
	sub	r2, r2, r3
	mov	r0, r7
	bl	onyx_write_register
	mov	r0, r7
	bl	mutex_unlock
	mov	r0, #1
	b	.L1
.L10:
	mov	r0, r7
	bl	mutex_unlock
	mov	r0, r4
	b	.L1
.L9:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	VOLUME_RANGE_SHIFT
	.word	EINVAL
	.word	ONYX_REG_DAC_ATTEN_LEFT
	.word	ONYX_REG_DAC_ATTEN_RIGHT
	.size	onyx_snd_vol_put, .-onyx_snd_vol_put
	.comm	VOLUME_RANGE_SHIFT,4,4
	.comm	ONYX_REG_DAC_ATTEN_RIGHT,4,4
	.comm	ONYX_REG_DAC_ATTEN_LEFT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
