	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alcor_pci_find_cap_offset
_alcor_pci_find_cap_offset:             ## @alcor_pci_find_cap_offset
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_ALCOR_CAP_START_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	callq	_pci_read_config_byte
	movq	-56(%rbp), %rbx
	xorl	%r15d, %r15d
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.1:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_pci_read_config_dword
	movl	-44(%rbp), %edx
	cmpl	$-1, %edx
	je	LBB0_9
## %bb.2:
	cmpb	$16, %dl
	je	LBB0_7
## %bb.3:
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testl	$65280, %edx                    ## imm = 0xFF00
	je	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movzbl	%dh, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r13, %rdx
	callq	_pci_read_config_dword
	movl	-44(%rbp), %edx
	cmpl	$-1, %edx
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpb	$16, %dl
	jne	LBB0_4
LBB0_7:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	movl	%ebx, %r15d
	jmp	LBB0_11
LBB0_9:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	$-1, %edx
LBB0_10:
	callq	_dev_dbg
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ALCOR_CAP_START_OFFSET,4,2     ## @ALCOR_CAP_START_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"find_cap_offset invalid value %x.\n"

L_.str.1:                               ## @.str.1
	.asciz	"pcie cap offset: %x\n"

L_.str.2:                               ## @.str.2
	.asciz	"pci_find_cap_offset invalid value %x.\n"

	.no_dead_strip	_alcor_pci_find_cap_offset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alcor_pci_find_cap_offset
_alcor_pci_find_cap_offset:             ; @alcor_pci_find_cap_offset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ALCOR_CAP_START_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ALCOR_CAP_START_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	bl	_pci_read_config_byte
	ldr	x20, [sp, #8]
	cbz	x20, LBB0_9
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #4
	mov	x0, x21
	mov	x1, x20
	bl	_pci_read_config_dword
	ldr	w2, [sp, #4]
	cmn	w2, #1
	b.eq	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w8, w2, #0xff
	cmp	w8, #16
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	tst	w2, #0xff00
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ubfx	w20, w2, #8, #8
	b	LBB0_1
LBB0_5:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #-1
	b	LBB0_8
LBB0_6:
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	b	LBB0_9
LBB0_7:
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	bl	_dev_dbg
	mov	w20, #0
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ALCOR_CAP_START_OFFSET,4,2     ; @ALCOR_CAP_START_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"find_cap_offset invalid value %x.\n"

l_.str.1:                               ; @.str.1
	.asciz	"pcie cap offset: %x\n"

l_.str.2:                               ; @.str.2
	.asciz	"pci_find_cap_offset invalid value %x.\n"

	.no_dead_strip	_alcor_pci_find_cap_offset
.subsections_via_symbols
