	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fs_posix_open
_fs_posix_open:                         ## @fs_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_r_fs_file_new
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %r12
	movq	$0, 8(%rax)
	movl	(%rbx), %eax
	movl	%eax, 4(%r12)
	testl	%r15d, %r15d
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rsi
	cmoveq	%rax, %rsi
	movq	%r14, %rdi
	callq	_r_sandbox_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %r14
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r14, %rdi
	callq	_ftell
	movl	%eax, (%r12)
	movq	%r14, %rdi
	callq	_fclose
	jmp	LBB0_5
LBB0_3:
	movq	%r12, %rdi
	callq	_r_fs_file_free
LBB0_4:
	xorl	%r12d, %r12d
LBB0_5:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.no_dead_strip	_fs_posix_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fs_posix_open
_fs_posix_open:                         ; @fs_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	x21, x2
	mov	x20, x1
	mov	x22, x0
	bl	_r_fs_file_new
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.1:
	str	xzr, [x19, #8]
	ldr	w8, [x22]
	str	w8, [x19, #4]
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w21, #0
	csel	x1, x9, x8, eq
	mov	x0, x20
	bl	_r_sandbox_fopen
	cbz	x0, LBB0_3
; %bb.2:
	mov	x20, x0
Lloh4:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	mov	x0, x20
	bl	_ftell
	str	w0, [x19]
	mov	x0, x20
	bl	_fclose
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_r_fs_file_free
	mov	x19, #0
LBB0_4:
	mov	x0, 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
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.no_dead_strip	_fs_posix_open
.subsections_via_symbols
