	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function transfer_image
_transfer_image:                        ## @transfer_image
	.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	%rdx, %rcx
	movq	%rdi, %r14
	cmpl	$128, %esi
	je	LBB0_4
## %bb.1:
	cmpl	$129, %esi
	jne	LBB0_10
## %bb.2:
	movq	_cxl_h_download_adapter_image@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movl	$129, %esi
	callq	_handle_image
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_11
	jmp	LBB0_3
LBB0_4:
	movq	_cxl_h_validate_adapter_image@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movl	$128, %esi
	callq	_handle_image
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	jne	LBB0_11
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_devel
	cmpl	$0, (%r14)
	jle	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_cxl_guest_remove_afu
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_8
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_pr_devel
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_cxl_h_reset_adapter
	movq	_DEVICE_SCOPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_update_devicetree
	movq	_transfer@GOTPCREL(%rip), %rcx
	movl	$1, (%rcx)
	jmp	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_devel
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_cxl_h_reset_adapter
LBB0_11:
	movl	%ebx, %eax
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cxl_h_download_adapter_image,4,2 ## @cxl_h_download_adapter_image
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"resetting adapter\n"

	.comm	_cxl_h_validate_adapter_image,4,2 ## @cxl_h_validate_adapter_image
L_.str.1:                               ## @.str.1
	.asciz	"remove current afu\n"

	.comm	_DEVICE_SCOPE,4,2               ## @DEVICE_SCOPE
	.comm	_transfer,4,2                   ## @transfer
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_transfer_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function transfer_image
_transfer_image:                        ; @transfer_image
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x3, x2
	mov	x19, x0
	cmp	w1, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w1, #129
	b.ne	LBB0_9
; %bb.2:
Lloh0:
	adrp	x2, _cxl_h_download_adapter_image@GOTPAGE
Lloh1:
	ldr	x2, [x2, _cxl_h_download_adapter_image@GOTPAGEOFF]
	mov	x0, x19
	bl	_handle_image
	mov	x20, x0
	tbz	w0, #31, LBB0_11
	b	LBB0_10
LBB0_3:
Lloh2:
	adrp	x2, _cxl_h_validate_adapter_image@GOTPAGE
Lloh3:
	ldr	x2, [x2, _cxl_h_validate_adapter_image@GOTPAGEOFF]
	mov	x0, x19
	bl	_handle_image
	mov	x20, x0
	tbnz	w0, #31, LBB0_10
; %bb.4:
	cbnz	w20, LBB0_11
; %bb.5:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_devel
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x20, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x20, lsl #2]
	bl	_cxl_guest_remove_afu
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_7
LBB0_8:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_devel
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_cxl_h_reset_adapter
Lloh8:
	adrp	x8, _DEVICE_SCOPE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DEVICE_SCOPE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_update_devicetree
Lloh11:
	adrp	x8, _transfer@GOTPAGE
Lloh12:
	ldr	x8, [x8, _transfer@GOTPAGEOFF]
	mov	w9, #1
Lloh13:
	str	w9, [x8]
	b	LBB0_12
LBB0_9:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_10:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_devel
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_cxl_h_reset_adapter
LBB0_11:
	mov	x0, x20
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_cxl_h_download_adapter_image,4,2 ; @cxl_h_download_adapter_image
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"resetting adapter\n"

	.comm	_cxl_h_validate_adapter_image,4,2 ; @cxl_h_validate_adapter_image
l_.str.1:                               ; @.str.1
	.asciz	"remove current afu\n"

	.comm	_DEVICE_SCOPE,4,2               ; @DEVICE_SCOPE
	.comm	_transfer,4,2                   ; @transfer
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_transfer_image
.subsections_via_symbols
