	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function start_tx
_start_tx:                              ## @start_tx
	.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, %r12
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_netdev_priv
	movq	%rax, %rbx
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %r13
	movl	(%rax), %eax
	movl	72(%rbx), %edi
	cltd
	idivl	(%r13)
	movl	%edx, %r15d
	movl	(%r12), %edx
	movl	4(%r12), %esi
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_pci_map_single
	movq	56(%rbx), %rcx
	movq	%rax, (%rcx,%r15,8)
	movq	64(%rbx), %rax
	movq	%r12, (%rax,%r15,8)
	movq	48(%rbx), %rax
	movq	56(%rbx), %rdx
	movq	(%rdx,%r15,8), %rcx
	leaq	(%r15,%r15,2), %r14
	movq	%rcx, 16(%rax,%r14,8)
	movl	(%r12), %ecx
	movq	_TX_BUFLIMIT@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	cmpl	%esi, %ecx
	jge	LBB0_2
## %bb.1:
	movq	_DescWholePkt@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_2:
	subl	%esi, %ecx
	movq	%rsi, %rdi
	addq	(%rdx,%r15,8), %rdi
	movq	%rdi, 8(%rax,%r14,8)
	movq	_DescWholePkt@GOTPCREL(%rip), %rdx
	shll	$11, %ecx
	orl	%esi, %ecx
LBB0_3:
	orl	(%rdx), %ecx
	movl	%ecx, (%rax,%r14,8)
	movl	(%r13), %edx
	decl	%edx
	cmpl	%edx, %r15d
	jne	LBB0_5
## %bb.4:
	leaq	(%rax,%r14,8), %rax
	movq	_DescEndRing@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%rax)
LBB0_5:
	movq	%rbx, %r13
	addq	$32, %r13
	movq	%r13, %rdi
	callq	_spin_lock_irq
	incl	(%rbx)
	xorl	%eax, %eax
	callq	_wmb
	movq	_DescOwned@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	48(%rbx), %rcx
	movl	%eax, 4(%rcx,%r14,8)
	xorl	%eax, %eax
	callq	_wmb
	movq	_TxStartDemand@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	40(%rbx), %rsi
	xorl	%edi, %edi
	callq	_iowrite32
	movslq	(%r12), %rax
	addq	8(%rbx), %rax
	movq	%rax, 8(%rbx)
	movslq	(%rbx), %rcx
	subq	16(%rbx), %rcx
	movq	_TX_QUEUE_LEN@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jg	LBB0_8
## %bb.6:
	movq	_HasBrokenTx@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 24(%rbx)
	je	LBB0_9
## %bb.7:
	movq	_TX_BUG_FIFO_LIMIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_9
LBB0_8:
	movq	%r14, %rdi
	callq	_netif_stop_queue
	xorl	%eax, %eax
	callq	_wmb
	movl	$1, 28(%rbx)
LBB0_9:
	movq	%r13, %rdi
	callq	_spin_unlock_irq
	movq	_debug@GOTPCREL(%rip), %rax
	cmpl	$5, (%rax)
	jl	LBB0_11
## %bb.10:
	movslq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %ecx
	callq	_netdev_dbg
LBB0_11:
	movq	_NETDEV_TX_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TX_RING_SIZE,4,2               ## @TX_RING_SIZE
	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
	.comm	_TX_BUFLIMIT,4,2                ## @TX_BUFLIMIT
	.comm	_DescWholePkt,4,2               ## @DescWholePkt
	.comm	_DescEndRing,4,2                ## @DescEndRing
	.comm	_DescOwned,4,2                  ## @DescOwned
	.comm	_TxStartDemand,8,3              ## @TxStartDemand
	.comm	_TX_QUEUE_LEN,8,3               ## @TX_QUEUE_LEN
	.comm	_HasBrokenTx,4,2                ## @HasBrokenTx
	.comm	_TX_BUG_FIFO_LIMIT,8,3          ## @TX_BUG_FIFO_LIMIT
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Transmit frame #%d queued in slot %d\n"

	.comm	_NETDEV_TX_OK,4,2               ## @NETDEV_TX_OK
	.no_dead_strip	_start_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function start_tx
_start_tx:                              ; @start_tx
	.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, x1
	mov	x22, x0
	mov	x0, x1
	bl	_netdev_priv
	mov	x21, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x23, _TX_RING_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _TX_RING_SIZE@GOTPAGEOFF]
	ldr	w9, [x23]
	sdiv	w10, w8, w9
	msub	w20, w10, w9, w8
	ldr	w0, [x0, #72]
	ldp	w2, w1, [x22]
Lloh2:
	adrp	x8, _PCI_DMA_TODEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DMA_TODEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	bl	_pci_map_single
	lsl	x10, x20, #3
	ldp	x8, x9, [x21, #56]
	str	x0, [x8, x10]
	str	x22, [x9, x10]
	ldp	x8, x9, [x21, #48]
	ldr	x10, [x9, x10]
	mov	w11, #24
	umaddl	x11, w20, w11, x8
	str	x10, [x11, #16]
	ldr	w11, [x22]
Lloh5:
	adrp	x10, _TX_BUFLIMIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _TX_BUFLIMIT@GOTPAGEOFF]
Lloh7:
	ldrsw	x10, [x10]
	cmp	w11, w10
	b.ge	LBB0_2
; %bb.1:
Lloh8:
	adrp	x9, _DescWholePkt@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DescWholePkt@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w9, w9, w11
	b	LBB0_3
LBB0_2:
	sub	w11, w11, w10
	ldr	x9, [x9, x20, lsl #3]
	add	x9, x9, x10
	mov	w12, #24
	madd	x12, x20, x12, x8
	str	x9, [x12, #8]
Lloh11:
	adrp	x9, _DescWholePkt@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DescWholePkt@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w10, w10, w11, lsl #11
	orr	w9, w10, w9
LBB0_3:
	mov	w10, #24
	madd	x8, x20, x10, x8
	str	w9, [x8]
	ldr	w10, [x23]
	sub	w10, w10, #1
	cmp	w20, w10
	b.ne	LBB0_5
; %bb.4:
Lloh14:
	adrp	x10, _DescEndRing@GOTPAGE
Lloh15:
	ldr	x10, [x10, _DescEndRing@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w9, w9, w10
	str	w9, [x8]
LBB0_5:
	add	x23, x21, #32
	mov	x0, x23
	bl	_spin_lock_irq
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	bl	_wmb
Lloh17:
	adrp	x8, _DescOwned@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DescOwned@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	x9, [x21, #48]
	mov	w10, #24
	madd	x9, x20, x10, x9
	str	w8, [x9, #4]
	bl	_wmb
	ldr	x8, [x21, #40]
Lloh20:
	adrp	x9, _TxStartDemand@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TxStartDemand@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_iowrite32
	ldrsw	x8, [x22]
	ldp	x9, x10, [x21, #8]
	add	x8, x9, x8
	str	x8, [x21, #8]
	ldrsw	x9, [x21]
Lloh23:
	adrp	x11, _TX_QUEUE_LEN@GOTPAGE
Lloh24:
	ldr	x11, [x11, _TX_QUEUE_LEN@GOTPAGEOFF]
Lloh25:
	ldr	x11, [x11]
	sub	x9, x9, x10
	cmp	x9, x11
	b.gt	LBB0_8
; %bb.6:
	ldr	w9, [x21, #24]
Lloh26:
	adrp	x10, _HasBrokenTx@GOTPAGE
Lloh27:
	ldr	x10, [x10, _HasBrokenTx@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_9
; %bb.7:
Lloh29:
	adrp	x9, _TX_BUG_FIFO_LIMIT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _TX_BUG_FIFO_LIMIT@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_netif_stop_queue
	bl	_wmb
	mov	w8, #1
	str	w8, [x21, #28]
LBB0_9:
	mov	x0, x23
	bl	_spin_unlock_irq
Lloh32:
	adrp	x8, _debug@GOTPAGE
Lloh33:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	cmp	w8, #5
	b.lt	LBB0_11
; %bb.10:
	ldrsw	x2, [x21]
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_netdev_dbg
LBB0_11:
Lloh37:
	adrp	x8, _NETDEV_TX_OK@GOTPAGE
Lloh38:
	ldr	x8, [x8, _NETDEV_TX_OK@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_TX_RING_SIZE,4,2               ; @TX_RING_SIZE
	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
	.comm	_TX_BUFLIMIT,4,2                ; @TX_BUFLIMIT
	.comm	_DescWholePkt,4,2               ; @DescWholePkt
	.comm	_DescEndRing,4,2                ; @DescEndRing
	.comm	_DescOwned,4,2                  ; @DescOwned
	.comm	_TxStartDemand,8,3              ; @TxStartDemand
	.comm	_TX_QUEUE_LEN,8,3               ; @TX_QUEUE_LEN
	.comm	_HasBrokenTx,4,2                ; @HasBrokenTx
	.comm	_TX_BUG_FIFO_LIMIT,8,3          ; @TX_BUG_FIFO_LIMIT
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Transmit frame #%d queued in slot %d\n"

	.comm	_NETDEV_TX_OK,4,2               ; @NETDEV_TX_OK
	.no_dead_strip	_start_tx
.subsections_via_symbols
