	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ice_init_pkg                   ## -- Begin function ice_init_pkg
	.p2align	4, 0x90
_ice_init_pkg:                          ## @ice_init_pkg
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.1:
	testl	%edx, %edx
	je	LBB0_5
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	movl	%edx, %esi
	callq	_ice_verify_pkg
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	movl	%eax, %r12d
	movq	_ICE_DBG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
LBB0_4:
	movq	%r14, %rdi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_ice_debug
	jmp	LBB0_7
LBB0_5:
	movq	_ICE_ERR_PARAM@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r12d
LBB0_7:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ice_init_pkg_info
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.9:
	leaq	12(%r14), %rdi
	callq	_ice_chk_pkg_version
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.10:
	movq	_SEGMENT_TYPE_ICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_ice_find_seg_in_pkg
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ice_download_pkg
	movl	%eax, %r12d
	movq	_ICE_ERR_AQ_NO_WORK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_14
## %bb.12:
	movq	_ICE_DBG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ice_debug
	jmp	LBB0_15
LBB0_13:
	movq	_ICE_DBG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ice_debug
	movq	_ICE_ERR_CFG@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_14:
	testl	%r12d, %r12d
	jne	LBB0_17
LBB0_15:
	movq	%r14, %rdi
	callq	_ice_get_pkg_info
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	leaq	8(%r14), %rdi
	callq	_ice_chk_pkg_version
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_18
LBB0_17:
	movq	_ICE_DBG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_4
LBB0_18:
	movq	%r15, (%r14)
	movq	%r14, %rdi
	callq	_ice_init_pkg_regs
	movq	%r14, %rdi
	callq	_ice_fill_blk_tbls
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ICE_ERR_PARAM,4,2              ## @ICE_ERR_PARAM
	.comm	_ICE_DBG_INIT,4,2               ## @ICE_DBG_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to verify pkg (err: %d)\n"

	.comm	_SEGMENT_TYPE_ICE,4,2           ## @SEGMENT_TYPE_ICE
L_.str.1:                               ## @.str.1
	.asciz	"no ice segment in package.\n"

	.comm	_ICE_ERR_CFG,4,2                ## @ICE_ERR_CFG
	.comm	_ICE_ERR_AQ_NO_WORK,4,2         ## @ICE_ERR_AQ_NO_WORK
L_.str.2:                               ## @.str.2
	.asciz	"package previously loaded - no work.\n"

L_.str.3:                               ## @.str.3
	.asciz	"package load failed, %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ice_init_pkg                   ; -- Begin function ice_init_pkg
	.p2align	2
_ice_init_pkg:                          ; @ice_init_pkg
	.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
	cbz	x1, LBB0_4
; %bb.1:
	cbz	w2, LBB0_4
; %bb.2:
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	mov	x1, x2
	bl	_ice_verify_pkg
	cbz	w0, LBB0_7
; %bb.3:
	mov	x20, x0
Lloh0:
	adrp	x8, _ICE_DBG_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ICE_DBG_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	x20, [sp]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ice_debug
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x8, _ICE_ERR_PARAM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ICE_ERR_PARAM@GOTPAGEOFF]
LBB0_5:
	ldr	w20, [x8]
LBB0_6:
	mov	x0, x20
	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
LBB0_7:
	mov	x0, x19
	mov	x1, x21
	bl	_ice_init_pkg_info
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.8:
	add	x0, x19, #12
	bl	_ice_chk_pkg_version
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.9:
Lloh7:
	adrp	x8, _SEGMENT_TYPE_ICE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEGMENT_TYPE_ICE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_ice_find_seg_in_pkg
	cbz	x0, LBB0_12
; %bb.10:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_ice_download_pkg
Lloh10:
	adrp	x8, _ICE_ERR_AQ_NO_WORK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ICE_ERR_AQ_NO_WORK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_13
; %bb.11:
Lloh13:
	adrp	x8, _ICE_DBG_INIT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ICE_DBG_INIT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str.2@PAGE
Lloh17:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ice_debug
	b	LBB0_14
LBB0_12:
Lloh18:
	adrp	x8, _ICE_DBG_INIT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ICE_DBG_INIT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str.1@PAGE
Lloh22:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ice_debug
Lloh23:
	adrp	x8, _ICE_ERR_CFG@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ICE_ERR_CFG@GOTPAGEOFF]
	b	LBB0_5
LBB0_13:
	mov	x20, x0
	cbnz	w0, LBB0_16
LBB0_14:
	mov	x0, x19
	bl	_ice_get_pkg_info
	mov	x20, x0
	cbnz	w0, LBB0_16
; %bb.15:
	add	x0, x19, #8
	bl	_ice_chk_pkg_version
	mov	x20, x0
	cbz	w0, LBB0_17
LBB0_16:
Lloh25:
	adrp	x8, _ICE_DBG_INIT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ICE_DBG_INIT@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	str	x20, [sp]
Lloh28:
	adrp	x2, l_.str.3@PAGE
Lloh29:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_ice_debug
	b	LBB0_6
LBB0_17:
	str	x21, [x19]
	mov	x0, x19
	bl	_ice_init_pkg_regs
	mov	x0, x19
	bl	_ice_fill_blk_tbls
	b	LBB0_6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ICE_ERR_PARAM,4,2              ; @ICE_ERR_PARAM
	.comm	_ICE_DBG_INIT,4,2               ; @ICE_DBG_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to verify pkg (err: %d)\n"

	.comm	_SEGMENT_TYPE_ICE,4,2           ; @SEGMENT_TYPE_ICE
l_.str.1:                               ; @.str.1
	.asciz	"no ice segment in package.\n"

	.comm	_ICE_ERR_CFG,4,2                ; @ICE_ERR_CFG
	.comm	_ICE_ERR_AQ_NO_WORK,4,2         ; @ICE_ERR_AQ_NO_WORK
l_.str.2:                               ; @.str.2
	.asciz	"package previously loaded - no work.\n"

l_.str.3:                               ; @.str.3
	.asciz	"package load failed, %d\n"

.subsections_via_symbols
