	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function moxa_board_deinit
LCPI0_0:
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_moxa_board_deinit:                     ## @moxa_board_deinit
	.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	%rdi, %r15
	movq	_moxa_openlock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_moxa_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_bh
	movq	$0, 24(%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock_bh
	cmpl	$0, (%r15)
	je	LBB0_1
## %bb.6:
	xorl	%ebx, %ebx
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r13
	movl	(%r15), %esi
	addq	$4, %rbx
	cmpq	%rsi, %r13
	jae	LBB0_2
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	movl	(%r12), %eax
	testl	%eax, (%rdi,%rbx)
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	addq	%rbx, %rdi
	callq	_tty_port_tty_get
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_tty_hangup
	movq	%r14, %rdi
	callq	_tty_kref_put
	jmp	LBB0_10
LBB0_1:
	xorl	%esi, %esi
LBB0_2:
	testl	%esi, %esi
	je	LBB0_21
## %bb.3:
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r12
	movq	_moxa_openlock@GOTPCREL(%rip), %r14
	pxor	%xmm7, %xmm7
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [2,2,2,2]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
                                        ##     Child Loop BB0_18 Depth 2
	movq	8(%r15), %rax
	movl	(%r12), %ecx
	movl	%esi, %edx
	cmpl	$8, %esi
	jae	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%edx, %esi
	andl	$-8, %esi
	movd	%ecx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rsi), %rdi
	movq	%rdi, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r8, %rdi
	andq	$-2, %rdi
	pxor	%xmm3, %xmm3
	xorl	%ebx, %ebx
	pxor	%xmm4, %xmm4
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rax,%rbx,4), %xmm5
	movdqu	16(%rax,%rbx,4), %xmm6
	movdqu	32(%rax,%rbx,4), %xmm1
	movdqu	48(%rax,%rbx,4), %xmm2
	pand	%xmm0, %xmm5
	pand	%xmm0, %xmm6
	pcmpeqd	%xmm7, %xmm5
	paddd	%xmm3, %xmm5
	pcmpeqd	%xmm7, %xmm6
	paddd	%xmm4, %xmm6
	pand	%xmm0, %xmm1
	pcmpeqd	%xmm7, %xmm1
	pand	%xmm0, %xmm2
	pcmpeqd	%xmm7, %xmm2
	paddd	%xmm8, %xmm1
	paddd	%xmm5, %xmm1
	paddd	%xmm8, %xmm2
	paddd	%xmm6, %xmm2
	addq	$16, %rbx
	movdqa	%xmm1, %xmm3
	movdqa	%xmm2, %xmm4
	addq	$-2, %rdi
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	testb	$1, %r8b
	je	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movdqu	(%rax,%rbx,4), %xmm3
	movdqu	16(%rax,%rbx,4), %xmm4
	pand	%xmm0, %xmm3
	pand	%xmm0, %xmm4
	pcmpeqd	%xmm7, %xmm3
	paddd	%xmm3, %xmm1
	pcmpeqd	%xmm7, %xmm4
	paddd	%xmm4, %xmm2
	pcmpeqd	%xmm0, %xmm0
	psubd	%xmm0, %xmm1
	psubd	%xmm0, %xmm2
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	paddd	%xmm2, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ebx
	cmpq	%rdx, %rsi
	je	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rax,%rsi,4), %edi
	andl	%ecx, %edi
	cmpl	$1, %edi
	sbbl	$-1, %ebx
	incq	%rsi
	cmpq	%rsi, %rdx
	jne	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$50, %edi
	callq	_msleep
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r15), %esi
	testl	%esi, %esi
	pxor	%xmm7, %xmm7
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [2,2,2,2]
	jne	LBB0_4
	jmp	LBB0_21
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	pxor	%xmm1, %xmm1
	xorl	%ebx, %ebx
	pxor	%xmm2, %xmm2
	testb	$1, %r8b
	jne	LBB0_16
	jmp	LBB0_17
LBB0_21:
	movq	_moxa_openlock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_22:
	movq	16(%r15), %rdi
	callq	_iounmap
	movq	$0, 16(%r15)
	movq	8(%r15), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_moxa_openlock,4,2              ## @moxa_openlock
	.comm	_moxa_lock,4,2                  ## @moxa_lock
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.no_dead_strip	_moxa_board_deinit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moxa_board_deinit
_moxa_board_deinit:                     ; @moxa_board_deinit
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, _moxa_openlock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _moxa_openlock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x20, _moxa_lock@GOTPAGE
Lloh3:
	ldr	x20, [x20, _moxa_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_spin_lock_bh
	str	xzr, [x19, #24]
	mov	x0, x20
	bl	_spin_unlock_bh
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x21, #0
	mov	x22, #0
Lloh4:
	adrp	x23, _ASYNC_INITIALIZED@GOTPAGE
Lloh5:
	ldr	x23, [x23, _ASYNC_INITIALIZED@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	ldr	w11, [x19]
	add	x21, x21, #4
	cmp	x22, x11
	b.hs	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x21
	ldr	w8, [x0]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_tty_port_tty_get
	cbz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, x0
	bl	_tty_hangup
	mov	x0, x20
	bl	_tty_kref_put
	b	LBB0_2
LBB0_6:
	mov	w11, #0
LBB0_7:
	cbz	w11, LBB0_18
; %bb.8:
Lloh6:
	adrp	x21, _ASYNC_INITIALIZED@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ASYNC_INITIALIZED@GOTPAGEOFF]
Lloh8:
	adrp	x20, _moxa_openlock@GOTPAGE
Lloh9:
	ldr	x20, [x20, _moxa_openlock@GOTPAGEOFF]
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x10, [x19, #8]
	ldr	w8, [x21]
	mov	w9, w11
	cmp	w11, #16
	b.hs	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x11, #0
	mov	w22, #0
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	and	x11, x9, #0xfffffff0
	dup.4s	v0, w8
	add	x12, x10, #32
	movi.2d	v1, #0000000000000000
	mov	x13, x11
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_12:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q5, q6, [x12, #-32]
	ldp	q7, q16, [x12], #64
	cmtst.4s	v5, v0, v5
	cmtst.4s	v6, v0, v6
	cmtst.4s	v7, v0, v7
	cmtst.4s	v16, v0, v16
	sub.4s	v1, v1, v5
	sub.4s	v2, v2, v6
	sub.4s	v3, v3, v7
	sub.4s	v4, v4, v16
	subs	x13, x13, #16
	b.ne	LBB0_12
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	add.4s	v0, v2, v1
	add.4s	v0, v3, v0
	add.4s	v0, v4, v0
	addv.4s	s0, v0
	fmov	w22, s0
	cmp	x11, x9
	b.eq	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x10, x10, x11, lsl #2
	sub	x9, x9, x11
LBB0_15:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x10], #4
	tst	w8, w11
	cinc	w22, w22, ne
	subs	x9, x9, #1
	b.ne	LBB0_15
LBB0_16:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w22, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w0, #50
	bl	_msleep
	mov	x0, x20
	bl	_mutex_lock
	ldr	w11, [x19]
	cbnz	w11, LBB0_9
LBB0_18:
Lloh10:
	adrp	x0, _moxa_openlock@GOTPAGE
Lloh11:
	ldr	x0, [x0, _moxa_openlock@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_19:
	ldr	x0, [x19, #16]
	bl	_iounmap
	str	xzr, [x19, #16]
	ldr	x0, [x19, #8]
	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
	b	_kfree
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_moxa_openlock,4,2              ; @moxa_openlock
	.comm	_moxa_lock,4,2                  ; @moxa_lock
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.no_dead_strip	_moxa_board_deinit
.subsections_via_symbols
