	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dos_write
_dos_write:                             ## @dos_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	_ports@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rdi), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpq	$0, 16(%rax,%rcx,8)
	movl	$1, %edx
	movl	$16, %esi
	cmovel	%edx, %esi
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.1:
	leaq	(%rax,%rcx,8), %r12
	movq	_com_data@GOTPCREL(%rip), %r13
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_5 Depth 2
	movl	$1, (%r12)
	cmpl	%ebx, %esi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $ebx killed $ebx killed $rbx
	cmovll	%esi, %ebx
	incl	%ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rdi
	addq	(%r13), %rdi
	movsbl	(%r15,%r14), %esi
	callq	_outportb
	decl	%ebx
	incq	%r14
	cmpl	$1, %ebx
	jg	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_rawclock
	movq	%rax, %r13
	movq	_RAWHZ@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	addq	%r14, %r15
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leal	1(%rbx), %eax
	subq	%r14, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %ebx
	subq	%r14, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$0, (%r12)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	xorl	%eax, %eax
	callq	_rawclock
	cmpq	%r13, %rax
	jl	LBB0_5
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$2, -56(%rbp)                   ## 4-byte Folded Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_com_data@GOTPCREL(%rip), %r13
	jge	LBB0_2
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_SERIAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ports,8,3                      ## @ports
	.comm	_com_data,8,3                   ## @com_data
	.comm	_RAWHZ,8,3                      ## @RAWHZ
	.comm	_EIO,4,2                        ## @EIO
	.comm	_errno,4,2                      ## @errno
	.comm	_SERIAL_ERROR,4,2               ## @SERIAL_ERROR
	.comm	_CNT_TX,8,3                     ## @CNT_TX
	.comm	_cnts,8,3                       ## @cnts
	.no_dead_strip	_dos_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dos_write
_dos_write:                             ; @dos_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _ports@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ports@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0]
	mov	w10, #24
	madd	x10, x9, x10, x8
	ldr	x10, [x10, #16]
	cmp	x10, #0
	mov	w10, #16
	csinc	w21, w10, wzr, ne
	cmp	w2, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	w10, #24
	madd	x22, x9, x10, x8
	add	x23, x22, #8
	mov	w24, #1
Lloh3:
	adrp	x25, _com_data@GOTPAGE
Lloh4:
	ldr	x25, [x25, _com_data@GOTPAGEOFF]
Lloh5:
	adrp	x26, _RAWHZ@GOTPAGE
Lloh6:
	ldr	x26, [x26, _RAWHZ@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;     Child Loop BB0_5 Depth 2
	str	w24, [x22]
	cmp	w21, w19
	csel	w8, w21, w19, lt
	add	w27, w8, #1
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x23]
	ldr	x9, [x25]
	add	x0, x9, x8
	ldrsb	w1, [x20], #1
	bl	_outportb
	sub	w19, w19, #1
	sub	w27, w27, #1
	cmp	w27, #1
	b.gt	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_rawclock
	ldr	x8, [x26]
	add	x28, x8, x0
	add	w27, w19, #1
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x22]
	cbz	w8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	bl	_rawclock
	cmp	x0, x28
	b.lt	LBB0_5
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w27, #2
	b.ge	LBB0_2
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _errno@GOTPAGE
Lloh11:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
Lloh13:
	adrp	x8, _SERIAL_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SERIAL_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ports,8,3                      ; @ports
	.comm	_com_data,8,3                   ; @com_data
	.comm	_RAWHZ,8,3                      ; @RAWHZ
	.comm	_EIO,4,2                        ; @EIO
	.comm	_errno,4,2                      ; @errno
	.comm	_SERIAL_ERROR,4,2               ; @SERIAL_ERROR
	.comm	_CNT_TX,8,3                     ; @CNT_TX
	.comm	_cnts,8,3                       ; @cnts
	.no_dead_strip	_dos_write
.subsections_via_symbols
