	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxser_set_baud
_mxser_set_baud:                        ## @mxser_set_baud
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	movl	$-1, %ebx
	cmpq	$0, 24(%r14)
	je	LBB0_14
## %bb.1:
	cmpq	%rsi, (%r14)
	jl	LBB0_14
## %bb.2:
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.4:
	cmpq	$134, %rsi
	jne	LBB0_6
## %bb.5:
	movl	8(%r14), %eax
	addl	%eax, %eax
	cltq
	imulq	$2043701911, %rax, %rbx         ## imm = 0x79D06A97
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$39, %rbx
	addl	%eax, %ebx
	movl	$134, %esi
	movl	$134, %edx
	jmp	LBB0_10
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	movslq	8(%r14), %rcx
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_7
## %bb.8:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	jmp	LBB0_9
LBB0_7:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	testl	%eax, %eax
	movl	$1, %ebx
	cmovnel	%eax, %ebx
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%eax, %esi
	movl	%eax, %edx
LBB0_10:
	callq	_tty_encode_baud_rate
LBB0_11:
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movl	16(%r14), %eax
	imull	%ebx, %eax
	imull	%ecx, %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
	cltd
	idivl	8(%r14)
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$36, %rcx
	addl	%edx, %ecx
	addl	%eax, %ecx
	movl	%ecx, 12(%r14)
	movq	_UART_MCR_DTR@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.12:
	orb	20(%r14), %al
	movb	%al, 20(%r14)
	movq	_UART_MCR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	24(%r14), %rsi
	movzbl	%al, %edi
	callq	_outb
	movq	_UART_LCR@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	24(%r14), %rdi
	callq	_inb
	movl	%eax, %r15d
	movq	_UART_LCR_DLAB@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	orb	%r15b, %al
	movq	(%r12), %rsi
	addq	24(%r14), %rsi
	movzbl	%al, %edi
	callq	_outb
	movq	_UART_DLL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r14), %rsi
	movzbl	%bl, %edi
	callq	_outb
	movq	_UART_DLM@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r14), %rsi
	movzbl	%bh, %edi
	callq	_outb
	movq	(%r12), %rsi
	addq	24(%r14), %rsi
	movzbl	%r15b, %edi
	callq	_outb
	movq	24(%r14), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_mxser_set_must_enum_value
	jmp	LBB0_14
LBB0_13:
	notb	%al
	andb	20(%r14), %al
	movb	%al, 20(%r14)
	movq	_UART_MCR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	24(%r14), %rsi
	movzbl	%al, %edi
	callq	_outb
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_UART_MCR_DTR,1,0               ## @UART_MCR_DTR
	.comm	_UART_MCR,8,3                   ## @UART_MCR
	.comm	_UART_LCR,8,3                   ## @UART_LCR
	.comm	_UART_LCR_DLAB,1,0              ## @UART_LCR_DLAB
	.comm	_UART_DLL,8,3                   ## @UART_DLL
	.comm	_UART_DLM,8,3                   ## @UART_DLM
	.comm	_BOTHER,8,3                     ## @BOTHER
	.no_dead_strip	_mxser_set_baud
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxser_set_baud
_mxser_set_baud:                        ; @mxser_set_baud
	.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
	ldr	x20, [x0]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20]
	cmp	x8, x1
	b.ge	LBB0_3
LBB0_2:
	mov	w0, #-1
	b	LBB0_13
LBB0_3:
	cbz	x1, LBB0_6
; %bb.4:
	cmp	x1, #134
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x20, #8]
	lsl	w8, w8, #1
	mov	w9, #27287
	movk	w9, #31184, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #39
	add	w21, w8, w9
	mov	w2, #134
	b	LBB0_8
LBB0_6:
	mov	w21, #0
	b	LBB0_9
LBB0_7:
	ldrsw	x8, [x20, #8]
	sdiv	x9, x8, x1
	cmp	w9, #0
	csinc	w21, w9, wzr, ne
	sdiv	w1, w8, w21
	mov	x2, x1
LBB0_8:
	bl	_tty_encode_baud_rate
LBB0_9:
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
	ldr	w9, [x20, #16]
Lloh2:
	ldrsw	x8, [x8]
	mul	w9, w21, w9
	mul	w9, w9, w8
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #1
	ldr	w10, [x20, #8]
	sdiv	w9, w9, w10
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	mul	x8, x8, x10
	lsr	x10, x8, #63
	asr	x8, x8, #36
	add	w8, w8, w10
	add	w8, w9, w8
	str	w8, [x20, #12]
Lloh3:
	adrp	x8, _UART_MCR_DTR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UART_MCR_DTR@GOTPAGEOFF]
	ldrb	w8, [x8]
	cbz	w21, LBB0_11
; %bb.10:
	ldrb	w9, [x20, #20]
	orr	w8, w9, w8
	strb	w8, [x20, #20]
	ldr	x9, [x20, #24]
Lloh5:
	adrp	x10, _UART_MCR@GOTPAGE
Lloh6:
	ldr	x10, [x10, _UART_MCR@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	add	x1, x10, x9
	and	w0, w8, #0xff
	bl	_outb
	ldr	x8, [x20, #24]
Lloh8:
	adrp	x22, _UART_LCR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _UART_LCR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inb
	mov	x19, x0
Lloh10:
	adrp	x8, _UART_LCR_DLAB@GOTPAGE
Lloh11:
	ldr	x8, [x8, _UART_LCR_DLAB@GOTPAGEOFF]
	ldrb	w8, [x8]
	orr	w8, w8, w0
	ldr	x9, [x20, #24]
	ldr	x10, [x22]
	add	x1, x10, x9
	and	w0, w8, #0xff
	bl	_outb
	ldr	x8, [x20, #24]
Lloh12:
	adrp	x9, _UART_DLL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _UART_DLL@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	and	w0, w21, #0xff
	bl	_outb
	ldr	x8, [x20, #24]
Lloh15:
	adrp	x9, _UART_DLM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _UART_DLM@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	ubfx	w0, w21, #8, #8
	bl	_outb
	ldr	x8, [x20, #24]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	x0, x19
	bl	_outb
	ldr	x0, [x20, #24]
	mov	w1, #0
	bl	_mxser_set_must_enum_value
	b	LBB0_12
LBB0_11:
	ldrb	w9, [x20, #20]
	bic	w8, w9, w8
	strb	w8, [x20, #20]
	ldr	x9, [x20, #24]
Lloh18:
	adrp	x10, _UART_MCR@GOTPAGE
Lloh19:
	ldr	x10, [x10, _UART_MCR@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	add	x1, x10, x9
	and	w0, w8, #0xff
	bl	_outb
LBB0_12:
	mov	w0, #0
LBB0_13:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_UART_MCR_DTR,1,0               ; @UART_MCR_DTR
	.comm	_UART_MCR,8,3                   ; @UART_MCR
	.comm	_UART_LCR,8,3                   ; @UART_LCR
	.comm	_UART_LCR_DLAB,1,0              ; @UART_LCR_DLAB
	.comm	_UART_DLL,8,3                   ; @UART_DLL
	.comm	_UART_DLM,8,3                   ; @UART_DLM
	.comm	_BOTHER,8,3                     ; @BOTHER
	.no_dead_strip	_mxser_set_baud
.subsections_via_symbols
