	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_hw_set_power_awake
_ath9k_hw_set_power_awake:              ## @ath9k_hw_set_power_awake
	.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
	movq	%rdi, %rbx
	callq	_AR_SREV_9300_20_OR_LATER
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_AR_WA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%rbx, %rdi
	callq	_REG_WRITE
	movl	$10, %edi
	callq	_udelay
LBB0_2:
	movq	_AR_RTC_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_REG_READ
	movq	_AR_RTC_STATUS_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_AR_RTC_STATUS_SHUTDOWN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.3:
	movq	_ATH9K_RESET_POWER_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ath9k_hw_set_reset_reg
	testl	%eax, %eax
	je	LBB0_20
## %bb.4:
	movq	%rbx, %rdi
	callq	_AR_SREV_9300_20_OR_LATER
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ath9k_hw_init_pll
LBB0_6:
	movq	%rbx, %rdi
	callq	_AR_SREV_9100
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_AR_RTC_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_RTC_RESET_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_SET_BIT
LBB0_8:
	movq	_AR_RTC_FORCE_WAKE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_AR_RTC_FORCE_WAKE_EN@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_REG_SET_BIT
	movq	%rbx, %rdi
	callq	_AR_SREV_9100
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	$10, %edi
	callq	_mdelay
	jmp	LBB0_11
LBB0_10:
	movl	$50, %edi
	callq	_udelay
LBB0_11:
	movq	_POWER_UP_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$50, %eax
	jl	LBB0_15
## %bb.12:
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	sarq	$36, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %r14d
	incl	%r14d
	movq	_AR_RTC_STATUS_ON@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	_AR_RTC_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_REG_READ
	movq	_AR_RTC_STATUS_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	(%r15), %eax
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$50, %edi
	callq	_udelay
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_REG_SET_BIT
	decl	%r14d
	cmpl	$1, %r14d
	jg	LBB0_13
	jmp	LBB0_16
LBB0_15:
	addl	$49, %eax
	cmpl	$98, %eax
	ja	LBB0_17
LBB0_16:
	movq	%rbx, %rdi
	callq	_ath9k_hw_common
	movq	_POWER_UP_TIME@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$1717986919, %rcx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$35, %rdx
	addl	%ecx, %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ath_err
LBB0_20:
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_17:
	movq	%rbx, %rdi
	callq	_ath9k_hw_mci_is_enabled
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_ar9003_mci_set_power_awake
LBB0_19:
	movq	_AR_STA_ID1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_STA_ID1_PWR_SAV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_CLR_BIT
	movl	$1, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_WA,4,2                      ## @AR_WA
	.comm	_AR_RTC_STATUS,4,2              ## @AR_RTC_STATUS
	.comm	_AR_RTC_STATUS_M,4,2            ## @AR_RTC_STATUS_M
	.comm	_AR_RTC_STATUS_SHUTDOWN,4,2     ## @AR_RTC_STATUS_SHUTDOWN
	.comm	_ATH9K_RESET_POWER_ON,4,2       ## @ATH9K_RESET_POWER_ON
	.comm	_AR_RTC_RESET,4,2               ## @AR_RTC_RESET
	.comm	_AR_RTC_RESET_EN,4,2            ## @AR_RTC_RESET_EN
	.comm	_AR_RTC_FORCE_WAKE,4,2          ## @AR_RTC_FORCE_WAKE
	.comm	_AR_RTC_FORCE_WAKE_EN,4,2       ## @AR_RTC_FORCE_WAKE_EN
	.comm	_POWER_UP_TIME,4,2              ## @POWER_UP_TIME
	.comm	_AR_RTC_STATUS_ON,4,2           ## @AR_RTC_STATUS_ON
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to wakeup in %uus\n"

	.comm	_AR_STA_ID1,4,2                 ## @AR_STA_ID1
	.comm	_AR_STA_ID1_PWR_SAV,4,2         ## @AR_STA_ID1_PWR_SAV
	.no_dead_strip	_ath9k_hw_set_power_awake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath9k_hw_set_power_awake
_ath9k_hw_set_power_awake:              ; @ath9k_hw_set_power_awake
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_AR_SREV_9300_20_OR_LATER
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AR_WA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR_WA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_REG_WRITE
	mov	w0, #10
	bl	_udelay
LBB0_2:
Lloh3:
	adrp	x20, _AR_RTC_STATUS@GOTPAGE
Lloh4:
	ldr	x20, [x20, _AR_RTC_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_REG_READ
Lloh5:
	adrp	x21, _AR_RTC_STATUS_M@GOTPAGE
Lloh6:
	ldr	x21, [x21, _AR_RTC_STATUS_M@GOTPAGEOFF]
	ldr	w8, [x21]
	and	w8, w8, w0
Lloh7:
	adrp	x9, _AR_RTC_STATUS_SHUTDOWN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _AR_RTC_STATUS_SHUTDOWN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
Lloh10:
	adrp	x8, _ATH9K_RESET_POWER_ON@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ATH9K_RESET_POWER_ON@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ath9k_hw_set_reset_reg
	cbz	w0, LBB0_20
; %bb.4:
	mov	x0, x19
	bl	_AR_SREV_9300_20_OR_LATER
	cbnz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, #0
	bl	_ath9k_hw_init_pll
LBB0_6:
	mov	x0, x19
	bl	_AR_SREV_9100
	cbz	x0, LBB0_8
; %bb.7:
Lloh13:
	adrp	x8, _AR_RTC_RESET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AR_RTC_RESET@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _AR_RTC_RESET_EN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AR_RTC_RESET_EN@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_SET_BIT
LBB0_8:
Lloh19:
	adrp	x22, _AR_RTC_FORCE_WAKE@GOTPAGE
Lloh20:
	ldr	x22, [x22, _AR_RTC_FORCE_WAKE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh21:
	adrp	x23, _AR_RTC_FORCE_WAKE_EN@GOTPAGE
Lloh22:
	ldr	x23, [x23, _AR_RTC_FORCE_WAKE_EN@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_REG_SET_BIT
	mov	x0, x19
	bl	_AR_SREV_9100
	cbz	x0, LBB0_10
; %bb.9:
	mov	w0, #10
	bl	_mdelay
	b	LBB0_11
LBB0_10:
	mov	w0, #50
	bl	_udelay
LBB0_11:
Lloh23:
	adrp	x24, _POWER_UP_TIME@GOTPAGE
Lloh24:
	ldr	x24, [x24, _POWER_UP_TIME@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #50
	b.lt	LBB0_15
; %bb.12:
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #36
	add	w8, w8, w9
	add	w25, w8, #1
Lloh25:
	adrp	x26, _AR_RTC_STATUS_ON@GOTPAGE
Lloh26:
	ldr	x26, [x26, _AR_RTC_STATUS_ON@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_REG_READ
	ldr	w8, [x21]
	and	w8, w8, w0
	ldr	w9, [x26]
	cmp	w8, w9
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w0, #50
	bl	_udelay
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_REG_SET_BIT
	sub	w25, w25, #1
	cmp	w25, #1
	b.gt	LBB0_13
	b	LBB0_16
LBB0_15:
	add	w8, w8, #49
	cmp	w8, #98
	b.hi	LBB0_17
LBB0_16:
	mov	x0, x19
	bl	_ath9k_hw_common
	ldrsw	x8, [x24]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w2, w8, w9
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ath_err
	mov	w0, #0
	b	LBB0_20
LBB0_17:
	mov	x0, x19
	bl	_ath9k_hw_mci_is_enabled
	cbz	x0, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_ar9003_mci_set_power_awake
LBB0_19:
Lloh29:
	adrp	x8, _AR_STA_ID1@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AR_STA_ID1@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _AR_STA_ID1_PWR_SAV@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AR_STA_ID1_PWR_SAV@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_CLR_BIT
	mov	w0, #1
LBB0_20:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_WA,4,2                      ; @AR_WA
	.comm	_AR_RTC_STATUS,4,2              ; @AR_RTC_STATUS
	.comm	_AR_RTC_STATUS_M,4,2            ; @AR_RTC_STATUS_M
	.comm	_AR_RTC_STATUS_SHUTDOWN,4,2     ; @AR_RTC_STATUS_SHUTDOWN
	.comm	_ATH9K_RESET_POWER_ON,4,2       ; @ATH9K_RESET_POWER_ON
	.comm	_AR_RTC_RESET,4,2               ; @AR_RTC_RESET
	.comm	_AR_RTC_RESET_EN,4,2            ; @AR_RTC_RESET_EN
	.comm	_AR_RTC_FORCE_WAKE,4,2          ; @AR_RTC_FORCE_WAKE
	.comm	_AR_RTC_FORCE_WAKE_EN,4,2       ; @AR_RTC_FORCE_WAKE_EN
	.comm	_POWER_UP_TIME,4,2              ; @POWER_UP_TIME
	.comm	_AR_RTC_STATUS_ON,4,2           ; @AR_RTC_STATUS_ON
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to wakeup in %uus\n"

	.comm	_AR_STA_ID1,4,2                 ; @AR_STA_ID1
	.comm	_AR_STA_ID1_PWR_SAV,4,2         ; @AR_STA_ID1_PWR_SAV
	.no_dead_strip	_ath9k_hw_set_power_awake
.subsections_via_symbols
