	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_chars
_get_chars:                             ## @get_chars
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_VTTY_PORTS@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_1
## %bb.2:
	movl	%edx, %r12d
	testl	%edx, %edx
	je	LBB0_3
## %bb.4:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_port_info@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_consolelock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	shlq	$4, %r14
	movl	(%r13,%r14), %ebx
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.6:
	movslq	4(%r13,%r14), %rsi
	subl	%esi, %ebx
	cmpl	%r12d, %ebx
	cmovgel	%r12d, %ebx
	leaq	(%r14,%r13), %r12
	shlq	$2, %rsi
	addq	8(%r13,%r14), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movl	4(%r13,%r14), %eax
	addl	%ebx, %eax
	movl	%eax, 4(%r13,%r14)
	cmpl	(%r12), %eax
	jne	LBB0_8
## %bb.7:
	leaq	(%r14,%r13), %rax
	addq	$4, %rax
	movl	$0, (%rax)
	movl	$0, (%r12)
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_5:
	xorl	%ebx, %ebx
LBB0_8:
	movq	_consolelock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VTTY_PORTS,8,3                 ## @VTTY_PORTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_port_info,8,3                  ## @port_info
	.comm	_consolelock,4,2                ## @consolelock
	.no_dead_strip	_get_chars
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_chars
_get_chars:                             ; @get_chars
	.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
Lloh0:
	adrp	x8, _VTTY_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VTTY_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ls	LBB0_5
; %bb.1:
	mov	x19, x2
	cbz	w2, LBB0_8
; %bb.2:
	mov	x20, x1
	mov	x21, x0
Lloh3:
	adrp	x8, _port_info@GOTPAGE
Lloh4:
	ldr	x8, [x8, _port_info@GOTPAGEOFF]
Lloh5:
	ldr	x22, [x8]
Lloh6:
	adrp	x0, _consolelock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _consolelock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	add	x21, x22, x21, lsl #4
	ldr	w8, [x21]
	cbz	w8, LBB0_6
; %bb.3:
	ldrsw	x9, [x21, #4]
	sub	w8, w8, w9
	cmp	w8, w19
	csel	w19, w8, w19, lt
	ldr	x8, [x21, #8]
	add	x1, x8, x9, lsl #2
	mov	x0, x20
	mov	x2, x19
	bl	_memcpy
	ldp	w9, w8, [x21]
	add	w8, w8, w19
	cmp	w8, w9
	str	w8, [x21, #4]
	b.ne	LBB0_7
; %bb.4:
	str	xzr, [x21]
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_6:
	mov	w19, #0
LBB0_7:
Lloh11:
	adrp	x0, _consolelock@GOTPAGE
Lloh12:
	ldr	x0, [x0, _consolelock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
LBB0_8:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_VTTY_PORTS,8,3                 ; @VTTY_PORTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_port_info,8,3                  ; @port_info
	.comm	_consolelock,4,2                ; @consolelock
	.no_dead_strip	_get_chars
.subsections_via_symbols
