	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9287_eeprom_get_tx_gain_index
_ar9287_eeprom_get_tx_gain_index:       ## @ar9287_eeprom_get_tx_gain_index
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %rbx
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	leaq	-48(%rbp), %rdx
	callq	_ath9k_hw_get_channel_centers
	testq	%r14, %r14
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	_AR5416_BCHAN_UNUSED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rax, (%r13,%rbx,8)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_3
## %bb.5:
	movq	%r14, %rbx
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	movl	-48(%rbp), %r14d
	movq	%r12, %rdi
	callq	_IS_CHAN_2GHZ
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_FREQ2FBIN
	leaq	-72(%rbp), %rcx
	leaq	-64(%rbp), %r8
	movq	%rax, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_ath9k_hw_get_lower_upper_index
	movq	-72(%rbp), %rcx
	movq	(%r15,%rcx,8), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	-64(%rbp), %rax
	movq	(%r15,%rax,8), %rax
	movq	(%rax), %rax
	addl	(%rax), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5416_BCHAN_UNUSED,8,3        ## @AR5416_BCHAN_UNUSED
	.no_dead_strip	_ar9287_eeprom_get_tx_gain_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9287_eeprom_get_tx_gain_index
_ar9287_eeprom_get_tx_gain_index:       ; @ar9287_eeprom_get_tx_gain_index
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x5
	mov	x24, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	stp	xzr, xzr, [sp, #16]
	add	x2, sp, #8
	bl	_ath9k_hw_get_channel_centers
	mov	x22, #0
	cbz	x24, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _AR5416_BCHAN_UNUSED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR5416_BCHAN_UNUSED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21, x22, lsl #3]
	cmp	x9, x8
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	cmp	x24, x22
	b.ne	LBB0_2
; %bb.4:
	mov	x22, x24
LBB0_5:
	ldr	w24, [sp, #8]
	mov	x0, x23
	bl	_IS_CHAN_2GHZ
	mov	x1, x0
	mov	x0, x24
	bl	_FREQ2FBIN
	add	x3, sp, #24
	add	x4, sp, #16
	mov	x1, x21
	mov	x2, x22
	bl	_ath9k_hw_get_lower_upper_index
	ldr	x8, [sp, #24]
	ldr	x8, [x20, x8, lsl #3]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x9, [sp, #16]
	ldr	x9, [x20, x9, lsl #3]
	ldr	x9, [x9]
	ldr	w9, [x9]
	add	w8, w9, w8
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
LBB0_7:
	str	w8, [x19]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5416_BCHAN_UNUSED,8,3        ; @AR5416_BCHAN_UNUSED
	.no_dead_strip	_ar9287_eeprom_get_tx_gain_index
.subsections_via_symbols
