	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxser_open
_mxser_open:                            ## @mxser_open
	.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
	movl	(%rdi), %ecx
	movq	_MXSER_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%eax, %eax
	cmpl	%edx, %ecx
	je	LBB0_6
## %bb.1:
	testl	%ecx, %ecx
	js	LBB0_3
## %bb.2:
	cmpl	%edx, %ecx
	jg	LBB0_3
## %bb.4:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_mxser_boards@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_MXSER_PORTS_PER_BOARD@GOTPCREL(%rip), %rdi
	movl	%ecx, %eax
	cltd
	idivl	(%rdi)
                                        ## kill: def $edx killed $edx def $rdx
	cltq
	movq	(%rsi,%rax,8), %r12
	leaq	(%rdx,%rdx,2), %r13
	cmpl	$0, 8(%r12,%r13,4)
	je	LBB0_3
## %bb.5:
	leaq	(%r12,%r13,4), %r15
	movq	%r15, 8(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_tty_port_tty_set
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	incl	4(%r12,%r13,4)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_mxser_startup
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tty_port_block_til_ready       ## TAILCALL
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MXSER_PORTS,4,2                ## @MXSER_PORTS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_mxser_boards,8,3               ## @mxser_boards
	.comm	_MXSER_PORTS_PER_BOARD,4,2      ## @MXSER_PORTS_PER_BOARD
	.no_dead_strip	_mxser_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxser_open
_mxser_open:                            ; @mxser_open
	.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	w8, [x0]
Lloh0:
	adrp	x9, _MXSER_PORTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MXSER_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	tbnz	w8, #31, LBB0_7
; %bb.3:
	cmp	w8, w9
	b.gt	LBB0_7
; %bb.4:
Lloh3:
	adrp	x9, _mxser_boards@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mxser_boards@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _MXSER_PORTS_PER_BOARD@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MXSER_PORTS_PER_BOARD@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	sdiv	w11, w8, w10
	ldr	x9, [x9, w11, sxtw #3]
	msub	w8, w11, w10, w8
	mov	w10, #12
	umaddl	x10, w8, w10, x9
	ldr	w10, [x10, #8]
	cbz	w10, LBB0_7
; %bb.5:
	mov	x19, x1
	mov	x20, x0
	mov	w10, #12
	madd	x21, x8, x10, x9
	str	x21, [x0, #8]
	mov	x0, x21
	mov	x1, x20
	bl	_tty_port_tty_set
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x21, #4]
	add	w8, w8, #1
	str	w8, [x21, #4]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_mxser_startup
	cbnz	w0, LBB0_8
; %bb.6:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	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
	b	_tty_port_block_til_ready
LBB0_7:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MXSER_PORTS,4,2                ; @MXSER_PORTS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_mxser_boards,8,3               ; @mxser_boards
	.comm	_MXSER_PORTS_PER_BOARD,4,2      ; @MXSER_PORTS_PER_BOARD
	.no_dead_strip	_mxser_open
.subsections_via_symbols
