	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nlm_wait_lock                  ## -- Begin function nlm_wait_lock
	.p2align	4, 0x90
_nlm_wait_lock:                         ## @nlm_wait_lock
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_nlm_global_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	cmpq	$0, (%r14)
	je	LBB0_1
## %bb.4:
	movq	_SIGDEFERSTOP_ERESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sigdeferstop
	movl	%eax, %r15d
	movq	_PCATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_nlm_global_lock@GOTPCREL(%rip), %rsi
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	%ebx, %r8d
	callq	_msleep
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_sigallowstop
	movq	_nw_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_nlm_waiting_locks@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_TAILQ_REMOVE
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.5:
	xorl	%eax, %eax
	cmpq	$0, (%r14)
	cmovel	%eax, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_nw_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_nlm_waiting_locks@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_TAILQ_REMOVE
LBB0_2:
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	je	LBB0_6
## %bb.3:
	movq	_EINTR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	movq	_nlm_global_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	_M_NLM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nlm_global_lock,4,2            ## @nlm_global_lock
	.comm	_SIGDEFERSTOP_ERESTART,4,2      ## @SIGDEFERSTOP_ERESTART
	.comm	_PCATCH,4,2                     ## @PCATCH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nlmlock"

	.comm	_nlm_waiting_locks,4,2          ## @nlm_waiting_locks
	.comm	_nw_link,4,2                    ## @nw_link
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_M_NLM,4,2                      ## @M_NLM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nlm_wait_lock                  ; -- Begin function nlm_wait_lock
	.p2align	2
_nlm_wait_lock:                         ; @nlm_wait_lock
	.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	x19, x0
Lloh0:
	adrp	x0, _nlm_global_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _nlm_global_lock@GOTPAGEOFF]
	bl	_mtx_lock
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _SIGDEFERSTOP_ERESTART@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SIGDEFERSTOP_ERESTART@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_sigdeferstop
	mov	x21, x0
Lloh5:
	adrp	x8, _PCATCH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCATCH@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x1, _nlm_global_lock@GOTPAGE
Lloh9:
	ldr	x1, [x1, _nlm_global_lock@GOTPAGEOFF]
Lloh10:
	adrp	x3, l_.str@PAGE
Lloh11:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	x4, x20
	bl	_msleep
	mov	x20, x0
	mov	x0, x21
	bl	_sigallowstop
Lloh12:
	adrp	x8, _nw_link@GOTPAGE
Lloh13:
	ldr	x8, [x8, _nw_link@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x0, _nlm_waiting_locks@GOTPAGE
Lloh16:
	ldr	x0, [x0, _nlm_waiting_locks@GOTPAGEOFF]
	mov	x1, x19
	bl	_TAILQ_REMOVE
	cbz	w20, LBB0_4
; %bb.2:
	ldr	x8, [x19]
	cmp	x8, #0
	csel	w20, wzr, w20, eq
	b	LBB0_5
LBB0_3:
Lloh17:
	adrp	x8, _nw_link@GOTPAGE
Lloh18:
	ldr	x8, [x8, _nw_link@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x0, _nlm_waiting_locks@GOTPAGE
Lloh21:
	ldr	x0, [x0, _nlm_waiting_locks@GOTPAGEOFF]
	mov	x1, x19
	bl	_TAILQ_REMOVE
LBB0_4:
	ldr	x8, [x19]
Lloh22:
	adrp	x9, _EINTR@GOTPAGE
Lloh23:
	ldr	x9, [x9, _EINTR@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w20, wzr, w9, eq
LBB0_5:
Lloh25:
	adrp	x0, _nlm_global_lock@GOTPAGE
Lloh26:
	ldr	x0, [x0, _nlm_global_lock@GOTPAGEOFF]
	bl	_mtx_unlock
Lloh27:
	adrp	x8, _M_NLM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _M_NLM@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_free
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_nlm_global_lock,4,2            ; @nlm_global_lock
	.comm	_SIGDEFERSTOP_ERESTART,4,2      ; @SIGDEFERSTOP_ERESTART
	.comm	_PCATCH,4,2                     ; @PCATCH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nlmlock"

	.comm	_nlm_waiting_locks,4,2          ; @nlm_waiting_locks
	.comm	_nw_link,4,2                    ; @nw_link
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_M_NLM,4,2                      ; @M_NLM
.subsections_via_symbols
