	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function make_boot_var
_make_boot_var:                         ## @make_boot_var
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movl	%r8d, %r12d
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rax
	xorl	%edi, %edi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	cmpl	$-1, %ebx
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	callq	_make_boot_var_name
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
	callq	_make_next_boot_var_name
LBB0_3:
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	testq	%r15, %r15
	je	LBB0_6
LBB0_7:
	leaq	-88(%rbp), %rsi
	movq	%r15, %rdi
	callq	_efivar_unix_path_to_device_path
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_9:
	testq	%r14, %r14
	je	LBB0_12
## %bb.10:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_efivar_unix_path_to_device_path
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_13
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
	testq	%r15, %r15
	jne	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	jmp	LBB0_7
LBB0_12:
	movq	$0, -48(%rbp)
LBB0_13:
	movq	-88(%rbp), %rdi
	callq	_efidp_size
	movq	%rax, %rbx
	movq	_MAX_DP_LEN@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jbe	LBB0_15
## %bb.14:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_15:
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi
	callq	_efidp_size
	movq	%rax, %r14
	cmpq	(%r15), %rax
	jbe	LBB0_17
## %bb.16:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_17:
	leaq	(%r14,%rbx), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_malloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_19:
	movl	16(%rbp), %r15d
	movq	-88(%rbp), %rsi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	-48(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.20:
	movq	%r13, %rdi
	addq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_memcpy
LBB0_21:
	movq	_LOAD_OPTION_CATEGORY_BOOT@GOTPCREL(%rip), %rax
	testl	%r15d, %r15d
	je	LBB0_23
## %bb.22:
	movq	_LOAD_OPTION_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_23:
	orl	(%rax), %r15d
	movq	_MAX_LOADOPT_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_malloc
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_25
## %bb.24:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_25:
	movl	(%rbx), %r12d
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_26
## %bb.27:
	movq	%rbx, %rdi
	callq	_strlen
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	incq	%rax
	jmp	LBB0_28
LBB0_26:
	xorl	%eax, %eax
LBB0_28:
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movq	%r13, %rcx
	pushq	%rax
	pushq	%rbx
	callq	_create_loadopt
	addq	$16, %rsp
	movq	%rax, %rbx
	movq	_BAD_LENGTH@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_30
## %bb.29:
	leaq	L_.str.8(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_30:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_34
## %bb.31:
	movq	_EFI_GLOBAL_GUID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_COMMON_ATTRS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_efi_set_variable
	testl	%eax, %eax
	je	LBB0_33
## %bb.32:
	leaq	L_.str.9(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_33:
	movq	%r15, %rdi
	callq	_add_to_boot_order
LBB0_34:
	movl	$16, %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_36
## %bb.35:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_36:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r15, (%rbx)
	movq	_EFI_GLOBAL_GUID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_entries@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_efivars@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_LIST_INSERT_HEAD
	movq	%r14, %rdi
	callq	_free
	movq	%r13, %rdi
	callq	_free
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bootvar creation"

L_.str.1:                               ## @.str.1
	.asciz	"Must specify boot loader"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot translate unix loader path '%s' to UEFI"

L_.str.3:                               ## @.str.3
	.asciz	"Cannot translate unix kernel path '%s' to UEFI"

	.comm	_MAX_DP_LEN,8,3                 ## @MAX_DP_LEN
L_.str.4:                               ## @.str.4
	.asciz	"Loader path too long."

L_.str.5:                               ## @.str.5
	.asciz	"Kernel path too long."

L_.str.6:                               ## @.str.6
	.asciz	"Can't allocate memory for new device paths"

	.comm	_LOAD_OPTION_CATEGORY_BOOT,4,2  ## @LOAD_OPTION_CATEGORY_BOOT
	.comm	_LOAD_OPTION_ACTIVE,4,2         ## @LOAD_OPTION_ACTIVE
	.comm	_MAX_LOADOPT_LEN,4,2            ## @MAX_LOADOPT_LEN
L_.str.7:                               ## @.str.7
	.asciz	"malloc"

	.comm	_BAD_LENGTH,8,3                 ## @BAD_LENGTH
L_.str.8:                               ## @.str.8
	.asciz	"Can't create loadopt"

	.comm	_EFI_GLOBAL_GUID,4,2            ## @EFI_GLOBAL_GUID
	.comm	_COMMON_ATTRS,4,2               ## @COMMON_ATTRS
L_.str.9:                               ## @.str.9
	.asciz	"efi_set_variable"

	.comm	_efivars,4,2                    ## @efivars
	.comm	_entries,4,2                    ## @entries
	.no_dead_strip	_make_boot_var
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function make_boot_var
_make_boot_var:                         ; @make_boot_var
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x23, x6
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x24, x2
	mov	x25, x1
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	cmn	w19, #1
	b.eq	LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_make_boot_var_name
	mov	x19, x0
	cbz	x0, LBB0_9
LBB0_2:
	cbz	x25, LBB0_10
LBB0_3:
	add	x1, sp, #24
	mov	x0, x25
	bl	_efivar_unix_path_to_device_path
	cbz	x0, LBB0_5
; %bb.4:
	str	x25, [sp]
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_5:
	cbz	x24, LBB0_11
; %bb.6:
	add	x1, sp, #16
	mov	x0, x24
	bl	_efivar_unix_path_to_device_path
	cbz	x0, LBB0_12
; %bb.7:
	str	x24, [sp]
Lloh2:
	adrp	x1, l_.str.3@PAGE
Lloh3:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
	b	LBB0_12
LBB0_8:
	bl	_make_next_boot_var_name
	mov	x19, x0
	cbnz	x0, LBB0_2
LBB0_9:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
	cbnz	x25, LBB0_3
LBB0_10:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
	b	LBB0_3
LBB0_11:
	str	xzr, [sp, #16]
LBB0_12:
	ldr	x0, [sp, #24]
	bl	_efidp_size
	mov	x26, x0
Lloh8:
	adrp	x24, _MAX_DP_LEN@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MAX_DP_LEN@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ls	LBB0_14
; %bb.13:
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_14:
	ldr	x0, [sp, #16]
	bl	_efidp_size
	mov	x27, x0
	ldr	x8, [x24]
	cmp	x0, x8
	b.ls	LBB0_16
; %bb.15:
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_16:
	add	x25, x27, x26
	mov	x0, x25
	bl	_malloc
	mov	x24, x0
	cbnz	x0, LBB0_18
; %bb.17:
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_18:
	ldr	x1, [sp, #24]
	mov	x0, x24
	mov	x2, x26
	bl	_memcpy
	ldr	x1, [sp, #16]
	cbz	x1, LBB0_20
; %bb.19:
	add	x0, x24, x26
	mov	x2, x27
	bl	_memcpy
LBB0_20:
Lloh16:
	adrp	x8, _LOAD_OPTION_CATEGORY_BOOT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LOAD_OPTION_CATEGORY_BOOT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _LOAD_OPTION_ACTIVE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _LOAD_OPTION_ACTIVE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w23, #0
	csel	w9, wzr, w9, eq
	orr	w26, w9, w8
Lloh22:
	adrp	x27, _MAX_LOADOPT_LEN@GOTPAGE
Lloh23:
	ldr	x27, [x27, _MAX_LOADOPT_LEN@GOTPAGEOFF]
	ldr	w0, [x27]
	bl	_malloc
	mov	x23, x0
	cbz	x0, LBB0_23
; %bb.21:
	ldr	w27, [x27]
	cbz	x21, LBB0_24
LBB0_22:
	mov	x0, x21
	bl	_strlen
	add	x7, x0, #1
	b	LBB0_25
LBB0_23:
Lloh24:
	adrp	x1, l_.str.7@PAGE
Lloh25:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_err
	ldr	w27, [x27]
	cbnz	x21, LBB0_22
LBB0_24:
	mov	x7, #0
LBB0_25:
	mov	x0, x23
	mov	x1, x27
	mov	x2, x26
	mov	x3, x24
	mov	x4, x25
	mov	x5, x22
	mov	x6, x21
	bl	_create_loadopt
	mov	x21, x0
Lloh26:
	adrp	x8, _BAD_LENGTH@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BAD_LENGTH@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_27
; %bb.26:
Lloh29:
	adrp	x1, l_.str.8@PAGE
Lloh30:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_27:
Lloh31:
	adrp	x22, _EFI_GLOBAL_GUID@GOTPAGE
Lloh32:
	ldr	x22, [x22, _EFI_GLOBAL_GUID@GOTPAGEOFF]
	cbnz	w20, LBB0_31
; %bb.28:
	ldr	w0, [x22]
Lloh33:
	adrp	x8, _COMMON_ATTRS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _COMMON_ATTRS@GOTPAGEOFF]
Lloh35:
	ldr	w4, [x8]
	mov	x1, x19
	mov	x2, x23
	mov	x3, x21
	bl	_efi_set_variable
	cbz	w0, LBB0_30
; %bb.29:
Lloh36:
	adrp	x1, l_.str.9@PAGE
Lloh37:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_30:
	mov	x0, x19
	bl	_add_to_boot_order
LBB0_31:
	mov	w0, #16
	bl	_malloc
	mov	x20, x0
	cbnz	x0, LBB0_33
; %bb.32:
Lloh38:
	adrp	x1, l_.str.7@PAGE
Lloh39:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_33:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	x19, [x20]
	ldr	w8, [x22]
	str	w8, [x20, #8]
Lloh40:
	adrp	x8, _entries@GOTPAGE
Lloh41:
	ldr	x8, [x8, _entries@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
Lloh43:
	adrp	x0, _efivars@GOTPAGE
Lloh44:
	ldr	x0, [x0, _efivars@GOTPAGEOFF]
	mov	x1, x20
	bl	_LIST_INSERT_HEAD
	mov	x0, x23
	bl	_free
	mov	x0, x24
	bl	_free
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bootvar creation"

l_.str.1:                               ; @.str.1
	.asciz	"Must specify boot loader"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot translate unix loader path '%s' to UEFI"

l_.str.3:                               ; @.str.3
	.asciz	"Cannot translate unix kernel path '%s' to UEFI"

	.comm	_MAX_DP_LEN,8,3                 ; @MAX_DP_LEN
l_.str.4:                               ; @.str.4
	.asciz	"Loader path too long."

l_.str.5:                               ; @.str.5
	.asciz	"Kernel path too long."

l_.str.6:                               ; @.str.6
	.asciz	"Can't allocate memory for new device paths"

	.comm	_LOAD_OPTION_CATEGORY_BOOT,4,2  ; @LOAD_OPTION_CATEGORY_BOOT
	.comm	_LOAD_OPTION_ACTIVE,4,2         ; @LOAD_OPTION_ACTIVE
	.comm	_MAX_LOADOPT_LEN,4,2            ; @MAX_LOADOPT_LEN
l_.str.7:                               ; @.str.7
	.asciz	"malloc"

	.comm	_BAD_LENGTH,8,3                 ; @BAD_LENGTH
l_.str.8:                               ; @.str.8
	.asciz	"Can't create loadopt"

	.comm	_EFI_GLOBAL_GUID,4,2            ; @EFI_GLOBAL_GUID
	.comm	_COMMON_ATTRS,4,2               ; @COMMON_ATTRS
l_.str.9:                               ; @.str.9
	.asciz	"efi_set_variable"

	.comm	_efivars,4,2                    ; @efivars
	.comm	_entries,4,2                    ; @entries
	.no_dead_strip	_make_boot_var
.subsections_via_symbols
