	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_rbr_add_page
_niu_rbr_add_page:                      ## @niu_rbr_add_page
	.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	%ecx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	%edx, %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r13
	movq	8(%rbx), %rax
	movl	(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	xorl	%r15d, %r15d
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_9
## %bb.2:
	movl	%eax, %ebx
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_niu_hash_page
	movl	(%r14), %esi
	cmpl	$2, %esi
	jl	LBB0_4
## %bb.3:
	decl	%esi
	movq	%r13, %rdi
	callq	_page_ref_add
	movl	(%r14), %esi
LBB0_4:
	testl	%esi, %esi
	jle	LBB0_7
## %bb.5:
	movslq	%r12d, %r12
	shlq	$2, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %r13
	addq	%r12, %r13
	movq	_RBR_DESCR_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%ebx, %edi
	sarl	%cl, %edi
	callq	_cpu_to_le32
	movl	%eax, (%r13,%r15,4)
	addl	8(%r14), %ebx
	incq	%r15
	movslq	(%r14), %rax
	cmpq	%rax, %r15
	jl	LBB0_6
LBB0_7:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_9:
	movq	%r13, %rdi
	callq	___free_page
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_RBR_DESCR_ADDR_SHIFT,4,2       ## @RBR_DESCR_ADDR_SHIFT
	.no_dead_strip	_niu_rbr_add_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_rbr_add_page
_niu_rbr_add_page:                      ; @niu_rbr_add_page
	.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	x21, x3
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_alloc_page
	cbz	x0, LBB0_9
; %bb.1:
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w0, [x20]
Lloh0:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x9]
Lloh3:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x9]
	mov	x1, x22
	mov	w2, #0
	blr	x8
	cbz	w0, LBB0_8
; %bb.2:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_niu_hash_page
	ldr	w8, [x19]
	subs	w1, w8, #1
	b.le	LBB0_4
; %bb.3:
	mov	x0, x22
	bl	_page_ref_add
	ldr	w8, [x19]
LBB0_4:
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x22, #0
	sbfiz	x21, x21, #2, #32
Lloh6:
	adrp	x23, _RBR_DESCR_ADDR_SHIFT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _RBR_DESCR_ADDR_SHIFT@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x24, x8, x21
	ldr	w8, [x23]
	asr	w0, w20, w8
	bl	_cpu_to_le32
	str	w0, [x24, x22, lsl #2]
	ldr	w8, [x19, #8]
	add	w20, w20, w8
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.lt	LBB0_6
LBB0_7:
	mov	w0, #0
	b	LBB0_10
LBB0_8:
	mov	x0, x22
	bl	___free_page
LBB0_9:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_RBR_DESCR_ADDR_SHIFT,4,2       ; @RBR_DESCR_ADDR_SHIFT
	.no_dead_strip	_niu_rbr_add_page
.subsections_via_symbols
