	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_alloc_db                  ## -- Begin function mlx4_alloc_db
	.p2align	4, 0x90
_mlx4_alloc_db:                         ## @mlx4_alloc_db
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_pthread_mutex_lock
	movq	8(%r14), %rax
	movl	%ebx, %r15d
	movq	(%rax,%r15,8), %rax
	testq	%rax, %rax
	je	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rcx
	cmpq	8(%rax), %rcx
	jl	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	32(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_2
LBB0_4:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	___add_page
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	(%rax), %rcx
LBB0_7:
	incq	%rcx
	movq	%rcx, (%rax)
	movq	16(%rax), %rdx
	movq	$-64, %rcx
	movq	$-1, %rdi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx,%rdi,8), %rsi
	addq	$64, %rcx
	incq	%rdi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.9:
	movl	%edi, %edi
	bsfq	%rsi, %rbx
	btrq	%rbx, %rsi
	movq	%rsi, (%rdx,%rdi,8)
	movabsq	$34359738304, %rdx              ## imm = 0x7FFFFFFC0
	andq	%rdx, %rcx
	orq	%rbx, %rcx
	movq	_db_size@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movslq	(%rdx,%r15,4), %rbx
	imulq	%rcx, %rbx
	shlq	$2, %rbx
	addq	24(%rax), %rbx
	jmp	LBB0_10
LBB0_5:
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_db_size,8,3                    ## @db_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_alloc_db                  ; -- Begin function mlx4_alloc_db
	.p2align	2
_mlx4_alloc_db:                         ; @mlx4_alloc_db
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_pthread_mutex_lock
	ldr	x8, [x19, #8]
	ldr	x0, [x8, w20, uxtw #3]
	cbz	x0, LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x0]
	cmp	x9, x8
	b.lt	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x0, #32]
	cbnz	x0, LBB0_1
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	bl	___add_page
	cbz	x0, LBB0_8
; %bb.4:
	ldr	x9, [x0]
LBB0_5:
	mov	x10, #0
	mov	w8, w20
	add	x9, x9, #1
	str	x9, [x0]
	ldr	x9, [x0, #16]
	mov	x11, #-64
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9, x10, lsl #3]
	add	x10, x10, #1
	add	x11, x11, #64
	cbz	x12, LBB0_6
; %bb.7:
	sub	w10, w10, #1
	rbit	x13, x12
	clz	x13, x13
	mov	w14, #1
	lsl	x14, x14, x13
	bic	x12, x12, x14
	str	x12, [x9, w10, uxtw #3]
	ldr	x9, [x0, #24]
	and	x10, x11, #0x7ffffffc0
Lloh0:
	adrp	x11, _db_size@GOTPAGE
Lloh1:
	ldr	x11, [x11, _db_size@GOTPAGEOFF]
	orr	x10, x10, x13
Lloh2:
	ldr	x11, [x11]
	ldrsw	x8, [x11, x8, lsl #2]
	mul	x8, x10, x8
	add	x20, x9, x8, lsl #2
	b	LBB0_9
LBB0_8:
	mov	x20, #0
LBB0_9:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_db_size,8,3                    ; @db_size
.subsections_via_symbols
