	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __add_page
___add_page:                            ## @__add_page
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_to_mdev
	movl	(%rax), %r12d
	movq	_db_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movl	%ebx, %r13d
	movl	%r12d, %eax
	cltd
	idivl	(%rcx,%r13,4)
	movl	%eax, %ebx
	leal	7(%rbx), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$3, %edi
	addl	$48, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	movq	%rax, %rdi
	addq	$40, %rdi
	movl	%r12d, %esi
	movl	%r12d, %edx
	callq	_mlx4_alloc_buf
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	callq	_free
LBB0_3:
	xorl	%r15d, %r15d
LBB0_8:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%ebx, (%r15)
	movq	$0, 32(%r15)
	cmpl	$64, %ebx
	jb	LBB0_6
## %bb.5:
	movslq	%ebx, %rax
	shrq	$6, %rax
	movq	24(%r15), %rdi
	cmpq	$2, %rax
	movl	$1, %edx
	cmovaeq	%rax, %rdx
	shlq	$2, %rdx
	movl	$255, %esi
	callq	_memset
LBB0_6:
	movq	$0, 8(%r15)
	movq	(%r14), %rax
	movq	(%rax,%r13,8), %rcx
	movq	%rcx, 16(%r15)
	movq	%r15, (%rax,%r13,8)
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r15, 8(%rax)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_db_size,8,3                    ## @db_size
	.no_dead_strip	___add_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __add_page
___add_page:                            ; @__add_page
	.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	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #8]
	bl	_to_mdev
	ldr	w22, [x0]
Lloh0:
	adrp	x8, _db_size@GOTPAGE
Lloh1:
	ldr	x8, [x8, _db_size@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x8, w21, uxtw #2]
	sdiv	w23, w22, w8
	add	w8, w23, #7
	cmp	w23, #0
	csel	w8, w8, w23, lt
	asr	w8, w8, #3
	add	w0, w8, #48
	bl	_malloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	add	x0, x19, #40
	mov	x1, x22
	mov	x2, x22
	bl	_mlx4_alloc_buf
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_free
	mov	x19, #0
	b	LBB0_7
LBB0_3:
	mov	w21, w21
	str	w23, [x19]
	str	xzr, [x19, #32]
	cmp	w23, #64
	b.lo	LBB0_5
; %bb.4:
	sxtw	x8, w23
	lsr	x8, x8, #6
	ldr	x0, [x19, #24]
	cmp	x8, #1
	csinc	x8, x8, xzr, hi
	lsl	x2, x8, #2
	mov	w1, #255
	bl	_memset
LBB0_5:
	str	xzr, [x19, #8]
	ldr	x8, [x20]
	lsl	x9, x21, #3
	ldr	x10, [x8, x9]
	str	x10, [x19, #16]
	str	x19, [x8, x9]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.6:
	str	x19, [x8, #8]
LBB0_7:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_db_size,8,3                    ; @db_size
	.no_dead_strip	___add_page
.subsections_via_symbols
