	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shadow_image
_shadow_image:                          ## @shadow_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r12
	leaq	8(%rdi), %r13
	movq	(%rcx), %rax
	cmpq	$0, 24(%rax)
	je	LBB0_4
## %bb.1:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	movl	8(%r15), %edi
	callq	*(%rax)
	movl	%eax, %r8d
	movl	%eax, -48(%rbp)
	movl	$1, -44(%rbp)
	xorl	%ecx, %ecx
	xorl	%edx, %edx
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_nvkm_debug
	movl	-48(%rbp), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_shadow_fetch
	testl	%eax, %eax
	je	LBB0_3
## %bb.10:
	movl	$4, %r14d
	cmpl	$0, -52(%rbp)
	jne	LBB0_15
## %bb.11:
	movq	(%r15), %rax
	cmpl	$0, 16(%rax)
	je	LBB0_12
LBB0_15:
	cmpl	$0, -44(%rbp)
	jne	LBB0_17
## %bb.16:
	incl	%ebx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	addl	-48(%rbp), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r15, %rcx
	callq	_shadow_image
	addl	%eax, %r14d
	jmp	LBB0_17
LBB0_4:
	leal	4096(%r14), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_shadow_fetch
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_nvbios_image
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	movl	-48(%rbp), %r8d
	jmp	LBB0_2
LBB0_3:
	movl	-56(%rbp), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	xorl	%r14d, %r14d
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	movl	%ebx, %edx
LBB0_9:
	xorl	%eax, %eax
	callq	_nvkm_debug
LBB0_17:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movslq	-56(%rbp), %rdi
	shlq	$2, %rdi
	addq	(%r12), %rdi
	movl	-48(%rbp), %esi
	callq	_nvbios_checksum
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	movl	-56(%rbp), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_nvkm_debug
	movq	(%r15), %rax
	cmpl	$0, 12(%rax)
	jne	LBB0_17
## %bb.14:
	cmpl	$1, 8(%rax)
	movl	$3, %r14d
	sbbl	$0, %r14d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%08x: header fetch failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"image %d invalid\n"

L_.str.2:                               ## @.str.2
	.asciz	"%08x: type %02x, %d bytes\n"

L_.str.3:                               ## @.str.3
	.asciz	"%08x: fetch failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"%08x: checksum failed\n"

	.no_dead_strip	_shadow_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shadow_image
_shadow_image:                          ; @shadow_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	add	x23, x0, #8
	ldr	x8, [x3]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_7
; %bb.1:
	str	xzr, [sp, #16]
	ldr	x8, [x8]
	ldr	w0, [x19, #8]
	blr	x8
                                        ; kill: def $w0 killed $w0 def $x0
	mov	w8, #0
	mov	w2, #0
	mov	w9, #1
	stp	w0, w9, [sp, #24]
LBB0_2:
	stp	x8, x0, [sp]
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_nvkm_debug
	ldr	w2, [sp, #24]
	mov	x0, x22
	mov	x1, x19
	bl	_shadow_fetch
	cbz	w0, LBB0_10
; %bb.3:
	ldr	w8, [sp, #20]
	cbnz	w8, LBB0_5
; %bb.4:
	ldr	x8, [x19]
	ldr	w8, [x8, #16]
	cbz	w8, LBB0_16
LBB0_5:
	mov	w23, #4
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_15
LBB0_6:
	add	w1, w21, #1
	ldr	w8, [sp, #24]
	add	w2, w8, w20
	mov	x0, x22
	mov	x3, x19
	bl	_shadow_image
	add	w23, w0, w23
	b	LBB0_15
LBB0_7:
	add	w2, w20, #1, lsl #12            ; =4096
	mov	x0, x22
	mov	x1, x19
	bl	_shadow_fetch
	cbz	w0, LBB0_11
; %bb.8:
	add	x2, sp, #16
	mov	x0, x22
	mov	x1, x21
	bl	_nvbios_image
	cbz	w0, LBB0_12
; %bb.9:
	ldp	w2, w8, [sp, #16]
	ldr	w0, [sp, #24]
	b	LBB0_2
LBB0_10:
	ldr	w2, [sp, #16]
Lloh2:
	adrp	x1, l_.str.3@PAGE
Lloh3:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
	b	LBB0_13
LBB0_11:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x20
	b	LBB0_13
LBB0_12:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x2, x21
LBB0_13:
	bl	_nvkm_debug
LBB0_14:
	mov	w23, #0
LBB0_15:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_16:
	ldr	x8, [x22]
	ldrsw	x9, [sp, #16]
	ldr	w1, [sp, #24]
	add	x0, x8, x9, lsl #2
	bl	_nvbios_checksum
	cbz	w0, LBB0_5
; %bb.17:
	ldr	w2, [sp, #16]
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x23
	bl	_nvkm_debug
	ldr	x8, [x19]
	ldr	w9, [x8, #12]
	cbnz	w9, LBB0_14
; %bb.18:
	ldr	w8, [x8, #8]
	cmp	w8, #0
	mov	w8, #2
	cinc	w23, w8, ne
	ldr	w8, [sp, #28]
	cbnz	w8, LBB0_15
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%08x: header fetch failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"image %d invalid\n"

l_.str.2:                               ; @.str.2
	.asciz	"%08x: type %02x, %d bytes\n"

l_.str.3:                               ; @.str.3
	.asciz	"%08x: fetch failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"%08x: checksum failed\n"

	.no_dead_strip	_shadow_image
.subsections_via_symbols
