	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_bitmap_alloc_range        ## -- Begin function mlx4_bitmap_alloc_range
	.p2align	4, 0x90
_mlx4_bitmap_alloc_range:               ## @mlx4_bitmap_alloc_range
	.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	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	%esi, %eax
	xorl	$1, %eax
	movl	%edx, %ecx
	xorl	$1, %ecx
	orl	%eax, %ecx
	xorl	%edi, %edi
	orl	%r12d, %ecx
	sete	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_1
## %bb.11:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mlx4_bitmap_alloc              ## TAILCALL
LBB0_1:
	leaq	24(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movl	28(%rbx), %edi
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	callq	_find_aligned_range
	movl	4(%rbx), %edx
	cmpl	%edx, %eax
	jge	LBB0_3
## %bb.2:
	movl	%eax, %r15d
	jmp	LBB0_4
LBB0_3:
	movl	8(%rbx), %eax
	addl	%edx, %eax
	addl	12(%rbx), %eax
	andl	16(%rbx), %eax
	movl	%eax, 8(%rbx)
	movl	28(%rbx), %edi
	xorl	%esi, %esi
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	callq	_find_aligned_range
	movl	%eax, %r15d
	movl	4(%rbx), %edx
LBB0_4:
	movl	$-1, %r12d
	cmpl	%edx, %r15d
	jge	LBB0_5
## %bb.6:
	movl	28(%rbx), %edi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_bitmap_set
	cmpl	(%rbx), %r15d
	jne	LBB0_8
## %bb.7:
	leal	(%r15,%r14), %eax
	xorl	%ecx, %ecx
	cmpl	4(%rbx), %eax
	cmovll	%eax, %ecx
	movl	%ecx, (%rbx)
LBB0_8:
	orl	8(%rbx), %r15d
	cmpl	$-1, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_10
## %bb.9:
	subl	%r14d, 20(%rbx)
	movl	%r15d, %r12d
	jmp	LBB0_10
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_10:
	callq	_spin_unlock
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_bitmap_alloc_range        ; -- Begin function mlx4_bitmap_alloc_range
	.p2align	2
_mlx4_bitmap_alloc_range:               ; @mlx4_bitmap_alloc_range
	.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	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
	cmp	w1, #1
	ccmp	w2, #1, #0, eq
	ccmp	w3, #0, #0, eq
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	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	_mlx4_bitmap_alloc
LBB0_2:
	add	x19, x20, #24
	mov	x0, x19
	bl	_spin_lock
	ldr	w0, [x20, #28]
	ldp	w1, w2, [x20]
	mov	x3, x21
	mov	x4, x23
	mov	x5, x22
	bl	_find_aligned_range
	ldr	w2, [x20, #4]
	cmp	w0, w2
	b.ge	LBB0_5
; %bb.3:
	mov	x24, x0
	cmp	w24, w2
	b.lt	LBB0_6
LBB0_4:
	mov	w22, #-1
	b	LBB0_10
LBB0_5:
	ldp	w8, w9, [x20, #8]
	add	w8, w8, w2
	add	w8, w8, w9
	ldr	w9, [x20, #16]
	and	w8, w8, w9
	str	w8, [x20, #8]
	ldr	w0, [x20, #28]
	mov	w1, #0
	mov	x3, x21
	mov	x4, x23
	mov	x5, x22
	bl	_find_aligned_range
	mov	x24, x0
	ldr	w2, [x20, #4]
	cmp	w24, w2
	b.ge	LBB0_4
LBB0_6:
	ldr	w0, [x20, #28]
	mov	x1, x24
	mov	x2, x21
	bl	_bitmap_set
	ldr	w8, [x20]
	cmp	w24, w8
	b.ne	LBB0_8
; %bb.7:
	ldr	w8, [x20, #4]
	add	w9, w24, w21
	cmp	w9, w8
	csel	w8, w9, wzr, lt
	str	w8, [x20]
LBB0_8:
	ldr	w8, [x20, #8]
	orr	w22, w8, w24
	cmn	w22, #1
	b.eq	LBB0_10
; %bb.9:
	ldr	w8, [x20, #20]
	sub	w8, w8, w21
	str	w8, [x20, #20]
LBB0_10:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x22
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
