	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl2_reset_hw
_atl2_reset_hw:                         ## @atl2_reset_hw
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_PCI_REG_COMMAND@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-36(%rbp), %rdx
	callq	_atl2_read_pci_cfg
	movl	-36(%rbp), %eax
	movq	_CMD_IO_SPACE@GOTPCREL(%rip), %rdx
	movq	_CMD_MEMORY_SPACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_CMD_BUS_MASTER@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%eax, %edx
	notl	%edx
	testl	%edx, %ecx
	je	LBB0_2
## %bb.1:
	orl	%eax, %ecx
	movl	%ecx, -36(%rbp)
	movl	(%rbx), %esi
	leaq	-36(%rbp), %rdx
	movq	%r12, %rdi
	callq	_atl2_write_pci_cfg
LBB0_2:
	movq	_REG_MASTER_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MASTER_CTRL_SOFT_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ATL2_WRITE_REG
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_wmb
	movl	$1, %edi
	callq	_msleep
	movq	_REG_IDLE_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.7:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movl	$1, %edi
	callq	_msleep
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ATL2_READ_REG
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rax, %rbx
	movl	$1, %edi
	callq	_msleep
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	%rbx, %r14
LBB0_13:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_REG_COMMAND,4,2            ## @PCI_REG_COMMAND
	.comm	_CMD_IO_SPACE,4,2               ## @CMD_IO_SPACE
	.comm	_CMD_MEMORY_SPACE,4,2           ## @CMD_MEMORY_SPACE
	.comm	_CMD_BUS_MASTER,4,2             ## @CMD_BUS_MASTER
	.comm	_REG_MASTER_CTRL,4,2            ## @REG_MASTER_CTRL
	.comm	_MASTER_CTRL_SOFT_RST,4,2       ## @MASTER_CTRL_SOFT_RST
	.comm	_REG_IDLE_STATUS,4,2            ## @REG_IDLE_STATUS
	.no_dead_strip	_atl2_reset_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atl2_reset_hw
_atl2_reset_hw:                         ; @atl2_reset_hw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _PCI_REG_COMMAND@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PCI_REG_COMMAND@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_atl2_read_pci_cfg
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _CMD_IO_SPACE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CMD_IO_SPACE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _CMD_MEMORY_SPACE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CMD_MEMORY_SPACE@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh8:
	adrp	x10, _CMD_BUS_MASTER@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CMD_BUS_MASTER@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bics	wzr, w9, w8
	b.eq	LBB0_2
; %bb.1:
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_atl2_write_pci_cfg
LBB0_2:
Lloh11:
	adrp	x8, _REG_MASTER_CTRL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_MASTER_CTRL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _MASTER_CTRL_SOFT_RST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MASTER_CTRL_SOFT_RST@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ATL2_WRITE_REG
	bl	_wmb
	mov	w0, #1
	bl	_msleep
Lloh17:
	adrp	x20, _REG_IDLE_STATUS@GOTPAGE
Lloh18:
	ldr	x20, [x20, _REG_IDLE_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.3:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.4:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.5:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.6:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.7:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.8:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.9:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.10:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	cbz	x0, LBB0_13
; %bb.11:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ATL2_READ_REG
	mov	x19, x0
	cbz	x0, LBB0_14
; %bb.12:
	mov	w0, #1
	bl	_msleep
	bl	_cpu_relax
	b	LBB0_14
LBB0_13:
	mov	x19, #0
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_REG_COMMAND,4,2            ; @PCI_REG_COMMAND
	.comm	_CMD_IO_SPACE,4,2               ; @CMD_IO_SPACE
	.comm	_CMD_MEMORY_SPACE,4,2           ; @CMD_MEMORY_SPACE
	.comm	_CMD_BUS_MASTER,4,2             ; @CMD_BUS_MASTER
	.comm	_REG_MASTER_CTRL,4,2            ; @REG_MASTER_CTRL
	.comm	_MASTER_CTRL_SOFT_RST,4,2       ; @MASTER_CTRL_SOFT_RST
	.comm	_REG_IDLE_STATUS,4,2            ; @REG_IDLE_STATUS
	.no_dead_strip	_atl2_reset_hw
.subsections_via_symbols
