	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altcons_open
_altcons_open:                          ## @altcons_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.1:
	leaq	-16(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_stat
	testl	%eax, %eax
	je	LBB0_2
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_2:
	movl	-16(%rbp), %edi
	callq	_S_ISCHR
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	_consout_fd@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_consin_fd@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_3:
	movq	_ENOTSUP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stdio"

	.comm	_ENOTSUP,4,2                    ## @ENOTSUP
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_errno,4,2                      ## @errno
	.comm	_consout_fd,4,2                 ## @consout_fd
	.comm	_consin_fd,4,2                  ## @consin_fd
	.no_dead_strip	_altcons_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altcons_open
_altcons_open:                          ; @altcons_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	w0, LBB0_2
; %bb.1:
	add	x1, sp, #8
	mov	x0, x19
	bl	_stat
	cbz	w0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_3:
	ldr	w0, [sp, #8]
	bl	_S_ISCHR
	cbz	w0, LBB0_6
; %bb.4:
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_7
; %bb.5:
	mov	x8, x0
	mov	w0, #0
Lloh8:
	adrp	x9, _consout_fd@GOTPAGE
Lloh9:
	ldr	x9, [x9, _consout_fd@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
Lloh11:
	adrp	x9, _consin_fd@GOTPAGE
Lloh12:
	ldr	x9, [x9, _consin_fd@GOTPAGEOFF]
Lloh13:
	str	w8, [x9]
	b	LBB0_2
LBB0_6:
Lloh14:
	adrp	x8, _ENOTSUP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOTSUP@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	b	LBB0_2
LBB0_7:
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stdio"

	.comm	_ENOTSUP,4,2                    ; @ENOTSUP
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_errno,4,2                      ; @errno
	.comm	_consout_fd,4,2                 ; @consout_fd
	.comm	_consin_fd,4,2                  ; @consin_fd
	.no_dead_strip	_altcons_open
.subsections_via_symbols
