	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_lock
_handle_lock:                           ## @handle_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	movl	32(%rdi), %edi
	movl	36(%rbx), %esi
	callq	_get_lock_type
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NO_ERROR@GOTPCREL(%rip), %rax
	movq	8(%rbx), %r14
	movq	16(%rbx), %r12
	movq	_NFS4_UINT64_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, %rdx
	subq	%r12, %rdx
	cmpq	%rdx, %r14
	jl	LBB0_2
## %bb.1:
	movq	%rcx, 8(%rbx)
	movq	%rcx, %r14
LBB0_2:
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	$1, %edi
	movl	$24, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:
	movq	%rax, %r15
	movq	%r12, (%rax)
	movq	%r14, 8(%rax)
	movl	32(%rbx), %eax
	movl	%eax, 16(%r15)
	movq	%r13, %r14
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_open_lock_delegate
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_LKLVL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	movq	8(%r15), %rcx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dprintf
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_12:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_GetLastError                   ## TAILCALL
LBB0_5:
	movq	_TRUE@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_nfs41_delegation_to_open
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movq	_ERROR_FILE_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_7
LBB0_8:
	movq	%r14, %rdi
	callq	_EnterCriticalSection
	leaq	-52(%rbp), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_lock_stateid_arg
	movl	12(%r14), %edi
	leaq	8(%r14), %rsi
	leaq	4(%r14), %rdx
	movq	(%r15), %r8
	movq	8(%r15), %r9
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	pushq	%r12
	pushq	(%r13)
	pushq	%rax
	callq	_nfs41_lock
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r12d
	movq	_LKLVL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %edi
	callq	_nfs_error_string
	movslq	%eax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_dprintf
	movq	_ERROR_BAD_NET_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_nfs_to_windows_error
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_LeaveCriticalSection
LBB0_7:
	movq	%r15, %rdi
	callq	_free
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	leaq	-52(%rbp), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_open_lock_add
	movq	%r14, %rdi
	callq	_LeaveCriticalSection
	movq	(%r13), %rax
	movq	%rax, 24(%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_NO_ERROR,4,2                   ## @NO_ERROR
	.comm	_NFS4_UINT64_MAX,8,3            ## @NFS4_UINT64_MAX
	.comm	_LKLVL,4,2                      ## @LKLVL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"delegated lock { %llu, %llu }\n"

	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_ERROR_FILE_INVALID,4,2         ## @ERROR_FILE_INVALID
	.comm	_FALSE,4,2                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"nfs41_lock failed with %s\n"

	.comm	_ERROR_BAD_NET_RESP,4,2         ## @ERROR_BAD_NET_RESP
	.no_dead_strip	_handle_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_lock
_handle_lock:                           ; @handle_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x0
	ldr	x19, [x0]
	ldr	w0, [x0, #32]
	ldr	w1, [x20, #36]
	bl	_get_lock_type
	mov	x22, x0
Lloh0:
	adrp	x8, _NO_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NO_ERROR@GOTPAGEOFF]
Lloh2:
	adrp	x9, _NFS4_UINT64_MAX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NFS4_UINT64_MAX@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldp	x25, x24, [x20, #8]
	sub	x10, x9, x24
	cmp	x25, x10
	b.lt	LBB0_2
; %bb.1:
	str	x9, [x20, #8]
	mov	x25, x9
LBB0_2:
	ldr	w23, [x8]
	mov	w0, #1
	mov	w1, #24
	bl	_calloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x21, x0
	stp	x24, x25, [x0]
	ldr	w8, [x20, #32]
	str	w8, [x0, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_open_lock_delegate
	cbz	x0, LBB0_7
; %bb.4:
Lloh5:
	adrp	x8, _LKLVL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LKLVL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldp	x2, x8, [x21]
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dprintf
Lloh10:
	adrp	x8, _TRUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
LBB0_5:
	str	x8, [x20, #24]
	b	LBB0_12
LBB0_6:
	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
	add	sp, sp, #96
	b	_GetLastError
LBB0_7:
Lloh13:
	adrp	x24, _TRUE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _TRUE@GOTPAGEOFF]
	ldr	x1, [x24]
	mov	x0, x19
	bl	_nfs41_delegation_to_open
	cbz	w0, LBB0_9
; %bb.8:
Lloh15:
	adrp	x8, _ERROR_FILE_INVALID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERROR_FILE_INVALID@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	b	LBB0_11
LBB0_9:
	mov	x0, x19
	bl	_EnterCriticalSection
	add	x23, sp, #12
	add	x1, sp, #12
	mov	x0, x19
	bl	_lock_stateid_arg
	ldr	w0, [x19, #12]
	add	x1, x19, #8
	add	x2, x19, #4
	ldp	x4, x5, [x21]
Lloh18:
	adrp	x8, _FALSE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh20:
	ldr	w6, [x8]
	ldr	x7, [x24]
	str	x23, [sp]
	mov	x3, x22
	bl	_nfs41_lock
	cbz	w0, LBB0_13
; %bb.10:
	mov	x22, x0
Lloh21:
	adrp	x8, _LKLVL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LKLVL@GOTPAGEOFF]
Lloh23:
	ldr	w20, [x8]
	bl	_nfs_error_string
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dprintf
Lloh26:
	adrp	x8, _ERROR_BAD_NET_RESP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERROR_BAD_NET_RESP@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_nfs_to_windows_error
	mov	x23, x0
	mov	x0, x19
	bl	_LeaveCriticalSection
LBB0_11:
	mov	x0, x21
	bl	_free
LBB0_12:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_13:
	add	x1, sp, #12
	mov	x0, x19
	mov	x2, x21
	bl	_open_lock_add
	mov	x0, x19
	bl	_LeaveCriticalSection
	mov	w23, #0
	ldr	x8, [x24]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_NO_ERROR,4,2                   ; @NO_ERROR
	.comm	_NFS4_UINT64_MAX,8,3            ; @NFS4_UINT64_MAX
	.comm	_LKLVL,4,2                      ; @LKLVL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"delegated lock { %llu, %llu }\n"

	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_ERROR_FILE_INVALID,4,2         ; @ERROR_FILE_INVALID
	.comm	_FALSE,4,2                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"nfs41_lock failed with %s\n"

	.comm	_ERROR_BAD_NET_RESP,4,2         ; @ERROR_BAD_NET_RESP
	.no_dead_strip	_handle_lock
.subsections_via_symbols
