	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_free_db                   ## -- Begin function mlx4_free_db
	.p2align	4, 0x90
_mlx4_free_db:                          ## @mlx4_free_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	callq	_to_mdev
	movq	(%rax), %r12
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	8(%r14), %r8
	movl	%ebx, %edi
	movq	(%r8,%rdi,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.1:
	negq	%r12
	andq	%r15, %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	8(%rbx), %r12
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_2
	jmp	LBB0_14
LBB0_4:
	subq	%r12, %r15
	movq	_db_size@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rax,%rdi,4), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%r15, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_7
LBB0_5:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movslq	%eax, %rdx
	movl	$1, %esi
	movl	%eax, %ecx
	shlq	%cl, %rsi
	movq	(%rbx), %rax
	shrq	$6, %rdx
	orq	%rsi, (%rax,%rdx,8)
	decl	32(%rbx)
	jne	LBB0_14
## %bb.8:
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rax
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.9:
	movq	%rax, (%rcx)
	jmp	LBB0_11
LBB0_10:
	movq	%rax, (%r8,%rdi,8)
	movq	24(%rbx), %rax
LBB0_11:
	leaq	8(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	16(%rbx), %rcx
	movq	%rcx, 16(%rax)
LBB0_13:
	callq	_mlx4_free_buf
	movq	%rbx, %rdi
	callq	_free
LBB0_14:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
	.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_free_db                   ; -- Begin function mlx4_free_db
	.p2align	2
_mlx4_free_db:                          ; @mlx4_free_db
	.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, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_to_mdev
	ldr	x23, [x0]
	mov	x0, x19
	bl	_pthread_mutex_lock
	ldr	x8, [x19, #8]
	ldr	x20, [x8, w22, uxtw #3]
	cbz	x20, LBB0_9
; %bb.1:
	mov	w9, w22
	neg	x10, x23
	and	x10, x10, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x20, #8]
	cmp	x10, x11
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x20, [x20, #24]
	cbnz	x20, LBB0_2
	b	LBB0_9
LBB0_4:
	sub	x10, x21, x10
Lloh0:
	adrp	x11, _db_size@GOTPAGE
Lloh1:
	ldr	x11, [x11, _db_size@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	ldrsw	x11, [x11, x9, lsl #2]
	sdiv	x10, x10, x11
	sxtw	x11, w10
	mov	w12, #1
	lsl	x10, x12, x10
	ldr	x12, [x20]
	lsr	x11, x11, #3
	and	x11, x11, #0x1ffffffffffffff8
	ldr	x13, [x12, x11]
	orr	x10, x13, x10
	str	x10, [x12, x11]
	ldr	w10, [x20, #32]
	subs	w10, w10, #1
	str	w10, [x20, #32]
	b.ne	LBB0_9
; %bb.5:
	add	x0, x20, #8
	ldp	x11, x10, [x20, #16]
	cbz	x11, LBB0_10
; %bb.6:
	str	x10, [x11]
	cbz	x10, LBB0_8
LBB0_7:
	ldr	x8, [x20, #16]
	str	x8, [x10, #16]
LBB0_8:
	bl	_mlx4_free_buf
	mov	x0, x20
	bl	_free
LBB0_9:
	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	_pthread_mutex_unlock
LBB0_10:
	str	x10, [x8, x9, lsl #3]
	ldr	x10, [x20, #24]
	cbnz	x10, LBB0_7
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_db_size,8,3                    ; @db_size
.subsections_via_symbols
