	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt61pci_link_tuner
_rt61pci_link_tuner:                    ## @rt61pci_link_tuner
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_external_lna_a
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	shll	$4, %ecx
	leal	72(%rcx), %eax
	orl	$40, %ecx
	cmpl	$0, 8(%rbx)
	jne	LBB0_4
	jmp	LBB0_12
LBB0_2:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_external_lna_bg
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	shll	$4, %ecx
	leal	64(%rcx), %eax
	orl	$32, %ecx
	cmpl	$0, 8(%rbx)
	je	LBB0_12
LBB0_4:
	movl	(%r14), %esi
	movl	$96, %edx
	cmpl	$-36, %esi
	jg	LBB0_19
## %bb.5:
	cmpl	$-59, %esi
	jbe	LBB0_7
## %bb.6:
	movl	%eax, %edx
	jmp	LBB0_19
LBB0_7:
	cmpl	$-66, %esi
	jb	LBB0_9
## %bb.8:
	addl	$16, %ecx
	movl	%ecx, %edx
	jmp	LBB0_19
LBB0_9:
	cmpl	$-74, %esi
	jb	LBB0_11
## %bb.10:
	addl	$8, %ecx
	movl	%ecx, %edx
	jmp	LBB0_19
LBB0_11:
	leal	(%rax,%rsi,2), %eax
	addl	$148, %eax
	cmpl	%eax, %ecx
	cmovgl	%ecx, %eax
	movl	%eax, %edx
	cmpl	%eax, 4(%r14)
	jg	LBB0_19
LBB0_12:
	movl	8(%r14), %edx
	cmpl	$513, %edx                      ## imm = 0x201
	jl	LBB0_15
## %bb.13:
	movl	4(%r14), %edx
	cmpl	%eax, %edx
	jge	LBB0_20
## %bb.14:
	incl	%edx
	jmp	LBB0_18
LBB0_15:
	cmpl	$99, %edx
	jg	LBB0_20
## %bb.16:
	movl	4(%r14), %edx
	cmpl	%ecx, %edx
	jle	LBB0_20
## %bb.17:
	decl	%edx
LBB0_18:
	movl	%edx, 4(%r14)
LBB0_19:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rt61pci_set_vgc                ## TAILCALL
LBB0_20:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.no_dead_strip	_rt61pci_link_tuner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt61pci_link_tuner
_rt61pci_link_tuner:                    ; @rt61pci_link_tuner
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	bl	_rt2x00_has_cap_external_lna_a
	cmp	x0, #0
	mov	w8, #88
	mov	w9, #72
	csel	w2, w9, w8, eq
	mov	w8, #56
	mov	w9, #40
	b	LBB0_3
LBB0_2:
	bl	_rt2x00_has_cap_external_lna_bg
	cmp	x0, #0
	mov	w8, #80
	mov	w9, #64
	csel	w2, w9, w8, eq
	mov	w8, #48
	mov	w9, #32
LBB0_3:
	csel	w8, w9, w8, eq
	ldr	w9, [x20, #8]
	cbz	w9, LBB0_12
; %bb.4:
	ldr	w9, [x19]
	cmn	w9, #36
	b.le	LBB0_6
; %bb.5:
	mov	w2, #96
	b	LBB0_19
LBB0_6:
	cmn	w9, #59
	b.hi	LBB0_19
; %bb.7:
	cmn	w9, #66
	b.lo	LBB0_9
; %bb.8:
	add	w2, w8, #16
	b	LBB0_19
LBB0_9:
	cmn	w9, #74
	b.lo	LBB0_11
; %bb.10:
	add	w2, w8, #8
	b	LBB0_19
LBB0_11:
	add	w9, w2, w9, lsl #1
	add	w9, w9, #148
	cmp	w8, w9
	csel	w2, w8, w9, gt
	ldr	w9, [x19, #4]
	cmp	w9, w2
	b.gt	LBB0_19
LBB0_12:
	ldr	w9, [x19, #8]
	cmp	w9, #513
	b.lt	LBB0_15
; %bb.13:
	ldr	w8, [x19, #4]
	cmp	w8, w2
	b.ge	LBB0_20
; %bb.14:
	add	w2, w8, #1
	b	LBB0_18
LBB0_15:
	cmp	w9, #99
	b.gt	LBB0_20
; %bb.16:
	ldr	w9, [x19, #4]
	cmp	w9, w8
	b.le	LBB0_20
; %bb.17:
	sub	w2, w9, #1
LBB0_18:
	str	w2, [x19, #4]
LBB0_19:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rt61pci_set_vgc
LBB0_20:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.no_dead_strip	_rt61pci_link_tuner
.subsections_via_symbols
