	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function program_hpx_type3_register
_program_hpx_type3_register:            ## @program_hpx_type3_register
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_hpx3_device_type
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.1:
	movq	%r14, %rdi
	callq	_hpx3_function_type
	testl	%eax, 4(%rbx)
	je	LBB0_12
## %bb.2:
	movl	8(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_7
## %bb.3:
	cmpl	$131, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$130, %eax
	jne	LBB0_13
## %bb.6:
	movl	52(%rbx), %esi
	movq	%r14, %rdi
	callq	_pci_find_capability
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_12
LBB0_7:
	movl	52(%rbx), %esi
	movq	%r14, %rdi
	callq	_pci_find_ext_capability
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movq	%rax, %r15
	leaq	-40(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_pci_read_config_dword
	movl	-40(%rbp), %edi
	callq	_PCI_EXT_CAP_VER
	movl	48(%rbx), %esi
	movl	%eax, %edi
	callq	_hpx3_cap_ver_matches
	testl	%eax, %eax
	jne	LBB0_9
	jmp	LBB0_12
LBB0_4:
	xorl	%r15d, %r15d
LBB0_9:
	movq	40(%rbx), %rsi
	addq	%r15, %rsi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movl	12(%rbx), %eax
	andl	-44(%rbp), %eax
	cmpl	16(%rbx), %eax
	jne	LBB0_12
## %bb.10:
	movq	32(%rbx), %rsi
	addq	%r15, %rsi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movl	-36(%rbp), %r12d
	movl	20(%rbx), %edx
	andl	%r12d, %edx
	orl	24(%rbx), %edx
	movl	%edx, -36(%rbp)
	cmpl	%edx, %r12d
	je	LBB0_12
## %bb.11:
	movq	32(%rbx), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_pci_write_config_dword
	movl	-36(%rbp), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_pci_dbg
LBB0_12:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_warn                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Encountered _HPX type 3 with unsupported config space location"

L_.str.1:                               ## @.str.1
	.asciz	"Applied _HPX3 at [0x%x]: 0x%08x -> 0x%08x"

	.no_dead_strip	_program_hpx_type3_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function program_hpx_type3_register
_program_hpx_type3_register:            ; @program_hpx_type3_register
	.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	x20, x1
	mov	x19, x0
	bl	_hpx3_device_type
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.1:
	mov	x0, x19
	bl	_hpx3_function_type
	ldr	w8, [x20, #4]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.2:
	ldr	w8, [x20, #8]
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #131
	b.eq	LBB0_8
; %bb.4:
	cmp	w8, #130
	b.ne	LBB0_13
; %bb.5:
	ldr	w1, [x20, #52]
	mov	x0, x19
	bl	_pci_find_capability
	mov	x21, x0
	cbnz	x0, LBB0_9
	b	LBB0_12
LBB0_6:
	ldr	w1, [x20, #52]
	mov	x0, x19
	bl	_pci_find_ext_capability
	cbz	x0, LBB0_12
; %bb.7:
	mov	x21, x0
	add	x2, sp, #4
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_dword
	ldr	w0, [sp, #4]
	bl	_PCI_EXT_CAP_VER
	ldr	w1, [x20, #48]
	bl	_hpx3_cap_ver_matches
	cbnz	w0, LBB0_9
	b	LBB0_12
LBB0_8:
	mov	x21, #0
LBB0_9:
	ldr	x8, [x20, #40]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x20, #12]
	and	w8, w9, w8
	cmp	w8, w10
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x20, #32]
	add	x1, x8, x21
	add	x2, sp, #8
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w22, [sp, #8]
	ldp	w8, w9, [x20, #20]
	and	w8, w8, w22
	orr	w2, w9, w8
	str	w2, [sp, #8]
	cmp	w22, w2
	b.eq	LBB0_12
; %bb.11:
	ldr	x8, [x20, #32]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_dword
	ldr	w4, [sp, #8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_pci_dbg
LBB0_12:
	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
LBB0_13:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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
	b	_pci_warn
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Encountered _HPX type 3 with unsupported config space location"

l_.str.1:                               ; @.str.1
	.asciz	"Applied _HPX3 at [0x%x]: 0x%08x -> 0x%08x"

	.no_dead_strip	_program_hpx_type3_register
.subsections_via_symbols
