	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtip_device_reset
_mtip_device_reset:                     ## @mtip_device_reset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_mtip_check_surprise_removal
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_mtip_hba_reset
	movq	%rax, %rbx
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	sarq	$63, %rbx
	andl	%ecx, %ebx
	movl	$1, %edi
	callq	_mdelay
	movl	8(%r14), %edi
	callq	_mtip_init_port
	movl	8(%r14), %edi
	callq	_mtip_start_port
	movq	_HOST_CTL@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_HOST_IRQ_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_writel
LBB0_2:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_HOST_CTL,8,3                   ## @HOST_CTL
	.comm	_HOST_IRQ_EN,4,2                ## @HOST_IRQ_EN
	.no_dead_strip	_mtip_device_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtip_device_reset
_mtip_device_reset:                     ; @mtip_device_reset
	.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	w0, [x0, #12]
	bl	_mtip_check_surprise_removal
	cbz	x0, LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_mtip_hba_reset
Lloh0:
	adrp	x8, _EFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	asr	x9, x0, #63
	neg	w8, w8
	and	w20, w9, w8
	mov	w0, #1
	bl	_mdelay
	ldr	w0, [x19, #8]
	bl	_mtip_init_port
	ldr	w0, [x19, #8]
	bl	_mtip_start_port
	ldr	x8, [x19]
Lloh3:
	adrp	x21, _HOST_CTL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _HOST_CTL@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
Lloh5:
	adrp	x8, _HOST_IRQ_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HOST_IRQ_EN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel
LBB0_3:
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_HOST_CTL,8,3                   ; @HOST_CTL
	.comm	_HOST_IRQ_EN,4,2                ; @HOST_IRQ_EN
	.no_dead_strip	_mtip_device_reset
.subsections_via_symbols
