	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_dl_unload                 ## -- Begin function grub_dl_unload
	.p2align	4, 0x90
_grub_dl_unload:                        ## @grub_dl_unload
	.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
	xorl	%eax, %eax
	cmpq	$0, (%rdi)
	jg	LBB0_10
## %bb.1:
	movq	%rdi, %r14
	movq	64(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	*%rcx
LBB0_3:
	movq	%r14, %rdi
	callq	_grub_dl_remove
	movq	%r14, %rdi
	callq	_grub_dl_unregister_symbols
	movq	56(%r14), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
LBB0_7:
	movq	40(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rdi
	movq	32(%rbx), %r15
	callq	_grub_free
	movq	%rbx, %rdi
	callq	_grub_free
	movq	%r15, %rbx
	testq	%r15, %r15
	jne	LBB0_8
LBB0_9:
	movq	16(%r14), %rdi
	callq	_grub_free
	movq	%r14, %rdi
	callq	_grub_free
	movl	$1, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_grub_free
	movq	%r15, %rbx
	testq	%r15, %r15
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%rbx), %r15
	movq	48(%rbx), %rdi
	callq	_grub_dl_unref
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	48(%rbx), %rdi
	callq	_grub_dl_unload
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_dl_unload                 ; -- Begin function grub_dl_unload
	.p2align	2
_grub_dl_unload:                        ; @grub_dl_unload
	.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
	ldr	x8, [x0]
	cmp	x8, #0
	b.le	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0, #64]
	cbz	x8, LBB0_4
; %bb.3:
	blr	x8
LBB0_4:
	mov	x0, x19
	bl	_grub_dl_remove
	mov	x0, x19
	bl	_grub_dl_unregister_symbols
	ldr	x20, [x19, #56]
	cbnz	x20, LBB0_10
LBB0_5:
	ldr	x20, [x19, #40]
	cbz	x20, LBB0_7
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x0, x21, [x20, #24]
	bl	_grub_free
	mov	x0, x20
	bl	_grub_free
	mov	x20, x21
	cbnz	x21, LBB0_6
LBB0_7:
	ldr	x0, [x19, #16]
	bl	_grub_free
	mov	x0, x19
	bl	_grub_free
	mov	w0, #1
LBB0_8:
	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
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_grub_free
	mov	x20, x21
	cbz	x21, LBB0_5
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x21, [x20, #32]
	ldr	x0, [x20, #48]
	bl	_grub_dl_unref
	cbnz	w0, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [x20, #48]
	bl	_grub_dl_unload
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
