	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efi_get_next_variable_name     ## -- Begin function efi_get_next_variable_name
	.p2align	4, 0x90
_efi_get_next_variable_name:            ## @efi_get_next_variable_name
	.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	%rsi, %r12
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_efi_open_dev
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	cmpq	$0, _efi_get_next_variable_name.buf(%rip)
	jne	LBB0_4
## %bb.3:
	movq	_efi_get_next_variable_name.buflen(%rip), %rdi
	addq	$8, %rdi
	callq	_malloc
	movq	%rax, _efi_get_next_variable_name.buf(%rip)
LBB0_4:
	leaq	-64(%rbp), %rbx
	movq	_efi_fd@GOTPCREL(%rip), %r15
	movq	_EFIIOC_VAR_NEXT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_efi_var_reset
	movq	_efi_get_next_variable_name.buf(%rip), %rax
	movq	%rax, -48(%rbp)
	movq	_efi_get_next_variable_name.buflen(%rip), %rcx
	movq	%rcx, -64(%rbp)
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	-48(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	callq	_utf8_to_ucs2
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	$0, (%rax)
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r15), %edi
	movl	(%r13), %esi
	movq	%rbx, %rdx
	callq	_ioctl
	testl	%eax, %eax
	jne	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, -48(%rbp)
	jne	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_efi_get_next_variable_name.buf(%rip), %rdi
	movl	-64(%rbp), %esi
	addl	$8, %esi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rcx
	movq	%rcx, _efi_get_next_variable_name.buflen(%rip)
	movq	%rax, _efi_get_next_variable_name.buf(%rip)
	jmp	LBB0_5
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_20
LBB0_16:
	testl	%eax, %eax
	jne	LBB0_13
## %bb.17:
	movq	(%r12), %rdi
	callq	_free
	movq	$0, (%r12)
	movq	-64(%rbp), %rax
	movq	-48(%rbp), %rdi
	andq	$-8, %rax
	movq	$0, (%rdi,%rax)
	movq	%r12, %rsi
	callq	_ucs2_to_utf8
	testl	%eax, %eax
	jne	LBB0_13
## %bb.18:
	movl	-56(%rbp), %eax
	movl	%eax, _efi_get_next_variable_name.retguid(%rip)
	leaq	_efi_get_next_variable_name.retguid(%rip), %rax
	movq	%rax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	$-1, %eax
LBB0_13:
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_ENOENT@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_19
## %bb.14:
	movq	$0, (%rcx)
	movq	(%r12), %rdi
	callq	_free
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_19:
	movl	%eax, %edi
	callq	_rv_to_linux_rv
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_efi_get_next_variable_name.buf,8,3 ## @efi_get_next_variable_name.buf
	.section	__DATA,__data
	.p2align	3                               ## @efi_get_next_variable_name.buflen
_efi_get_next_variable_name.buflen:
	.quad	2048                            ## 0x800

.zerofill __DATA,__bss,_efi_get_next_variable_name.retguid,4,2 ## @efi_get_next_variable_name.retguid
	.comm	_efi_fd,4,2                     ## @efi_fd
	.comm	_EFIIOC_VAR_NEXT,4,2            ## @EFIIOC_VAR_NEXT
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efi_get_next_variable_name     ; -- Begin function efi_get_next_variable_name
	.p2align	2
_efi_get_next_variable_name:            ; @efi_get_next_variable_name
	.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	x19, x1
	mov	x20, x0
	bl	_efi_open_dev
	cmn	w0, #1
	b.eq	LBB0_18
; %bb.1:
	adrp	x22, _efi_get_next_variable_name.buf@PAGE
	ldr	x8, [x22, _efi_get_next_variable_name.buf@PAGEOFF]
	adrp	x23, _efi_get_next_variable_name.buflen@PAGE
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x23, _efi_get_next_variable_name.buflen@PAGEOFF]
	add	x0, x8, #8
	bl	_malloc
	str	x0, [x22, _efi_get_next_variable_name.buf@PAGEOFF]
LBB0_3:
	add	x8, sp, #8
	add	x21, x8, #16
Lloh0:
	adrp	x24, _efi_fd@GOTPAGE
Lloh1:
	ldr	x24, [x24, _efi_fd@GOTPAGEOFF]
Lloh2:
	adrp	x25, _EFIIOC_VAR_NEXT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _EFIIOC_VAR_NEXT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	bl	_efi_var_reset
	ldr	x8, [x22, _efi_get_next_variable_name.buf@PAGEOFF]
	ldr	x9, [x23, _efi_get_next_variable_name.buflen@PAGEOFF]
	str	x8, [sp, #24]
	str	x9, [sp, #8]
	ldr	x0, [x19]
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, sp
	mov	x1, x21
	bl	_utf8_to_ucs2
	cbnz	w0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	ldr	w8, [x8]
	str	w8, [sp, #16]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [x8]
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x24]
	ldr	w1, [x25]
	add	x2, sp, #8
	bl	_ioctl
	ldr	x8, [sp, #24]
	cmp	w0, #0
	ccmp	x8, #0, #0, eq
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x22, _efi_get_next_variable_name.buf@PAGEOFF]
	ldr	w8, [sp, #8]
	add	w1, w8, #8
	bl	_realloc
	cbz	x0, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	str	x8, [x23, _efi_get_next_variable_name.buflen@PAGEOFF]
	str	x0, [x22, _efi_get_next_variable_name.buf@PAGEOFF]
	b	LBB0_4
LBB0_11:
	cbnz	w0, LBB0_15
; %bb.12:
	ldr	x0, [x19]
	bl	_free
	str	xzr, [x19]
	ldr	x0, [sp, #24]
	ldr	x8, [sp, #8]
	and	x8, x8, #0xfffffffffffffff8
	str	xzr, [x0, x8]
	mov	x1, x19
	bl	_ucs2_to_utf8
	cbnz	w0, LBB0_15
; %bb.13:
	ldr	w8, [sp, #16]
	adrp	x9, _efi_get_next_variable_name.retguid@PAGE
	str	w8, [x9, _efi_get_next_variable_name.retguid@PAGEOFF]
Lloh4:
	adrp	x8, _efi_get_next_variable_name.retguid@PAGE
Lloh5:
	add	x8, x8, _efi_get_next_variable_name.retguid@PAGEOFF
	str	x8, [x20]
	b	LBB0_17
LBB0_14:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _errno@GOTPAGE
Lloh10:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh11:
	str	x8, [x9]
	mov	w0, #-1
LBB0_15:
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	ldr	x9, [x8]
Lloh14:
	adrp	x10, _ENOENT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _ENOENT@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.16:
	str	xzr, [x8]
	ldr	x0, [x19]
	bl	_free
	mov	w0, #0
	b	LBB0_18
LBB0_17:
	bl	_rv_to_linux_rv
LBB0_18:
	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 AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_efi_get_next_variable_name.buf,8,3 ; @efi_get_next_variable_name.buf
	.section	__DATA,__data
	.p2align	3                               ; @efi_get_next_variable_name.buflen
_efi_get_next_variable_name.buflen:
	.quad	2048                            ; 0x800

.zerofill __DATA,__bss,_efi_get_next_variable_name.retguid,4,2 ; @efi_get_next_variable_name.retguid
	.comm	_efi_fd,4,2                     ; @efi_fd
	.comm	_EFIIOC_VAR_NEXT,4,2            ; @EFIIOC_VAR_NEXT
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
.subsections_via_symbols
