	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __io_posix_open
___io_posix_open:                       ## @__io_posix_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_r_str_startswith
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_strlen
	cltq
	addq	%rax, %rbx
LBB0_2:
	movq	%rbx, %rdi
	callq	_r_file_is_directory
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	movl	$-1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_R_PERM_W@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
## %bb.4:
	movq	_R_PERM_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	andl	(%rcx), %r15d
	je	LBB0_6
## %bb.5:
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_6:
	orl	(%rax), %r15d
	jmp	LBB0_8
LBB0_7:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_8:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_r_sandbox_open                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file://"

	.comm	_R_PERM_W,4,2                   ## @R_PERM_W
	.comm	_R_PERM_CREAT,4,2               ## @R_PERM_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_BINARY,4,2                   ## @O_BINARY
	.no_dead_strip	___io_posix_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __io_posix_open
___io_posix_open:                       ; @__io_posix_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_r_str_startswith
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_strlen
	add	x20, x20, w0, sxtw
LBB0_2:
	mov	x0, x20
	bl	_r_file_is_directory
	cbz	x0, LBB0_4
; %bb.3:
	mov	w0, #-1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh4:
	adrp	x8, _R_PERM_W@GOTPAGE
Lloh5:
	ldr	x8, [x8, _R_PERM_W@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_6
; %bb.5:
Lloh7:
	adrp	x8, _R_PERM_CREAT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _R_PERM_CREAT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _O_CREAT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _O_CREAT@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w8, w21
	csel	w8, wzr, w10, eq
	orr	w1, w8, w9
	b	LBB0_7
LBB0_6:
Lloh16:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
LBB0_7:
	mov	x0, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_r_sandbox_open
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file://"

	.comm	_R_PERM_W,4,2                   ; @R_PERM_W
	.comm	_R_PERM_CREAT,4,2               ; @R_PERM_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_BINARY,4,2                   ; @O_BINARY
	.no_dead_strip	___io_posix_open
.subsections_via_symbols
