	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_start_work                 ## -- Begin function cxl_start_work
	.p2align	4, 0x90
_cxl_start_work:                        ## @cxl_start_work
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_CXL_START_WORK_NUM_IRQS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_1
## %bb.5:
	movq	8(%rbx), %rsi
	movq	(%r14), %rax
	cmpq	(%rax), %rsi
	jl	LBB0_7
## %bb.6:
	cmpq	8(%rax), %rsi
	jle	LBB0_2
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_1:
	movq	(%r14), %rax
	movq	(%rax), %rsi
	movq	%rsi, 8(%rbx)
LBB0_2:
	movq	%r14, %rdi
	callq	_afu_register_irqs
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movl	16(%rbx), %esi
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cxl_start_context
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jns	LBB0_8
## %bb.4:
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	_afu_release_irqs
	movl	%ebx, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CXL_START_WORK_NUM_IRQS,4,2    ## @CXL_START_WORK_NUM_IRQS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_current,4,2                    ## @current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_start_work                 ; -- Begin function cxl_start_work
	.p2align	2
_cxl_start_work:                        ; @cxl_start_work
	.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
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _CXL_START_WORK_NUM_IRQS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CXL_START_WORK_NUM_IRQS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	x1, [x20, #8]
	ldr	x8, [x19]
	ldr	x9, [x8]
	cmp	x1, x9
	b.lt	LBB0_3
; %bb.2:
	ldr	x8, [x8, #8]
	cmp	x1, x8
	b.le	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_4:
	ldr	x8, [x19]
	ldr	x1, [x8]
	str	x1, [x20, #8]
LBB0_5:
	mov	x0, x19
	bl	_afu_register_irqs
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.6:
	ldr	w1, [x20, #16]
Lloh6:
	adrp	x8, _current@GOTPAGE
Lloh7:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_cxl_start_context
	tbnz	w0, #31, LBB0_8
; %bb.7:
	mov	w21, #0
	b	LBB0_9
LBB0_8:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x19
	bl	_afu_release_irqs
LBB0_9:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CXL_START_WORK_NUM_IRQS,4,2    ; @CXL_START_WORK_NUM_IRQS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_current,4,2                    ; @current
.subsections_via_symbols
