	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtip_restart_port
_mtip_restart_port:                     ## @mtip_restart_port
	.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, %r14
	xorl	%esi, %esi
	callq	_mtip_enable_engine
	movq	_jiffies@GOTPCREL(%rip), %r15
	movq	(%r15), %r12
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r12, %rbx
	movq	_PORT_CMD@GOTPCREL(%rip), %r12
	movq	_PORT_CMD_LIST_ON@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	testl	%eax, (%r13)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_1
LBB0_3:
	movq	_MTIP_DDF_REMOVE_PENDING_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	addq	$8, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_18
## %bb.4:
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	testl	%eax, (%r13)
	je	LBB0_8
## %bb.5:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	(%r14), %rdi
	callq	_mtip_hba_reset
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_7:
	movl	$30, %edi
	callq	_mdelay
LBB0_8:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
	movq	_PORT_SCR_CTL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	orl	$1, %eax
	movq	(%r13), %rsi
	addq	8(%r14), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movq	(%r15), %r12
	movl	$1, %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r12, %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_9
## %bb.10:
	movq	_MTIP_DDF_REMOVE_PENDING_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	addq	$8, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_18
## %bb.11:
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	andl	$-2, %eax
	movq	(%r13), %rsi
	addq	8(%r14), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	movq	(%r15), %r12
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r12, %rbx
	movq	_PORT_SCR_STAT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	testb	$1, %al
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_12
LBB0_14:
	movq	_MTIP_DDF_REMOVE_PENDING_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rsi
	addq	$8, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_15
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readl
	testb	$1, %al
	jne	LBB0_17
## %bb.16:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_warn
LBB0_17:
	movq	%r14, %rdi
	callq	_mtip_init_port
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtip_start_port                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_PORT_CMD,8,3                   ## @PORT_CMD
	.comm	_PORT_CMD_LIST_ON,4,2           ## @PORT_CMD_LIST_ON
	.comm	_MTIP_DDF_REMOVE_PENDING_BIT,4,2 ## @MTIP_DDF_REMOVE_PENDING_BIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PxCMD.CR not clear, escalating reset\n"

L_.str.1:                               ## @.str.1
	.asciz	"HBA reset escalation failed.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Issuing COM reset\n"

	.comm	_PORT_SCR_CTL,8,3               ## @PORT_SCR_CTL
	.comm	_PORT_SCR_STAT,8,3              ## @PORT_SCR_STAT
L_.str.3:                               ## @.str.3
	.asciz	"COM reset failed\n"

	.no_dead_strip	_mtip_restart_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtip_restart_port
_mtip_restart_port:                     ; @mtip_restart_port
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	mov	w1, #0
	bl	_mtip_enable_engine
Lloh0:
	adrp	x21, _jiffies@GOTPAGE
Lloh1:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	x20, [x21]
	mov	w0, #500
	bl	_msecs_to_jiffies
	add	x20, x0, x20
Lloh2:
	adrp	x24, _PORT_CMD@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PORT_CMD@GOTPAGEOFF]
Lloh4:
	adrp	x23, _PORT_CMD_LIST_ON@GOTPAGE
Lloh5:
	ldr	x23, [x23, _PORT_CMD_LIST_ON@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x21]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_1
LBB0_3:
Lloh6:
	adrp	x22, _MTIP_DDF_REMOVE_PENDING_BIT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MTIP_DDF_REMOVE_PENDING_BIT@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	x8, [x19]
	add	x1, x8, #8
	bl	_test_bit
	cbnz	x0, LBB0_15
; %bb.4:
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.5:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	ldr	x0, [x19]
	bl	_mtip_hba_reset
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_7:
	mov	w0, #30
	bl	_mdelay
LBB0_8:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #8]
Lloh14:
	adrp	x23, _PORT_SCR_CTL@GOTPAGE
Lloh15:
	ldr	x23, [x23, _PORT_SCR_CTL@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	orr	w0, w0, #0x1
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	ldr	x20, [x21]
	mov	w0, #1
	bl	_msecs_to_jiffies
	add	x20, x0, x20
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_9
; %bb.10:
	ldr	w0, [x22]
	ldr	x8, [x19]
	add	x1, x8, #8
	bl	_test_bit
	cbnz	x0, LBB0_15
; %bb.11:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	and	w0, w0, #0xfffffffe
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	ldr	x20, [x21]
	mov	w0, #500
	bl	_msecs_to_jiffies
	add	x20, x0, x20
Lloh16:
	adrp	x23, _PORT_SCR_STAT@GOTPAGE
Lloh17:
	ldr	x23, [x23, _PORT_SCR_STAT@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	tbnz	w0, #0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x0, [x21]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_12
LBB0_14:
	ldr	w0, [x22]
	ldr	x8, [x19]
	add	x1, x8, #8
	bl	_test_bit
	cbz	x0, LBB0_16
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	tbnz	w0, #0, LBB0_18
; %bb.17:
	ldr	x8, [x19]
	ldr	x0, [x8]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
LBB0_18:
	mov	x0, x19
	bl	_mtip_init_port
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mtip_start_port
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_PORT_CMD,8,3                   ; @PORT_CMD
	.comm	_PORT_CMD_LIST_ON,4,2           ; @PORT_CMD_LIST_ON
	.comm	_MTIP_DDF_REMOVE_PENDING_BIT,4,2 ; @MTIP_DDF_REMOVE_PENDING_BIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PxCMD.CR not clear, escalating reset\n"

l_.str.1:                               ; @.str.1
	.asciz	"HBA reset escalation failed.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Issuing COM reset\n"

	.comm	_PORT_SCR_CTL,8,3               ; @PORT_SCR_CTL
	.comm	_PORT_SCR_STAT,8,3              ; @PORT_SCR_STAT
l_.str.3:                               ; @.str.3
	.asciz	"COM reset failed\n"

	.no_dead_strip	_mtip_restart_port
.subsections_via_symbols
