	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_xhci_reset_port
_pci_xhci_reset_port:                   ## @pci_xhci_reset_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_XHCI_MAX_DEVS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%esi, (%rax)
	setge	%dil
	callq	_assert
	movslq	%r15d, %rbx
	movq	%rbx, %rdi
	callq	_DPRINTF
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_XHCI_PORTREG_PTR
	movq	%rax, %r13
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_XHCI_DEVINST_PTR
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	_XHCI_PS_PLS_MASK@GOTPCREL(%rip), %rax
	movq	_XHCI_PS_PR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_XHCI_PS_PRC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, (%r13)
	movq	_XHCI_PS_PED@GOTPCREL(%rip), %rax
	movl	%r12d, %r14d
	movl	(%rax), %r12d
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	callq	_XHCI_PS_SPEED_SET
	orl	%r12d, %eax
	orl	(%r13), %eax
	movl	%eax, (%r13)
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.2:
	movq	(%rbx), %rcx
	cmpl	$3, (%rcx)
	jne	LBB0_4
## %bb.3:
	movq	_XHCI_PS_WRC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r13)
LBB0_4:
	movq	_XHCI_PS_PRC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	jne	LBB0_7
## %bb.5:
	orl	%eax, %ecx
	movl	%ecx, (%r13)
	movq	_XHCI_TRB_ERROR_SUCCESS@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_XHCI_TRB_EVENT_PORT_STS_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_pci_xhci_set_evtrb
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_pci_xhci_insert_event
	cmpl	(%r12), %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPRINTF
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XHCI_MAX_DEVS,4,2              ## @XHCI_MAX_DEVS
	.comm	_XHCI_PS_PLS_MASK,4,2           ## @XHCI_PS_PLS_MASK
	.comm	_XHCI_PS_PR,4,2                 ## @XHCI_PS_PR
	.comm	_XHCI_PS_PRC,4,2                ## @XHCI_PS_PRC
	.comm	_XHCI_PS_PED,4,2                ## @XHCI_PS_PED
	.comm	_XHCI_PS_WRC,4,2                ## @XHCI_PS_WRC
	.comm	_XHCI_TRB_ERROR_SUCCESS,4,2     ## @XHCI_TRB_ERROR_SUCCESS
	.comm	_XHCI_TRB_EVENT_PORT_STS_CHANGE,4,2 ## @XHCI_TRB_EVENT_PORT_STS_CHANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"xhci reset port insert event failed\r\n"

	.no_dead_strip	_pci_xhci_reset_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_xhci_reset_port
_pci_xhci_reset_port:                   ; @pci_xhci_reset_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _XHCI_MAX_DEVS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XHCI_MAX_DEVS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w0, ge
	bl	_assert
	sxtw	x0, w20
	bl	_DPRINTF
	mov	x0, x19
	mov	x1, x20
	bl	_XHCI_PORTREG_PTR
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_XHCI_DEVINST_PTR
	cbz	x0, LBB0_7
; %bb.1:
	mov	x23, x0
Lloh3:
	adrp	x8, _XHCI_PS_PLS_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XHCI_PS_PLS_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _XHCI_PS_PR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _XHCI_PS_PR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x24, _XHCI_PS_PRC@GOTPAGE
Lloh10:
	ldr	x24, [x24, _XHCI_PS_PRC@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w8, w9
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
Lloh11:
	adrp	x8, _XHCI_PS_PED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _XHCI_PS_PED@GOTPAGEOFF]
Lloh13:
	ldr	w25, [x8]
	ldr	x8, [x0]
	ldr	w0, [x8, #4]
	bl	_XHCI_PS_SPEED_SET
	orr	w8, w0, w25
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x21]
	cbz	w22, LBB0_4
; %bb.2:
	ldr	x9, [x23]
	ldr	w9, [x9]
	cmp	w9, #3
	b.ne	LBB0_4
; %bb.3:
Lloh14:
	adrp	x9, _XHCI_PS_WRC@GOTPAGE
Lloh15:
	ldr	x9, [x9, _XHCI_PS_WRC@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_4:
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.5:
	orr	w8, w9, w8
	str	w8, [x21]
Lloh17:
	adrp	x21, _XHCI_TRB_ERROR_SUCCESS@GOTPAGE
Lloh18:
	ldr	x21, [x21, _XHCI_TRB_ERROR_SUCCESS@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh19:
	adrp	x8, _XHCI_TRB_EVENT_PORT_STS_CHANGE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _XHCI_TRB_EVENT_PORT_STS_CHANGE@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	x1, x20
	bl	_pci_xhci_set_evtrb
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_pci_xhci_insert_event
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_7
; %bb.6:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINTF
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_XHCI_MAX_DEVS,4,2              ; @XHCI_MAX_DEVS
	.comm	_XHCI_PS_PLS_MASK,4,2           ; @XHCI_PS_PLS_MASK
	.comm	_XHCI_PS_PR,4,2                 ; @XHCI_PS_PR
	.comm	_XHCI_PS_PRC,4,2                ; @XHCI_PS_PRC
	.comm	_XHCI_PS_PED,4,2                ; @XHCI_PS_PED
	.comm	_XHCI_PS_WRC,4,2                ; @XHCI_PS_WRC
	.comm	_XHCI_TRB_ERROR_SUCCESS,4,2     ; @XHCI_TRB_ERROR_SUCCESS
	.comm	_XHCI_TRB_EVENT_PORT_STS_CHANGE,4,2 ; @XHCI_TRB_EVENT_PORT_STS_CHANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"xhci reset port insert event failed\r\n"

	.no_dead_strip	_pci_xhci_reset_port
.subsections_via_symbols
