	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpc_tty_chars_in_buffer
_cpc_tty_chars_in_buffer:               ## @cpc_tty_chars_in_buffer
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	cmpq	%rdi, 16(%rax)
	jne	LBB0_5
## %bb.4:
	movq	(%rax), %rcx
	movq	_CPC_TTY_ST_OPEN@GOTPCREL(%rip), %rdx
	xorl	%ebx, %ebx
	cmpq	(%rdx), %rcx
	je	LBB0_7
LBB0_5:
	movl	8(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_CPC_TTY_DBG
	jmp	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_CPC_TTY_DBG
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hdlcX-tty: no TTY to chars in buffer\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CPC_TTY_ST_OPEN,8,3            ## @CPC_TTY_ST_OPEN
L_.str.1:                               ## @.str.1
	.asciz	"%s: TTY is not opened\n"

	.no_dead_strip	_cpc_tty_chars_in_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpc_tty_chars_in_buffer
_cpc_tty_chars_in_buffer:               ; @cpc_tty_chars_in_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	x9, [x8, #16]
	cmp	x9, x0
	b.ne	LBB0_6
; %bb.3:
	ldr	x9, [x8]
Lloh0:
	adrp	x10, _CPC_TTY_ST_OPEN@GOTPAGE
Lloh1:
	ldr	x10, [x10, _CPC_TTY_ST_OPEN@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_6
; %bb.4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	ldr	w8, [x8, #8]
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_CPC_TTY_DBG
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hdlcX-tty: no TTY to chars in buffer\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CPC_TTY_ST_OPEN,8,3            ; @CPC_TTY_ST_OPEN
l_.str.1:                               ; @.str.1
	.asciz	"%s: TTY is not opened\n"

	.no_dead_strip	_cpc_tty_chars_in_buffer
.subsections_via_symbols
