	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdio_uart_write
_sdio_uart_write:                       ## @sdio_uart_write
	.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), %r14
	cmpl	$0, 4(%r14)
	je	LBB0_1
## %bb.2:
	movl	%edx, %r13d
	movq	%rsi, %r12
	leaq	8(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movl	16(%r14), %edi
	movl	32(%r14), %esi
	movq	_UART_XMIT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_CIRC_SPACE_TO_END
	movl	%eax, %ebx
	cmpl	%eax, %r13d
	cmovll	%r13d, %ebx
	xorl	%r15d, %r15d
	testl	%ebx, %ebx
	jle	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	16(%r14), %rdi
	addq	24(%r14), %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	16(%r14), %eax
	addl	%ebx, %eax
	movq	_UART_XMIT_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	-1(%rdx), %edi
	andl	%eax, %edi
	movl	%edi, 16(%r14)
	movl	%ebx, %eax
	addq	%rax, %r12
	subl	%ebx, %r13d
	addl	%ebx, %r15d
	movl	32(%r14), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_CIRC_SPACE_TO_END
	movl	%eax, %ebx
	cmpl	%eax, %r13d
	cmovll	%r13d, %ebx
	testl	%ebx, %ebx
	jg	LBB0_3
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_UART_IER_THRI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_6
LBB0_8:
	movl	%r15d, %eax
	jmp	LBB0_9
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_6:
	movq	%r14, %rdi
	callq	_sdio_uart_claim_func
	testl	%eax, %eax
	je	LBB0_7
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rdi
	callq	_sdio_uart_start_tx
	movl	4(%r14), %edi
	callq	_sdio_uart_irq
	movq	%r14, %rdi
	callq	_sdio_uart_release_func
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_UART_XMIT_SIZE,4,2             ## @UART_XMIT_SIZE
	.comm	_UART_IER_THRI,4,2              ## @UART_IER_THRI
	.no_dead_strip	_sdio_uart_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdio_uart_write
_sdio_uart_write:                       ; @sdio_uart_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x19, [x0]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x20, x2
	mov	x22, x1
	add	x21, x19, #8
	mov	x0, x21
	bl	_spin_lock
	ldr	w0, [x19, #16]
	ldr	w1, [x19, #32]
Lloh0:
	adrp	x25, _UART_XMIT_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _UART_XMIT_SIZE@GOTPAGEOFF]
	ldr	w2, [x25]
	bl	_CIRC_SPACE_TO_END
	cmp	w20, w0
	csel	w23, w20, w0, lt
	cmp	w23, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w24, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19, #16]
	add	x0, x8, x9
	mov	x1, x22
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x19, #16]
	ldr	w2, [x25]
	sub	w9, w2, #1
	add	w8, w8, w23
	and	w0, w9, w8
	str	w0, [x19, #16]
	add	x22, x22, w23, uxtw
	sub	w20, w20, w23
	add	w24, w23, w24
	ldr	w1, [x19, #32]
	bl	_CIRC_SPACE_TO_END
	cmp	w20, w0
	csel	w23, w20, w0, lt
	cmp	w23, #0
	b.gt	LBB0_3
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_5:
	mov	w24, #0
LBB0_6:
	mov	x0, x21
	bl	_spin_unlock
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _UART_IER_THRI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _UART_IER_THRI@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_7:
	mov	x0, x24
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_sdio_uart_claim_func
	cbz	w0, LBB0_10
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	bl	_sdio_uart_start_tx
	ldr	w0, [x19, #4]
	bl	_sdio_uart_irq
	mov	x0, x19
	bl	_sdio_uart_release_func
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_UART_XMIT_SIZE,4,2             ; @UART_XMIT_SIZE
	.comm	_UART_IER_THRI,4,2              ; @UART_IER_THRI
	.no_dead_strip	_sdio_uart_write
.subsections_via_symbols
