	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lo_measure_gain_values
_lo_measure_gain_values:                ## @lo_measure_gain_values
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rdi, %r14
	movq	(%rdi), %r12
	xorl	%ebx, %ebx
	testl	%esi, %esi
	cmovgl	%esi, %ebx
	callq	_has_loopback_gain
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	movl	(%r12), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	subl	%ecx, %ebx
	cmovll	%ecx, %ebx
LBB0_3:
	leal	-8(%rbx), %edi
	xorl	%eax, %eax
	cmpl	$9, %ebx
	setge	%al
	cmovll	%ebx, %edi
	movl	%eax, 4(%r12)
	xorl	%esi, %esi
	movl	$45, %edx
	callq	_clamp_val
	movslq	%eax, %rcx
	imulq	$1431655766, %rcx, %rax         ## imm = 0x55555556
	movq	%rax, %rdx
	shrq	$63, %rdx
	shrq	$32, %rax
	addl	%edx, %eax
	movl	%eax, 8(%r12)
	cmpl	$15, %ecx
	jl	LBB0_5
## %bb.4:
	addl	$-5, %eax
	movl	%eax, 8(%r12)
	movl	$2, 12(%r12)
	jmp	LBB0_13
LBB0_6:
	movl	$0, 12(%r12)
	movl	$32, (%r12)
	cmpl	$20, %ebx
	jb	LBB0_8
## %bb.7:
	movabsq	$8589934593, %rax               ## imm = 0x200000001
	movq	%rax, 4(%r12)
	jmp	LBB0_13
LBB0_5:
	movl	$0, 12(%r12)
	jmp	LBB0_13
LBB0_8:
	cmpl	$18, %ebx
	jb	LBB0_10
## %bb.9:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%r12)
	jmp	LBB0_13
LBB0_10:
	cmpl	$15, %ebx
	jb	LBB0_12
## %bb.11:
	movq	$1, 4(%r12)
	jmp	LBB0_13
LBB0_12:
	movq	$0, 4(%r12)
LBB0_13:
	movq	%r14, %rdi
	movl	$122, %esi
	callq	_b43_radio_read16
                                        ## kill: def $eax killed $eax def $rax
	xorl	%ecx, %ecx
	cmpl	$0, 4(%r12)
	setne	%cl
	andl	$-9, %eax
	leal	(%rax,%rcx,8), %edx
	movq	%r14, %rdi
	movl	$122, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_b43_radio_write16              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lo_measure_gain_values
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function lo_measure_gain_values
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
lCPI0_1:
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_lo_measure_gain_values:                ; @lo_measure_gain_values
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x2
	mov	x19, x0
	ldr	x21, [x0]
	cmp	w1, #0
	csel	w22, w1, wzr, gt
	bl	_has_loopback_gain
	cbz	x0, LBB0_5
; %bb.1:
	cbz	w20, LBB0_3
; %bb.2:
	ldr	w8, [x21]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	subs	w9, w22, w8
	csel	w22, w8, w9, lt
LBB0_3:
	subs	w8, w22, #8
	cset	w9, gt
	cmp	w22, #9
	csel	w0, w22, w8, lt
	str	w9, [x21, #4]
	mov	w1, #0
	mov	w2, #45
	bl	_clamp_val
	mov	w8, #21846
	movk	w8, #21845, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	str	w8, [x21, #8]
	cmp	w0, #15
	b.lt	LBB0_7
; %bb.4:
	sub	w8, w8, #5
	mov	w9, #2
	stp	w8, w9, [x21, #8]
	b	LBB0_13
LBB0_5:
	str	wzr, [x21, #12]
	mov	w8, #32
	str	w8, [x21]
	cmp	w22, #20
	b.lo	LBB0_8
; %bb.6:
Lloh0:
	adrp	x8, lCPI0_1@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	stur	d0, [x21, #4]
	b	LBB0_13
LBB0_7:
	str	wzr, [x21, #12]
	b	LBB0_13
LBB0_8:
	cmp	w22, #18
	b.lo	LBB0_10
; %bb.9:
	movi.2s	v0, #1
	stur	d0, [x21, #4]
	b	LBB0_13
LBB0_10:
	cmp	w22, #15
	b.lo	LBB0_12
; %bb.11:
Lloh2:
	adrp	x8, lCPI0_0@PAGE
Lloh3:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x21, #4]
	b	LBB0_13
LBB0_12:
	stp	wzr, wzr, [x21, #4]
LBB0_13:
	mov	x0, x19
	mov	w1, #122
	bl	_b43_radio_read16
	mov	x2, x0
	ldr	w8, [x21, #4]
	cmp	w8, #0
	cset	w8, ne
	bfi	w2, w8, #3, #1
	mov	x0, x19
	mov	w1, #122
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_b43_radio_write16
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdr	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lo_measure_gain_values
.subsections_via_symbols
