	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_fixup_malformed_tlp
_cxl_fixup_malformed_tlp:               ## @cxl_fixup_malformed_tlp
	.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
	testb	$-16, 1(%rdi)
	je	LBB0_1
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %rbx
	movq	_PCI_EXT_CAP_ID_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pci_find_ext_capability
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movslq	%eax, %r14
	movq	_PCI_ERR_UNCOR_MASK@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	%r14, %rsi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_read_config_dword
	movl	-28(%rbp), %eax
	movq	_PCI_ERR_UNC_MALF_TLP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_PCI_ERR_UNC_INTN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%eax, %ecx
	je	LBB0_4
## %bb.3:
	movl	%edx, %esi
	andl	%eax, %esi
	jne	LBB0_5
LBB0_4:
	orl	%eax, %ecx
	orl	%ecx, %edx
	movl	%edx, -28(%rbp)
	addq	(%r15), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_pci_write_config_dword
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.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_UNC_MALF_TLP,4,2       ## @PCI_ERR_UNC_MALF_TLP
	.comm	_PCI_ERR_UNC_INTN,4,2           ## @PCI_ERR_UNC_INTN
	.no_dead_strip	_cxl_fixup_malformed_tlp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_fixup_malformed_tlp
_cxl_fixup_malformed_tlp:               ; @cxl_fixup_malformed_tlp
	.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
	ldrb	w8, [x0, #1]
	tst	w8, #0xf0
	b.eq	LBB0_2
LBB0_1:
	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_2:
	mov	x19, x1
Lloh0:
	adrp	x8, _PCI_EXT_CAP_ID_ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_EXT_CAP_ID_ERR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_find_ext_capability
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_1
; %bb.3:
	sxtw	x20, w0
Lloh3:
	adrp	x21, _PCI_ERR_UNCOR_MASK@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PCI_ERR_UNCOR_MASK@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x1, x8, x20
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _PCI_ERR_UNC_MALF_TLP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_ERR_UNC_MALF_TLP@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w11, w9, w8
Lloh8:
	adrp	x10, _PCI_ERR_UNC_INTN@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PCI_ERR_UNC_INTN@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	and	w12, w10, w8
	cmp	w11, #0
	ccmp	w12, #0, #4, ne
	b.ne	LBB0_1
; %bb.4:
	orr	w8, w9, w8
	orr	w2, w10, w8
	str	w2, [sp, #12]
	ldr	x8, [x21]
	add	x1, x8, x20
	mov	x0, x19
	bl	_pci_write_config_dword
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.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_UNC_MALF_TLP,4,2       ; @PCI_ERR_UNC_MALF_TLP
	.comm	_PCI_ERR_UNC_INTN,4,2           ; @PCI_ERR_UNC_INTN
	.no_dead_strip	_cxl_fixup_malformed_tlp
.subsections_via_symbols
