	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_xhci_cmd_set_tr
_pci_xhci_cmd_set_tr:                   ## @pci_xhci_cmd_set_tr
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rdi, %r12
	movq	_XHCI_TRB_ERROR_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	callq	_XHCI_SLOTDEV_PTR
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movl	8(%r13), %edi
	callq	_XHCI_TRB_3_SLOT_GET
	movl	8(%r13), %edi
	callq	_XHCI_TRB_3_EP_GET
	movl	8(%r13), %edi
	andl	$1, %edi
	callq	_DPRINTF
	movl	8(%r13), %edi
	callq	_XHCI_TRB_3_EP_GET
	movl	%eax, %ebx
	leal	-32(%rbx), %eax
	cmpl	$-32, %eax
	ja	LBB0_2
## %bb.1:
	movslq	%ebx, %rdi
	callq	_DPRINTF
	movq	_XHCI_TRB_ERROR_TRB@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	8(%r15), %r14
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	movq	(%r14), %r14
	movl	%ebx, %r12d
	leaq	(%r14,%r12,8), %rbx
	movq	(%r15), %r15
	movl	(%r14,%r12,8), %edi
	callq	_XHCI_EPCTX_0_EPSTATE_GET
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_3
## %bb.4:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %edi
	callq	_XHCI_TRB_2_STREAM_GET
	movl	%eax, %r15d
	movl	(%rbx), %edi
	callq	_XHCI_EPCTX_0_MAXP_STREAMS_GET
	testq	%rax, %rax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.5:
	movq	$0, -72(%rbp)
	leaq	-72(%rbp), %rcx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r15d, %r14d
	movl	%r15d, %edx
	callq	_pci_xhci_find_stream
	movl	%eax, %ebx
	cmpq	$0, -72(%rbp)
	je	LBB0_10
## %bb.6:
	shlq	$5, %r12
	xorl	%edi, %edi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpq	$0, 24(%r15,%r12)
	setne	%dil
	callq	_assert
	movl	(%r13), %edi
	movq	24(%r15,%r12), %rax
	movslq	%r14d, %r14
	movl	%edi, (%rax,%r14,4)
	movl	%edi, %eax
	andl	$-16, %eax
	movq	16(%r15,%r12), %rcx
	movl	%eax, (%rcx,%r14,8)
	callq	_XHCI_EPCTX_2_DCS_GET
	movq	16(%r15,%r12), %rcx
	movl	%eax, 4(%rcx,%r14,8)
	jmp	LBB0_10
LBB0_3:
	movl	(%rbx), %edi
	callq	_XHCI_EPCTX_0_EPSTATE_GET
	movslq	%eax, %rdi
	callq	_DPRINTF
	movq	_XHCI_TRB_ERROR_CONTEXT_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_7:
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.8:
	movslq	%r15d, %rdi
	callq	_DPRINTF
LBB0_9:
	movl	(%r13), %eax
	movl	%eax, %esi
	andl	$-16, %esi
	movl	%esi, 4(%r14,%r12,8)
	shlq	$5, %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%esi, (%rbx,%r12)
	andl	$1, %eax
	movl	%eax, 4(%rbx,%r12)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_XHCI_GADDR
	movl	%eax, 8(%rbx,%r12)
	leaq	L_.str.4(%rip), %rdi
	callq	_DPRINTF
	movl	8(%rbx,%r12), %edi
	callq	_pci_xhci_dump_trb
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_10:
	movl	$-136, %eax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	andl	(%rcx), %eax
	orl	$128, %eax
	movl	%eax, (%rcx)
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XHCI_TRB_ERROR_SUCCESS,4,2     ## @XHCI_TRB_ERROR_SUCCESS
	.comm	_XHCI_TRB_ERROR_TRB,4,2         ## @XHCI_TRB_ERROR_TRB
	.comm	_XHCI_TRB_ERROR_CONTEXT_STATE,4,2 ## @XHCI_TRB_ERROR_CONTEXT_STATE
	.section	__TEXT,__cstring,cstring_literals
L_.str.4:                               ## @.str.4
	.asciz	"pci_xhci set_tr first TRB:\r\n"

	.no_dead_strip	_pci_xhci_cmd_set_tr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function pci_xhci_cmd_set_tr
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_pci_xhci_cmd_set_tr:                   ; @pci_xhci_cmd_set_tr
	.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	x20, x2
	mov	x22, x0
Lloh0:
	adrp	x8, _XHCI_TRB_ERROR_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XHCI_TRB_ERROR_SUCCESS@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	bl	_XHCI_SLOTDEV_PTR
	mov	x23, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	ldr	w0, [x20, #8]
	bl	_XHCI_TRB_3_SLOT_GET
	ldr	w0, [x20, #8]
	bl	_XHCI_TRB_3_EP_GET
	ldr	w8, [x20, #8]
	and	x0, x8, #0x1
	bl	_DPRINTF
	ldr	w0, [x20, #8]
	bl	_XHCI_TRB_3_EP_GET
	mov	x24, x0
	sub	w8, w0, #32
	cmn	w8, #32
	b.hi	LBB0_2
; %bb.1:
	sxtw	x0, w24
	bl	_DPRINTF
Lloh3:
	adrp	x8, _XHCI_TRB_ERROR_TRB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XHCI_TRB_ERROR_TRB@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	b	LBB0_11
LBB0_2:
	ldr	x21, [x23, #8]
	cmp	x21, #0
	cset	w0, ne
	bl	_assert
	ldr	x26, [x21]
	add	x21, x26, w24, uxtw #3
	ldr	x25, [x23]
	ldr	w0, [x21]
	bl	_XHCI_EPCTX_0_EPSTATE_GET
	and	w8, w0, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.3:
	mov	w24, w24
	ldr	w0, [x20, #4]
	bl	_XHCI_TRB_2_STREAM_GET
	mov	x23, x0
	ldr	w0, [x21]
	bl	_XHCI_EPCTX_0_MAXP_STREAMS_GET
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.4:
	str	xzr, [sp, #8]
	add	x3, sp, #8
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_pci_xhci_find_stream
	mov	x19, x0
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_10
; %bb.5:
	add	x22, x25, x24, lsl #5
	ldr	x8, [x22, #24]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	ldr	w0, [x20]
	ldp	x9, x8, [x22, #16]
	str	w0, [x8, w23, sxtw #2]
	and	w8, w0, #0xfffffff0
	sbfiz	x20, x23, #3, #32
	str	w8, [x9, x20]
	bl	_XHCI_EPCTX_2_DCS_GET
	ldr	x8, [x22, #16]
	add	x8, x8, x20
	str	w0, [x8, #4]
	b	LBB0_10
LBB0_6:
	ldr	w0, [x21]
	bl	_XHCI_EPCTX_0_EPSTATE_GET
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x0, w0
	bl	_DPRINTF
Lloh6:
	adrp	x8, _XHCI_TRB_ERROR_CONTEXT_STATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XHCI_TRB_ERROR_CONTEXT_STATE@GOTPAGEOFF]
Lloh8:
	ldr	w19, [x8]
	b	LBB0_11
LBB0_7:
	cbz	w23, LBB0_9
; %bb.8:
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sxtw	x0, w23
	bl	_DPRINTF
LBB0_9:
	add	x8, x26, x24, lsl #3
	add	x23, x25, x24, lsl #5
	ld1r.2s	{ v0 }, [x20]
Lloh9:
	adrp	x9, lCPI0_0@PAGE
Lloh10:
	ldr	d1, [x9, lCPI0_0@PAGEOFF]
	and.8b	v0, v0, v1
	str	s0, [x8, #4]
	str	d0, [x23]
	fmov	w1, s0
	mov	x0, x22
	bl	_XHCI_GADDR
	str	w0, [x23, #8]
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DPRINTF
	ldr	w0, [x23, #8]
	bl	_pci_xhci_dump_trb
LBB0_10:
	ldr	w8, [x21]
	and	w8, w8, #0xfffffff8
	orr	w8, w8, #0x80
	str	w8, [x21]
LBB0_11:
	mov	x0, x19
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdr	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_XHCI_TRB_ERROR_SUCCESS,4,2     ; @XHCI_TRB_ERROR_SUCCESS
	.comm	_XHCI_TRB_ERROR_TRB,4,2         ; @XHCI_TRB_ERROR_TRB
	.comm	_XHCI_TRB_ERROR_CONTEXT_STATE,4,2 ; @XHCI_TRB_ERROR_CONTEXT_STATE
	.section	__TEXT,__cstring,cstring_literals
l_.str.4:                               ; @.str.4
	.asciz	"pci_xhci set_tr first TRB:\r\n"

	.no_dead_strip	_pci_xhci_cmd_set_tr
.subsections_via_symbols
