	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw28_set_audio_gain            ## -- Begin function tw28_set_audio_gain
	.p2align	4, 0x90
_tw28_set_audio_gain:                   ## @tw28_set_audio_gain
	.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, %r15d
	leal	3(%r15), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	movl	%edx, %r12d
	movq	%rdi, %rbx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	sarl	$2, %r14d
	andl	$-4, %eax
	subl	%eax, %r15d
	movl	%r15d, %edi
	callq	_TW286x_AUDIO_INPUT_GAIN_ADDR
	movl	%eax, %r13d
	movl	%r15d, %edi
	callq	_TW_AUDIO_INPUT_GAIN_ADDR
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_tw_readbyte
	movl	%r12d, %ecx
	shll	$4, %ecx
	testb	$1, %r15b
	movl	$240, %edx
	movl	$15, %ebx
	cmovel	%edx, %ebx
	cmovel	%r12d, %ecx
	andl	%eax, %ebx
	orl	%ecx, %ebx
	movl	%r15d, %edi
	callq	_TW286x_AUDIO_INPUT_GAIN_ADDR
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_TW_AUDIO_INPUT_GAIN_ADDR
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	movl	%ebx, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tw_writebyte                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw28_set_audio_gain            ; -- Begin function tw28_set_audio_gain
	.p2align	2
_tw28_set_audio_gain:                   ; @tw28_set_audio_gain
	.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	x19, x2
	mov	x20, x0
	add	w8, w1, #3
	cmp	w1, #0
	csel	w8, w8, w1, lt
	asr	w21, w8, #2
	and	w8, w8, #0xfffffffc
	sub	w22, w1, w8
	mov	x0, x22
	bl	_TW286x_AUDIO_INPUT_GAIN_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_AUDIO_INPUT_GAIN_ADDR
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_tw_readbyte
	tst	w22, #0x1
	mov	w8, #15
	mov	w9, #240
	csel	w8, w9, w8, eq
	and	w8, w0, w8
	lsl	w9, w19, #4
	csel	w9, w19, w9, eq
	orr	w19, w8, w9
	mov	x0, x22
	bl	_TW286x_AUDIO_INPUT_GAIN_ADDR
	mov	x23, x0
	mov	x0, x22
	bl	_TW_AUDIO_INPUT_GAIN_ADDR
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	mov	x4, x19
	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
	b	_tw_writebyte
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
