	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdio_uart_close
_sdio_uart_close:                       ## @sdio_uart_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	movq	%rdi, %r14
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	callq	_BUG_ON
	movq	(%rbx), %rax
	cmpq	%rax, (%r14)
	jle	LBB0_2
## %bb.6:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	decq	%rax
	movq	%rax, (%rbx)
	jne	LBB0_4
## %bb.3:
	movl	$1, 8(%r14)
	movq	%rbx, %rdi
	callq	_sdio_uart_shutdown
	movq	%r14, %rdi
	callq	_tty_ldisc_flush
	movq	$0, 16(%rbx)
	movq	$0, 16(%r14)
	movl	$0, 8(%r14)
LBB0_4:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdio_uart_port_put             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_sdio_uart_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdio_uart_close
_sdio_uart_close:                       ; @sdio_uart_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
	ldr	x19, [x0, #16]
	cbz	x19, LBB0_3
; %bb.1:
	mov	x20, x0
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	x9, [x20]
	ldr	x8, [x19]
	cmp	x9, x8
	b.le	LBB0_4
; %bb.2:
	mov	x0, x21
	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	_mutex_unlock
LBB0_3:
	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
LBB0_4:
	subs	x8, x8, #1
	str	x8, [x19]
	b.ne	LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x20, #8]
	mov	x0, x19
	bl	_sdio_uart_shutdown
	mov	x0, x20
	bl	_tty_ldisc_flush
	str	xzr, [x19, #16]
	str	xzr, [x20, #16]
	str	wzr, [x20, #8]
LBB0_6:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, 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	_sdio_uart_port_put
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_sdio_uart_close
.subsections_via_symbols
