	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_file_lock                      ## -- Begin function file_lock
	.p2align	4, 0x90
_file_lock:                             ## @file_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %ebx
	movq	_O_LOCKFILES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_O_ISSET
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	$0, (%r14)
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
	movq	_LOCK_NB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	%ebx, %edi
	callq	_flock
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	(%r14), %rax
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	movq	_LOCK_UNAVAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_LOCK_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_F_SETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_fcntl
	movq	_LOCK_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_LOCK_FAILED@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_LOCKFILES,4,2                ## @O_LOCKFILES
	.comm	_LOCK_SUCCESS,4,2               ## @LOCK_SUCCESS
	.comm	_errno,8,3                      ## @errno
	.comm	_LOCK_EX,4,2                    ## @LOCK_EX
	.comm	_LOCK_NB,4,2                    ## @LOCK_NB
	.comm	_F_SETFD,4,2                    ## @F_SETFD
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_LOCK_UNAVAIL,4,2               ## @LOCK_UNAVAIL
	.comm	_LOCK_FAILED,4,2                ## @LOCK_FAILED
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_file_lock                      ; -- Begin function file_lock
	.p2align	2
_file_lock:                             ; @file_lock
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
Lloh0:
	adrp	x8, _O_LOCKFILES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_LOCKFILES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_O_ISSET
	cbz	w0, LBB0_4
; %bb.1:
Lloh3:
	adrp	x20, _errno@GOTPAGE
Lloh4:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
Lloh5:
	adrp	x8, _LOCK_EX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LOCK_EX@GOTPAGEOFF]
	str	xzr, [x20]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _LOCK_NB@GOTPAGE
Lloh9:
	ldr	x9, [x9, _LOCK_NB@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_flock
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh13:
	adrp	x10, _LOCK_UNAVAIL@GOTPAGE
Lloh14:
	ldr	x10, [x10, _LOCK_UNAVAIL@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
Lloh16:
	adrp	x11, _LOCK_FAILED@GOTPAGE
Lloh17:
	ldr	x11, [x11, _LOCK_FAILED@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	b	LBB0_5
LBB0_3:
Lloh18:
	adrp	x8, _F_SETFD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _F_SETFD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_fcntl
LBB0_4:
Lloh21:
	adrp	x8, _LOCK_SUCCESS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LOCK_SUCCESS@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_O_LOCKFILES,4,2                ; @O_LOCKFILES
	.comm	_LOCK_SUCCESS,4,2               ; @LOCK_SUCCESS
	.comm	_errno,8,3                      ; @errno
	.comm	_LOCK_EX,4,2                    ; @LOCK_EX
	.comm	_LOCK_NB,4,2                    ; @LOCK_NB
	.comm	_F_SETFD,4,2                    ; @F_SETFD
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_LOCK_UNAVAIL,4,2               ; @LOCK_UNAVAIL
	.comm	_LOCK_FAILED,4,2                ; @LOCK_FAILED
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
.subsections_via_symbols
