	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stack_extend_alloc
_stack_extend_alloc:                    ## @stack_extend_alloc
	.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
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r8
	movq	8(%rax), %r12
	subq	%r8, %r12
	sarq	$2, %r12
	movq	16(%rax), %r15
	subq	%r8, %r15
	sarq	$2, %r15
	cmpq	%r12, %r15
	movq	%r12, %rax
	cmovaq	%r15, %rax
	movq	%rsi, %rbx
	movq	_MRB_STACK_GROWTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rsi, %rcx
	cmovgq	%rcx, %rbx
	addq	%rax, %rbx
	leal	(,%rbx,4), %edx
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%r8, %rsi
	callq	_mrb_realloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	callq	_mrb_obj_value
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mrb_exc_raise
LBB0_2:
	leaq	(,%r12,4), %rdi
	addq	%r13, %rdi
	movq	%rbx, %rsi
	subq	%r12, %rsi
	callq	_stack_clear
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	movq	%r12, %rcx
	callq	_envadjust
	movq	8(%r14), %rax
	movq	%r13, (%rax)
	leaq	(,%r15,4), %rcx
	addq	%r13, %rcx
	movq	%rcx, 16(%rax)
	leaq	(,%rbx,4), %rcx
	addq	%r13, %rcx
	movq	%rcx, 8(%rax)
	movq	_MRB_STACK_MAX@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jbe	LBB0_3
## %bb.4:
	movl	(%r14), %edi
	callq	_mrb_obj_value
	movq	%r14, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mrb_exc_raise                  ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MRB_STACK_GROWTH,8,3           ## @MRB_STACK_GROWTH
	.comm	_MRB_STACK_MAX,8,3              ## @MRB_STACK_MAX
	.no_dead_strip	_stack_extend_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stack_extend_alloc
_stack_extend_alloc:                    ; @stack_extend_alloc
	.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	x19, x0
	ldr	x8, [x0, #8]
	ldp	x20, x9, [x8]
	sub	x9, x9, x20
	asr	x21, x9, #2
	ldr	x8, [x8, #16]
	sub	x8, x8, x20
	asr	x23, x8, #2
Lloh0:
	adrp	x8, _MRB_STACK_GROWTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MRB_STACK_GROWTH@GOTPAGEOFF]
	cmp	x23, x21
	csel	x9, x23, x21, hi
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	csel	x8, x8, x1, gt
	add	x24, x9, x8
	lsl	w2, w24, #2
	mov	x1, x20
	bl	_mrb_realloc
	mov	x22, x0
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	bl	_mrb_obj_value
	mov	x1, x0
	mov	x0, x19
	bl	_mrb_exc_raise
LBB0_2:
	add	x0, x22, x21, lsl #2
	sub	x1, x24, x21
	bl	_stack_clear
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	bl	_envadjust
	ldr	x8, [x19, #8]
	add	x10, x22, x23, lsl #2
	add	x9, x22, x24, lsl #2
	str	x22, [x8]
	stp	x9, x10, [x8, #8]
Lloh3:
	adrp	x8, _MRB_STACK_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MRB_STACK_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x24, x8
	b.ls	LBB0_4
; %bb.3:
	ldr	w0, [x19]
	bl	_mrb_obj_value
	mov	x1, x0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mrb_exc_raise
LBB0_4:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MRB_STACK_GROWTH,8,3           ; @MRB_STACK_GROWTH
	.comm	_MRB_STACK_MAX,8,3              ; @MRB_STACK_MAX
	.no_dead_strip	_stack_extend_alloc
.subsections_via_symbols
