	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getbootfile
_getbootfile:                           ## @getbootfile
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r14d
	movq	_getbootfile.name(%rip), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_free
	movq	$0, _getbootfile.name(%rip)
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_default_bootfiles@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_4:
	testq	%rbx, %rbx
	setne	%cl
	testl	%r14d, %r14d
	jle	LBB0_8
## %bb.5:
	testq	%rbx, %rbx
	je	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$59, %esi
	callq	_strchr
	leaq	1(%rax), %rbx
	testq	%rax, %rax
	setne	%cl
	cmoveq	%rax, %rbx
	cmpl	$2, %r14d
	jb	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	decl	%r14d
	testb	%cl, %cl
	jne	LBB0_6
LBB0_8:
	testb	%cl, %cl
	je	LBB0_14
## %bb.9:
	movq	%rbx, %rdi
	movl	$59, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, %r14
	subq	%rbx, %r14
	jmp	LBB0_12
LBB0_11:
	movq	%rbx, %rdi
	callq	_strlen
	movq	%rax, %r14
LBB0_12:
	leaq	1(%r14), %rdi
	callq	_malloc
	movq	%rax, _getbootfile.name(%rip)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_strncpy
	movq	_getbootfile.name(%rip), %rax
	movb	$0, (%rax,%r14)
	cmpb	$0, (%rax)
	jne	LBB0_15
## %bb.13:
	movq	%rax, %rdi
	callq	_free
	movq	$0, _getbootfile.name(%rip)
LBB0_14:
	xorl	%eax, %eax
LBB0_15:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_getbootfile.name,8,3 ## @getbootfile.name
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bootfile"

	.comm	_default_bootfiles,8,3          ## @default_bootfiles
	.no_dead_strip	_getbootfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getbootfile
_getbootfile:                           ; @getbootfile
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
	adrp	x21, _getbootfile.name@PAGE
	ldr	x0, [x21, _getbootfile.name@PAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_free
	str	xzr, [x21, _getbootfile.name@PAGEOFF]
LBB0_2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
Lloh2:
	adrp	x8, _default_bootfiles@GOTPAGE
Lloh3:
	ldr	x8, [x8, _default_bootfiles@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x19, x8, x0, eq
	cmp	x19, #0
	cset	w8, ne
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.3:
	cbz	x19, LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #59
	bl	_strchr
	cmp	x0, #0
	cset	w8, ne
	csinc	x19, xzr, x0, eq
	cmp	w20, #2
	b.lo	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w20, w20, #1
	tbnz	w8, #0, LBB0_4
LBB0_6:
	cbz	w8, LBB0_9
; %bb.7:
	mov	x0, x19
	mov	w1, #59
	bl	_strchr
	cbz	x0, LBB0_10
; %bb.8:
	sub	x20, x0, x19
	b	LBB0_11
LBB0_9:
	mov	x0, #0
	b	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_strlen
	mov	x20, x0
LBB0_11:
	add	x0, x20, #1
	bl	_malloc
	str	x0, [x21, _getbootfile.name@PAGEOFF]
	mov	x1, x19
	mov	x2, x20
	bl	_strncpy
	ldr	x0, [x21, _getbootfile.name@PAGEOFF]
	strb	wzr, [x0, x20]
	ldrb	w8, [x0]
	cbnz	w8, LBB0_13
; %bb.12:
	bl	_free
	mov	x0, #0
	str	xzr, [x21, _getbootfile.name@PAGEOFF]
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_getbootfile.name,8,3 ; @getbootfile.name
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bootfile"

	.comm	_default_bootfiles,8,3          ; @default_bootfiles
	.no_dead_strip	_getbootfile
.subsections_via_symbols
