	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fcntl_setlk                    ## -- Begin function fcntl_setlk
	.p2align	4, 0x90
_fcntl_setlk:                           ## @fcntl_setlk
	.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
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rsi), %rax
	movq	_F_RDLCK_@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_F_WRLCK_@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	cmpq	%rdx, %rax
	je	LBB0_4
## %bb.1:
	cmpq	%rcx, %rax
	je	LBB0_4
## %bb.2:
	movq	_F_UNLCK_@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rax
	je	LBB0_4
## %bb.3:
	movq	__EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_4:
	cmpq	%rdx, %rax
	jne	LBB0_7
## %bb.5:
	movq	%r15, %rdi
	callq	_fd_getflags
	movq	_O_RDONLY_@GOTPCREL(%rip), %rcx
	movq	_O_RDWR_@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_16
## %bb.6:
	movq	(%r14), %rax
	movq	(%rbx), %rcx
LBB0_7:
	cmpq	%rcx, %rax
	jne	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	_fd_getflags
	movq	_O_WRONLY_@GOTPCREL(%rip), %rcx
	movq	_O_RDWR_@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_16
LBB0_9:
	movq	(%r15), %r13
	movq	%r13, %rdi
	callq	_lock
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_file_lock_from_flock
	testl	%eax, %eax
	js	LBB0_14
## %bb.10:
	leaq	4(%r13), %r14
	leaq	-48(%rbp), %r15
	movq	__EAGAIN@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_file_lock_acquire
	movl	%eax, %ebx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	(%r12), %ebx
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_wait_for
	testl	%eax, %eax
	jns	LBB0_11
LBB0_14:
	movl	%eax, %ebx
LBB0_15:
	movq	%r13, %rdi
	callq	_unlock
	jmp	LBB0_18
LBB0_16:
	movq	__EBADF@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F_RDLCK_,8,3                   ## @F_RDLCK_
	.comm	_F_WRLCK_,8,3                   ## @F_WRLCK_
	.comm	_F_UNLCK_,8,3                   ## @F_UNLCK_
	.comm	__EINVAL,4,2                    ## @_EINVAL
	.comm	_O_RDONLY_,4,2                  ## @O_RDONLY_
	.comm	_O_RDWR_,4,2                    ## @O_RDWR_
	.comm	__EBADF,4,2                     ## @_EBADF
	.comm	_O_WRONLY_,4,2                  ## @O_WRONLY_
	.comm	__EAGAIN,4,2                    ## @_EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fcntl_setlk                    ; -- Begin function fcntl_setlk
	.p2align	2
_fcntl_setlk:                           ; @fcntl_setlk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _F_RDLCK_@GOTPAGE
Lloh1:
	ldr	x9, [x9, _F_RDLCK_@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x9]
Lloh3:
	adrp	x22, _F_WRLCK_@GOTPAGE
Lloh4:
	ldr	x22, [x22, _F_WRLCK_@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh5:
	adrp	x11, _F_UNLCK_@GOTPAGE
Lloh6:
	ldr	x11, [x11, _F_UNLCK_@GOTPAGEOFF]
Lloh7:
	ldr	x11, [x11]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	ccmp	x8, x11, #4, ne
	b.ne	LBB0_13
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x8, x10
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_fd_getflags
Lloh8:
	adrp	x8, _O_RDONLY_@GOTPAGE
Lloh9:
	ldr	x8, [x8, _O_RDONLY_@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _O_RDWR_@GOTPAGE
Lloh12:
	ldr	x9, [x9, _O_RDWR_@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_14
; %bb.3:
	ldr	x8, [x20]
	ldr	x9, [x22]
LBB0_4:
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_fd_getflags
Lloh14:
	adrp	x8, _O_WRONLY_@GOTPAGE
Lloh15:
	ldr	x8, [x8, _O_WRONLY_@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _O_RDWR_@GOTPAGE
Lloh18:
	ldr	x9, [x9, _O_RDWR_@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_14
LBB0_6:
	ldr	x22, [x21]
	mov	x0, x22
	bl	_lock
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x20
	bl	_file_lock_from_flock
	tbnz	w0, #31, LBB0_11
; %bb.7:
	add	x21, x22, #4
Lloh20:
	adrp	x23, __EAGAIN@GOTPAGE
Lloh21:
	ldr	x23, [x23, __EAGAIN@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #8
	mov	x0, x22
	bl	_file_lock_acquire
	mov	x20, x0
	cbz	w19, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x23]
	cmp	w20, w8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	x2, #0
	bl	_wait_for
	tbz	w0, #31, LBB0_8
LBB0_11:
	mov	x20, x0
LBB0_12:
	mov	x0, x22
	bl	_unlock
	b	LBB0_16
LBB0_13:
Lloh22:
	adrp	x8, __EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, __EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh24:
	adrp	x8, __EBADF@GOTPAGE
Lloh25:
	ldr	x8, [x8, __EBADF@GOTPAGEOFF]
LBB0_15:
	ldr	w20, [x8]
LBB0_16:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_F_RDLCK_,8,3                   ; @F_RDLCK_
	.comm	_F_WRLCK_,8,3                   ; @F_WRLCK_
	.comm	_F_UNLCK_,8,3                   ; @F_UNLCK_
	.comm	__EINVAL,4,2                    ; @_EINVAL
	.comm	_O_RDONLY_,4,2                  ; @O_RDONLY_
	.comm	_O_RDWR_,4,2                    ; @O_RDWR_
	.comm	__EBADF,4,2                     ; @_EBADF
	.comm	_O_WRONLY_,4,2                  ; @O_WRONLY_
	.comm	__EAGAIN,4,2                    ; @_EAGAIN
.subsections_via_symbols
