	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write
_write:                                 ## @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
	movl	%edx, %r13d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_sanity_check
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movslq	%r14d, %rbx
	movq	%rbx, %rdi
	callq	_DBGINFO
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movslq	%r13d, %rdi
	callq	_DBGINFO
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.3:
	cmpl	%r13d, 8(%r15)
	jge	LBB0_5
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_1
LBB0_5:
	testl	%r13d, %r13d
	je	LBB0_1
## %bb.6:
	cmpl	$0, 40(%r15)
	je	LBB0_11
LBB0_7:
	movq	_DMABUFSIZE@GOTPCREL(%rip), %rcx
	movl	%r13d, %eax
	cltd
	idivl	(%rcx)
	cmpl	$1, %edx
	sbbl	$-1, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_free_tbuf_count
	cmpl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	ja	LBB0_1
## %bb.8:
	movl	%r13d, 12(%r15)
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_tx_load
	cmpl	$0, 12(%r15)
	jne	LBB0_9
	jmp	LBB0_13
LBB0_11:
	movl	12(%r15), %edx
	testl	%edx, %edx
	je	LBB0_7
## %bb.12:
	movq	%r15, %rdi
	callq	_tx_load
	xorl	%r13d, %r13d
	cmpl	$0, 12(%r15)
	je	LBB0_13
LBB0_9:
	cmpl	$0, 4(%rbx)
	jne	LBB0_13
## %bb.14:
	cmpl	$0, (%rbx)
	je	LBB0_16
LBB0_13:
	movl	%r13d, %r14d
	jmp	LBB0_1
LBB0_16:
	leaq	28(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, 40(%r15)
	je	LBB0_21
## %bb.17:
	movq	_TDCSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rd_reg32
	movq	_BIT0@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_22
## %bb.18:
	movl	16(%r15), %eax
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movl	20(%r15), %eax
LBB0_20:
	decl	%eax
	movq	32(%r15), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_desc_count
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_25
	jmp	LBB0_22
LBB0_21:
	movq	%r15, %rdi
	callq	_tx_start
LBB0_22:
	testl	%r13d, %r13d
	jle	LBB0_24
## %bb.23:
	movq	%r15, %rdi
	callq	_update_tx_timer
LBB0_24:
	movl	%r13d, %r14d
LBB0_25:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_DMABUFSIZE,4,2                 ## @DMABUFSIZE
	.comm	_TDCSR,4,2                      ## @TDCSR
	.comm	_BIT0,4,2                       ## @BIT0
	.no_dead_strip	_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write
_write:                                 ; @write
	.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, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x20, [x0, #16]
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_sanity_check
	cbz	x0, LBB0_3
LBB0_1:
	mov	w19, #0
LBB0_2:
	sxtw	x0, w19
	bl	_DBGINFO
	mov	x0, x19
	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
	ret
LBB0_3:
	mov	x8, x19
	sxtw	x0, w8
	bl	_DBGINFO
	ldr	x1, [x20]
	cbz	x1, LBB0_1
; %bb.4:
	ldr	w8, [x20, #8]
	cmp	w8, w19
	b.ge	LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_2
LBB0_6:
	cbz	w19, LBB0_2
; %bb.7:
	ldr	w8, [x20, #40]
	cbz	w8, LBB0_10
LBB0_8:
Lloh5:
	adrp	x8, _DMABUFSIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMABUFSIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sdiv	w9, w19, w8
	msub	w8, w9, w8, w19
	cmp	w8, #0
	cinc	w23, w9, ne
	mov	x0, x20
	bl	_free_tbuf_count
	cmp	w23, w0
	b.hi	LBB0_1
; %bb.9:
	str	w19, [x20, #12]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_tx_load
	b	LBB0_12
LBB0_10:
	ldr	w2, [x20, #12]
	cbz	w2, LBB0_8
; %bb.11:
	mov	x0, x20
	bl	_tx_load
	mov	w19, #0
LBB0_12:
	ldr	w8, [x20, #12]
	cbz	w8, LBB0_2
; %bb.13:
	ldr	w8, [x21, #4]
	cbnz	w8, LBB0_2
; %bb.14:
	ldr	w8, [x21]
	cbnz	w8, LBB0_2
; %bb.15:
	add	x21, x20, #28
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x20, #40]
	cbz	w8, LBB0_21
; %bb.16:
Lloh8:
	adrp	x8, _TDCSR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TDCSR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rd_reg32
Lloh11:
	adrp	x8, _BIT0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BIT0@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_22
; %bb.17:
	ldr	w8, [x20, #16]
	cbnz	w8, LBB0_19
; %bb.18:
	ldr	w8, [x20, #20]
LBB0_19:
	sub	w8, w8, #1
	ldr	x9, [x20, #32]
	ldr	w0, [x9, w8, uxtw #2]
	bl	_desc_count
	cbz	x0, LBB0_22
; %bb.20:
	mov	w19, #0
	b	LBB0_24
LBB0_21:
	mov	x0, x20
	bl	_tx_start
LBB0_22:
	cmp	w19, #1
	b.lt	LBB0_24
; %bb.23:
	mov	x0, x20
	bl	_update_tx_timer
LBB0_24:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_DMABUFSIZE,4,2                 ; @DMABUFSIZE
	.comm	_TDCSR,4,2                      ; @TDCSR
	.comm	_BIT0,4,2                       ; @BIT0
	.no_dead_strip	_write
.subsections_via_symbols
