	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_init_one_tx_channel
_niu_init_one_tx_channel:               ## @niu_init_one_tx_channel
	.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	%rsi, %r14
	movq	%rdi, %r12
	movl	(%rsi), %r15d
	movl	%r15d, %esi
	callq	_niu_tx_channel_stop
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_niu_tx_channel_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_niu_tx_channel_lpage_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movl	%r15d, %edi
	callq	_TXC_DMA_MAX
	movl	4(%r14), %esi
	movl	%eax, %edi
	callq	_nw64
	movl	%r15d, %edi
	callq	_TX_ENT_MSK
	xorl	%ebx, %ebx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_nw64
	movslq	8(%r14), %rax
	movq	_TX_RNG_CFIG_STADDR_BASE@GOTPCREL(%rip), %rcx
	movq	_TX_RNG_CFIG_STADDR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	testl	%edx, %eax
	je	LBB0_5
## %bb.4:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movq	%rax, %rcx
	callq	_netdev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movl	12(%r14), %ecx
	leal	7(%rcx), %ebx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %ebx
	sarl	$3, %ebx
	movq	_TX_RNG_CFIG_LEN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movl	%r15d, %edi
	callq	_TX_RNG_CFIG
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_nw64
	movslq	16(%r14), %rcx
	movq	_TXDMA_MBL_MBADDR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	notl	%eax
	testl	%eax, %ecx
	je	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	callq	_netdev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_7:
	movl	%r15d, %edi
	callq	_TXDMA_MBH
	movl	%eax, %edi
	callq	_nw64
	movl	%r15d, %edi
	callq	_TXDMA_MBL
	movl	(%rbx), %esi
	andl	16(%r14), %esi
	movl	%eax, %edi
	callq	_nw64
	movl	%r15d, %edi
	callq	_TX_CS
	xorl	%ebx, %ebx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_nw64
	movq	$0, 24(%r14)
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TX_RNG_CFIG_STADDR_BASE,4,2    ## @TX_RNG_CFIG_STADDR_BASE
	.comm	_TX_RNG_CFIG_STADDR,4,2         ## @TX_RNG_CFIG_STADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TX ring channel %d DMA addr (%llx) is not aligned\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TX_RNG_CFIG_LEN_SHIFT,4,2      ## @TX_RNG_CFIG_LEN_SHIFT
	.comm	_TXDMA_MBH_MBADDR,4,2           ## @TXDMA_MBH_MBADDR
	.comm	_TXDMA_MBL_MBADDR,4,2           ## @TXDMA_MBL_MBADDR
L_.str.1:                               ## @.str.1
	.asciz	"TX ring channel %d MBOX addr (%llx) has invalid bits\n"

	.no_dead_strip	_niu_init_one_tx_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_init_one_tx_channel
_niu_init_one_tx_channel:               ; @niu_init_one_tx_channel
	.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	x20, x1
	mov	x21, x0
	ldr	w19, [x1]
	mov	x1, x19
	bl	_niu_tx_channel_stop
	cbnz	w0, LBB0_8
; %bb.1:
	mov	x0, x21
	mov	x1, x19
	bl	_niu_tx_channel_reset
	cbnz	w0, LBB0_8
; %bb.2:
	mov	x0, x21
	mov	x1, x19
	bl	_niu_tx_channel_lpage_init
	cbnz	w0, LBB0_8
; %bb.3:
	mov	x0, x19
	bl	_TXC_DMA_MAX
	ldr	w1, [x20, #4]
	bl	_nw64
	mov	x0, x19
	bl	_TX_ENT_MSK
	mov	w1, #0
	bl	_nw64
	ldrsw	x3, [x20, #8]
Lloh0:
	adrp	x8, _TX_RNG_CFIG_STADDR_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TX_RNG_CFIG_STADDR_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _TX_RNG_CFIG_STADDR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TX_RNG_CFIG_STADDR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bics	wzr, w3, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x21]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w8, [x20, #12]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
Lloh8:
	adrp	x9, _TX_RNG_CFIG_LEN_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TX_RNG_CFIG_LEN_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	orr	w22, w8, w3
	mov	x0, x19
	bl	_TX_RNG_CFIG
	mov	x1, x22
	bl	_nw64
	ldrsw	x3, [x20, #16]
Lloh11:
	adrp	x22, _TXDMA_MBL_MBADDR@GOTPAGE
Lloh12:
	ldr	x22, [x22, _TXDMA_MBL_MBADDR@GOTPAGEOFF]
	ldr	w8, [x22]
	bics	wzr, w3, w8
	b.eq	LBB0_9
; %bb.6:
	ldr	w0, [x21]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x2, x19
	bl	_netdev_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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_9:
	mov	x0, x19
	bl	_TXDMA_MBH
	bl	_nw64
	mov	x0, x19
	bl	_TXDMA_MBL
	ldr	w8, [x20, #16]
	ldr	w9, [x22]
	and	w1, w9, w8
	bl	_nw64
	mov	x0, x19
	bl	_TX_CS
	mov	w1, #0
	bl	_nw64
	mov	w0, #0
	str	xzr, [x20, #24]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_TX_RNG_CFIG_STADDR_BASE,4,2    ; @TX_RNG_CFIG_STADDR_BASE
	.comm	_TX_RNG_CFIG_STADDR,4,2         ; @TX_RNG_CFIG_STADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TX ring channel %d DMA addr (%llx) is not aligned\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TX_RNG_CFIG_LEN_SHIFT,4,2      ; @TX_RNG_CFIG_LEN_SHIFT
	.comm	_TXDMA_MBH_MBADDR,4,2           ; @TXDMA_MBH_MBADDR
	.comm	_TXDMA_MBL_MBADDR,4,2           ; @TXDMA_MBL_MBADDR
l_.str.1:                               ; @.str.1
	.asciz	"TX ring channel %d MBOX addr (%llx) has invalid bits\n"

	.no_dead_strip	_niu_init_one_tx_channel
.subsections_via_symbols
