	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function carl9170_init_phy
_carl9170_init_phy:                     ## @carl9170_init_phy
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	cmpl	%esi, %r13d
	sete	-41(%rbp)                       ## 1-byte Folded Spill
	movq	8(%rdi), %rdi
	callq	_conf_is_ht40
	movl	%eax, %ebx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_carl9170_regwrite_begin
	movq	_ar5416_phy_init@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_10
## %bb.1:
	movl	$4, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%rcx,4), %rcx
	addq	$12, %rcx
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rcx), %esi
	movl	-4(%rax,%r14), %edi
	callq	_carl9170_regwrite
	incq	%r12
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$20, %r14
	cmpq	%rax, %r12
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%r12,4), %rcx
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%rcx,4), %rcx
	addq	$16, %rcx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%r12,4), %rcx
	leaq	(%rax,%rcx,4), %rcx
	addq	$8, %rcx
	jmp	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%r14), %rcx
	jmp	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	callq	_carl9170_regwrite_finish
	xorl	%eax, %eax
	callq	_carl9170_regwrite_result
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	xorl	%esi, %esi
	movb	-41(%rbp), %al                  ## 1-byte Reload
	movb	%al, %sil
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_carl9170_init_phy_from_eeprom
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_carl9170_init_power_cal
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, (%rcx)
	je	LBB0_15
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%edx, %edx
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	sete	%dl
	movq	_AR9170_PWR_REG_PLL_ADDAC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$5, %edx
	orl	$20803, %edx                    ## imm = 0x5143
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_carl9170_write_reg             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_2GHZ,4,2          ## @NL80211_BAND_2GHZ
	.comm	_ar5416_phy_init,8,3            ## @ar5416_phy_init
	.comm	_AR9170_PWR_REG_PLL_ADDAC,4,2   ## @AR9170_PWR_REG_PLL_ADDAC
	.no_dead_strip	_carl9170_init_phy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function carl9170_init_phy
_carl9170_init_phy:                     ; @carl9170_init_phy
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _NL80211_BAND_2GHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	cmp	w23, w1
	cset	w21, eq
	ldr	x0, [x0, #8]
	bl	_conf_is_ht40
	mov	x22, x0
	mov	x0, x19
	bl	_carl9170_regwrite_begin
Lloh3:
	adrp	x24, _ar5416_phy_init@GOTPAGE
Lloh4:
	ldr	x24, [x24, _ar5416_phy_init@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x25, #0
	mov	x26, #0
	mov	w27, #20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	cmp	w23, w20
	add	x9, x8, x25
	add	x9, x9, #4
	madd	x10, x26, x27, x8
	add	x10, x10, #8
	csel	x9, x9, x10, ne
	cmp	w23, w20
	madd	x10, x26, x27, x8
	add	x10, x10, #12
	madd	x11, x26, x27, x8
	add	x11, x11, #16
	csel	x10, x10, x11, ne
	cmp	w22, #0
	csel	x9, x9, x10, eq
	ldr	w1, [x9]
	ldr	w0, [x8, x25]
	bl	_carl9170_regwrite
	add	x26, x26, #1
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	add	x25, x25, #20
	cmp	x26, w0, sxtw
	b.lt	LBB0_2
LBB0_3:
	bl	_carl9170_regwrite_finish
	bl	_carl9170_regwrite_result
	cbnz	w0, LBB0_8
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_carl9170_init_phy_from_eeprom
	cbnz	w0, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_carl9170_init_power_cal
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh5:
	adrp	x8, _AR9170_PWR_REG_PLL_ADDAC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AR9170_PWR_REG_PLL_ADDAC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w8, #20803
	mov	w9, #20835
	cmp	w23, w20
	csel	w2, w9, w8, eq
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_carl9170_write_reg
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_2GHZ,4,2          ; @NL80211_BAND_2GHZ
	.comm	_ar5416_phy_init,8,3            ; @ar5416_phy_init
	.comm	_AR9170_PWR_REG_PLL_ADDAC,4,2   ; @AR9170_PWR_REG_PLL_ADDAC
	.no_dead_strip	_carl9170_init_phy
.subsections_via_symbols
