	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_update_image_control       ## -- Begin function cxl_update_image_control
	.p2align	4, 0x90
_cxl_update_image_control:              ## @cxl_update_image_control
	.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	%rdi, %r14
	movl	16(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_find_cxl_vsec
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r12d
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_CXL_READ_VSEC_IMAGE_STATE
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_4:
	cmpq	$0, 8(%r14)
	movq	_CXL_VSEC_PERST_LOADS_IMAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	je	LBB0_6
## %bb.5:
	orl	-36(%rbp), %eax
	jmp	LBB0_7
LBB0_6:
	notl	%eax
	andl	-36(%rbp), %eax
LBB0_7:
	movq	_CXL_VSEC_PERST_SELECT_USER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %ecx
	notl	%ecx
	andl	%eax, %ecx
	orl	%eax, %edx
	cmpq	$0, (%r14)
	cmovel	%ecx, %edx
	movl	%edx, -36(%rbp)
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_CXL_WRITE_VSEC_IMAGE_STATE
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_10:
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ABORTING: CXL VSEC not found!\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"failed to read image state: %i\n"

	.comm	_CXL_VSEC_PERST_LOADS_IMAGE,4,2 ## @CXL_VSEC_PERST_LOADS_IMAGE
	.comm	_CXL_VSEC_PERST_SELECT_USER,4,2 ## @CXL_VSEC_PERST_SELECT_USER
L_.str.2:                               ## @.str.2
	.asciz	"failed to update image control: %i\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_update_image_control       ; -- Begin function cxl_update_image_control
	.p2align	2
_cxl_update_image_control:              ; @cxl_update_image_control
	.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, x0
	ldr	w0, [x0, #16]
	bl	_to_pci_dev
	mov	x19, x0
	bl	_find_cxl_vsec
	cbz	w0, LBB0_3
; %bb.1:
	mov	x21, x0
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_CXL_READ_VSEC_IMAGE_STATE
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
	str	x22, [sp]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_9
LBB0_3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_4:
	ldr	x9, [x20, #8]
Lloh7:
	adrp	x8, _CXL_VSEC_PERST_LOADS_IMAGE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CXL_VSEC_PERST_LOADS_IMAGE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cbz	x9, LBB0_6
; %bb.5:
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	b	LBB0_7
LBB0_6:
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
LBB0_7:
	ldr	x9, [x20]
Lloh10:
	adrp	x10, _CXL_VSEC_PERST_SELECT_USER@GOTPAGE
Lloh11:
	ldr	x10, [x10, _CXL_VSEC_PERST_SELECT_USER@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	bic	w11, w8, w10
	orr	w8, w10, w8
	cmp	x9, #0
	csel	w2, w11, w8, eq
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	bl	_CXL_WRITE_VSEC_IMAGE_STATE
	mov	x22, x0
	cbz	w0, LBB0_9
; %bb.8:
	str	x22, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
LBB0_9:
	mov	x0, x22
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ABORTING: CXL VSEC not found!\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"failed to read image state: %i\n"

	.comm	_CXL_VSEC_PERST_LOADS_IMAGE,4,2 ; @CXL_VSEC_PERST_LOADS_IMAGE
	.comm	_CXL_VSEC_PERST_SELECT_USER,4,2 ; @CXL_VSEC_PERST_SELECT_USER
l_.str.2:                               ; @.str.2
	.asciz	"failed to update image control: %i\n"

.subsections_via_symbols
