	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_loader_env
_read_loader_env:                       ## @read_loader_env
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	$0, -28(%rbp)
	leaq	-28(%rbp), %rdx
	xorl	%esi, %esi
	callq	_efi_freebsd_getenv
	movq	_EFI_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.1:
	movl	-28(%rbp), %edi
	incl	%edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %rbx
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_efi_freebsd_getenv
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_efi_freebsd_delenv
LBB0_6:
	movslq	-28(%rbp), %rax
	movb	$0, (%rbx,%rax)
	jmp	LBB0_9
LBB0_8:
	testq	%rbx, %rbx
	je	LBB0_10
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_printf
	movq	_boot_img@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_parse_loader_efi_config
	jmp	LBB0_10
LBB0_7:
	movl	-28(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_10
LBB0_3:
	movq	%rbx, %rdi
	callq	_free
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_printf
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFI_BUFFER_TOO_SMALL,8,3       ## @EFI_BUFFER_TOO_SMALL
	.comm	_EFI_SUCCESS,8,3                ## @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't fetch FreeBSD::%s we know is there\n"

L_.str.1:                               ## @.str.1
	.asciz	"Can't allocate %d bytes to fetch FreeBSD::%s env var\n"

L_.str.2:                               ## @.str.2
	.asciz	"    Reading loader env vars from %s\n"

	.comm	_boot_img,8,3                   ## @boot_img
	.no_dead_strip	_read_loader_env
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_loader_env
_read_loader_env:                       ; @read_loader_env
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	wzr, [sp, #28]
	add	x2, sp, #28
	mov	x1, #0
	bl	_efi_freebsd_getenv
Lloh0:
	adrp	x8, _EFI_BUFFER_TOO_SMALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFI_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.1:
	ldr	w8, [sp, #28]
	add	w0, w8, #1
	bl	_malloc
	cbz	x0, LBB0_8
; %bb.2:
	mov	x19, x0
	add	x2, sp, #28
	mov	x0, x20
	mov	x1, x19
	bl	_efi_freebsd_getenv
Lloh3:
	adrp	x8, _EFI_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFI_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.3:
	cbz	w21, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_efi_freebsd_delenv
LBB0_5:
	ldrsw	x8, [sp, #28]
	strb	wzr, [x19, x8]
	b	LBB0_7
LBB0_6:
	cbz	x19, LBB0_11
LBB0_7:
	str	x19, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
Lloh8:
	adrp	x8, _boot_img@GOTPAGE
Lloh9:
	ldr	x8, [x8, _boot_img@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_parse_loader_efi_config
	b	LBB0_11
LBB0_8:
	ldr	w8, [sp, #28]
	stp	x8, x20, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_free
	str	x20, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
LBB0_10:
	bl	_printf
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EFI_BUFFER_TOO_SMALL,8,3       ; @EFI_BUFFER_TOO_SMALL
	.comm	_EFI_SUCCESS,8,3                ; @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't fetch FreeBSD::%s we know is there\n"

l_.str.1:                               ; @.str.1
	.asciz	"Can't allocate %d bytes to fetch FreeBSD::%s env var\n"

l_.str.2:                               ; @.str.2
	.asciz	"    Reading loader env vars from %s\n"

	.comm	_boot_img,8,3                   ; @boot_img
	.no_dead_strip	_read_loader_env
.subsections_via_symbols
