	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_file
_open_file:                             ## @open_file
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_capflags@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_capmode@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%eax, %eax
	callq	_open
	jmp	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	callq	_open
LBB0_3:
	movl	%eax, %ebx
	movl	$-1, %r14d
	testl	%eax, %eax
	js	LBB0_11
## %bb.4:
	movq	_caprightsp@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.5:
	movl	%ebx, %edi
	callq	_cap_rights_limit
	testq	%rax, %rax
	jns	LBB0_7
## %bb.8:
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_10
LBB0_7:
	movl	%ebx, %r14d
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%ebx, %edi
	callq	_close
	movl	%r12d, (%r15)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_capflags,4,2                   ## @capflags
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_capmode,4,2                    ## @capmode
	.comm	_caprightsp,8,3                 ## @caprightsp
	.comm	_errno,4,2                      ## @errno
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.no_dead_strip	_open_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_file
_open_file:                             ; @open_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _capflags@GOTPAGE
Lloh1:
	ldr	x8, [x8, _capflags@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _capmode@GOTPAGE
Lloh7:
	ldr	x8, [x8, _capmode@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	x8, [sp]
LBB0_2:
	bl	_open
	mov	x19, x0
	tbnz	w0, #31, LBB0_7
; %bb.3:
Lloh9:
	adrp	x8, _caprightsp@GOTPAGE
Lloh10:
	ldr	x8, [x8, _caprightsp@GOTPAGEOFF]
Lloh11:
	ldr	x1, [x8]
	cbz	x1, LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_cap_rights_limit
	tbz	x0, #63, LBB0_8
; %bb.5:
Lloh12:
	adrp	x20, _errno@GOTPAGE
Lloh13:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w21, [x20]
Lloh14:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w21, w8
	b.eq	LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_close
	str	w21, [x20]
LBB0_7:
	mov	w19, #-1
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_capflags,4,2                   ; @capflags
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_capmode,4,2                    ; @capmode
	.comm	_caprightsp,8,3                 ; @caprightsp
	.comm	_errno,4,2                      ; @errno
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.no_dead_strip	_open_file
.subsections_via_symbols
