	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function program_hpx_type2
_program_hpx_type2:                     ## @program_hpx_type2
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_14
## %bb.2:
	movl	(%rbx), %edx
	cmpl	$2, %edx
	jl	LBB0_3
## %bb.15:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_warn                       ## TAILCALL
LBB0_3:
	movq	_PCI_EXP_DEVCTL_PAYLOAD@GOTPCREL(%rip), %rax
	movq	_PCI_EXP_DEVCTL_READRQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	4(%rbx), %edx
	orl	%ecx, %edx
	movl	%edx, 4(%rbx)
	notl	%ecx
	andl	8(%rbx), %ecx
	movl	%ecx, 8(%rbx)
	movq	_PCI_EXP_DEVCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%edx
	movq	%r14, %rdi
	callq	_pcie_capability_clear_and_set_word
	movq	%r14, %rdi
	callq	_pcie_cap_has_lnkctl
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	_PCI_EXP_LNKCTL_RCB@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	orl	%eax, 12(%rbx)
	notl	%eax
	andl	%eax, 16(%rbx)
	movq	%r14, %rdi
	callq	_pcie_root_rcb_set
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	16(%rbx), %ecx
	orl	(%r15), %ecx
	movl	%ecx, 16(%rbx)
	jmp	LBB0_7
LBB0_5:
	movl	16(%rbx), %ecx
LBB0_7:
	movq	_PCI_EXP_LNKCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	notl	%edx
	movq	%r14, %rdi
	callq	_pcie_capability_clear_and_set_word
LBB0_8:
	movq	_PCI_EXT_CAP_ID_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_14
## %bb.9:
	movslq	%eax, %r15
	movq	_PCI_ERR_UNCOR_MASK@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	%r15, %rsi
	leaq	-44(%rbp), %r12
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_dword
	movl	20(%rbx), %edx
	andl	-44(%rbp), %edx
	orl	24(%rbx), %edx
	movl	%edx, -44(%rbp)
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_pci_write_config_dword
	movq	_PCI_ERR_UNCOR_SEVER@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_dword
	movl	28(%rbx), %edx
	andl	-44(%rbp), %edx
	orl	32(%rbx), %edx
	movl	%edx, -44(%rbp)
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_pci_write_config_dword
	movq	_PCI_ERR_COR_MASK@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_dword
	movl	36(%rbx), %edx
	andl	-44(%rbp), %edx
	orl	40(%rbx), %edx
	movl	%edx, -44(%rbp)
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_pci_write_config_dword
	movq	_PCI_ERR_CAP@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_pci_read_config_dword
	movl	44(%rbx), %edx
	andl	-44(%rbp), %edx
	orl	48(%rbx), %edx
	movl	%edx, -44(%rbp)
	movq	_PCI_ERR_CAP_ECRC_GENC@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	jne	LBB0_11
## %bb.10:
	movq	_PCI_ERR_CAP_ECRC_GENE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_11:
	movq	_PCI_ERR_CAP_ECRC_CHKC@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	jne	LBB0_13
## %bb.12:
	movq	_PCI_ERR_CAP_ECRC_CHKE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_13:
	addq	(%r13), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_dword
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCIe settings rev %d not supported\n"

	.comm	_PCI_EXP_DEVCTL_PAYLOAD,4,2     ## @PCI_EXP_DEVCTL_PAYLOAD
	.comm	_PCI_EXP_DEVCTL_READRQ,4,2      ## @PCI_EXP_DEVCTL_READRQ
	.comm	_PCI_EXP_DEVCTL,4,2             ## @PCI_EXP_DEVCTL
	.comm	_PCI_EXP_LNKCTL_RCB,4,2         ## @PCI_EXP_LNKCTL_RCB
	.comm	_PCI_EXP_LNKCTL,4,2             ## @PCI_EXP_LNKCTL
	.comm	_PCI_EXT_CAP_ID_ERR,4,2         ## @PCI_EXT_CAP_ID_ERR
	.comm	_PCI_ERR_UNCOR_MASK,8,3         ## @PCI_ERR_UNCOR_MASK
	.comm	_PCI_ERR_UNCOR_SEVER,8,3        ## @PCI_ERR_UNCOR_SEVER
	.comm	_PCI_ERR_COR_MASK,8,3           ## @PCI_ERR_COR_MASK
	.comm	_PCI_ERR_CAP,8,3                ## @PCI_ERR_CAP
	.comm	_PCI_ERR_CAP_ECRC_GENC,4,2      ## @PCI_ERR_CAP_ECRC_GENC
	.comm	_PCI_ERR_CAP_ECRC_GENE,4,2      ## @PCI_ERR_CAP_ECRC_GENE
	.comm	_PCI_ERR_CAP_ECRC_CHKC,4,2      ## @PCI_ERR_CAP_ECRC_CHKC
	.comm	_PCI_ERR_CAP_ECRC_CHKE,4,2      ## @PCI_ERR_CAP_ECRC_CHKE
	.no_dead_strip	_program_hpx_type2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function program_hpx_type2
_program_hpx_type2:                     ; @program_hpx_type2
	.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
	cbz	x1, LBB0_15
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_pci_is_pcie
	cbz	w0, LBB0_15
; %bb.2:
	ldr	w2, [x20]
	cmp	w2, #2
	b.lt	LBB0_4
; %bb.3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	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
LBB0_4:
Lloh2:
	adrp	x8, _PCI_EXP_DEVCTL_PAYLOAD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_EXP_DEVCTL_PAYLOAD@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PCI_EXP_DEVCTL_READRQ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_EXP_DEVCTL_READRQ@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldp	w9, w10, [x20, #4]
	orr	w9, w9, w8
	bic	w3, w10, w8
	stp	w9, w3, [x20, #4]
Lloh8:
	adrp	x8, _PCI_EXP_DEVCTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCI_EXP_DEVCTL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mvn	w2, w9
	mov	x0, x19
	bl	_pcie_capability_clear_and_set_word
	mov	x0, x19
	bl	_pcie_cap_has_lnkctl
	cbz	x0, LBB0_9
; %bb.5:
Lloh11:
	adrp	x21, _PCI_EXP_LNKCTL_RCB@GOTPAGE
Lloh12:
	ldr	x21, [x21, _PCI_EXP_LNKCTL_RCB@GOTPAGEOFF]
	ldr	w8, [x21]
	ldp	w9, w10, [x20, #12]
	orr	w9, w9, w8
	bic	w8, w10, w8
	stp	w9, w8, [x20, #12]
	mov	x0, x19
	bl	_pcie_root_rcb_set
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w8, [x21]
	ldr	w9, [x20, #16]
	orr	w3, w9, w8
	str	w3, [x20, #16]
	b	LBB0_8
LBB0_7:
	ldr	w3, [x20, #16]
LBB0_8:
Lloh13:
	adrp	x8, _PCI_EXP_LNKCTL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PCI_EXP_LNKCTL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	w8, [x20, #12]
	mvn	w2, w8
	mov	x0, x19
	bl	_pcie_capability_clear_and_set_word
LBB0_9:
Lloh16:
	adrp	x8, _PCI_EXT_CAP_ID_ERR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_ERR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_find_ext_capability
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_15
; %bb.10:
	sxtw	x21, w0
Lloh19:
	adrp	x22, _PCI_ERR_UNCOR_MASK@GOTPAGE
Lloh20:
	ldr	x22, [x22, _PCI_ERR_UNCOR_MASK@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x20, #20]
	and	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	x8, [x22]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_dword
Lloh21:
	adrp	x22, _PCI_ERR_UNCOR_SEVER@GOTPAGE
Lloh22:
	ldr	x22, [x22, _PCI_ERR_UNCOR_SEVER@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x20, #28]
	and	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	x8, [x22]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_dword
Lloh23:
	adrp	x22, _PCI_ERR_COR_MASK@GOTPAGE
Lloh24:
	ldr	x22, [x22, _PCI_ERR_COR_MASK@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x20, #36]
	and	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
	ldr	x8, [x22]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_dword
Lloh25:
	adrp	x22, _PCI_ERR_CAP@GOTPAGE
Lloh26:
	ldr	x22, [x22, _PCI_ERR_CAP@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	ldp	w9, w10, [x20, #44]
	and	w8, w9, w8
	orr	w2, w8, w10
	str	w2, [sp, #12]
Lloh27:
	adrp	x8, _PCI_ERR_CAP_ECRC_GENC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PCI_ERR_CAP_ECRC_GENC@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	tst	w8, w2
	b.ne	LBB0_12
; %bb.11:
Lloh30:
	adrp	x8, _PCI_ERR_CAP_ECRC_GENE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCI_ERR_CAP_ECRC_GENE@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	bic	w2, w2, w8
	str	w2, [sp, #12]
LBB0_12:
Lloh33:
	adrp	x8, _PCI_ERR_CAP_ECRC_CHKC@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PCI_ERR_CAP_ECRC_CHKC@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	tst	w8, w2
	b.ne	LBB0_14
; %bb.13:
Lloh36:
	adrp	x8, _PCI_ERR_CAP_ECRC_CHKE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PCI_ERR_CAP_ECRC_CHKE@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	bic	w2, w2, w8
	str	w2, [sp, #12]
LBB0_14:
	ldr	x8, [x22]
	add	x1, x8, x21
	mov	x0, x19
	bl	_pci_write_config_dword
LBB0_15:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCIe settings rev %d not supported\n"

	.comm	_PCI_EXP_DEVCTL_PAYLOAD,4,2     ; @PCI_EXP_DEVCTL_PAYLOAD
	.comm	_PCI_EXP_DEVCTL_READRQ,4,2      ; @PCI_EXP_DEVCTL_READRQ
	.comm	_PCI_EXP_DEVCTL,4,2             ; @PCI_EXP_DEVCTL
	.comm	_PCI_EXP_LNKCTL_RCB,4,2         ; @PCI_EXP_LNKCTL_RCB
	.comm	_PCI_EXP_LNKCTL,4,2             ; @PCI_EXP_LNKCTL
	.comm	_PCI_EXT_CAP_ID_ERR,4,2         ; @PCI_EXT_CAP_ID_ERR
	.comm	_PCI_ERR_UNCOR_MASK,8,3         ; @PCI_ERR_UNCOR_MASK
	.comm	_PCI_ERR_UNCOR_SEVER,8,3        ; @PCI_ERR_UNCOR_SEVER
	.comm	_PCI_ERR_COR_MASK,8,3           ; @PCI_ERR_COR_MASK
	.comm	_PCI_ERR_CAP,8,3                ; @PCI_ERR_CAP
	.comm	_PCI_ERR_CAP_ECRC_GENC,4,2      ; @PCI_ERR_CAP_ECRC_GENC
	.comm	_PCI_ERR_CAP_ECRC_GENE,4,2      ; @PCI_ERR_CAP_ECRC_GENE
	.comm	_PCI_ERR_CAP_ECRC_CHKC,4,2      ; @PCI_ERR_CAP_ECRC_CHKC
	.comm	_PCI_ERR_CAP_ECRC_CHKE,4,2      ; @PCI_ERR_CAP_ECRC_CHKE
	.no_dead_strip	_program_hpx_type2
.subsections_via_symbols
