	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hso_serial_close
_hso_serial_close:                      ## @hso_serial_close
	.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, %r15
	movq	(%rdi), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_D1
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.1:
	movq	8(%rbx), %rdi
	addq	$4, %rdi
	callq	_mutex_lock
	movq	8(%rbx), %rax
	movl	12(%rax), %r12d
	testl	%r12d, %r12d
	jne	LBB0_3
## %bb.2:
	movl	8(%rax), %edi
	callq	_usb_autopm_get_interface
LBB0_3:
	movq	(%rbx), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rbx)
	cmpq	$1, %rax
	jg	LBB0_9
## %bb.4:
	movq	$0, (%rbx)
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irq
	cmpq	%r15, 32(%rbx)
	jne	LBB0_6
## %bb.5:
	movq	$0, (%r15)
	movq	$0, 32(%rbx)
	movq	%r15, %rdi
	callq	_tty_kref_put
LBB0_6:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	testl	%r12d, %r12d
	jne	LBB0_8
## %bb.7:
	movq	8(%rbx), %rdi
	callq	_hso_stop_serial_device
LBB0_8:
	leaq	20(%rbx), %rdi
	callq	_tasklet_kill
	leaq	16(%rbx), %rdi
	callq	_cancel_work_sync
LBB0_9:
	testl	%r12d, %r12d
	jne	LBB0_11
## %bb.10:
	movq	8(%rbx), %rax
	movl	8(%rax), %edi
	callq	_usb_autopm_put_interface
LBB0_11:
	movq	8(%rbx), %rdi
	addq	$4, %rdi
	callq	_mutex_unlock
	movq	8(%rbx), %rdi
	movq	_hso_serial_ref_free@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kref_put                       ## TAILCALL
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Closing serial port"

	.comm	_hso_serial_ref_free,4,2        ## @hso_serial_ref_free
	.no_dead_strip	_hso_serial_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hso_serial_close
_hso_serial_close:                      ; @hso_serial_close
	.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	x19, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D1
	cbz	x21, LBB0_12
; %bb.1:
	ldr	x8, [x21, #8]
	add	x0, x8, #4
	bl	_mutex_lock
	ldr	x8, [x21, #8]
	ldr	w22, [x8, #12]
	cbnz	w22, LBB0_3
; %bb.2:
	ldr	w0, [x8, #8]
	bl	_usb_autopm_get_interface
LBB0_3:
	ldr	x8, [x21]
	subs	x8, x8, #1
	str	x8, [x21]
	b.gt	LBB0_9
; %bb.4:
	str	xzr, [x21]
	add	x20, x21, #24
	mov	x0, x20
	bl	_spin_lock_irq
	ldr	x8, [x21, #32]
	cmp	x8, x19
	b.ne	LBB0_6
; %bb.5:
	str	xzr, [x19]
	str	xzr, [x21, #32]
	mov	x0, x19
	bl	_tty_kref_put
LBB0_6:
	mov	x0, x20
	bl	_spin_unlock_irq
	cbnz	w22, LBB0_8
; %bb.7:
	ldr	x0, [x21, #8]
	bl	_hso_stop_serial_device
LBB0_8:
	add	x0, x21, #20
	bl	_tasklet_kill
	add	x0, x21, #16
	bl	_cancel_work_sync
LBB0_9:
	cbnz	w22, LBB0_11
; %bb.10:
	ldr	x8, [x21, #8]
	ldr	w0, [x8, #8]
	bl	_usb_autopm_put_interface
LBB0_11:
	ldr	x8, [x21, #8]
	add	x0, x8, #4
	bl	_mutex_unlock
	ldr	x0, [x21, #8]
Lloh2:
	adrp	x8, _hso_serial_ref_free@GOTPAGE
Lloh3:
	ldr	x8, [x8, _hso_serial_ref_free@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	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	_kref_put
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Closing serial port"

	.comm	_hso_serial_ref_free,4,2        ; @hso_serial_ref_free
	.no_dead_strip	_hso_serial_close
.subsections_via_symbols
