	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_check_and_clear_ins       ## -- Begin function cpci_check_and_clear_ins
	.p2align	4, 0x90
_cpci_check_and_clear_ins:              ## @cpci_check_and_clear_ins
	.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, %rbx
	movl	(%rdi), %esi
	movl	4(%rdi), %edi
	movq	_PCI_CAP_ID_CHSWP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_pci_bus_find_capability
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %r15d
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	addl	$2, %r15d
	leaq	-28(%rbp), %rcx
	movl	%r15d, %edx
	callq	_pci_bus_read_config_word
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movl	-28(%rbp), %ecx
	movq	_HS_CSR_INS@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	movl	%r15d, %edx
	callq	_pci_bus_write_config_word
	xorl	%r14d, %r14d
	testq	%rax, %rax
	sete	%r14b
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CAP_ID_CHSWP,4,2           ## @PCI_CAP_ID_CHSWP
	.comm	_HS_CSR_INS,4,2                 ## @HS_CSR_INS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_check_and_clear_ins       ; -- Begin function cpci_check_and_clear_ins
	.p2align	2
_cpci_check_and_clear_ins:              ; @cpci_check_and_clear_ins
	.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	x19, x0
	ldr	w0, [x0, #4]
	ldr	w1, [x19]
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
	cbz	w0, LBB0_5
; %bb.1:
	ldp	w1, w8, [x19]
	add	w20, w0, #2
	add	x3, sp, #12
	mov	x0, x8
	mov	x2, x20
	bl	_pci_bus_read_config_word
	cbz	x0, LBB0_3
LBB0_2:
	mov	w0, #0
	b	LBB0_5
LBB0_3:
	ldr	w3, [sp, #12]
Lloh3:
	adrp	x8, _HS_CSR_INS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HS_CSR_INS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w3
	b.eq	LBB0_2
; %bb.4:
	ldp	w1, w0, [x19]
	mov	x2, x20
	bl	_pci_bus_write_config_word
	cmp	x0, #0
	cset	w0, eq
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CAP_ID_CHSWP,4,2           ; @PCI_CAP_ID_CHSWP
	.comm	_HS_CSR_INS,4,2                 ; @HS_CSR_INS
.subsections_via_symbols
