	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_device_open               ## -- Begin function grub_device_open
	.p2align	4, 0x90
_grub_device_open:                      ## @grub_device_open
	.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
	movq	%rdi, %r14
	testq	%rdi, %rdi
	jne	LBB0_5
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_grub_env_get
	movq	%rax, %r14
	cmpb	$0, (%rax)
	je	LBB0_2
LBB0_5:
	movl	$16, %edi
	callq	_grub_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_grub_disk_open
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	movq	%rax, 8(%rbx)
	movq	$0, (%rbx)
	jmp	LBB0_8
LBB0_2:
	movq	_GRUB_ERR_BAD_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_grub_error
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%rbx, %rdi
	callq	_grub_free
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"root"

	.comm	_GRUB_ERR_BAD_DEVICE,4,2        ## @GRUB_ERR_BAD_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"no device is set"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_device_open               ; -- Begin function grub_device_open
	.p2align	2
_grub_device_open:                      ; @grub_device_open
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_grub_env_get
	mov	x20, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_5
LBB0_2:
	mov	w0, #16
	bl	_grub_malloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_grub_disk_open
	cbz	x0, LBB0_6
; %bb.4:
	stp	xzr, x0, [x19]
	b	LBB0_7
LBB0_5:
Lloh2:
	adrp	x8, _GRUB_ERR_BAD_DEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GRUB_ERR_BAD_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_grub_error
	mov	x19, #0
LBB0_6:
	mov	x0, x19
	bl	_grub_free
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"root"

	.comm	_GRUB_ERR_BAD_DEVICE,4,2        ; @GRUB_ERR_BAD_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"no device is set"

.subsections_via_symbols
