	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	cmpb	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NOCTTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_BINARY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	movl	%eax, 8(%rbx)
	cmpl	$-1, %eax
	je	LBB0_9
LBB0_4:
	leaq	24(%rbx), %r14
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_fstat
	testq	%rax, %rax
	jne	LBB0_8
## %bb.5:
	movl	(%r14), %edi
	callq	_S_ISDIR
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_8:
	movl	8(%rbx), %edi
	callq	_close
	movl	$-1, 8(%rbx)
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	movl	$0, 8(%rbx)
	xorl	%eax, %eax
	callq	_set_stdin_to_binary_mode
	movl	8(%rbx), %eax
	cmpl	$-1, %eax
	jne	LBB0_4
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rcx
	movq	_ENOTDIR@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	cmpq	(%rsi), %rcx
	jne	LBB0_11
## %bb.10:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rdx)
	jmp	LBB0_11
LBB0_6:
	movl	$1, %eax
	xorl	%ecx, %ecx
LBB0_11:
	movq	%rcx, 16(%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
	.comm	_O_BINARY,4,2                   ## @O_BINARY
	.comm	_ENOENT,8,3                     ## @ENOENT
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTDIR,8,3                    ## @ENOTDIR
	.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:
	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, x0
	ldr	x0, [x0]
	ldrb	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_NOCTTY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_NOCTTY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_BINARY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_BINARY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #438
	bl	_open
	str	w0, [x19, #8]
	cmn	w0, #1
	b.eq	LBB0_7
LBB0_2:
	add	x20, x19, #24
	mov	x1, x20
	bl	_fstat
Lloh9:
	adrp	x21, _errno@GOTPAGE
Lloh10:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	cbnz	x0, LBB0_5
; %bb.3:
	ldr	w0, [x20]
	bl	_S_ISDIR
	cbz	w0, LBB0_10
; %bb.4:
Lloh11:
	adrp	x8, _ENOENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x21]
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_close
	mov	w0, #0
	mov	w8, #-1
	str	w8, [x19, #8]
	ldr	x8, [x21]
	b	LBB0_11
LBB0_6:
	str	wzr, [x19, #8]
	bl	_set_stdin_to_binary_mode
	ldr	w0, [x19, #8]
	cmn	w0, #1
	b.ne	LBB0_2
LBB0_7:
Lloh14:
	adrp	x9, _errno@GOTPAGE
Lloh15:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
	ldr	x8, [x9]
Lloh16:
	adrp	x10, _ENOTDIR@GOTPAGE
Lloh17:
	ldr	x10, [x10, _ENOTDIR@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_9
; %bb.8:
	mov	w0, #0
Lloh19:
	adrp	x8, _ENOENT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	str	x8, [x9]
	b	LBB0_11
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	mov	x8, #0
	mov	w0, #1
LBB0_11:
	str	x8, [x19, #16]
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
	.comm	_O_BINARY,4,2                   ; @O_BINARY
	.comm	_ENOENT,8,3                     ; @ENOENT
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTDIR,8,3                    ; @ENOTDIR
	.no_dead_strip	_open_file
.subsections_via_symbols
