	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function is_console
_is_console:                            ## @is_console
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	callq	__get_osfhandle
	movq	%rax, %rbx
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpq	(%rax), %rbx
	je	LBB0_10
## %bb.1:
	movq	%rbx, %rdi
	callq	_GetFileType
	movq	_FILE_TYPE_CHAR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.2:
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.5:
	leaq	-32(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_GetConsoleScreenBufferInfo
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	cmpl	$2, %r15d
	jbe	LBB0_7
	jmp	LBB0_8
LBB0_3:
	leaq	-36(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_GetConsoleMode
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	movq	$0, -32(%rbp)
LBB0_7:
	movq	_FD_CONSOLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_fd_is_interactive@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%r15d, %edx
	orl	%eax, (%rcx,%rdx,4)
LBB0_8:
	movl	$1, %r14d
	cmpb	$0, _is_console.initialized(%rip)
	jne	LBB0_10
## %bb.9:
	movq	_console@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	-32(%rbp), %rax
	movq	_plain_attr@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_attr@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_negative@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movb	$1, _is_console.initialized(%rip)
LBB0_10:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_is_console.initialized,1,2 ## @is_console.initialized
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_FILE_TYPE_CHAR,8,3             ## @FILE_TYPE_CHAR
	.comm	_FD_CONSOLE,4,2                 ## @FD_CONSOLE
	.comm	_fd_is_interactive,8,3          ## @fd_is_interactive
	.comm	_console,8,3                    ## @console
	.comm	_plain_attr,8,3                 ## @plain_attr
	.comm	_attr,8,3                       ## @attr
	.comm	_negative,8,3                   ## @negative
	.no_dead_strip	_is_console
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function is_console
_is_console:                            ; @is_console
	.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	x20, x0
	bl	__get_osfhandle
Lloh0:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.1:
	mov	x19, x0
	bl	_GetFileType
Lloh3:
	adrp	x8, _FILE_TYPE_CHAR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FILE_TYPE_CHAR@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.2:
	cbz	w20, LBB0_7
; %bb.3:
	add	x1, sp, #8
	mov	x0, x19
	bl	_GetConsoleScreenBufferInfo
	cbz	w0, LBB0_6
; %bb.4:
	cmp	w20, #2
	b.ls	LBB0_9
	b	LBB0_10
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
	add	x1, sp, #4
	mov	x0, x19
	bl	_GetConsoleMode
	cbz	w0, LBB0_6
; %bb.8:
	str	xzr, [sp, #8]
LBB0_9:
Lloh6:
	adrp	x8, _FD_CONSOLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FD_CONSOLE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _fd_is_interactive@GOTPAGE
Lloh10:
	ldr	x9, [x9, _fd_is_interactive@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	mov	w10, w20
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	orr	w8, w11, w8
	str	w8, [x9, x10]
LBB0_10:
	adrp	x8, _is_console.initialized@PAGE
	ldrb	w9, [x8, _is_console.initialized@PAGEOFF]
	mov	w0, #1
	tbnz	w9, #0, LBB0_6
; %bb.11:
Lloh12:
	adrp	x9, _console@GOTPAGE
Lloh13:
	ldr	x9, [x9, _console@GOTPAGEOFF]
Lloh14:
	str	x19, [x9]
	ldr	x9, [sp, #8]
Lloh15:
	adrp	x10, _plain_attr@GOTPAGE
Lloh16:
	ldr	x10, [x10, _plain_attr@GOTPAGEOFF]
Lloh17:
	adrp	x11, _attr@GOTPAGE
Lloh18:
	ldr	x11, [x11, _attr@GOTPAGEOFF]
Lloh19:
	str	x9, [x10]
Lloh20:
	str	x9, [x11]
Lloh21:
	adrp	x9, _negative@GOTPAGE
Lloh22:
	ldr	x9, [x9, _negative@GOTPAGEOFF]
Lloh23:
	str	xzr, [x9]
	strb	w0, [x8, _is_console.initialized@PAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_is_console.initialized,1,2 ; @is_console.initialized
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_FILE_TYPE_CHAR,8,3             ; @FILE_TYPE_CHAR
	.comm	_FD_CONSOLE,4,2                 ; @FD_CONSOLE
	.comm	_fd_is_interactive,8,3          ; @fd_is_interactive
	.comm	_console,8,3                    ; @console
	.comm	_plain_attr,8,3                 ; @plain_attr
	.comm	_attr,8,3                       ; @attr
	.comm	_negative,8,3                   ; @negative
	.no_dead_strip	_is_console
.subsections_via_symbols
