	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_set_ant_diversity
_rt2800_set_ant_diversity:              ## @rt2800_set_ant_diversity
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_ANTENNA_A@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	xorl	%ebx, %ebx
	cmpl	%esi, %r12d
	sete	%bl
	callq	_rt2x00_is_pci
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_E2PROM_CSR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_E2PROM_CSR_DATA_CLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	callq	_rt2800_register_write
	jmp	LBB0_4
LBB0_2:
	movq	%r15, %rdi
	callq	_rt2x00_is_usb
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_MCU_ANT_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$255, %edx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_rt2800_mcu_request
LBB0_4:
	xorl	%ebx, %ebx
	cmpl	%r14d, %r12d
	setne	%bl
	movq	_GPIO_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_GPIO_CTRL_DIR3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_GPIO_CTRL_VAL3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_rt2x00_set_field32
	movl	(%r12), %esi
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	callq	_rt2800_register_write
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ANTENNA_A,4,2                  ## @ANTENNA_A
	.comm	_E2PROM_CSR,4,2                 ## @E2PROM_CSR
	.comm	_E2PROM_CSR_DATA_CLOCK,4,2      ## @E2PROM_CSR_DATA_CLOCK
	.comm	_MCU_ANT_SELECT,4,2             ## @MCU_ANT_SELECT
	.comm	_GPIO_CTRL,4,2                  ## @GPIO_CTRL
	.comm	_GPIO_CTRL_DIR3,4,2             ## @GPIO_CTRL_DIR3
	.comm	_GPIO_CTRL_VAL3,4,2             ## @GPIO_CTRL_VAL3
	.no_dead_strip	_rt2800_set_ant_diversity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_set_ant_diversity
_rt2800_set_ant_diversity:              ; @rt2800_set_ant_diversity
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ANTENNA_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ANTENNA_A@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	cmp	w22, w1
	cset	w21, eq
	bl	_rt2x00_is_pci
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x23, _E2PROM_CSR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _E2PROM_CSR@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh5:
	adrp	x8, _E2PROM_CSR_DATA_CLOCK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _E2PROM_CSR_DATA_CLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_rt2x00_is_usb
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _MCU_ANT_SELECT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MCU_ANT_SELECT@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #255
	mov	x3, x21
	mov	w4, #0
	bl	_rt2800_mcu_request
LBB0_4:
	cmp	w22, w20
	cset	w20, ne
Lloh11:
	adrp	x21, _GPIO_CTRL@GOTPAGE
Lloh12:
	ldr	x21, [x21, _GPIO_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh13:
	adrp	x8, _GPIO_CTRL_DIR3@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GPIO_CTRL_DIR3@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh16:
	adrp	x8, _GPIO_CTRL_VAL3@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GPIO_CTRL_VAL3@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x20
	bl	_rt2x00_set_field32
	ldr	w1, [x21]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ANTENNA_A,4,2                  ; @ANTENNA_A
	.comm	_E2PROM_CSR,4,2                 ; @E2PROM_CSR
	.comm	_E2PROM_CSR_DATA_CLOCK,4,2      ; @E2PROM_CSR_DATA_CLOCK
	.comm	_MCU_ANT_SELECT,4,2             ; @MCU_ANT_SELECT
	.comm	_GPIO_CTRL,4,2                  ; @GPIO_CTRL
	.comm	_GPIO_CTRL_DIR3,4,2             ; @GPIO_CTRL_DIR3
	.comm	_GPIO_CTRL_VAL3,4,2             ; @GPIO_CTRL_VAL3
	.no_dead_strip	_rt2800_set_ant_diversity
.subsections_via_symbols
