	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar5008_hw_init_chain_masks
_ar5008_hw_init_chain_masks:            ## @ar5008_hw_init_chain_masks
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %r15d
	movl	4(%rdi), %r14d
	leal	-1(%r15), %eax
	cmpl	$6, %eax
	ja	LBB0_6
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movq	_AR_PHY_ANALOG_SWAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_SWAP_ALT_CHAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_SET_BIT
LBB0_3:
	movl	8(%rbx), %eax
	movq	_AR_SREV_REVISION_5416_10@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	movq	_AR_PHY_RX_CHAINMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$7, %edx
	callq	_REG_WRITE
	movq	_AR_PHY_CAL_CHAINMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$7, %edx
	callq	_REG_WRITE
	jmp	LBB0_7
LBB0_5:
	movq	%rbx, %rdi
	callq	_ENABLE_REGWRITE_BUFFER
	movq	_AR_PHY_RX_CHAINMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_REG_WRITE
	movq	_AR_PHY_CAL_CHAINMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_REG_WRITE
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_ENABLE_REGWRITE_BUFFER
LBB0_7:
	movq	_AR_SELFGEN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_REGWRITE_BUFFER_FLUSH
	cmpl	$5, %r14d
	jne	LBB0_9
## %bb.8:
	movq	_AR_PHY_ANALOG_SWAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_SWAP_ALT_CHAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_SET_BIT
LBB0_9:
	movq	%rbx, %rdi
	callq	_AR_SREV_9100
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_AR_PHY_ANALOG_SWAP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_REG_READ
	orl	$1, %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_WRITE                      ## TAILCALL
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_3
	.long	L0_0_set_6
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_AR_PHY_ANALOG_SWAP,4,2         ## @AR_PHY_ANALOG_SWAP
	.comm	_AR_PHY_SWAP_ALT_CHAIN,4,2      ## @AR_PHY_SWAP_ALT_CHAIN
	.comm	_AR_SREV_REVISION_5416_10,4,2   ## @AR_SREV_REVISION_5416_10
	.comm	_AR_PHY_RX_CHAINMASK,4,2        ## @AR_PHY_RX_CHAINMASK
	.comm	_AR_PHY_CAL_CHAINMASK,4,2       ## @AR_PHY_CAL_CHAINMASK
	.comm	_AR_SELFGEN_MASK,4,2            ## @AR_SELFGEN_MASK
	.no_dead_strip	_ar5008_hw_init_chain_masks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar5008_hw_init_chain_masks
_ar5008_hw_init_chain_masks:            ; @ar5008_hw_init_chain_masks
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldp	w21, w20, [x0]
	sub	w8, w21, #1
	cmp	w8, #6
	b.hi	LBB0_6
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh2:
	adrp	x8, _AR_PHY_ANALOG_SWAP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AR_PHY_ANALOG_SWAP@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _AR_PHY_SWAP_ALT_CHAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AR_PHY_SWAP_ALT_CHAIN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_SET_BIT
LBB0_3:
	ldr	w8, [x19, #8]
Lloh8:
	adrp	x9, _AR_SREV_REVISION_5416_10@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AR_SREV_REVISION_5416_10@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _AR_PHY_RX_CHAINMASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AR_PHY_RX_CHAINMASK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #7
	bl	_REG_WRITE
Lloh14:
	adrp	x8, _AR_PHY_CAL_CHAINMASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AR_PHY_CAL_CHAINMASK@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #7
	bl	_REG_WRITE
	b	LBB0_7
LBB0_5:
	mov	x0, x19
	bl	_ENABLE_REGWRITE_BUFFER
Lloh17:
	adrp	x8, _AR_PHY_RX_CHAINMASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AR_PHY_RX_CHAINMASK@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_REG_WRITE
Lloh20:
	adrp	x8, _AR_PHY_CAL_CHAINMASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AR_PHY_CAL_CHAINMASK@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_REG_WRITE
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_ENABLE_REGWRITE_BUFFER
LBB0_7:
Lloh23:
	adrp	x8, _AR_SELFGEN_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AR_SELFGEN_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_REG_WRITE
	mov	x0, x19
	bl	_REGWRITE_BUFFER_FLUSH
	cmp	w20, #5
	b.ne	LBB0_9
; %bb.8:
Lloh26:
	adrp	x8, _AR_PHY_ANALOG_SWAP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AR_PHY_ANALOG_SWAP@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _AR_PHY_SWAP_ALT_CHAIN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AR_PHY_SWAP_ALT_CHAIN@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_SET_BIT
LBB0_9:
	mov	x0, x19
	bl	_AR_SREV_9100
	cbz	x0, LBB0_11
; %bb.10:
Lloh32:
	adrp	x8, _AR_PHY_ANALOG_SWAP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AR_PHY_ANALOG_SWAP@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_REG_READ
	orr	w2, w0, #0x1
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_REG_WRITE
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
                                        ; -- End function
	.comm	_AR_PHY_ANALOG_SWAP,4,2         ; @AR_PHY_ANALOG_SWAP
	.comm	_AR_PHY_SWAP_ALT_CHAIN,4,2      ; @AR_PHY_SWAP_ALT_CHAIN
	.comm	_AR_SREV_REVISION_5416_10,4,2   ; @AR_SREV_REVISION_5416_10
	.comm	_AR_PHY_RX_CHAINMASK,4,2        ; @AR_PHY_RX_CHAINMASK
	.comm	_AR_PHY_CAL_CHAINMASK,4,2       ; @AR_PHY_CAL_CHAINMASK
	.comm	_AR_SELFGEN_MASK,4,2            ; @AR_SELFGEN_MASK
	.no_dead_strip	_ar5008_hw_init_chain_masks
.subsections_via_symbols
