	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isicom_shutdown_port
_isicom_shutdown_port:                  ## @isicom_shutdown_port
	.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, %rbx
	movq	8(%rdi), %r14
	callq	_tty_port_tty_get
	movq	%rax, %r15
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	je	LBB0_10
## %bb.1:
	movq	%rbx, %rdi
	callq	_tty_port_free_xmit_buf
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_tty_port_tty_set
	movq	%r15, %rdi
	callq	_C_HUPCL
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_drop_dtr
LBB0_3:
	testq	%r15, %r15
	je	LBB0_5
## %bb.4:
	movq	_TTY_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
LBB0_5:
	movq	(%r14), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, (%r14)
	testq	%rax, %rax
	jg	LBB0_7
## %bb.6:
	movl	8(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_dbg
	movq	$0, (%r14)
LBB0_7:
	movq	%r15, %rdi
	callq	_C_HUPCL
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	cmpq	$0, (%r14)
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_isicom_shutdown_board
LBB0_10:
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tty_kref_put                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_TTY_IO_ERROR,4,2               ## @TTY_IO_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"isicom_shutdown_port: bad board(0x%lx) count %d.\n"

	.no_dead_strip	_isicom_shutdown_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isicom_shutdown_port
_isicom_shutdown_port:                  ; @isicom_shutdown_port
	.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
	mov	x21, x0
	ldr	x19, [x0, #8]
	bl	_tty_port_tty_get
	mov	x20, x0
	ldr	w8, [x21]
Lloh0:
	adrp	x22, _ASYNC_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ASYNC_INITIALIZED@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.1:
	mov	x0, x21
	bl	_tty_port_free_xmit_buf
	ldr	w8, [x22]
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
	mov	x0, x21
	mov	x1, #0
	bl	_tty_port_tty_set
	mov	x0, x20
	bl	_C_HUPCL
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_drop_dtr
LBB0_3:
	cbz	x20, LBB0_5
; %bb.4:
Lloh2:
	adrp	x8, _TTY_IO_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TTY_IO_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
LBB0_5:
	ldr	x8, [x19]
	sub	x2, x8, #1
	str	x2, [x19]
	cmp	x8, #0
	b.gt	LBB0_7
; %bb.6:
	ldr	w1, [x19, #8]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_dbg
	str	xzr, [x19]
LBB0_7:
	mov	x0, x20
	bl	_C_HUPCL
	cbz	x0, LBB0_10
; %bb.8:
	ldr	x8, [x19]
	cbnz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_isicom_shutdown_board
LBB0_10:
	mov	x0, x20
	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_kref_put
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_TTY_IO_ERROR,4,2               ; @TTY_IO_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"isicom_shutdown_port: bad board(0x%lx) count %d.\n"

	.no_dead_strip	_isicom_shutdown_port
.subsections_via_symbols
