	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function efi_verify_staging_size
_efi_verify_staging_size:               ## @efi_verify_staging_size
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -48(%rbp)
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %r13
	leaq	-68(%rbp), %r14
	movq	_EFI_BUFFER_TOO_SMALL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	leaq	-72(%rbp), %rdx
	movq	%r13, %rcx
	movq	%r14, %r8
	callq	*(%rax)
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_EFI_ERROR
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	(%r12), %r15d
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_free
	movl	-44(%rbp), %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	addl	-48(%rbp), %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_1
## %bb.5:
	leaq	L_str.4(%rip), %rdi
	callq	_puts
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_6:
	movl	-48(%rbp), %eax
	cltd
	idivl	-44(%rbp)
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jle	LBB0_12
## %bb.7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %r14d
	movl	$1, %r12d
	movq	%rbx, %rax
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %esi
	movq	%rax, %rdi
	callq	_NextMemoryDescriptor
	incl	%r12d
	addl	$-1, %r14d
	jae	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %r13
	movq	_KERNEL_PHYSICAL_BASE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, %rdx
	subq	%r13, %rdx
	jl	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movslq	8(%rax), %r15
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	imulq	%r15, %rsi
	addq	%rsi, %r13
	cmpq	%r13, %rcx
	jge	LBB0_10
## %bb.11:
	movq	_EFI_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarq	%cl, %rdx
	subq	%rdx, %r15
	je	LBB0_12
## %bb.13:
	movl	-44(%rbp), %esi
	movq	%rax, %rdi
	callq	_NextMemoryDescriptor
	cmpl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	jge	LBB0_19
## %bb.14:
	movq	_EfiConventionalMemory@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rax), %rcx
	cmpq	(%r12), %rcx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_EfiLoaderData@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_19
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	cmpq	%r13, (%rax)
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=1
	movslq	8(%rax), %rcx
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	%rcx, %rdx
	addq	%rdx, %r13
	addq	%rcx, %r15
	movl	-44(%rbp), %esi
	movq	%rax, %rdi
	callq	_NextMemoryDescriptor
	decl	%r14d
	jne	LBB0_15
LBB0_19:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rsi
	cmpq	%r15, %rsi
	jbe	LBB0_21
## %bb.20:
	leaq	L_.str.3(%rip), %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_printf
	movq	%r15, (%r14)
	jmp	LBB0_21
LBB0_3:
	movl	%r15d, %edi
	callq	_EFI_ERROR_CODE
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_21
LBB0_12:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_21:
	movq	%rbx, %rdi
	callq	_free
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BS,8,3                         ## @BS
	.comm	_EFI_BUFFER_TOO_SMALL,4,2       ## @EFI_BUFFER_TOO_SMALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't read memory map: %lu\n"

	.comm	_EFI_PAGE_SIZE,4,2              ## @EFI_PAGE_SIZE
	.comm	_KERNEL_PHYSICAL_BASE,8,3       ## @KERNEL_PHYSICAL_BASE
	.comm	_EFI_PAGE_SHIFT,8,3             ## @EFI_PAGE_SHIFT
	.comm	_EfiConventionalMemory,8,3      ## @EfiConventionalMemory
	.comm	_EfiLoaderData,8,3              ## @EfiLoaderData
L_.str.3:                               ## @.str.3
	.asciz	"Staging area's size is reduced: %ld -> %ld!\n"

L_str:                                  ## @str
	.asciz	"Can't find valid memory map for staging area!"

L_str.4:                                ## @str.4
	.asciz	"Unable to allocate memory"

	.no_dead_strip	_efi_verify_staging_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function efi_verify_staging_size
_efi_verify_staging_size:               ; @efi_verify_staging_size
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x20, x0
	mov	x19, #0
	str	wzr, [sp, #28]
Lloh0:
	adrp	x22, _BS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BS@GOTPAGEOFF]
	mov	w23, #10
Lloh2:
	adrp	x24, _EFI_BUFFER_TOO_SMALL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EFI_BUFFER_TOO_SMALL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x8, [x8]
	add	x0, sp, #28
	add	x2, sp, #24
	add	x3, sp, #20
	add	x4, sp, #16
	mov	x1, x19
	blr	x8
	mov	x21, x0
	bl	_EFI_ERROR
	cbz	w0, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x24]
	cmp	w21, w8
	b.ne	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_free
	ldr	w8, [sp, #28]
	ldr	w9, [sp, #20]
	madd	w0, w9, w23, w8
	bl	_malloc
	mov	x19, x0
	cbnz	x0, LBB0_1
; %bb.4:
Lloh4:
	adrp	x0, l_str.4@PAGE
Lloh5:
	add	x0, x0, l_str.4@PAGEOFF
	b	LBB0_19
LBB0_5:
	ldr	w8, [sp, #28]
	ldr	w9, [sp, #20]
	sdiv	w25, w8, w9
	subs	w21, w25, #1
	b.lt	LBB0_18
; %bb.6:
	mov	w26, #1
Lloh6:
	adrp	x22, _EFI_PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _EFI_PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	adrp	x23, _KERNEL_PHYSICAL_BASE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _KERNEL_PHYSICAL_BASE@GOTPAGEOFF]
	mov	x0, x19
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x0]
	ldrsw	x8, [x0, #8]
	ldrsw	x10, [x22]
	madd	x24, x10, x8, x9
	ldr	x10, [x23]
	subs	x9, x10, x9
	ccmp	x10, x24, #0, ge
	b.lt	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [sp, #20]
	bl	_NextMemoryDescriptor
	sub	w21, w21, #1
	add	w26, w26, #1
	cmn	w21, #1
	b.ne	LBB0_7
	b	LBB0_18
LBB0_9:
	mov	x0, x21
	bl	_EFI_ERROR_CODE
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	b	LBB0_20
LBB0_10:
Lloh12:
	adrp	x10, _EFI_PAGE_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _EFI_PAGE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	asr	x9, x9, x10
	subs	x23, x8, x9
	b.eq	LBB0_18
; %bb.11:
	ldr	w1, [sp, #20]
	bl	_NextMemoryDescriptor
	cmp	w26, w25
	b.ge	LBB0_16
; %bb.12:
Lloh15:
	adrp	x25, _EfiConventionalMemory@GOTPAGE
Lloh16:
	ldr	x25, [x25, _EfiConventionalMemory@GOTPAGEOFF]
Lloh17:
	adrp	x26, _EfiLoaderData@GOTPAGE
Lloh18:
	ldr	x26, [x26, _EfiLoaderData@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x0, #16]
	ldr	x9, [x25]
	ldr	x10, [x26]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x0]
	cmp	x8, x24
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldrsw	x8, [x0, #8]
	ldrsw	x9, [x22]
	madd	x24, x9, x8, x24
	add	x23, x23, x8
	ldr	w1, [sp, #20]
	bl	_NextMemoryDescriptor
	subs	w21, w21, #1
	b.ne	LBB0_13
LBB0_16:
	ldr	x8, [x20]
	cmp	x8, x23
	b.ls	LBB0_20
; %bb.17:
	stp	x8, x23, [sp]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	str	x23, [x20]
	b	LBB0_20
LBB0_18:
Lloh21:
	adrp	x0, l_str@PAGE
Lloh22:
	add	x0, x0, l_str@PAGEOFF
LBB0_19:
	bl	_puts
LBB0_20:
	mov	x0, x19
	bl	_free
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_BS,8,3                         ; @BS
	.comm	_EFI_BUFFER_TOO_SMALL,4,2       ; @EFI_BUFFER_TOO_SMALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't read memory map: %lu\n"

	.comm	_EFI_PAGE_SIZE,4,2              ; @EFI_PAGE_SIZE
	.comm	_KERNEL_PHYSICAL_BASE,8,3       ; @KERNEL_PHYSICAL_BASE
	.comm	_EFI_PAGE_SHIFT,8,3             ; @EFI_PAGE_SHIFT
	.comm	_EfiConventionalMemory,8,3      ; @EfiConventionalMemory
	.comm	_EfiLoaderData,8,3              ; @EfiLoaderData
l_.str.3:                               ; @.str.3
	.asciz	"Staging area's size is reduced: %ld -> %ld!\n"

l_str:                                  ; @str
	.asciz	"Can't find valid memory map for staging area!"

l_str.4:                                ; @str.4
	.asciz	"Unable to allocate memory"

	.no_dead_strip	_efi_verify_staging_size
.subsections_via_symbols
