	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dos_setbaudrate
_dos_setbaudrate:                       ## @dos_setbaudrate
	.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	_ports@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	(%rdi), %rbx
	xorl	%r14d, %r14d
	cmpl	%esi, (%r15,%rbx,4)
	je	LBB0_4
## %bb.1:
	movl	%esi, %r13d
	movl	%esi, %edi
	callq	_dos_baudconv
	testl	%eax, %eax
	jle	LBB0_2
## %bb.3:
	leaq	(%r15,%rbx,4), %r15
	xorl	%r14d, %r14d
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_disable
	movq	_com_cfcr@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_inb
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	movl	(%r12), %esi
	movq	_CFCR_DLAB@GOTPCREL(%rip), %rax
	movzbl	(%rax), %edx
	movq	%r15, %rdi
	callq	_outb
	movq	_com_dlbl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r15, %rdi
	callq	_outb
	movq	_com_dlbh@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bh, %edx
	movq	%r15, %rdi
	callq	_outb
	movl	(%r12), %esi
	movzbl	-41(%rbp), %edx                 ## 1-byte Folded Reload
	movq	%r15, %rdi
	callq	_outb
	movl	%r13d, (%r15)
	xorl	%eax, %eax
	callq	_enable
	jmp	LBB0_4
LBB0_2:
	movq	_gdb_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_fprintf_unfiltered
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ports,8,3                      ## @ports
	.comm	_gdb_stderr,4,2                 ## @gdb_stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: impossible baudrate\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_com_cfcr,4,2                   ## @com_cfcr
	.comm	_CFCR_DLAB,1,0                  ## @CFCR_DLAB
	.comm	_com_dlbl,4,2                   ## @com_dlbl
	.comm	_com_dlbh,4,2                   ## @com_dlbh
	.no_dead_strip	_dos_setbaudrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dos_setbaudrate
_dos_setbaudrate:                       ; @dos_setbaudrate
	.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, _ports@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ports@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0]
	add	x20, x8, x9, lsl #2
	ldr	w8, [x20]
	cmp	w8, w1
	b.eq	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x0, x1
	bl	_dos_baudconv
	cmp	w0, #0
	b.le	LBB0_4
; %bb.2:
	mov	x21, x0
	bl	_disable
Lloh3:
	adrp	x23, _com_cfcr@GOTPAGE
Lloh4:
	ldr	x23, [x23, _com_cfcr@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_inb
	mov	x22, x0
	ldr	w1, [x23]
Lloh5:
	adrp	x8, _CFCR_DLAB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CFCR_DLAB@GOTPAGEOFF]
	ldrb	w2, [x8]
	mov	x0, x20
	bl	_outb
Lloh7:
	adrp	x8, _com_dlbl@GOTPAGE
Lloh8:
	ldr	x8, [x8, _com_dlbl@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	and	w2, w21, #0xff
	mov	x0, x20
	bl	_outb
Lloh10:
	adrp	x8, _com_dlbh@GOTPAGE
Lloh11:
	ldr	x8, [x8, _com_dlbh@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ubfx	w2, w21, #8, #8
	mov	x0, x20
	bl	_outb
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x22
	bl	_outb
	str	w19, [x20]
	bl	_enable
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _gdb_stderr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _gdb_stderr@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_fprintf_unfiltered
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _errno@GOTPAGE
Lloh22:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh23:
	str	w8, [x9]
	mov	w0, #-1
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ports,8,3                      ; @ports
	.comm	_gdb_stderr,4,2                 ; @gdb_stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: impossible baudrate\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_com_cfcr,4,2                   ; @com_cfcr
	.comm	_CFCR_DLAB,1,0                  ; @CFCR_DLAB
	.comm	_com_dlbl,4,2                   ; @com_dlbl
	.comm	_com_dlbh,4,2                   ; @com_dlbh
	.no_dead_strip	_dos_setbaudrate
.subsections_via_symbols
