	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_h_download_facility
_cxl_h_download_facility:               ## @cxl_h_download_facility
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PLPAR_HCALL_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	movq	(%r12), %r12
	leal	(,%r15,8), %edx
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	callq	_memset
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_H_DOWNLOAD_CA_FACILITY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	subq	$8, %rsp
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movq	-96(%rbp), %r9                  ## 8-byte Reload
	pushq	%r12
	callq	_plpar_hcall
	addq	$16, %rsp
	movq	(%r13), %r12
	cmpq	$136, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_H_IS_LONG_BUSY
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	callq	_get_longbusy_msecs
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	addl	%eax, %ecx
	movq	_CXL_HCALL_TIMEOUT_DOWNLOAD@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	ja	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_msleep
	jmp	LBB0_1
LBB0_6:
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_7:
	movq	_H_DOWNLOAD_CA_FACILITY@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_WARN
	movl	$136, %r15d
LBB0_8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_OP_STR_DOWNLOAD_ADAPTER
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	movq	%r13, %r8
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %r9
	pushq	%r15
	pushq	(%rbx)
	callq	__PRINT_MSG
	addq	$16, %rsp
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_OP_STR_DOWNLOAD_ADAPTER
	movq	(%rbx), %r8
	movq	%r14, %rdi
	movl	%eax, %esi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movq	%r15, %r9
	callq	_trace_cxl_hcall_download_facility
	leaq	-128(%r15), %rax
	cmpq	$10, %rax
	ja	LBB0_16
## %bb.9:
	xorl	%r14d, %r14d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	xorl	%r14d, %r14d
LBB0_13:
	subq	(%rax), %r14
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.15:
	movq	%r14, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movl	$1, %edi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_17:
	movq	(%rbx), %rax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	$1, %r14d
	jmp	LBB0_14
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
LJTI0_0:
	.long	L0_0_set_14
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_17
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_PLPAR_HCALL_BUFSIZE,4,2        ## @PLPAR_HCALL_BUFSIZE
	.comm	_H_DOWNLOAD_CA_FACILITY,4,2     ## @H_DOWNLOAD_CA_FACILITY
	.comm	_CXL_HCALL_TIMEOUT_DOWNLOAD,4,2 ## @CXL_HCALL_TIMEOUT_DOWNLOAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: Giving up waiting for CXL hcall %#x after %u msec\n"

L_.str.1:                               ## @.str.1
	.asciz	"cxl_h_download_facility(%#.16llx, %s(%#llx, %#llx), %#lx): %li\n"

	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_EBUSY,8,3                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"Unexpected return code: %lx"

	.no_dead_strip	_cxl_h_download_facility
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_h_download_facility
_cxl_h_download_facility:               ; @cxl_h_download_facility
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x21, x3
	mov	x22, x2
	mov	x24, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _PLPAR_HCALL_BUFSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PLPAR_HCALL_BUFSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	lsl	x8, x12, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	stur	x4, [x29, #-96]                 ; 8-byte Folded Spill
	ldr	x26, [x4]
	lsl	w2, w12, #3
	mov	x0, x20
	mov	w1, #0
	bl	_memset
	mov	w27, #0
Lloh8:
	adrp	x28, _H_DOWNLOAD_CA_FACILITY@GOTPAGE
Lloh9:
	ldr	x28, [x28, _H_DOWNLOAD_CA_FACILITY@GOTPAGEOFF]
Lloh10:
	adrp	x19, _CXL_HCALL_TIMEOUT_DOWNLOAD@GOTPAGE
Lloh11:
	ldr	x19, [x19, _CXL_HCALL_TIMEOUT_DOWNLOAD@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x28]
	mov	x1, x20
	mov	x2, x23
	mov	x3, x24
	mov	x4, x22
	mov	x5, x21
	mov	x6, x26
	bl	_plpar_hcall
	ldr	x26, [x20]
	cmp	x0, #136
	b.eq	LBB0_1
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x25, x0
	bl	_H_IS_LONG_BUSY
	cbz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x25
	bl	_get_longbusy_msecs
	ldr	w8, [x19]
	add	w27, w0, w27
	cmp	w27, w8
	b.hi	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_msleep
	b	LBB0_1
LBB0_5:
	ldrsw	x2, [x28]
	str	x27, [sp, #-16]!
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
	add	sp, sp, #16
	mov	w25, #136
LBB0_6:
	mov	x0, x24
	bl	_OP_STR_DOWNLOAD_ADAPTER
	mov	x3, x0
	ldr	x6, [x20]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x25
	mov	x2, x23
	mov	x4, x22
	mov	x5, x21
	mov	x7, x25
	bl	__PRINT_MSG
	mov	x0, x24
	bl	_OP_STR_DOWNLOAD_ADAPTER
	mov	x1, x0
	ldr	x4, [x20]
	mov	x0, x23
	mov	x2, x22
	mov	x3, x21
	mov	x5, x25
	bl	_trace_cxl_hcall_download_facility
	sub	x8, x25, #128
	cmp	x8, #10
	b.hi	LBB0_9
; %bb.7:
	mov	x0, #0
Lloh16:
	adrp	x9, lJTI0_0@PAGE
Lloh17:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
Lloh18:
	adrp	x8, _EBUSY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	mov	x2, x25
	bl	_WARN
LBB0_10:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	x8, [x8]
	neg	x0, x8
LBB0_12:
	ldur	x8, [x29, #-88]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.13:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	x8, [x20]
	ldur	x9, [x29, #-96]                 ; 8-byte Folded Reload
	str	x8, [x9]
	mov	w0, #1
	b	LBB0_12
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_12-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_14-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_8-LBB0_8)>>2
                                        ; -- End function
	.comm	_PLPAR_HCALL_BUFSIZE,4,2        ; @PLPAR_HCALL_BUFSIZE
	.comm	_H_DOWNLOAD_CA_FACILITY,4,2     ; @H_DOWNLOAD_CA_FACILITY
	.comm	_CXL_HCALL_TIMEOUT_DOWNLOAD,4,2 ; @CXL_HCALL_TIMEOUT_DOWNLOAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: Giving up waiting for CXL hcall %#x after %u msec\n"

l_.str.1:                               ; @.str.1
	.asciz	"cxl_h_download_facility(%#.16llx, %s(%#llx, %#llx), %#lx): %li\n"

	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_EBUSY,8,3                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"Unexpected return code: %lx"

	.no_dead_strip	_cxl_h_download_facility
.subsections_via_symbols
