	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_memalign                  ## -- Begin function grub_memalign
	.p2align	4, 0x90
_grub_memalign:                         ## @grub_memalign
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	_GRUB_MM_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rsi,%rax), %r14d
	decl	%r14d
	movq	_GRUB_MM_ALIGN_LOG2@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r14d
	sarl	%cl, %edi
	incl	%r14d
	testl	%edi, %edi
	movl	$1, %r15d
	cmovnel	%edi, %r15d
	movq	_base@GOTPCREL(%rip), %r12
	xorl	%eax, %eax
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%eax, %r13d
	movq	(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_grub_real_malloc
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$2, %eax
	cmpl	$1, %r13d
	je	LBB0_1
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_grub_disk_cache_invalidate_all
	movl	$1, %eax
	jmp	LBB0_1
LBB0_8:
	movq	_GRUB_ERR_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_grub_error
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRUB_MM_ALIGN,4,2              ## @GRUB_MM_ALIGN
	.comm	_GRUB_MM_ALIGN_LOG2,4,2         ## @GRUB_MM_ALIGN_LOG2
	.comm	_base,8,3                       ## @base
	.comm	_GRUB_ERR_OUT_OF_MEMORY,4,2     ## @GRUB_ERR_OUT_OF_MEMORY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_memalign                  ; -- Begin function grub_memalign
	.p2align	2
_grub_memalign:                         ; @grub_memalign
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	w8, #0
Lloh0:
	adrp	x9, _GRUB_MM_ALIGN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GRUB_MM_ALIGN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w9, w1, w9
	sub	w9, w9, #1
Lloh3:
	adrp	x10, _GRUB_MM_ALIGN_LOG2@GOTPAGE
Lloh4:
	ldr	x10, [x10, _GRUB_MM_ALIGN_LOG2@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	asr	w9, w9, w10
	add	w19, w9, #1
	asr	w9, w0, w10
	cmp	w9, #0
	csinc	w20, w9, wzr, ne
Lloh6:
	adrp	x22, _base@GOTPAGE
Lloh7:
	ldr	x22, [x22, _base@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	mov	x23, x8
	ldr	x21, [x22]
	cbz	x21, LBB0_4
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_grub_real_malloc
	cbnz	x0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	x21, [x21, #8]
	cbnz	x21, LBB0_2
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w8, #2
	cmp	w23, #1
	b.eq	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	cbnz	w23, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_grub_disk_cache_invalidate_all
	mov	w8, #1
	b	LBB0_1
LBB0_7:
Lloh8:
	adrp	x8, _GRUB_ERR_OUT_OF_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GRUB_ERR_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_grub_error
	mov	x0, #0
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_MM_ALIGN,4,2              ; @GRUB_MM_ALIGN
	.comm	_GRUB_MM_ALIGN_LOG2,4,2         ; @GRUB_MM_ALIGN_LOG2
	.comm	_base,8,3                       ; @base
	.comm	_GRUB_ERR_OUT_OF_MEMORY,4,2     ; @GRUB_ERR_OUT_OF_MEMORY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory"

.subsections_via_symbols
