	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function paint_alloc
_paint_alloc:                           ## @paint_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	movl	$32, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %r14d
	movl	(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %eax
	movl	8(%rbx), %ecx
	subl	%ecx, %eax
	cmpl	%eax, %r14d
	jbe	LBB0_5
LBB0_2:
	movq	_POOL_SIZE@GOTPCREL(%rip), %r15
	cmpl	(%r15), %r14d
	jbe	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_BUG
	movl	(%rbx), %esi
LBB0_4:
	incl	%esi
	movl	%esi, (%rbx)
	movq	16(%rbx), %rdi
	callq	_REALLOC_ARRAY
	movl	(%r15), %edi
	callq	_xmalloc
	movl	%eax, 8(%rbx)
	movq	16(%rbx), %rcx
	movslq	(%rbx), %rdx
	movl	%eax, -4(%rcx,%rdx,4)
	movl	8(%rbx), %ecx
	movl	(%r15), %eax
	addl	%ecx, %eax
	movl	%eax, 4(%rbx)
LBB0_5:
	movl	%ecx, %eax
	addl	%ecx, %r14d
	movl	%r14d, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POOL_SIZE,4,2                  ## @POOL_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pool size too small for %d in paint_alloc()"

	.no_dead_strip	_paint_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function paint_alloc
_paint_alloc:                           ; @paint_alloc
	.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
	mov	x19, x0
	ldr	w0, [x0, #24]
	mov	w1, #32
	bl	_DIV_ROUND_UP
	mov	x20, x0
	ldr	w8, [x19]
	cbz	w8, LBB0_2
; %bb.1:
	ldp	w10, w9, [x19, #4]
	sub	w10, w10, w9
	cmp	w20, w10
	b.ls	LBB0_5
LBB0_2:
Lloh0:
	adrp	x21, _POOL_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _POOL_SIZE@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w20, w9
	b.ls	LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_BUG
	ldr	w8, [x19]
LBB0_4:
	add	w1, w8, #1
	str	w1, [x19]
	ldr	x0, [x19, #16]
	bl	_REALLOC_ARRAY
	ldr	w0, [x21]
	bl	_xmalloc
	str	w0, [x19, #8]
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19]
	add	x8, x8, x9, lsl #2
	stur	w0, [x8, #-4]
	ldr	w9, [x19, #8]
	ldr	w8, [x21]
	add	w8, w8, w9
	str	w8, [x19, #4]
LBB0_5:
	mov	w0, w9
	add	w8, w9, w20
	str	w8, [x19, #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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_POOL_SIZE,4,2                  ; @POOL_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pool size too small for %d in paint_alloc()"

	.no_dead_strip	_paint_alloc
.subsections_via_symbols
