	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Devices_H_Read
_Devices_H_Read:                        ## @Devices_H_Read
	.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	_devbug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Log_print
LBB0_2:
	xorl	%eax, %eax
	callq	_Devices_GetIOCB
	testl	%eax, %eax
	je	LBB0_26
## %bb.3:
	movq	_h_fp@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_h_iocb@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rdi
	movl	$136, %ebx
	testq	%rdi, %rdi
	je	LBB0_25
## %bb.4:
	movq	_h_lastop@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movb	(%rax,%rcx), %al
	cmpb	$114, %al
	je	LBB0_8
## %bb.5:
	cmpb	$119, %al
	jne	LBB0_7
## %bb.6:
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_fseek
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rdi
LBB0_7:
	callq	_fgetc
	movq	_h_lastbyte@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r12), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	(%r15), %rax
	movb	$114, (%rax,%rdx)
	movq	(%r12), %rcx
LBB0_8:
	movq	_h_lastbyte@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movl	(%rax,%rcx,4), %r13d
	movq	_EOF@GOTPCREL(%rip), %r15
	cmpl	(%r15), %r13d
	je	LBB0_25
## %bb.9:
	movq	_h_textmode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_13
## %bb.10:
	cmpl	$10, %r13d
	je	LBB0_14
## %bb.11:
	movq	%rdx, %rbx
	cmpl	$13, %r13d
	jne	LBB0_17
## %bb.12:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_h_wascr@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rdx,%rcx,4)
	movl	$155, %r13d
	jmp	LBB0_24
LBB0_14:
	movq	_h_wascr@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$155, %r13d
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_13
## %bb.15:
	movq	%rdx, %rbx
	movq	(%r14), %rax
	movq	(%rax,%rcx,8), %rdi
	callq	_fgetc
	cmpl	%eax, (%r15)
	jne	LBB0_20
## %bb.16:
	movq	_CPU_regY@GOTPCREL(%rip), %rcx
	movl	$136, (%rcx)
	movq	(%r12), %rcx
	jmp	LBB0_23
LBB0_13:
	movq	%rdx, %rbx
	jmp	LBB0_24
LBB0_17:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_h_wascr@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
LBB0_18:
	movl	%eax, (%rdx,%rcx,4)
	jmp	LBB0_24
LBB0_20:
	cmpl	$13, %eax
	jne	LBB0_22
## %bb.21:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_h_wascr@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	(%r12), %rcx
	jmp	LBB0_18
LBB0_22:
	movq	_FALSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_h_wascr@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	(%r12), %rcx
	movl	%edx, (%rsi,%rcx,4)
LBB0_23:
	movl	%eax, %r13d
LBB0_24:
	movslq	%r13d, %rax
	movq	_CPU_regA@GOTPCREL(%rip), %rdx
	movq	%rax, (%rdx)
	movq	(%r14), %rax
	movq	(%rax,%rcx,8), %rdi
	callq	_fgetc
	movq	(%rbx), %rcx
	movq	(%r12), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	(%r14), %rax
	movq	(%rax,%rdx,8), %rdi
	callq	_feof
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	leal	(%rcx,%rcx), %ebx
	incl	%ebx
LBB0_25:
	movq	_CPU_regY@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
LBB0_26:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_devbug,8,3                     ## @devbug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HHREAD"

	.comm	_h_fp,8,3                       ## @h_fp
	.comm	_h_iocb,8,3                     ## @h_iocb
	.comm	_h_lastop,8,3                   ## @h_lastop
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_h_lastbyte,8,3                 ## @h_lastbyte
	.comm	_EOF,4,2                        ## @EOF
	.comm	_h_textmode,8,3                 ## @h_textmode
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_h_wascr,8,3                    ## @h_wascr
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_CPU_regY,4,2                   ## @CPU_regY
	.comm	_CPU_SetN,4,2                   ## @CPU_SetN
	.comm	_CPU_regA,8,3                   ## @CPU_regA
	.comm	_CPU_ClrN,4,2                   ## @CPU_ClrN
	.no_dead_strip	_Devices_H_Read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Devices_H_Read
_Devices_H_Read:                        ; @Devices_H_Read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _devbug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _devbug@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_print
LBB0_2:
	bl	_Devices_GetIOCB
	cbz	w0, LBB0_23
; %bb.3:
Lloh5:
	adrp	x20, _h_fp@GOTPAGE
Lloh6:
	ldr	x20, [x20, _h_fp@GOTPAGEOFF]
Lloh7:
	adrp	x21, _h_iocb@GOTPAGE
Lloh8:
	ldr	x21, [x21, _h_iocb@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	x8, [x21]
	ldr	x0, [x9, x8, lsl #3]
Lloh9:
	adrp	x19, _CPU_regY@GOTPAGE
Lloh10:
	ldr	x19, [x19, _CPU_regY@GOTPAGEOFF]
	cbz	x0, LBB0_9
; %bb.4:
Lloh11:
	adrp	x23, _h_lastop@GOTPAGE
Lloh12:
	ldr	x23, [x23, _h_lastop@GOTPAGEOFF]
	ldr	x9, [x23]
	ldrb	w9, [x9, x8]
Lloh13:
	adrp	x22, _h_lastbyte@GOTPAGE
Lloh14:
	ldr	x22, [x22, _h_lastbyte@GOTPAGEOFF]
	cmp	w9, #114
	b.eq	LBB0_8
; %bb.5:
	cmp	w9, #119
	b.ne	LBB0_7
; %bb.6:
Lloh15:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	ldr	x8, [x20]
	ldr	x9, [x21]
	ldr	x0, [x8, x9, lsl #3]
LBB0_7:
	bl	_fgetc
	ldr	x8, [x22]
	ldr	x9, [x21]
	str	w0, [x8, x9, lsl #2]
	ldr	x8, [x23]
	mov	w10, #114
	strb	w10, [x8, x9]
	ldr	x8, [x21]
LBB0_8:
	ldr	x9, [x22]
	ldr	w0, [x9, x8, lsl #2]
Lloh18:
	adrp	x23, _EOF@GOTPAGE
Lloh19:
	ldr	x23, [x23, _EOF@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w0, w9
	b.ne	LBB0_10
LBB0_9:
	mov	w8, #136
	b	LBB0_22
LBB0_10:
Lloh20:
	adrp	x9, _h_textmode@GOTPAGE
Lloh21:
	ldr	x9, [x9, _h_textmode@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	ldr	x9, [x9, x8, lsl #3]
	cbz	x9, LBB0_21
; %bb.11:
	cmp	w0, #10
	b.eq	LBB0_15
; %bb.12:
	cmp	w0, #13
	b.ne	LBB0_19
; %bb.13:
Lloh23:
	adrp	x9, _TRUE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _TRUE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
Lloh26:
	adrp	x10, _h_wascr@GOTPAGE
Lloh27:
	ldr	x10, [x10, _h_wascr@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
LBB0_14:
	str	w9, [x10, x8, lsl #2]
	b	LBB0_18
LBB0_15:
Lloh29:
	adrp	x24, _h_wascr@GOTPAGE
Lloh30:
	ldr	x24, [x24, _h_wascr@GOTPAGEOFF]
	ldr	x9, [x24]
	ldr	w9, [x9, x8, lsl #2]
	cbz	w9, LBB0_18
; %bb.16:
	ldr	x9, [x20]
	ldr	x0, [x9, x8, lsl #3]
	bl	_fgetc
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	ldr	w8, [x23]
	cmp	w8, w0
	b.ne	LBB0_24
; %bb.17:
	mov	w8, #136
	str	w8, [x19]
	ldr	x8, [x21]
	b	LBB0_21
LBB0_18:
	mov	w0, #155
	b	LBB0_21
LBB0_19:
Lloh31:
	adrp	x9, _FALSE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
Lloh34:
	adrp	x10, _h_wascr@GOTPAGE
Lloh35:
	ldr	x10, [x10, _h_wascr@GOTPAGEOFF]
Lloh36:
	ldr	x10, [x10]
LBB0_20:
	str	w9, [x10, x8, lsl #2]
LBB0_21:
	sxtw	x9, w0
Lloh37:
	adrp	x10, _CPU_regA@GOTPAGE
Lloh38:
	ldr	x10, [x10, _CPU_regA@GOTPAGEOFF]
Lloh39:
	str	x9, [x10]
	ldr	x9, [x20]
	ldr	x0, [x9, x8, lsl #3]
	bl	_fgetc
	ldr	x8, [x22]
	ldr	x9, [x21]
	str	w0, [x8, x9, lsl #2]
	ldr	x8, [x20]
	ldr	x0, [x8, x9, lsl #3]
	bl	_feof
	cmp	x0, #0
	mov	w8, #3
	csinc	w8, w8, wzr, ne
LBB0_22:
	str	w8, [x19]
LBB0_23:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_24:
	cmp	w0, #13
	b.ne	LBB0_26
; %bb.25:
Lloh40:
	adrp	x8, _TRUE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x8]
	ldr	x10, [x24]
	ldr	x8, [x21]
	b	LBB0_14
LBB0_26:
Lloh43:
	adrp	x8, _FALSE@GOTPAGE
Lloh44:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x8]
	ldr	x10, [x24]
	ldr	x8, [x21]
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_devbug,8,3                     ; @devbug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HHREAD"

	.comm	_h_fp,8,3                       ; @h_fp
	.comm	_h_iocb,8,3                     ; @h_iocb
	.comm	_h_lastop,8,3                   ; @h_lastop
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_h_lastbyte,8,3                 ; @h_lastbyte
	.comm	_EOF,4,2                        ; @EOF
	.comm	_h_textmode,8,3                 ; @h_textmode
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_h_wascr,8,3                    ; @h_wascr
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_CPU_regY,4,2                   ; @CPU_regY
	.comm	_CPU_SetN,4,2                   ; @CPU_SetN
	.comm	_CPU_regA,8,3                   ; @CPU_regA
	.comm	_CPU_ClrN,4,2                   ; @CPU_ClrN
	.no_dead_strip	_Devices_H_Read
.subsections_via_symbols
