	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad1848_mixer_set
_ad1848_mixer_set:                      ## @ad1848_mixer_set
	.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
	cmpl	$32, %esi
	jge	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movl	(%rdi), %eax
	btl	%esi, %eax
	jae	LBB0_1
## %bb.3:
	movslq	%esi, %rax
	movq	8(%r15), %rcx
	movq	24(%r15), %rsi
	movslq	(%rcx,%rax,4), %r14
	movq	(%rsi,%r14,8), %rsi
	movq	_LEFT_CHN@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	$0, (%rsi,%rcx,8)
	je	LBB0_1
## %bb.4:
	movzbl	%dl, %edi
	movzbl	%dh, %eax
	cmpl	$100, %edi
	movl	$100, %edx
	cmovbl	%edi, %edx
	movq	_RIGHT_CHN@GOTPCREL(%rip), %r13
	movq	(%r13), %rbx
	cmpq	$0, (%rsi,%rbx,8)
	cmovel	%edi, %eax
	movl	$100, %esi
	cmpl	$100, %eax
	cmovael	%esi, %eax
	movq	_mix_cvt@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movl	(%rsi,%rax,4), %r12d
	movl	%eax, %ebx
	shll	$8, %ebx
	orl	%edx, %ebx
	movl	(%rsi,%rdx,4), %edx
	movq	16(%r15), %rax
	movl	%ebx, (%rax,%r14,4)
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ad1848_mixer_set_channel
	movq	24(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movq	(%r13), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	callq	_ad1848_mixer_set_channel
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LEFT_CHN,8,3                   ## @LEFT_CHN
	.comm	_RIGHT_CHN,8,3                  ## @RIGHT_CHN
	.comm	_mix_cvt,8,3                    ## @mix_cvt
	.no_dead_strip	_ad1848_mixer_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad1848_mixer_set
_ad1848_mixer_set:                      ; @ad1848_mixer_set
	.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
	cmp	w1, #32
	b.ge	LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	lsr	w8, w8, w1
	tbz	w8, #0, LBB0_5
; %bb.2:
	ldr	x8, [x19, #8]
	ldrsw	x21, [x8, w1, sxtw #2]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x21, lsl #3]
Lloh0:
	adrp	x9, _LEFT_CHN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LEFT_CHN@GOTPAGEOFF]
Lloh2:
	ldr	x3, [x9]
	ldr	x9, [x8, x3, lsl #3]
	cbz	x9, LBB0_5
; %bb.3:
	and	w9, w2, #0xff
	ubfx	w10, w2, #8, #8
	mov	w11, #100
	cmp	w9, #100
	csel	w20, w9, w11, lo
Lloh3:
	adrp	x23, _RIGHT_CHN@GOTPAGE
Lloh4:
	ldr	x23, [x23, _RIGHT_CHN@GOTPAGEOFF]
	ldr	x12, [x23]
	ldr	x8, [x8, x12, lsl #3]
	cmp	x8, #0
	csel	w8, w9, w10, eq
	cmp	w8, #100
	csel	w8, w8, w11, lo
Lloh5:
	adrp	x9, _mix_cvt@GOTPAGE
Lloh6:
	ldr	x9, [x9, _mix_cvt@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	w2, [x9, w20, uxtw #2]
	bfi	w20, w8, #8, #8
	ldr	w22, [x9, w8, uxtw #2]
	ldr	x8, [x19, #16]
	str	w20, [x8, x21, lsl #2]
	mov	x0, x19
	mov	x1, x21
	bl	_ad1848_mixer_set_channel
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x3, [x23]
	ldr	x8, [x8, x3, lsl #3]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_ad1848_mixer_set_channel
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LEFT_CHN,8,3                   ; @LEFT_CHN
	.comm	_RIGHT_CHN,8,3                  ; @RIGHT_CHN
	.comm	_mix_cvt,8,3                    ; @mix_cvt
	.no_dead_strip	_ad1848_mixer_set
.subsections_via_symbols
