	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_transport_rsrv_port      ## -- Begin function usnic_transport_rsrv_port
	.p2align	4, 0x90
_usnic_transport_rsrv_port:             ## @usnic_transport_rsrv_port
	.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
	movl	%edi, %r14d
	movq	_USNIC_TRANSPORT_ROCE_CUSTOM@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jne	LBB0_6
## %bb.1:
	movl	%esi, %ebx
	movq	_roce_bitmap_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock
	movq	_roce_bitmap@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.4:
	movl	%ebx, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movl	%r14d, %edi
	callq	_usnic_transport_to_str
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_usnic_err
	movq	_roce_bitmap_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	jmp	LBB0_7
LBB0_6:
	movl	%r14d, %edi
	callq	_usnic_transport_to_str
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_usnic_err
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_2:
	movq	_ROCE_BITMAP_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_roce_next_port@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	%esi, %edi
	movl	%eax, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_bitmap_find_next_zero_area
	movl	%eax, %ebx
	andl	$4095, %eax                     ## imm = 0xFFF
	incl	%eax
	movl	%eax, (%r12)
LBB0_3:
	movl	(%r15), %edi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_bitmap_set
	movq	_roce_bitmap_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	movl	%r14d, %edi
	callq	_usnic_transport_to_str
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_usnic_dbg
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_USNIC_TRANSPORT_ROCE_CUSTOM,4,2 ## @USNIC_TRANSPORT_ROCE_CUSTOM
	.comm	_roce_bitmap_lock,4,2           ## @roce_bitmap_lock
	.comm	_roce_bitmap,4,2                ## @roce_bitmap
	.comm	_ROCE_BITMAP_SZ,4,2             ## @ROCE_BITMAP_SZ
	.comm	_roce_next_port,4,2             ## @roce_next_port
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate port for %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate port - transport %s unsupported\n"

L_.str.2:                               ## @.str.2
	.asciz	"Allocating port %hu for %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_transport_rsrv_port      ; -- Begin function usnic_transport_rsrv_port
	.p2align	2
_usnic_transport_rsrv_port:             ; @usnic_transport_rsrv_port
	.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	x19, x0
Lloh0:
	adrp	x8, _USNIC_TRANSPORT_ROCE_CUSTOM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USNIC_TRANSPORT_ROCE_CUSTOM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ne	LBB0_4
; %bb.1:
	mov	x20, x1
Lloh3:
	adrp	x0, _roce_bitmap_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _roce_bitmap_lock@GOTPAGEOFF]
	bl	_spin_lock
Lloh5:
	adrp	x21, _roce_bitmap@GOTPAGE
Lloh6:
	ldr	x21, [x21, _roce_bitmap@GOTPAGEOFF]
	ldr	w1, [x21]
	cbz	w20, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_test_bit
	cbz	x0, LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_usnic_transport_to_str
	mov	x1, x0
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_usnic_err
Lloh9:
	adrp	x0, _roce_bitmap_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _roce_bitmap_lock@GOTPAGEOFF]
	bl	_spin_unlock
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_usnic_transport_to_str
	mov	x1, x0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_usnic_err
LBB0_5:
	mov	w20, #0
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _ROCE_BITMAP_SZ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ROCE_BITMAP_SZ@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x22, _roce_next_port@GOTPAGE
Lloh17:
	ldr	x22, [x22, _roce_next_port@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x1
	mov	x1, x8
	mov	w3, #1
	mov	w4, #0
	bl	_bitmap_find_next_zero_area
	mov	x20, x0
	and	w8, w0, #0xfff
	add	w8, w8, #1
	str	w8, [x22]
LBB0_7:
	ldr	w0, [x21]
	mov	x1, x20
	mov	w2, #1
	bl	_bitmap_set
Lloh18:
	adrp	x0, _roce_bitmap_lock@GOTPAGE
Lloh19:
	ldr	x0, [x0, _roce_bitmap_lock@GOTPAGEOFF]
	bl	_spin_unlock
	mov	x0, x19
	bl	_usnic_transport_to_str
	mov	x2, x0
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_usnic_dbg
LBB0_8:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_USNIC_TRANSPORT_ROCE_CUSTOM,4,2 ; @USNIC_TRANSPORT_ROCE_CUSTOM
	.comm	_roce_bitmap_lock,4,2           ; @roce_bitmap_lock
	.comm	_roce_bitmap,4,2                ; @roce_bitmap
	.comm	_ROCE_BITMAP_SZ,4,2             ; @ROCE_BITMAP_SZ
	.comm	_roce_next_port,4,2             ; @roce_next_port
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate port for %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate port - transport %s unsupported\n"

l_.str.2:                               ; @.str.2
	.asciz	"Allocating port %hu for %s\n"

.subsections_via_symbols
