	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_realloc_orig              ## -- Begin function grub_realloc_orig
	.p2align	4, 0x90
_grub_realloc_orig:                     ## @grub_realloc_orig
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.2:
	movq	_GRUB_MM_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%r14,%rax), %r15d
	decl	%r15d
	movq	_GRUB_MM_ALIGN_LOG2@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	leaq	-32(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_get_header_from_pointer
	movq	-32(%rbp), %rax
	cmpl	%r15d, (%rax)
	jg	LBB0_8
## %bb.3:
	movl	%r14d, %edi
	callq	_grub_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_grub_memcpy
	movq	%rbx, %rdi
	callq	_grub_free
	movq	%r15, %rbx
	jmp	LBB0_8
LBB0_5:
	movl	%r14d, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_grub_malloc                    ## TAILCALL
LBB0_6:
	movq	%rbx, %rdi
	callq	_grub_free
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_grub_realloc_orig              ; -- Begin function grub_realloc_orig
	.p2align	2
_grub_realloc_orig:                     ; @grub_realloc_orig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	cbz	w20, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _GRUB_MM_ALIGN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRUB_MM_ALIGN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w8, w20, w8
	sub	w8, w8, #1
Lloh3:
	adrp	x9, _GRUB_MM_ALIGN_LOG2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GRUB_MM_ALIGN_LOG2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w21, w8, w9
	add	x1, sp, #8
	add	x2, sp, #4
	mov	x0, x19
	bl	_get_header_from_pointer
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
	cmp	w8, w21
	b.gt	LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_grub_malloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x21, x0
	mov	x1, x19
	mov	x2, x20
	bl	_grub_memcpy
	mov	x0, x19
	bl	_grub_free
	mov	x19, x21
	b	LBB0_8
LBB0_5:
	mov	x0, x20
	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
	add	sp, sp, #64
	b	_grub_malloc
LBB0_6:
	mov	x0, x19
	bl	_grub_free
LBB0_7:
	mov	x19, #0
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GRUB_MM_ALIGN,4,2              ; @GRUB_MM_ALIGN
	.comm	_GRUB_MM_ALIGN_LOG2,4,2         ; @GRUB_MM_ALIGN_LOG2
.subsections_via_symbols
