	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nfp_alloc_bar
_nfp_alloc_bar:                         ## @nfp_alloc_bar
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$16777217, %r9                  ## imm = 0x1000001
	jb	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_2:
	movl	%edx, %r15d
	movq	%rdi, %r12
	movl	%esi, %r13d
	movq	%r9, %r14
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	callq	_spin_lock_irqsave
	subq	$8, %rsp
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	movl	%r15d, %edx
	movl	%ebx, %r12d
	movl	%ebx, %ecx
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r8d
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %r9
	movl	16(%rbp), %eax
	pushq	%rax
	callq	_find_matching_bar
	addq	$16, %rsp
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movl	%eax, %esi
	shlq	$2, %rsi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	addq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_nfp_bar_get
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_11
LBB0_4:
	movl	%r15d, %ecx
	movl	%r12d, %r15d
	subq	$8, %rsp
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, %edx
	movl	%r12d, %ecx
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%ebx, %r8d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %r9
	movl	16(%rbp), %r15d
	pushq	%r15
	callq	_find_unused_bar_noblock
	addq	$16, %rsp
	movl	%eax, -44(%rbp)
	testl	%eax, %eax
	movl	%ebx, %ecx
	movq	%r12, %rbx
	js	LBB0_5
LBB0_8:
	movslq	%eax, %rsi
	shlq	$2, %rsi
	addq	8(%r13), %rsi
	movq	%r13, %rdi
	movl	%ecx, %r12d
	callq	_nfp_bar_get
	movslq	-44(%rbp), %rsi
	shlq	$2, %rsi
	addq	8(%r13), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movl	%r12d, %r9d
	pushq	%r15
	pushq	%rbx
	callq	_reconfigure_bar
	addq	$16, %rsp
	testl	%eax, %eax
	jns	LBB0_10
## %bb.9:
	movl	%eax, %r14d
	movslq	-44(%rbp), %rsi
	shlq	$2, %rsi
	addq	8(%r13), %rsi
	movq	%r13, %rdi
	callq	_nfp_bar_put
	movl	%r14d, -44(%rbp)
	jmp	LBB0_10
LBB0_5:
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	cmpl	$0, 24(%rbp)
	je	LBB0_6
LBB0_10:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movl	-44(%rbp), %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r13, %rdi
	movl	%ecx, %r12d
	callq	_spin_unlock_irqrestore
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movl	%r12d, %r9d
	movl	16(%rbp), %eax
	movq	%rax, %r15
	pushq	%rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	pushq	%rbx
	callq	_nfp_wait_for_bar
	addq	$16, %rsp
	movl	%r12d, %ecx
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:
	movq	%r13, %rdi
	movl	%ecx, %r12d
	callq	___acquire
	movl	-44(%rbp), %eax
	movl	%r12d, %ecx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nfp_alloc_bar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nfp_alloc_bar
_nfp_alloc_bar:                         ; @nfp_alloc_bar
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	w8, #1
	movk	w8, #256, lsl #16
	cmp	x5, x8
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_9
LBB0_2:
	mov	x26, x7
	mov	x20, x6
	mov	x21, x5
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	bl	_find_matching_bar
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x27, x0
	ldr	x8, [x19, #8]
	add	x1, x8, w0, uxtw #2
	mov	x0, x19
	bl	_nfp_bar_get
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	b	LBB0_9
LBB0_4:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	bl	_find_unused_bar_noblock
	str	w0, [sp, #12]
	tbnz	w0, #31, LBB0_7
LBB0_5:
	ldr	x8, [x19, #8]
	add	x1, x8, w0, sxtw #2
	mov	x0, x19
	bl	_nfp_bar_get
	ldr	x8, [x19, #8]
	ldrsw	x9, [sp, #12]
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x21
	mov	x7, x20
	bl	_reconfigure_bar
	tbz	w0, #31, LBB0_8
; %bb.6:
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldrsw	x9, [sp, #12]
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	bl	_nfp_bar_put
	str	w20, [sp, #12]
	b	LBB0_8
LBB0_7:
	cbz	w26, LBB0_10
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	ldr	w27, [sp, #12]
LBB0_9:
	mov	x0, x27
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	add	x1, sp, #12
	mov	x0, x19
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	mov	x6, x21
	mov	x7, x20
	bl	_nfp_wait_for_bar
	mov	x27, x0
	cbnz	w0, LBB0_9
; %bb.11:
	mov	x0, x19
	bl	___acquire
	ldr	w0, [sp, #12]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nfp_alloc_bar
.subsections_via_symbols
