	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2x00lib_antenna_diversity_eval
_rt2x00lib_antenna_diversity_eval:      ## @rt2x00lib_antenna_diversity_eval
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	4(%rdi), %rsi
	leaq	-40(%rbp), %rdi
	movl	$16, %edx
	callq	_memcpy
	movq	%r14, %rdi
	callq	_rt2x00link_antenna_get_link_rssi
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_rt2x00link_antenna_get_rssi_history
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_rt2x00link_antenna_update_rssi_history
	subl	%r15d, %ebx
	movl	%ebx, %eax
	negl	%eax
	cmovsl	%ebx, %eax
	cmpl	$5, %eax
	jb	LBB0_10
## %bb.1:
	movq	_ANTENNA_MODE_SAMPLE@GOTPCREL(%rip), %rcx
	movl	(%r14), %eax
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	_ANTENNA_RX_DIVERSITY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.2:
	movq	_ANTENNA_A@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, -40(%rbp)
	jne	LBB0_4
## %bb.3:
	movq	_ANTENNA_B@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_4:
	movq	%rcx, -40(%rbp)
LBB0_5:
	movq	_ANTENNA_TX_DIVERSITY@GOTPCREL(%rip), %rcx
	movq	-32(%rbp), %rdx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.6:
	movq	_ANTENNA_A@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jne	LBB0_8
## %bb.7:
	movq	_ANTENNA_B@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_8:
	movq	%rax, -32(%rbp)
	movq	%rax, %rdx
LBB0_9:
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_rt2x00lib_config_antenna
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ANTENNA_MODE_SAMPLE,4,2        ## @ANTENNA_MODE_SAMPLE
	.comm	_ANTENNA_RX_DIVERSITY,4,2       ## @ANTENNA_RX_DIVERSITY
	.comm	_ANTENNA_A,8,3                  ## @ANTENNA_A
	.comm	_ANTENNA_B,8,3                  ## @ANTENNA_B
	.comm	_ANTENNA_TX_DIVERSITY,4,2       ## @ANTENNA_TX_DIVERSITY
	.no_dead_strip	_rt2x00lib_antenna_diversity_eval
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2x00lib_antenna_diversity_eval
_rt2x00lib_antenna_diversity_eval:      ; @rt2x00lib_antenna_diversity_eval
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	add	x1, x0, #4
	mov	x0, sp
	mov	w2, #16
	bl	_memcpy
	mov	x0, x19
	bl	_rt2x00link_antenna_get_link_rssi
	mov	x20, x0
	mov	x0, x19
	bl	_rt2x00link_antenna_get_rssi_history
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_rt2x00link_antenna_update_rssi_history
	subs	w8, w20, w21
	cneg	w8, w8, mi
	cmp	w8, #5
	b.lo	LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _ANTENNA_MODE_SAMPLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANTENNA_MODE_SAMPLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh3:
	adrp	x9, _ANTENNA_RX_DIVERSITY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ANTENNA_RX_DIVERSITY@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x9]
Lloh6:
	adrp	x9, _ANTENNA_A@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ANTENNA_A@GOTPAGEOFF]
Lloh8:
	adrp	x10, _ANTENNA_B@GOTPAGE
Lloh9:
	ldr	x10, [x10, _ANTENNA_B@GOTPAGEOFF]
	tst	w11, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	x11, [sp]
	ldr	x12, [x9]
	ldr	x13, [x10]
	cmp	x11, x12
	csel	x11, x13, x12, eq
	str	x11, [sp]
LBB0_3:
Lloh10:
	adrp	x11, _ANTENNA_TX_DIVERSITY@GOTPAGE
Lloh11:
	ldr	x11, [x11, _ANTENNA_TX_DIVERSITY@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x11]
	ldr	x2, [sp, #8]
	tst	w11, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	x8, [x9]
	ldr	x9, [x10]
	cmp	x2, x8
	csel	x2, x9, x8, eq
	str	x2, [sp, #8]
LBB0_5:
	ldr	x1, [sp]
	mov	x0, x19
	bl	_rt2x00lib_config_antenna
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_MODE_SAMPLE,4,2        ; @ANTENNA_MODE_SAMPLE
	.comm	_ANTENNA_RX_DIVERSITY,4,2       ; @ANTENNA_RX_DIVERSITY
	.comm	_ANTENNA_A,8,3                  ; @ANTENNA_A
	.comm	_ANTENNA_B,8,3                  ; @ANTENNA_B
	.comm	_ANTENNA_TX_DIVERSITY,4,2       ; @ANTENNA_TX_DIVERSITY
	.no_dead_strip	_rt2x00lib_antenna_diversity_eval
.subsections_via_symbols
