	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_configure_adapter
_cxl_configure_adapter:                 ## @cxl_configure_adapter
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	%rsi, 24(%rdi)
	movq	_cxl_release_adapter@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	movq	%rsi, %rdi
	movq	%r14, %rsi
	callq	_pci_set_drvdata
	movq	%r15, %rdi
	callq	_pci_enable_device
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_19
LBB0_2:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_cxl_read_vsec
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.3:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_cxl_vsec_looks_ok
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_cxl_fixup_malformed_tlp
	movq	%r15, %rdi
	callq	_setup_cxl_bars
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.5:
	movq	%r15, %rdi
	callq	_switch_card_to_cxl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.6:
	movq	%r14, %rdi
	callq	_cxl_update_image_control
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.7:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_cxl_map_adapter_regs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:
	movq	%r14, %rdi
	callq	_sanitise_adapter_regs
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.10:
	movq	%r15, %rdi
	callq	_pci_set_master
	movl	$0, (%r14)
	xorl	%eax, %eax
	callq	_cxl_is_power9
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	movq	%r15, %rdi
	movl	$-536870912, %esi               ## imm = 0xE0000000
	movl	$1, %edx
	callq	_pnv_pci_set_tunnel_bar
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_info
	jmp	LBB0_14
LBB0_13:
	movl	$1, (%r14)
LBB0_14:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	8(%rax), %esi
	movq	%r15, %rdi
	callq	_pnv_phb_to_cxl_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	movq	_OPAL_PHB_CAPI_MODE_SNOOP_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pnv_phb_to_cxl_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.16:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_cxl_setup_psl_timebase
	movq	%r14, %rdi
	callq	_cxl_native_register_psl_err_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_17
LBB0_18:
	movq	%r14, %rdi
	callq	_cxl_unmap_adapter_regs
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	xorl	%ebx, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_cxl_release_adapter,4,2        ## @cxl_release_adapter
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pci_enable_device failed: %i\n"

L_.str.1:                               ## @.str.1
	.asciz	"Tunneled operations unsupported\n"

	.comm	_OPAL_PHB_CAPI_MODE_SNOOP_ON,4,2 ## @OPAL_PHB_CAPI_MODE_SNOOP_ON
	.no_dead_strip	_cxl_configure_adapter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_configure_adapter
_cxl_configure_adapter:                 ; @cxl_configure_adapter
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	str	x1, [x0, #24]
Lloh0:
	adrp	x8, _cxl_release_adapter@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cxl_release_adapter@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	mov	x0, x1
	mov	x1, x19
	bl	_pci_set_drvdata
	mov	x0, x20
	bl	_pci_enable_device
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
	b	LBB0_18
LBB0_2:
	mov	x0, x19
	mov	x1, x20
	bl	_cxl_read_vsec
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_cxl_vsec_looks_ok
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	bl	_cxl_fixup_malformed_tlp
	mov	x0, x20
	bl	_setup_cxl_bars
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.5:
	mov	x0, x20
	bl	_switch_card_to_cxl
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.6:
	mov	x0, x19
	bl	_cxl_update_image_control
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_cxl_map_adapter_regs
	mov	x21, x0
	cbnz	w0, LBB0_18
; %bb.8:
	mov	x0, x19
	bl	_sanitise_adapter_regs
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.10:
	mov	x0, x20
	bl	_pci_set_master
	str	wzr, [x19]
	bl	_cxl_is_power9
	cbz	x0, LBB0_14
; %bb.11:
	mov	w21, #1
	mov	x0, x20
	mov	w1, #-536870912
	mov	w2, #1
	bl	_pnv_pci_set_tunnel_bar
	cbz	x0, LBB0_13
; %bb.12:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
	b	LBB0_14
LBB0_13:
	str	w21, [x19]
LBB0_14:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w1, [x8, #8]
	mov	x0, x20
	bl	_pnv_phb_to_cxl_mode
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.15:
Lloh7:
	adrp	x8, _OPAL_PHB_CAPI_MODE_SNOOP_ON@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPAL_PHB_CAPI_MODE_SNOOP_ON@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_pnv_phb_to_cxl_mode
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.16:
	mov	x0, x19
	mov	x1, x20
	bl	_cxl_setup_psl_timebase
	mov	x0, x19
	bl	_cxl_native_register_psl_err_irq
	mov	x21, x0
	cbz	w0, LBB0_18
LBB0_17:
	mov	x0, x19
	bl	_cxl_unmap_adapter_regs
LBB0_18:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_cxl_release_adapter,4,2        ; @cxl_release_adapter
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pci_enable_device failed: %i\n"

l_.str.1:                               ; @.str.1
	.asciz	"Tunneled operations unsupported\n"

	.comm	_OPAL_PHB_CAPI_MODE_SNOOP_ON,4,2 ; @OPAL_PHB_CAPI_MODE_SNOOP_ON
	.no_dead_strip	_cxl_configure_adapter
.subsections_via_symbols
