	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_os_open_file                   ## -- Begin function os_open_file
	.p2align	4, 0x90
_os_open_file:                          ## @os_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %edx
	leaq	16(%rbp), %r14
	movq	64(%rbp), %rax
	movq	72(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.1:
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.4:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	xorl	%r8d, %r8d
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r8d
LBB0_8:
	xorl	%eax, %eax
	cmpq	$0, 40(%r14)
	movl	$0, %esi
	je	LBB0_10
## %bb.9:
	movq	_O_SYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_10:
	cmpq	$0, 32(%r14)
	movl	$0, %ebx
	je	LBB0_12
## %bb.11:
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_12:
	cmpq	$0, 24(%r14)
	movl	$0, %ecx
	je	LBB0_14
## %bb.13:
	movq	_O_TRUNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_14:
	orl	%ecx, %ebx
	orl	%r8d, %esi
	cmpq	$0, 16(%r14)
	movl	$0, %ecx
	je	LBB0_16
## %bb.15:
	movq	_O_EXCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_16:
	orl	%ebx, %esi
	cmpq	$0, 8(%r14)
	je	LBB0_18
## %bb.17:
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	orl	%eax, %ecx
	orl	%ecx, %esi
	callq	_open64
	testl	%eax, %eax
	js	LBB0_19
## %bb.20:
	movl	%eax, %ebx
	cmpq	$0, (%r14)
	je	LBB0_23
## %bb.21:
	movq	_F_SETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_fcntl
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movq	_errno@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_close
	movl	%r14d, %ebx
	jmp	LBB0_23
LBB0_19:
	movq	_errno@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_SYNC,4,2                     ## @O_SYNC
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.comm	_errno,4,2                      ## @errno
	.comm	_F_SETFD,4,2                    ## @F_SETFD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_os_open_file                   ; -- Begin function os_open_file
	.p2align	2
_os_open_file:                          ; @os_open_file
	.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, x1
	ldp	x8, x9, [x1, #48]
	cbz	x9, LBB0_3
; %bb.1:
	cbz	x8, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w8, wzr, w9, eq
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
LBB0_6:
	ldr	x9, [x19, #40]
Lloh7:
	adrp	x10, _O_SYNC@GOTPAGE
Lloh8:
	ldr	x10, [x10, _O_SYNC@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
	ldp	x11, x10, [x19, #24]
	cmp	x10, #0
Lloh12:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
Lloh13:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh14:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	x11, #0
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
	ldp	x10, x9, [x19, #8]
	cmp	x9, #0
Lloh16:
	adrp	x9, _O_EXCL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _O_EXCL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w8, w8, w9
Lloh19:
	adrp	x9, _O_APPEND@GOTPAGE
Lloh20:
	ldr	x9, [x9, _O_APPEND@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	x10, #0
	csel	w9, wzr, w9, eq
	orr	w1, w8, w9
	bl	_open64
	tbnz	w0, #31, LBB0_10
; %bb.7:
	mov	x20, x0
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.8:
Lloh22:
	adrp	x8, _F_SETFD@GOTPAGE
Lloh23:
	ldr	x8, [x8, _F_SETFD@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_fcntl
	cbz	x0, LBB0_11
; %bb.9:
Lloh25:
	adrp	x8, _errno@GOTPAGE
Lloh26:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w19, w8
	mov	x0, x20
	bl	_close
	mov	x20, x19
	b	LBB0_11
LBB0_10:
Lloh28:
	adrp	x8, _errno@GOTPAGE
Lloh29:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_SYNC,4,2                     ; @O_SYNC
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.comm	_errno,4,2                      ; @errno
	.comm	_F_SETFD,4,2                    ; @F_SETFD
.subsections_via_symbols
