	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_bitmap_alloc          ## -- Begin function hns_roce_bitmap_alloc
	.p2align	4, 0x90
_hns_roce_bitmap_alloc:                 ## @hns_roce_bitmap_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	28(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	movl	32(%rbx), %edi
	movq	(%rbx), %rsi
	movq	8(%rbx), %rdx
	callq	_find_next_zero_bit
	movq	%rax, (%r15)
	movq	(%rbx), %rsi
	cmpq	%rsi, %rax
	jb	LBB0_2
## %bb.1:
	movl	16(%rbx), %eax
	addl	%esi, %eax
	addl	20(%rbx), %eax
	andl	24(%rbx), %eax
	movl	%eax, 16(%rbx)
	movl	32(%rbx), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_find_first_zero_bit
	movq	%rax, (%r15)
	movq	(%rbx), %rsi
LBB0_2:
	movl	$-1, %r12d
	cmpq	%rsi, %rax
	jae	LBB0_4
## %bb.3:
	movl	32(%rbx), %esi
	movq	%rax, %rdi
	callq	_set_bit
	movq	(%r15), %rax
	incq	%rax
	xorl	%r12d, %r12d
	cmpq	(%rbx), %rax
	movl	$0, %ecx
	cmovneq	%rax, %rcx
	movq	%rcx, 8(%rbx)
	movslq	16(%rbx), %rax
	orq	%rax, (%r15)
LBB0_4:
	movq	%r14, %rdi
	callq	_spin_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	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	_hns_roce_bitmap_alloc          ; -- Begin function hns_roce_bitmap_alloc
	.p2align	2
_hns_roce_bitmap_alloc:                 ; @hns_roce_bitmap_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	x20, x1
	mov	x21, x0
	add	x19, x0, #28
	mov	x0, x19
	bl	_spin_lock
	ldr	w0, [x21, #32]
	ldp	x1, x2, [x21]
	bl	_find_next_zero_bit
	str	x0, [x20]
	ldr	x1, [x21]
	cmp	x0, x1
	b.lo	LBB0_2
; %bb.1:
	ldp	w8, w9, [x21, #16]
	ldr	w10, [x21, #24]
	add	w8, w8, w1
	add	w8, w8, w9
	and	w8, w8, w10
	str	w8, [x21, #16]
	ldr	w0, [x21, #32]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_find_first_zero_bit
	str	x0, [x20]
	ldr	x1, [x21]
LBB0_2:
	cmp	x0, x1
	b.hs	LBB0_4
; %bb.3:
	ldr	w1, [x21, #32]
	bl	_set_bit
	mov	w22, #0
	ldr	x8, [x20]
	add	x9, x8, #1
	ldr	x10, [x21]
	cmp	x9, x10
	csinc	x8, xzr, x8, eq
	str	x8, [x21, #8]
	ldrsw	x8, [x21, #16]
	ldr	x9, [x20]
	orr	x8, x9, x8
	str	x8, [x20]
	b	LBB0_5
LBB0_4:
	mov	w22, #-1
LBB0_5:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x22
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
