	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_alloc_tx_ring_info
_niu_alloc_tx_ring_info:                ## @niu_alloc_tx_ring_info
	.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, %rbx
	movl	$1, %edi
	callq	_BUILD_BUG_ON
	movq	8(%rbx), %rax
	movl	4(%rbx), %edi
	leaq	56(%r14), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	*(%rax)
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	testb	$63, %al
	je	LBB0_6
## %bb.4:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_5:
	movq	%rax, %rdx
	callq	_netdev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_6:
	movq	8(%rbx), %rax
	movl	4(%rbx), %edi
	movq	_MAX_TX_RING_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	shll	$2, %esi
	leaq	40(%r14), %rdx
	movl	(%r15), %ecx
	callq	*(%rax)
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	testb	$63, %al
	je	LBB0_9
## %bb.8:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	(%r12), %eax
	movl	%eax, (%r14)
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r14)
	movq	$0, 24(%r14)
	movl	%ecx, 4(%r14)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_niu_set_max_burst
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Coherent alloc gives misaligned TXDMA mailbox %p\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_TX_RING_SIZE,4,2           ## @MAX_TX_RING_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Coherent alloc gives misaligned TXDMA descr table %p\n"

	.no_dead_strip	_niu_alloc_tx_ring_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_alloc_tx_ring_info
_niu_alloc_tx_ring_info:                ; @niu_alloc_tx_ring_info
	.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	x19, x0
	mov	w0, #1
	bl	_BUILD_BUG_ON
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x19, #4]
	add	x2, x20, #56
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	w1, #4
	blr	x8
	str	x0, [x20, #48]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x2, x0
	tst	x0, #0x3f
	b.eq	LBB0_4
; %bb.2:
	ldr	w0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	bl	_netdev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x22, _MAX_TX_RING_SIZE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MAX_TX_RING_SIZE@GOTPAGEOFF]
	ldr	w9, [x22]
	lsl	w1, w9, #2
	add	x2, x20, #40
	ldr	w3, [x21]
	blr	x8
	str	x0, [x20, #32]
	cbz	x0, LBB0_7
; %bb.5:
	mov	x2, x0
	tst	x0, #0x3f
	b.eq	LBB0_10
; %bb.6:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_7:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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_10:
	ldr	w8, [x22]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w9, w9, w8, lt
	stp	xzr, xzr, [x20, #16]
	asr	w9, w9, #2
	str	xzr, [x20, #8]
	stp	w8, w9, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_niu_set_max_burst
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Coherent alloc gives misaligned TXDMA mailbox %p\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_TX_RING_SIZE,4,2           ; @MAX_TX_RING_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Coherent alloc gives misaligned TXDMA descr table %p\n"

	.no_dead_strip	_niu_alloc_tx_ring_info
.subsections_via_symbols
