	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdb_has_a_terminal             ## -- Begin function gdb_has_a_terminal
	.p2align	4, 0x90
_gdb_has_a_terminal:                    ## @gdb_has_a_terminal
	.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	_gdb_has_a_terminal_flag@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_1
## %bb.2:
	cmpl	$130, %eax
	je	LBB0_4
## %bb.3:
	cmpl	$129, %eax
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movl	$1, %eax
	jmp	LBB0_8
LBB0_4:
	movl	$129, (%rbx)
	xorl	%edi, %edi
	callq	_serial_fdopen
	movq	_stdin_serial@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	%rax, %rdi
	callq	_serial_get_tty_state
	movq	_our_ttystate@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	$128, (%rbx)
LBB0_7:
	xorl	%eax, %eax
	cmpl	$128, (%rbx)
	sete	%al
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gdb_has_a_terminal_flag,4,2    ## @gdb_has_a_terminal_flag
	.comm	_stdin_serial,8,3               ## @stdin_serial
	.comm	_our_ttystate,8,3               ## @our_ttystate
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_TIOCGPGRP,4,2                  ## @TIOCGPGRP
	.comm	_our_process_group,4,2          ## @our_process_group
	.comm	_tflags_ours,4,2                ## @tflags_ours
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdb_has_a_terminal             ; -- Begin function gdb_has_a_terminal
	.p2align	2
_gdb_has_a_terminal:                    ; @gdb_has_a_terminal
	.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
Lloh0:
	adrp	x19, _gdb_has_a_terminal_flag@GOTPAGE
Lloh1:
	ldr	x19, [x19, _gdb_has_a_terminal_flag@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #130
	b.eq	LBB0_4
; %bb.2:
	cmp	w8, #129
	mov	w0, #0
	b	LBB0_8
LBB0_3:
	mov	w0, #1
	b	LBB0_8
LBB0_4:
	mov	w8, #129
	str	w8, [x19]
	mov	w0, #0
	bl	_serial_fdopen
Lloh2:
	adrp	x8, _stdin_serial@GOTPAGE
Lloh3:
	ldr	x8, [x8, _stdin_serial@GOTPAGEOFF]
Lloh4:
	str	x0, [x8]
	cbz	x0, LBB0_7
; %bb.5:
	bl	_serial_get_tty_state
Lloh5:
	adrp	x8, _our_ttystate@GOTPAGE
Lloh6:
	ldr	x8, [x8, _our_ttystate@GOTPAGEOFF]
Lloh7:
	str	x0, [x8]
	cbz	x0, LBB0_7
; %bb.6:
	mov	w8, #128
	str	w8, [x19]
LBB0_7:
	ldr	w8, [x19]
	cmp	w8, #128
	cset	w0, eq
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_gdb_has_a_terminal_flag,4,2    ; @gdb_has_a_terminal_flag
	.comm	_stdin_serial,8,3               ; @stdin_serial
	.comm	_our_ttystate,8,3               ; @our_ttystate
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_TIOCGPGRP,4,2                  ; @TIOCGPGRP
	.comm	_our_process_group,4,2          ; @our_process_group
	.comm	_tflags_ours,4,2                ; @tflags_ours
.subsections_via_symbols
