	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Devices_H_Write
_Devices_H_Write:                       ## @Devices_H_Write
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -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_12
## %bb.3:
	movq	_h_fp@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movq	_h_iocb@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rcx,%rax,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.5:
	movq	_h_lastop@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	cmpb	$114, (%rcx,%rax)
	jne	LBB0_7
## %bb.6:
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_fseek
	movq	(%r15), %rcx
	movq	(%rbx), %rax
LBB0_7:
	movb	$119, (%rcx,%rax)
	movq	_CPU_regA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	$155, %edi
	jne	LBB0_8
## %bb.9:
	movq	_h_textmode@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%rbx), %rax
	cmpq	$0, (%rcx,%rax,8)
	movl	$155, %ecx
	movl	$10, %edi
	cmovel	%ecx, %edi
	jmp	LBB0_10
LBB0_4:
	movl	$135, %eax
	jmp	LBB0_11
LBB0_8:
	movq	(%rbx), %rax
LBB0_10:
	movq	(%r14), %rcx
	movq	(%rcx,%rax,8), %rsi
	callq	_fputc
	movl	$1, %eax
LBB0_11:
	movq	_CPU_regY@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	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	"HHWRIT"

	.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	_CPU_regA,4,2                   ## @CPU_regA
	.comm	_h_textmode,8,3                 ## @h_textmode
	.comm	_CPU_regY,4,2                   ## @CPU_regY
	.comm	_CPU_ClrN,4,2                   ## @CPU_ClrN
	.comm	_CPU_SetN,4,2                   ## @CPU_SetN
	.no_dead_strip	_Devices_H_Write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Devices_H_Write
_Devices_H_Write:                       ; @Devices_H_Write
	.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, _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_12
; %bb.3:
Lloh5:
	adrp	x19, _h_fp@GOTPAGE
Lloh6:
	ldr	x19, [x19, _h_fp@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh7:
	adrp	x20, _h_iocb@GOTPAGE
Lloh8:
	ldr	x20, [x20, _h_iocb@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x0, [x9, x8, lsl #3]
	cbz	x0, LBB0_8
; %bb.4:
Lloh9:
	adrp	x21, _h_lastop@GOTPAGE
Lloh10:
	ldr	x21, [x21, _h_lastop@GOTPAGEOFF]
	ldr	x9, [x21]
	ldrb	w10, [x9, x8]
	cmp	w10, #114
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	ldr	x9, [x21]
	ldr	x8, [x20]
LBB0_6:
	mov	w10, #119
	strb	w10, [x9, x8]
Lloh14:
	adrp	x8, _CPU_regA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CPU_regA@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	cmp	w0, #155
	b.ne	LBB0_9
; %bb.7:
Lloh17:
	adrp	x8, _h_textmode@GOTPAGE
Lloh18:
	ldr	x8, [x8, _h_textmode@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x8]
	ldr	x8, [x20]
	ldr	x9, [x9, x8, lsl #3]
	cmp	x9, #0
	mov	w9, #10
	mov	w10, #155
	csel	w0, w10, w9, eq
	b	LBB0_10
LBB0_8:
	mov	w8, #135
	b	LBB0_11
LBB0_9:
	ldr	x8, [x20]
LBB0_10:
	ldr	x9, [x19]
	ldr	x1, [x9, x8, lsl #3]
	bl	_fputc
	mov	w8, #1
LBB0_11:
Lloh20:
	adrp	x9, _CPU_regY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CPU_regY@GOTPAGEOFF]
Lloh22:
	str	w8, [x9]
LBB0_12:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_devbug,8,3                     ; @devbug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HHWRIT"

	.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	_CPU_regA,4,2                   ; @CPU_regA
	.comm	_h_textmode,8,3                 ; @h_textmode
	.comm	_CPU_regY,4,2                   ; @CPU_regY
	.comm	_CPU_ClrN,4,2                   ; @CPU_ClrN
	.comm	_CPU_SetN,4,2                   ; @CPU_SetN
	.no_dead_strip	_Devices_H_Write
.subsections_via_symbols
