	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt61pci_config_antenna_5x
_rt61pci_config_antenna_5x:             ## @rt61pci_config_antenna_5x
	.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	%rsi, %r14
	movq	%rdi, %r15
	movl	$3, %esi
	callq	_rt61pci_bbp_read
	movl	%eax, -36(%rbp)
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_rt61pci_bbp_read
	movl	%eax, -32(%rbp)
	movq	%r15, %rdi
	movl	$77, %esi
	callq	_rt61pci_bbp_read
	movl	%eax, -28(%rbp)
	movq	_BBP_R3_SMART_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_RF5325@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rt2x00_rf
	leaq	-36(%rbp), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rt2x00_set_field8
	movl	(%r14), %eax
	cmpl	$130, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_5
## %bb.2:
	movq	_BBP_R4_RX_ANTENNA_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_rt2x00_set_field8
	movq	_BBP_R4_RX_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %eax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	setne	%dl
	movq	%rbx, %rdi
	jmp	LBB0_7
LBB0_3:
	movq	_BBP_R4_RX_ANTENNA_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field8
	movq	_BBP_R4_RX_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field8
	movl	(%r15), %eax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	movq	_BBP_R77_RX_ANTENNA@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	(%rcx), %eax
	je	LBB0_6
LBB0_4:
	leaq	-28(%rbp), %rdi
	movl	$3, %edx
	jmp	LBB0_7
LBB0_5:
	movq	_BBP_R4_RX_ANTENNA_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field8
	movq	_BBP_R4_RX_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field8
	movl	(%r15), %eax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	movq	_BBP_R77_RX_ANTENNA@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpl	(%rcx), %eax
	je	LBB0_4
LBB0_6:
	leaq	-28(%rbp), %rdi
	xorl	%edx, %edx
LBB0_7:
	callq	_rt2x00_set_field8
	movl	-28(%rbp), %edx
	movq	%r15, %rdi
	movl	$77, %esi
	callq	_rt61pci_bbp_write
	movl	-36(%rbp), %edx
	movq	%r15, %rdi
	movl	$3, %esi
	callq	_rt61pci_bbp_write
	movl	-32(%rbp), %edx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_rt61pci_bbp_write
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BBP_R3_SMART_MODE,4,2          ## @BBP_R3_SMART_MODE
	.comm	_RF5325,4,2                     ## @RF5325
	.comm	_BBP_R4_RX_ANTENNA_CONTROL,4,2  ## @BBP_R4_RX_ANTENNA_CONTROL
	.comm	_BBP_R4_RX_FRAME_END,4,2        ## @BBP_R4_RX_FRAME_END
	.comm	_NL80211_BAND_5GHZ,4,2          ## @NL80211_BAND_5GHZ
	.comm	_BBP_R77_RX_ANTENNA,4,2         ## @BBP_R77_RX_ANTENNA
	.no_dead_strip	_rt61pci_config_antenna_5x
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt61pci_config_antenna_5x
_rt61pci_config_antenna_5x:             ; @rt61pci_config_antenna_5x
	.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	x20, x1
	mov	x19, x0
	mov	w1, #3
	bl	_rt61pci_bbp_read
	str	w0, [sp, #12]
	mov	x0, x19
	mov	w1, #4
	bl	_rt61pci_bbp_read
	str	w0, [sp, #8]
	mov	x0, x19
	mov	w1, #77
	bl	_rt61pci_bbp_read
	str	w0, [sp, #4]
Lloh0:
	adrp	x8, _BBP_R3_SMART_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BBP_R3_SMART_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _RF5325@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RF5325@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	mov	x2, x0
	add	x0, sp, #12
	mov	x1, x21
	bl	_rt2x00_set_field8
	ldr	w8, [x20]
	cmp	w8, #130
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #2
	bl	_rt2x00_set_field8
Lloh9:
	adrp	x8, _BBP_R4_RX_FRAME_END@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BBP_R4_RX_FRAME_END@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w2, ne
	add	x0, sp, #8
	b	LBB0_7
LBB0_3:
Lloh15:
	adrp	x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field8
Lloh18:
	adrp	x8, _BBP_R4_RX_FRAME_END@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BBP_R4_RX_FRAME_END@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field8
Lloh21:
	adrp	x8, _NL80211_BAND_5GHZ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NL80211_BAND_5GHZ@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x10, _BBP_R77_RX_ANTENNA@GOTPAGE
Lloh25:
	ldr	x10, [x10, _BBP_R77_RX_ANTENNA@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x10]
	cmp	w9, w8
	b.eq	LBB0_6
LBB0_4:
	add	x0, sp, #4
	mov	w2, #3
	b	LBB0_7
LBB0_5:
Lloh27:
	adrp	x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BBP_R4_RX_ANTENNA_CONTROL@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field8
Lloh30:
	adrp	x8, _BBP_R4_RX_FRAME_END@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BBP_R4_RX_FRAME_END@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field8
Lloh33:
	adrp	x8, _NL80211_BAND_5GHZ@GOTPAGE
Lloh34:
	ldr	x8, [x8, _NL80211_BAND_5GHZ@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x10, _BBP_R77_RX_ANTENNA@GOTPAGE
Lloh37:
	ldr	x10, [x10, _BBP_R77_RX_ANTENNA@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x10]
	cmp	w9, w8
	b.eq	LBB0_4
LBB0_6:
	add	x0, sp, #4
	mov	w2, #0
LBB0_7:
	bl	_rt2x00_set_field8
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	w1, #77
	bl	_rt61pci_bbp_write
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #3
	bl	_rt61pci_bbp_write
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #4
	bl	_rt61pci_bbp_write
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_BBP_R3_SMART_MODE,4,2          ; @BBP_R3_SMART_MODE
	.comm	_RF5325,4,2                     ; @RF5325
	.comm	_BBP_R4_RX_ANTENNA_CONTROL,4,2  ; @BBP_R4_RX_ANTENNA_CONTROL
	.comm	_BBP_R4_RX_FRAME_END,4,2        ; @BBP_R4_RX_FRAME_END
	.comm	_NL80211_BAND_5GHZ,4,2          ; @NL80211_BAND_5GHZ
	.comm	_BBP_R77_RX_ANTENNA,4,2         ; @BBP_R77_RX_ANTENNA
	.no_dead_strip	_rt61pci_config_antenna_5x
.subsections_via_symbols
