	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_get_hs_csr                ## -- Begin function cpci_get_hs_csr
	.p2align	4, 0x90
_cpci_get_hs_csr:                       ## @cpci_get_hs_csr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %esi
	movl	4(%rdi), %edi
	movq	_PCI_CAP_ID_CHSWP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pci_bus_find_capability
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	addl	$2, %eax
	leaq	-12(%rbp), %rcx
	movl	%eax, %edx
	callq	_pci_bus_read_config_word
	movq	%rax, %rcx
	movl	$65535, %eax                    ## imm = 0xFFFF
	testq	%rcx, %rcx
	jne	LBB0_4
## %bb.3:
	movl	-12(%rbp), %eax
	jmp	LBB0_4
LBB0_1:
	movl	$65535, %eax                    ## imm = 0xFFFF
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CAP_ID_CHSWP,4,2           ## @PCI_CAP_ID_CHSWP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_get_hs_csr                ; -- Begin function cpci_get_hs_csr
	.p2align	2
_cpci_get_hs_csr:                       ; @cpci_get_hs_csr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	ldr	w0, [x0, #4]
	ldr	w1, [x20]
Lloh0:
	adrp	x8, _PCI_CAP_ID_CHSWP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_CAP_ID_CHSWP@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_pci_bus_find_capability
	mov	w19, #65535
	cbz	w0, LBB0_2
; %bb.1:
	ldp	w1, w8, [x20]
	add	w2, w0, #2
	add	x3, sp, #12
	mov	x0, x8
	bl	_pci_bus_read_config_word
	ldr	w8, [sp, #12]
	cmp	x0, #0
	csel	w19, w8, w19, eq
LBB0_2:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CAP_ID_CHSWP,4,2           ; @PCI_CAP_ID_CHSWP
.subsections_via_symbols
