	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfp_resource_acquire           ## -- Begin function nfp_resource_acquire
	.p2align	4, 0x90
_nfp_resource_acquire:                  ## @nfp_resource_acquire
	.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
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_NFP_MUTEX_WAIT_FIRST_WARN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_HZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_NFP_MUTEX_WAIT_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	imulq	%rbx, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movl	(%rax), %edi
	movq	_NFP_RESOURCE_ENTRY_NAME_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_strncpy
	movq	_NFP_RESOURCE_TBL_TARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NFP_RESOURCE_TBL_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_NFP_RESOURCE_TBL_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_nfp_cpp_mutex_alloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, %r13
	imulq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	%rax, %rbx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_time_is_before_eq_jiffies
	testq	%rax, %rax
	jne	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_nfp_resource_try_acquire
	testl	%eax, %eax
	je	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %r14d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_msleep_interruptible
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_time_is_before_eq_jiffies
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_HZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_NFP_MUTEX_WAIT_NEXT_WARN@GOTPCREL(%rip), %rax
	imulq	(%rax), %rbx
	movq	_jiffies@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_nfp_warn
	jmp	LBB0_11
LBB0_15:
	movq	%r15, %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_nfp_err
	xorl	%r14d, %r14d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_16:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nfp_cpp_mutex_free
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_13:
	subl	(%rax), %r14d
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_nfp_cpp_mutex_free
	movq	%r15, %rdi
	callq	_kfree
	movl	%r14d, %edi
LBB0_2:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_NFP_MUTEX_WAIT_FIRST_WARN,8,3  ## @NFP_MUTEX_WAIT_FIRST_WARN
	.comm	_HZ,8,3                         ## @HZ
	.comm	_NFP_MUTEX_WAIT_ERROR,8,3       ## @NFP_MUTEX_WAIT_ERROR
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NFP_RESOURCE_ENTRY_NAME_SZ,4,2 ## @NFP_RESOURCE_ENTRY_NAME_SZ
	.comm	_NFP_RESOURCE_TBL_TARGET,4,2    ## @NFP_RESOURCE_TBL_TARGET
	.comm	_NFP_RESOURCE_TBL_BASE,4,2      ## @NFP_RESOURCE_TBL_BASE
	.comm	_NFP_RESOURCE_TBL_KEY,4,2       ## @NFP_RESOURCE_TBL_KEY
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_NFP_MUTEX_WAIT_NEXT_WARN,8,3   ## @NFP_MUTEX_WAIT_NEXT_WARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: waiting for NFP resource %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error: resource %s timed out\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nfp_resource_acquire           ; -- Begin function nfp_resource_acquire
	.p2align	2
_nfp_resource_acquire:                  ; @nfp_resource_acquire
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _jiffies@GOTPAGE
Lloh1:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
Lloh3:
	adrp	x8, _NFP_MUTEX_WAIT_FIRST_WARN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NFP_MUTEX_WAIT_FIRST_WARN@GOTPAGEOFF]
Lloh5:
	ldr	x26, [x8]
Lloh6:
	adrp	x28, _HZ@GOTPAGE
Lloh7:
	ldr	x28, [x28, _HZ@GOTPAGEOFF]
	ldr	x27, [x28]
Lloh8:
	adrp	x8, _NFP_MUTEX_WAIT_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NFP_MUTEX_WAIT_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	x23, [x8]
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0]
Lloh14:
	adrp	x8, _NFP_RESOURCE_ENTRY_NAME_SZ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NFP_RESOURCE_ENTRY_NAME_SZ@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_strncpy
Lloh17:
	adrp	x8, _NFP_RESOURCE_TBL_TARGET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NFP_RESOURCE_TBL_TARGET@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _NFP_RESOURCE_TBL_BASE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NFP_RESOURCE_TBL_BASE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x8, _NFP_RESOURCE_TBL_KEY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NFP_RESOURCE_TBL_KEY@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_nfp_cpp_mutex_alloc
	cbz	x0, LBB0_9
; %bb.2:
	mov	x22, x0
Lloh26:
	adrp	x24, _EBUSY@GOTPAGE
Lloh27:
	ldr	x24, [x24, _EBUSY@GOTPAGEOFF]
	madd	x23, x23, x27, x25
	madd	x25, x27, x26, x25
Lloh28:
	adrp	x27, _jiffies@GOTPAGE
Lloh29:
	ldr	x27, [x27, _jiffies@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	bl	_time_is_before_eq_jiffies
	cbnz	x0, LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	bl	_nfp_resource_try_acquire
	cbz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x0
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_msleep_interruptible
	cbnz	w0, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x25
	bl	_time_is_before_eq_jiffies
	cbz	x0, LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x27]
Lloh30:
	adrp	x9, _NFP_MUTEX_WAIT_NEXT_WARN@GOTPAGE
Lloh31:
	ldr	x9, [x9, _NFP_MUTEX_WAIT_NEXT_WARN@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	ldr	x10, [x28]
	madd	x25, x10, x9, x8
	mov	x0, x21
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_nfp_warn
	b	LBB0_3
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
Lloh35:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_11:
Lloh38:
	adrp	x1, l_.str.1@PAGE
Lloh39:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_nfp_err
	ldr	w8, [x24]
	b	LBB0_14
LBB0_12:
	mov	x0, x22
	bl	_nfp_cpp_mutex_free
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh40:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
LBB0_14:
	neg	w26, w8
LBB0_15:
	mov	x0, x22
	bl	_nfp_cpp_mutex_free
	mov	x0, x19
	bl	_kfree
	mov	x0, x26
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ERR_PTR
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_NFP_MUTEX_WAIT_FIRST_WARN,8,3  ; @NFP_MUTEX_WAIT_FIRST_WARN
	.comm	_HZ,8,3                         ; @HZ
	.comm	_NFP_MUTEX_WAIT_ERROR,8,3       ; @NFP_MUTEX_WAIT_ERROR
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NFP_RESOURCE_ENTRY_NAME_SZ,4,2 ; @NFP_RESOURCE_ENTRY_NAME_SZ
	.comm	_NFP_RESOURCE_TBL_TARGET,4,2    ; @NFP_RESOURCE_TBL_TARGET
	.comm	_NFP_RESOURCE_TBL_BASE,4,2      ; @NFP_RESOURCE_TBL_BASE
	.comm	_NFP_RESOURCE_TBL_KEY,4,2       ; @NFP_RESOURCE_TBL_KEY
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_NFP_MUTEX_WAIT_NEXT_WARN,8,3   ; @NFP_MUTEX_WAIT_NEXT_WARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: waiting for NFP resource %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error: resource %s timed out\n"

.subsections_via_symbols
