	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _file_lock
__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
	subq	$32, %rsp
	movsbl	(%rdx), %eax
	cmpl	$119, %eax
	je	LBB0_1
## %bb.2:
	cmpl	$117, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$114, %eax
	jne	LBB0_5
## %bb.4:
	movq	_F_RDLCK@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_F_WRLCK@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_F_UNLCK@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	%rcx, -16(%rbp)
	movq	%r8, -24(%rbp)
	movq	%rsi, %rdi
	callq	_fileno
	movq	_F_SETLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-24(%rbp), %rdx
	movl	%eax, %edi
	callq	_fcntl
	xorl	%ecx, %ecx
	cmpl	$-1, %eax
	setne	%cl
	movl	%ecx, %eax
	addq	$32, %rsp
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r9, %rdx
	addq	$32, %rsp
	popq	%rbp
	jmp	_luaL_error                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_F_WRLCK,4,2                    ## @F_WRLCK
	.comm	_F_RDLCK,4,2                    ## @F_RDLCK
	.comm	_F_UNLCK,4,2                    ## @F_UNLCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: invalid mode"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_F_SETLK,4,2                    ## @F_SETLK
	.comm	_LK_NBLCK,4,2                   ## @LK_NBLCK
	.comm	_LK_UNLCK,4,2                   ## @LK_UNLCK
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.no_dead_strip	__file_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _file_lock
__file_lock:                            ; @_file_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	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
	ldrsb	w8, [x2]
	cmp	w8, #119
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #117
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #114
	b.ne	LBB0_7
; %bb.3:
Lloh0:
	adrp	x8, _F_RDLCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_RDLCK@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _F_WRLCK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _F_WRLCK@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh4:
	adrp	x8, _F_UNLCK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _F_UNLCK@GOTPAGEOFF]
LBB0_6:
Lloh6:
	adrp	x9, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SEEK_SET@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
	stp	x4, x3, [sp, #8]
	mov	x0, x1
	bl	_fileno
Lloh9:
	adrp	x8, _F_SETLK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _F_SETLK@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_fcntl
	cmn	w0, #1
	cset	w0, ne
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x5
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_luaL_error
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_F_WRLCK,4,2                    ; @F_WRLCK
	.comm	_F_RDLCK,4,2                    ; @F_RDLCK
	.comm	_F_UNLCK,4,2                    ; @F_UNLCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: invalid mode"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_F_SETLK,4,2                    ; @F_SETLK
	.comm	_LK_NBLCK,4,2                   ; @LK_NBLCK
	.comm	_LK_UNLCK,4,2                   ; @LK_UNLCK
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.no_dead_strip	__file_lock
.subsections_via_symbols
