	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RDevice_WRIT                   ## -- Begin function RDevice_WRIT
	.p2align	4, 0x90
_RDevice_WRIT:                          ## @RDevice_WRIT
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_CPU_regY@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_translation@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_CPU_regA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	je	LBB0_8
## %bb.1:
	cmpl	$155, %eax
                                        ## implicit-def: $al
	jne	LBB0_8
## %bb.2:
	movb	$13, -17(%rbp)
	movq	_linefeeds@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.4:
	movq	_RDevice_serial_enabled@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_connected@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_bufend@GOTPCREL(%rip), %r14
	movslq	(%r14), %rax
	leal	1(%rax), %ecx
	movl	%ecx, (%r14)
	movq	_bufout@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movb	$13, (%rdx,%rax)
	movq	(%rcx), %rax
	movslq	(%r14), %rdx
	movb	$0, (%rax,%rdx)
	movq	_command_end@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_command_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movb	$0, (%rax)
	movq	(%rcx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcat
	addl	$4, (%r14)
	jmp	LBB0_7
LBB0_3:
	movb	$13, %al
	jmp	LBB0_8
LBB0_6:
	movq	_rdev_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-17(%rbp), %rsi
	movl	$1, %edx
	callq	_write
LBB0_7:
	movb	$10, %al
LBB0_8:
	movq	_connected@GOTPCREL(%rip), %rcx
	movq	_trans_cr@GOTPCREL(%rip), %rdx
	cmpb	$13, %al
	movzbl	%al, %eax
	movl	$10, %esi
	cmovnel	%eax, %esi
	cmpl	$0, (%rdx)
	cmovel	%eax, %esi
	cmpq	$0, (%rcx)
	cmovel	%eax, %esi
	movb	%sil, -17(%rbp)
	je	LBB0_11
## %bb.9:
	movq	_rdev_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-17(%rbp), %rsi
	movl	$1, %edx
	callq	_write
	testl	%eax, %eax
	jle	LBB0_10
LBB0_11:
	movl	$1, (%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	callq	_RDevice_WRIT.cold.1
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function RDevice_WRIT.cold.1
_RDevice_WRIT.cold.1:                   ## @RDevice_WRIT.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	leaq	L_.str.2(%rip), %rdi
	callq	_DBG_APRINT
	movq	_CPU_regY@GOTPCREL(%rip), %rax
	movl	$135, (%rax)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CPU_regY,4,2                   ## @CPU_regY
	.comm	_CPU_ClrN,4,2                   ## @CPU_ClrN
	.comm	_translation,8,3                ## @translation
	.comm	_CPU_regA,4,2                   ## @CPU_regA
	.comm	_linefeeds,8,3                  ## @linefeeds
	.comm	_RDevice_serial_enabled,8,3     ## @RDevice_serial_enabled
	.comm	_connected,8,3                  ## @connected
	.comm	_bufend,4,2                     ## @bufend
	.comm	_bufout,8,3                     ## @bufout
	.comm	_command_end,8,3                ## @command_end
	.comm	_command_buf,8,3                ## @command_buf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OK\r\n"

	.comm	_rdev_fd,4,2                    ## @rdev_fd
	.comm	_trans_cr,4,2                   ## @trans_cr
L_.str.1:                               ## @.str.1
	.asciz	"write"

L_.str.2:                               ## @.str.2
	.asciz	"R*: ERROR on write."

	.comm	_CPU_SetN,4,2                   ## @CPU_SetN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_RDevice_WRIT                   ; -- Begin function RDevice_WRIT
	.p2align	2
_RDevice_WRIT:                          ; @RDevice_WRIT
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, _CPU_regY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CPU_regY@GOTPAGEOFF]
	mov	w9, #1
Lloh2:
	str	w9, [x8]
Lloh3:
	adrp	x8, _translation@GOTPAGE
Lloh4:
	ldr	x8, [x8, _translation@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
Lloh6:
	adrp	x19, _CPU_regA@GOTPAGE
Lloh7:
	ldr	x19, [x19, _CPU_regA@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh8:
	adrp	x20, _connected@GOTPAGE
Lloh9:
	ldr	x20, [x20, _connected@GOTPAGEOFF]
	cbz	x9, LBB0_7
; %bb.1:
	cmp	w8, #155
                                        ; implicit-def: $w8
	b.ne	LBB0_7
; %bb.2:
	mov	w8, #13
	strb	w8, [sp, #15]
Lloh10:
	adrp	x9, _linefeeds@GOTPAGE
Lloh11:
	ldr	x9, [x9, _linefeeds@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cbz	x9, LBB0_7
; %bb.3:
Lloh13:
	adrp	x8, _RDevice_serial_enabled@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RDevice_serial_enabled@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x9, [x20]
	orr	x8, x8, x9
	cbnz	x8, LBB0_5
; %bb.4:
Lloh16:
	adrp	x21, _bufend@GOTPAGE
Lloh17:
	ldr	x21, [x21, _bufend@GOTPAGEOFF]
	ldrsw	x8, [x21]
	add	w9, w8, #1
	str	w9, [x21]
Lloh18:
	adrp	x9, _bufout@GOTPAGE
Lloh19:
	ldr	x9, [x9, _bufout@GOTPAGEOFF]
	ldr	x10, [x9]
	mov	w11, #13
	strb	w11, [x10, x8]
	ldr	x8, [x9]
	ldrsw	x10, [x21]
	strb	wzr, [x8, x10]
Lloh20:
	adrp	x8, _command_end@GOTPAGE
Lloh21:
	ldr	x8, [x8, _command_end@GOTPAGEOFF]
Lloh22:
	str	xzr, [x8]
Lloh23:
	adrp	x8, _command_buf@GOTPAGE
Lloh24:
	ldr	x8, [x8, _command_buf@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	strb	wzr, [x8]
	ldr	x0, [x9]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcat
	ldr	w8, [x21]
	add	w8, w8, #4
	str	w8, [x21]
	b	LBB0_6
LBB0_5:
Lloh28:
	adrp	x8, _rdev_fd@GOTPAGE
Lloh29:
	ldr	x8, [x8, _rdev_fd@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	add	x1, sp, #15
	mov	w2, #1
	bl	_write
LBB0_6:
	mov	w8, #10
LBB0_7:
	ldr	x9, [x20]
Lloh31:
	adrp	x10, _trans_cr@GOTPAGE
Lloh32:
	ldr	x10, [x10, _trans_cr@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	and	w11, w8, #0xff
	cmp	w11, #13
	ccmp	w10, #0, #4, eq
	ccmp	x9, #0, #4, ne
	mov	w10, #10
	csel	w8, w10, w8, ne
	strb	w8, [sp, #15]
	cbz	x9, LBB0_9
; %bb.8:
Lloh34:
	adrp	x8, _rdev_fd@GOTPAGE
Lloh35:
	ldr	x8, [x8, _rdev_fd@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	add	x1, sp, #15
	mov	w2, #1
	bl	_write
	cmp	w0, #0
	b.le	LBB0_10
LBB0_9:
	mov	w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_10:
	bl	_RDevice_WRIT.cold.1
	b	LBB0_9
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function RDevice_WRIT.cold.1
_RDevice_WRIT.cold.1:                   ; @RDevice_WRIT.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG_APRINT
Lloh41:
	adrp	x8, _CPU_regY@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CPU_regY@GOTPAGEOFF]
	mov	w9, #135
Lloh43:
	str	w9, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotStr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_CPU_regY,4,2                   ; @CPU_regY
	.comm	_CPU_ClrN,4,2                   ; @CPU_ClrN
	.comm	_translation,8,3                ; @translation
	.comm	_CPU_regA,4,2                   ; @CPU_regA
	.comm	_linefeeds,8,3                  ; @linefeeds
	.comm	_RDevice_serial_enabled,8,3     ; @RDevice_serial_enabled
	.comm	_connected,8,3                  ; @connected
	.comm	_bufend,4,2                     ; @bufend
	.comm	_bufout,8,3                     ; @bufout
	.comm	_command_end,8,3                ; @command_end
	.comm	_command_buf,8,3                ; @command_buf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OK\r\n"

	.comm	_rdev_fd,4,2                    ; @rdev_fd
	.comm	_trans_cr,4,2                   ; @trans_cr
l_.str.1:                               ; @.str.1
	.asciz	"write"

l_.str.2:                               ; @.str.2
	.asciz	"R*: ERROR on write."

	.comm	_CPU_SetN,4,2                   ; @CPU_SetN
.subsections_via_symbols
