	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_hw_on_hold               ## -- Begin function ath5k_hw_on_hold
	.p2align	4, 0x90
_ath5k_hw_on_hold:                      ## @ath5k_hw_on_hold
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	callq	_ath5k_get_bus_type
	movq	_ATH_AHB@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_13
## %bb.1:
	movq	_AR5K_PM_AWAKE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ath5k_hw_set_power_mode
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_ATH5K_ERR
	jmp	LBB0_13
LBB0_3:
	testq	%r15, %r15
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_pci_is_pcie
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_6
LBB0_5:
	movq	_AR5K_RESET_CTL_PCI@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_6:
	movq	(%r14), %rax
	movq	_AR5K_AR5210@GOTPCREL(%rip), %rdx
	movq	_AR5K_RESET_CTL_PCU@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	cmpq	(%rdx), %rax
	jne	LBB0_8
## %bb.7:
	movq	_AR5K_RESET_CTL_MAC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_AR5K_RESET_CTL_DMA@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_AR5K_RESET_CTL_PHY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_AR5K_RESET_CTL_PCI@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ath5k_hw_nic_reset
	movl	%eax, %ebx
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$2500, %esi                     ## imm = 0x9C4
	callq	_usleep_range
	testl	%ebx, %ebx
	je	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_ATH5K_ERR
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_8:
	movq	_AR5K_RESET_CTL_BASEBAND@GOTPCREL(%rip), %rax
	orl	%ecx, %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ath5k_hw_nic_reset
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_10
LBB0_11:
	movl	(%r12), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ath5k_hw_set_power_mode
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_ATH5K_ERR
	movl	%r15d, %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH_AHB,8,3                    ## @ATH_AHB
	.comm	_AR5K_PM_AWAKE,4,2              ## @AR5K_PM_AWAKE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to wakeup the MAC Chip\n"

	.comm	_AR5K_RESET_CTL_PCI,4,2         ## @AR5K_RESET_CTL_PCI
	.comm	_AR5K_AR5210,8,3                ## @AR5K_AR5210
	.comm	_AR5K_RESET_CTL_PCU,4,2         ## @AR5K_RESET_CTL_PCU
	.comm	_AR5K_RESET_CTL_MAC,4,2         ## @AR5K_RESET_CTL_MAC
	.comm	_AR5K_RESET_CTL_DMA,4,2         ## @AR5K_RESET_CTL_DMA
	.comm	_AR5K_RESET_CTL_PHY,4,2         ## @AR5K_RESET_CTL_PHY
	.comm	_AR5K_RESET_CTL_BASEBAND,4,2    ## @AR5K_RESET_CTL_BASEBAND
L_.str.1:                               ## @.str.1
	.asciz	"failed to put device on warm reset\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"failed to put device on hold\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath5k_hw_on_hold               ; -- Begin function ath5k_hw_on_hold
	.p2align	2
_ath5k_hw_on_hold:                      ; @ath5k_hw_on_hold
	.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
	ldr	x21, [x0, #8]
	bl	_ath5k_get_bus_type
Lloh0:
	adrp	x8, _ATH_AHB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH_AHB@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_12
LBB0_2:
Lloh3:
	adrp	x22, _AR5K_PM_AWAKE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _AR5K_PM_AWAKE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ath5k_hw_set_power_mode
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x19
	bl	_ATH5K_ERR
	b	LBB0_12
LBB0_5:
Lloh7:
	adrp	x20, _AR5K_RESET_CTL_PCI@GOTPAGE
Lloh8:
	ldr	x20, [x20, _AR5K_RESET_CTL_PCI@GOTPAGEOFF]
	cbz	x21, LBB0_8
; %bb.6:
	mov	x0, x21
	bl	_pci_is_pcie
	cbz	x0, LBB0_8
; %bb.7:
	mov	w8, #0
	b	LBB0_9
LBB0_8:
	ldr	w8, [x20]
LBB0_9:
Lloh9:
	adrp	x9, _AR5K_AR5210@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AR5K_AR5210@GOTPAGEOFF]
	ldr	x10, [x19]
Lloh11:
	ldr	x11, [x9]
Lloh12:
	adrp	x9, _AR5K_RESET_CTL_PCU@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AR5K_RESET_CTL_PCU@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	x10, x11
	b.ne	LBB0_13
; %bb.10:
Lloh15:
	adrp	x8, _AR5K_RESET_CTL_MAC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AR5K_RESET_CTL_MAC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _AR5K_RESET_CTL_DMA@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AR5K_RESET_CTL_DMA@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _AR5K_RESET_CTL_PHY@GOTPAGE
Lloh22:
	ldr	x9, [x9, _AR5K_RESET_CTL_PHY@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_ath5k_hw_nic_reset
	mov	x20, x0
	mov	w0, #2000
	mov	w1, #2500
	bl	_usleep_range
	cbz	w20, LBB0_14
LBB0_11:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ATH5K_ERR
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	mov	x0, 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
	ret
LBB0_13:
Lloh29:
	adrp	x10, _AR5K_RESET_CTL_BASEBAND@GOTPAGE
Lloh30:
	ldr	x10, [x10, _AR5K_RESET_CTL_BASEBAND@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w1, w8, w10
	mov	x0, x19
	bl	_ath5k_hw_nic_reset
	mov	x20, x0
	cbnz	w20, LBB0_11
LBB0_14:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ath5k_hw_set_power_mode
	mov	x20, x0
	cbz	w0, LBB0_12
; %bb.15:
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH_AHB,8,3                    ; @ATH_AHB
	.comm	_AR5K_PM_AWAKE,4,2              ; @AR5K_PM_AWAKE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to wakeup the MAC Chip\n"

	.comm	_AR5K_RESET_CTL_PCI,4,2         ; @AR5K_RESET_CTL_PCI
	.comm	_AR5K_AR5210,8,3                ; @AR5K_AR5210
	.comm	_AR5K_RESET_CTL_PCU,4,2         ; @AR5K_RESET_CTL_PCU
	.comm	_AR5K_RESET_CTL_MAC,4,2         ; @AR5K_RESET_CTL_MAC
	.comm	_AR5K_RESET_CTL_DMA,4,2         ; @AR5K_RESET_CTL_DMA
	.comm	_AR5K_RESET_CTL_PHY,4,2         ; @AR5K_RESET_CTL_PHY
	.comm	_AR5K_RESET_CTL_BASEBAND,4,2    ; @AR5K_RESET_CTL_BASEBAND
l_.str.1:                               ; @.str.1
	.asciz	"failed to put device on warm reset\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"failed to put device on hold\n"

.subsections_via_symbols
