	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfp_resource_table_init        ## -- Begin function nfp_resource_table_init
	.p2align	4, 0x90
_nfp_resource_table_init:               ## @nfp_resource_table_init
	.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
	movq	%rdi, %r15
	movq	_NFP_RESOURCE_TBL_TARGET@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_NFP_RESOURCE_TBL_BASE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	callq	_nfp_cpp_mutex_reclaim
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_nfp_warn
LBB0_4:
	movl	(%r14), %esi
	movq	(%rbx), %rdx
	movq	_NFP_RESOURCE_TBL_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_nfp_cpp_mutex_alloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_nfp_cpp_mutex_lock
	testq	%rax, %rax
	je	LBB0_7
## %bb.16:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_nfp_err
	movq	%r14, %rdi
	callq	_nfp_cpp_mutex_free
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_1:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_nfp_err
	jmp	LBB0_15
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_7:
	movq	_NFP_RESOURCE_TBL_ENTRIES@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpl	$2, (%rax)
	jl	LBB0_14
## %bb.8:
	movl	$1, %ebx
	movl	$4, %r13d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movq	_NFP_RESOURCE_TBL_ENTRIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$4, %r13
	cmpq	%rax, %rbx
	jge	LBB0_13
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_NFP_RESOURCE_TBL_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	%r13, %rdx
	movq	_NFP_RESOURCE_TBL_TARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_nfp_cpp_mutex_reclaim
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_nfp_warn
	jmp	LBB0_12
LBB0_13:
	xorl	%r12d, %r12d
	jmp	LBB0_14
LBB0_17:
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_nfp_err
LBB0_14:
	movq	%r14, %rdi
	callq	_nfp_cpp_mutex_unlock
	movq	%r14, %rdi
	callq	_nfp_cpp_mutex_free
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NFP_RESOURCE_TBL_TARGET,4,2    ## @NFP_RESOURCE_TBL_TARGET
	.comm	_NFP_RESOURCE_TBL_BASE,8,3      ## @NFP_RESOURCE_TBL_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: failed to reclaim resource table mutex\n"

L_.str.1:                               ## @.str.1
	.asciz	"Warning: busted main resource table mutex\n"

	.comm	_NFP_RESOURCE_TBL_KEY,4,2       ## @NFP_RESOURCE_TBL_KEY
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Error: failed to claim resource table mutex\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NFP_RESOURCE_TBL_ENTRIES,4,2   ## @NFP_RESOURCE_TBL_ENTRIES
L_.str.3:                               ## @.str.3
	.asciz	"Error: failed to reclaim resource %d mutex\n"

L_.str.4:                               ## @.str.4
	.asciz	"Warning: busted resource %d mutex\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfp_resource_table_init        ; -- Begin function nfp_resource_table_init
	.p2align	2
_nfp_resource_table_init:               ; @nfp_resource_table_init
	.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	x19, x0
Lloh0:
	adrp	x23, _NFP_RESOURCE_TBL_TARGET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NFP_RESOURCE_TBL_TARGET@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x24, _NFP_RESOURCE_TBL_BASE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _NFP_RESOURCE_TBL_BASE@GOTPAGEOFF]
	ldr	x2, [x24]
	bl	_nfp_cpp_mutex_reclaim
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
	cbz	w21, LBB0_3
; %bb.2:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_nfp_warn
LBB0_3:
	ldr	w1, [x23]
	ldr	x2, [x24]
Lloh6:
	adrp	x8, _NFP_RESOURCE_TBL_KEY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NFP_RESOURCE_TBL_KEY@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_nfp_cpp_mutex_alloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x20, x0
	bl	_nfp_cpp_mutex_lock
	cbz	x0, LBB0_9
; %bb.5:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_nfp_err
	mov	x0, x20
	bl	_nfp_cpp_mutex_free
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nfp_err
	b	LBB0_18
LBB0_7:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_18
LBB0_9:
Lloh17:
	adrp	x25, _NFP_RESOURCE_TBL_ENTRIES@GOTPAGE
Lloh18:
	ldr	x25, [x25, _NFP_RESOURCE_TBL_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #2
	b.lt	LBB0_15
; %bb.10:
	mov	w26, #1
	mov	w27, #4
Lloh19:
	adrp	x22, l_.str.4@PAGE
Lloh20:
	add	x22, x22, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x25]
	add	x27, x27, #4
	cmp	x26, x8
	b.ge	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x2, x27, x8
	ldr	w1, [x23]
	mov	x0, x19
	bl	_nfp_cpp_mutex_reclaim
	mov	x21, x0
	tbnz	w0, #31, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cbz	w21, LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	str	x26, [sp]
	mov	x0, x19
	mov	x1, x22
	bl	_nfp_warn
	b	LBB0_11
LBB0_15:
	mov	w21, #0
	b	LBB0_17
LBB0_16:
	str	x26, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_nfp_err
LBB0_17:
	mov	x0, x20
	bl	_nfp_cpp_mutex_unlock
	mov	x0, x20
	bl	_nfp_cpp_mutex_free
LBB0_18:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_NFP_RESOURCE_TBL_TARGET,4,2    ; @NFP_RESOURCE_TBL_TARGET
	.comm	_NFP_RESOURCE_TBL_BASE,8,3      ; @NFP_RESOURCE_TBL_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: failed to reclaim resource table mutex\n"

l_.str.1:                               ; @.str.1
	.asciz	"Warning: busted main resource table mutex\n"

	.comm	_NFP_RESOURCE_TBL_KEY,4,2       ; @NFP_RESOURCE_TBL_KEY
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Error: failed to claim resource table mutex\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NFP_RESOURCE_TBL_ENTRIES,4,2   ; @NFP_RESOURCE_TBL_ENTRIES
l_.str.3:                               ; @.str.3
	.asciz	"Error: failed to reclaim resource %d mutex\n"

l_.str.4:                               ; @.str.4
	.asciz	"Warning: busted resource %d mutex\n"

.subsections_via_symbols
