	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_atten_apply
_ar9003_hw_atten_apply:                 ## @ar9003_hw_atten_apply
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_AR_PHY_EXT_ATTEN_CTL_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rbx, -80(%rbp)
	movq	_AR_PHY_EXT_ATTEN_CTL_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	_AR_PHY_EXT_ATTEN_CTL_2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	callq	_AR_SREV_9462
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpl	$2, (%r15)
	jne	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	movl	$1, %esi
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_ar9003_hw_atten_chain_get
	movq	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %ecx
	callq	_REG_RMW_FIELD
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	callq	_ar9003_hw_atten_chain_get_margin
	movq	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %ecx
	callq	_REG_RMW_FIELD
LBB0_3:
	xorl	%ebx, %ebx
	movq	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r13d, %ecx
	callq	_REG_RMW_FIELD
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	je	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r15), %r12d
	movl	%ebx, %edi
	callq	_BIT
	testl	%r12d, %eax
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_ar9003_hw_atten_chain_get
	movq	-80(%rbp,%rbx,8), %r12
	movq	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%eax, %ecx
	callq	_REG_RMW_FIELD
	movq	%r15, %rdi
	callq	_AR_SREV_9485
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_ar9003_hw_get_rx_gain_idx
	testq	%rax, %rax
	je	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_ar9003_hw_atten_chain_get_margin
	movl	%eax, %r13d
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, 8(%r15)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_AR_PHY_EXT_ATTEN_CTL_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	(%r14), %edx
	movq	%r15, %rdi
	movl	%r13d, %ecx
	callq	_REG_RMW_FIELD
	jmp	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$5, %r13d
	cmpq	$0, 16(%r15)
	jne	LBB0_9
	jmp	LBB0_8
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_EXT_ATTEN_CTL_0,8,3     ## @AR_PHY_EXT_ATTEN_CTL_0
	.comm	_AR_PHY_EXT_ATTEN_CTL_1,8,3     ## @AR_PHY_EXT_ATTEN_CTL_1
	.comm	_AR_PHY_EXT_ATTEN_CTL_2,8,3     ## @AR_PHY_EXT_ATTEN_CTL_2
	.comm	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB,4,2 ## @AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB
	.comm	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN,4,2 ## @AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN
	.no_dead_strip	_ar9003_hw_atten_apply
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_hw_atten_apply
_ar9003_hw_atten_apply:                 ; @ar9003_hw_atten_apply
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x24, _AR_PHY_EXT_ATTEN_CTL_0@GOTPAGE
Lloh4:
	ldr	x24, [x24, _AR_PHY_EXT_ATTEN_CTL_0@GOTPAGEOFF]
	ldr	x21, [x24]
Lloh5:
	adrp	x8, _AR_PHY_EXT_ATTEN_CTL_1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AR_PHY_EXT_ATTEN_CTL_1@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	stp	x21, x8, [sp]
Lloh8:
	adrp	x8, _AR_PHY_EXT_ATTEN_CTL_2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AR_PHY_EXT_ATTEN_CTL_2@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [sp, #16]
	bl	_AR_SREV_9462
Lloh11:
	adrp	x25, _AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB@GOTPAGE
Lloh12:
	ldr	x25, [x25, _AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB@GOTPAGEOFF]
Lloh13:
	adrp	x26, _AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN@GOTPAGE
Lloh14:
	ldr	x26, [x26, _AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #2
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x20
	mov	w1, #1
	mov	x2, x19
	bl	_ar9003_hw_atten_chain_get
	mov	x3, x0
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x21
	bl	_REG_RMW_FIELD
	mov	x0, x20
	mov	w1, #1
	mov	x2, x19
	bl	_ar9003_hw_atten_chain_get_margin
	mov	x3, x0
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x21
	bl	_REG_RMW_FIELD
LBB0_3:
	mov	x21, #0
	mov	x27, sp
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x23
	bl	_REG_RMW_FIELD
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	cmp	x21, #3
	b.eq	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x20, #4]
	mov	x0, x21
	bl	_BIT
	tst	w0, w22
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_ar9003_hw_atten_chain_get
	mov	x3, x0
	ldr	x22, [x27, x21, lsl #3]
	ldr	w2, [x25]
	mov	x0, x20
	mov	x1, x22
	bl	_REG_RMW_FIELD
	mov	x0, x20
	bl	_AR_SREV_9485
	cbz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_ar9003_hw_get_rx_gain_idx
	cbz	x0, LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_ar9003_hw_atten_chain_get_margin
	mov	x23, x0
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x1, [x24]
	ldr	w2, [x26]
	mov	x0, x20
	mov	x3, x23
	bl	_REG_RMW_FIELD
	b	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #5
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_10
	b	LBB0_4
LBB0_13:
	ldr	x8, [sp, #24]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_EXT_ATTEN_CTL_0,8,3     ; @AR_PHY_EXT_ATTEN_CTL_0
	.comm	_AR_PHY_EXT_ATTEN_CTL_1,8,3     ; @AR_PHY_EXT_ATTEN_CTL_1
	.comm	_AR_PHY_EXT_ATTEN_CTL_2,8,3     ; @AR_PHY_EXT_ATTEN_CTL_2
	.comm	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB,4,2 ; @AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB
	.comm	_AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN,4,2 ; @AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN
	.no_dead_strip	_ar9003_hw_atten_apply
.subsections_via_symbols
