	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_xhci_read
_pci_xhci_read:                         ## @pci_xhci_read
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movq	%r8, %r12
	movq	(%rdx), %rbx
	xorl	%edi, %edi
	testl	%ecx, %ecx
	sete	%dil
	callq	_assert
	leaq	24(%rbx), %r15
	movq	%r15, %rdi
	callq	_pthread_mutex_lock
	movq	_XHCI_CAPLEN@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jle	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pci_xhci_hostcap_read
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_2:
	cmpq	%r12, (%rbx)
	jle	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pci_xhci_hostop_read
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_4:
	cmpq	%r12, 8(%rbx)
	jle	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pci_xhci_dbregs_read
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_6:
	movq	16(%rbx), %rax
	cmpq	%r12, %rax
	jle	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pci_xhci_rtsregs_read
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_8:
	subq	$-128, %rax
	cmpq	%r12, %rax
	jle	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pci_xhci_xecp_read
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	callq	_WPRINTF
	xorl	%ebx, %ebx
LBB0_11:
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
	cmpl	$2, %r14d
	je	LBB0_14
## %bb.12:
	cmpl	$1, %r14d
	jne	LBB0_15
## %bb.13:
	movzbl	%bl, %ebx
	jmp	LBB0_15
LBB0_14:
	movzwl	%bx, %ebx
LBB0_15:
	movslq	%ebx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XHCI_CAPLEN,8,3                ## @XHCI_CAPLEN
	.no_dead_strip	_pci_xhci_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_xhci_read
_pci_xhci_read:                         ; @pci_xhci_read
	.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, x5
	mov	x21, x4
	ldr	x22, [x2]
	cmp	w3, #0
	cset	w0, eq
	bl	_assert
	add	x20, x22, #24
	mov	x0, x20
	bl	_pthread_mutex_lock
Lloh0:
	adrp	x8, _XHCI_CAPLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XHCI_CAPLEN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.le	LBB0_2
; %bb.1:
	mov	x0, x22
	mov	x1, x21
	bl	_pci_xhci_hostcap_read
	mov	x21, x0
	b	LBB0_11
LBB0_2:
	ldr	x8, [x22]
	cmp	x8, x21
	b.le	LBB0_4
; %bb.3:
	mov	x0, x22
	mov	x1, x21
	bl	_pci_xhci_hostop_read
	mov	x21, x0
	b	LBB0_11
LBB0_4:
	ldr	x8, [x22, #8]
	cmp	x8, x21
	b.le	LBB0_6
; %bb.5:
	mov	x0, x22
	mov	x1, x21
	bl	_pci_xhci_dbregs_read
	mov	x21, x0
	b	LBB0_11
LBB0_6:
	ldr	x8, [x22, #16]
	cmp	x8, x21
	b.le	LBB0_8
; %bb.7:
	mov	x0, x22
	mov	x1, x21
	bl	_pci_xhci_rtsregs_read
	mov	x21, x0
	b	LBB0_11
LBB0_8:
	add	x8, x8, #128
	cmp	x8, x21
	b.le	LBB0_10
; %bb.9:
	mov	x0, x22
	mov	x1, x21
	bl	_pci_xhci_xecp_read
	mov	x21, x0
	b	LBB0_11
LBB0_10:
	mov	x0, x21
	bl	_WPRINTF
	mov	w21, #0
LBB0_11:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	and	w8, w21, #0xffff
	and	w9, w21, #0xff
	cmp	w19, #1
	csel	w9, w21, w9, ne
	cmp	w19, #2
	csel	w8, w8, w9, eq
	sxtw	x0, w8
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XHCI_CAPLEN,8,3                ; @XHCI_CAPLEN
	.no_dead_strip	_pci_xhci_read
.subsections_via_symbols
