	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ResourceArrayEnlarge
_ResourceArrayEnlarge:                  ## @ResourceArrayEnlarge
	.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	32(%rdi), %rax
	cmpq	24(%rdi), %rax
	jge	LBB0_2
## %bb.1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rdi, %r13
	movl	8(%rdi), %r12d
	testl	%r12d, %r12d
	jg	LBB0_4
## %bb.3:
	movq	_RESARRAY_INIT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_5
LBB0_4:
	leal	(%r12,%r12), %r15d
LBB0_5:
	movq	(%r13), %r14
	movq	_TopMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	(,%r15,8), %esi
	callq	_MemoryContextAlloc
	testl	%r15d, %r15d
	jle	LBB0_21
## %bb.6:
	movl	%r15d, %ecx
	cmpl	$4, %r15d
	jb	LBB0_7
## %bb.8:
	leaq	24(%r13), %rdx
	cmpq	%rdx, %rax
	jae	LBB0_11
## %bb.9:
	leaq	(%rax,%rcx,8), %rdx
	leaq	16(%r13), %rsi
	cmpq	%rdx, %rsi
	jae	LBB0_11
LBB0_7:
	xorl	%edx, %edx
LBB0_17:
	movq	%rdx, %rsi
	notq	%rsi
	addq	%rcx, %rsi
	movq	%rcx, %rdi
	andq	$3, %rdi
	je	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rbx
	movq	%rbx, (%rax,%rdx,8)
	incq	%rdx
	decq	%rdi
	jne	LBB0_18
LBB0_19:
	cmpq	$3, %rsi
	jb	LBB0_21
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rsi
	movq	%rsi, (%rax,%rdx,8)
	movq	16(%r13), %rsi
	movq	%rsi, 8(%rax,%rdx,8)
	movq	16(%r13), %rsi
	movq	%rsi, 16(%rax,%rdx,8)
	movq	16(%r13), %rsi
	movq	%rsi, 24(%rax,%rdx,8)
	addq	$4, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_20
	jmp	LBB0_21
LBB0_11:
	movl	%ecx, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_30
## %bb.12:
	movq	%r8, %rsi
	andq	$-2, %rsi
	movq	16(%r13), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
	movdqu	%xmm0, 32(%rax,%rdi,8)
	movdqu	%xmm0, 48(%rax,%rdi,8)
	addq	$8, %rdi
	addq	$-2, %rsi
	jne	LBB0_13
## %bb.14:
	testb	$1, %r8b
	je	LBB0_16
LBB0_15:
	movq	16(%r13), %xmm0                 ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movdqu	%xmm0, (%rax,%rdi,8)
	movdqu	%xmm0, 16(%rax,%rdi,8)
LBB0_16:
	cmpq	%rcx, %rdx
	jne	LBB0_17
LBB0_21:
	movq	%rax, (%r13)
	movl	%r15d, 8(%r13)
	movl	%r15d, %edi
	callq	_RESARRAY_MAX_ITEMS
	movq	%rax, 24(%r13)
	movq	$0, 32(%r13)
	testq	%r14, %r14
	je	LBB0_28
## %bb.22:
	testl	%r12d, %r12d
	jle	LBB0_27
## %bb.23:
	xorl	%ebx, %ebx
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_25 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	je	LBB0_27
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rsi
	cmpq	16(%r13), %rsi
	je	LBB0_24
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r13, %rdi
	callq	_ResourceArrayAdd
	jmp	LBB0_24
LBB0_27:
	movq	%r14, %rdi
	callq	_pfree
	movq	24(%r13), %rax
	movq	32(%r13), %rcx
	jmp	LBB0_29
LBB0_28:
	xorl	%ecx, %ecx
LBB0_29:
	xorl	%edi, %edi
	cmpq	%rax, %rcx
	setl	%dil
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Assert                         ## TAILCALL
LBB0_30:
	xorl	%edi, %edi
	testb	$1, %r8b
	jne	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_RESARRAY_INIT_SIZE,4,2         ## @RESARRAY_INIT_SIZE
	.comm	_TopMemoryContext,4,2           ## @TopMemoryContext
	.no_dead_strip	_ResourceArrayEnlarge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ResourceArrayEnlarge
_ResourceArrayEnlarge:                  ; @ResourceArrayEnlarge
	.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
	ldp	x9, x8, [x0, #24]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	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_2:
	mov	x19, x0
	ldr	x20, [x0]
	ldr	w22, [x0, #8]
	lsl	w8, w22, #1
Lloh0:
	adrp	x9, _RESARRAY_INIT_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RESARRAY_INIT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w22, #0
	csel	w21, w8, w9, gt
Lloh3:
	adrp	x8, _TopMemoryContext@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TopMemoryContext@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	lsl	w1, w21, #3
	bl	_MemoryContextAlloc
	cmp	w21, #1
	b.lt	LBB0_11
; %bb.3:
	cmp	w21, #8
	b.lo	LBB0_8
; %bb.4:
	add	x8, x0, x21, lsl #3
	add	x9, x19, #16
	add	x10, x19, #24
	cmp	x0, x10
	ccmp	x9, x8, #2, lo
	b.lo	LBB0_8
; %bb.5:
	and	x8, x21, #0xfffffff8
	ld1r.2d	{ v0 }, [x9]
	add	x9, x0, #32
	mov	x10, x8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x19, #16]
	dup.2d	v1, v1[0]
	stp	q0, q0, [x9, #-32]
	stp	q0, q1, [x9], #64
	subs	x10, x10, #8
	b.ne	LBB0_6
; %bb.7:
	cmp	x8, x21
	b.ne	LBB0_9
	b	LBB0_11
LBB0_8:
	mov	x8, #0
LBB0_9:
	add	x9, x0, x8, lsl #3
	sub	x8, x21, x8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19, #16]
	str	x10, [x9], #8
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	str	x0, [x19]
	str	w21, [x19, #8]
	mov	x0, x21
	bl	_RESARRAY_MAX_ITEMS
	stp	x0, xzr, [x19, #24]
	cbz	x20, LBB0_18
; %bb.12:
	cmp	w22, #1
	b.lt	LBB0_17
; %bb.13:
	mov	x21, x20
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x21, x21, #8
	subs	x22, x22, #1
	b.eq	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x21]
	ldr	x8, [x19, #16]
	cmp	x1, x8
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x19
	bl	_ResourceArrayAdd
	b	LBB0_14
LBB0_17:
	mov	x0, x20
	bl	_pfree
	ldp	x0, x8, [x19, #24]
	b	LBB0_19
LBB0_18:
	mov	x8, #0
LBB0_19:
	cmp	x8, x0
	cset	w0, lt
	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
	b	_Assert
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RESARRAY_INIT_SIZE,4,2         ; @RESARRAY_INIT_SIZE
	.comm	_TopMemoryContext,4,2           ; @TopMemoryContext
	.no_dead_strip	_ResourceArrayEnlarge
.subsections_via_symbols
