	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2x00lib_antenna_diversity_sample
_rt2x00lib_antenna_diversity_sample:    ## @rt2x00lib_antenna_diversity_sample
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_rt2x00link_antenna_get_link_rssi
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_rt2x00link_antenna_get_rssi_history
	movl	%eax, %r12d
	leaq	4(%rbx), %r15
	leaq	-40(%rbp), %rdi
	movq	%r15, %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	_ANTENNA_MODE_SAMPLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	cmpl	%r12d, %r14d
	jge	LBB0_1
## %bb.2:
	movq	_ANTENNA_A@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, (%r15)
	jne	LBB0_4
## %bb.3:
	movq	_ANTENNA_B@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_4:
	movq	_ANTENNA_RX_DIVERSITY@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_6
## %bb.5:
	movl	%ecx, -40(%rbp)
LBB0_6:
	movq	_ANTENNA_TX_DIVERSITY@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_8
## %bb.7:
	movl	%ecx, -36(%rbp)
LBB0_8:
	movq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_rt2x00lib_config_antenna
	jmp	LBB0_9
LBB0_1:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_rt2x00link_antenna_update_rssi_history
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ANTENNA_MODE_SAMPLE,4,2        ## @ANTENNA_MODE_SAMPLE
	.comm	_ANTENNA_A,4,2                  ## @ANTENNA_A
	.comm	_ANTENNA_B,4,2                  ## @ANTENNA_B
	.comm	_ANTENNA_RX_DIVERSITY,4,2       ## @ANTENNA_RX_DIVERSITY
	.comm	_ANTENNA_TX_DIVERSITY,4,2       ## @ANTENNA_TX_DIVERSITY
	.no_dead_strip	_rt2x00lib_antenna_diversity_sample
.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_sample
_rt2x00lib_antenna_diversity_sample:    ; @rt2x00lib_antenna_diversity_sample
	.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
	bl	_rt2x00link_antenna_get_link_rssi
	mov	x20, x0
	mov	x0, x19
	bl	_rt2x00link_antenna_get_rssi_history
	mov	x22, x0
	add	x21, x19, #4
	add	x0, sp, #8
	mov	x1, x21
	mov	w2, #8
	bl	_memcpy
Lloh0:
	adrp	x8, _ANTENNA_MODE_SAMPLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANTENNA_MODE_SAMPLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	cmp	w20, w22
	b.ge	LBB0_6
; %bb.1:
	ldr	w9, [x21]
Lloh3:
	adrp	x10, _ANTENNA_A@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ANTENNA_A@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x11, _ANTENNA_B@GOTPAGE
Lloh7:
	ldr	x11, [x11, _ANTENNA_B@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	cmp	w9, w10
	csel	w9, w11, w10, eq
Lloh9:
	adrp	x10, _ANTENNA_RX_DIVERSITY@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ANTENNA_RX_DIVERSITY@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_3
; %bb.2:
	str	w9, [sp, #8]
LBB0_3:
Lloh12:
	adrp	x10, _ANTENNA_TX_DIVERSITY@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ANTENNA_TX_DIVERSITY@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_5
; %bb.4:
	str	w9, [sp, #12]
LBB0_5:
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_rt2x00lib_config_antenna
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_rt2x00link_antenna_update_rssi_history
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_MODE_SAMPLE,4,2        ; @ANTENNA_MODE_SAMPLE
	.comm	_ANTENNA_A,4,2                  ; @ANTENNA_A
	.comm	_ANTENNA_B,4,2                  ; @ANTENNA_B
	.comm	_ANTENNA_RX_DIVERSITY,4,2       ; @ANTENNA_RX_DIVERSITY
	.comm	_ANTENNA_TX_DIVERSITY,4,2       ; @ANTENNA_TX_DIVERSITY
	.no_dead_strip	_rt2x00lib_antenna_diversity_sample
.subsections_via_symbols
