	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function geth_setup_freeq
_geth_setup_freeq:                      ## @geth_setup_freeq
	.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, %r15
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%rdi), %eax
	movl	$1, %r12d
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movb	4(%rdi), %dl
	movl	%edx, %ecx
	shll	%cl, %r12d
	subl	%eax, %r14d
	movl	%r14d, %ecx
	shrl	%cl, %r12d
	movl	$4, %esi
	movl	%edx, %ecx
	shlq	%cl, %rsi
	movl	24(%rdi), %edi
	leaq	8(%r15), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r13, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	_DMA_Q_BASE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%eax, (%r13)
	je	LBB0_5
## %bb.2:
	movl	24(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_3:
	movb	4(%r15), %cl
	movl	$4, %esi
	shlq	%cl, %rsi
	movl	24(%r15), %edi
	movq	16(%r15), %rdx
	movl	8(%r15), %ecx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_dma_free_coherent
	movq	$0, 16(%r15)
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%rbx), %edx
	movl	%r12d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 32(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movl	%r12d, 12(%r15)
	movl	24(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_info
	testl	%r12d, %r12d
	je	LBB0_15
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_geth_freeq_alloc_map_page
	testl	%eax, %eax
	je	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	cmpl	%ebx, %r12d
	jne	LBB0_8
LBB0_15:
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_geth_fill_freeq
	testl	%eax, %eax
	je	LBB0_10
## %bb.16:
	movq	_GLOBAL_QUEUE_THRESHOLD_REG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	40(%r15), %rdi
	callq	_readl
	movq	(%rbx), %rsi
	addq	40(%r15), %rsi
	movl	$32, %edi
	callq	_writel
	movb	(%r15), %cl
	movl	$1, %edi
	shll	%cl, %edi
	movq	_GLOBAL_DMA_SKB_SIZE_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	40(%r15), %rsi
	callq	_writel
	movl	4(%r15), %edi
	orl	8(%r15), %edi
	movq	_GLOBAL_SW_FREEQ_BASE_SIZE_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	40(%r15), %rsi
	callq	_writel
	jmp	LBB0_17
LBB0_9:
	movl	%ebx, %r12d
LBB0_10:
	testl	%r12d, %r12d
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_13
## %bb.11:
	leal	-1(%r12), %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	movq	16(%r15), %rcx
	movl	(%rcx,%rax,4), %esi
	movl	24(%r15), %edi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r13d, %edx
	callq	_dma_unmap_single
	movq	32(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_put_page
	decq	%rbx
	decl	%r12d
	jne	LBB0_12
LBB0_13:
	movq	32(%r15), %rdi
	callq	_kfree
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_Q_BASE_MASK,4,2            ## @DMA_Q_BASE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue ring base is not aligned\n"

L_.str.1:                               ## @.str.1
	.asciz	"allocate %d pages for queue\n"

	.comm	_GLOBAL_QUEUE_THRESHOLD_REG,8,3 ## @GLOBAL_QUEUE_THRESHOLD_REG
	.comm	_GLOBAL_DMA_SKB_SIZE_REG,8,3    ## @GLOBAL_DMA_SKB_SIZE_REG
	.comm	_GLOBAL_SW_FREEQ_BASE_SIZE_REG,8,3 ## @GLOBAL_SW_FREEQ_BASE_SIZE_REG
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_geth_setup_freeq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function geth_setup_freeq
_geth_setup_freeq:                      ; @geth_setup_freeq
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldp	w23, w21, [x0]
	ldr	w0, [x0, #24]
	mov	w8, #4
	lsl	x1, x8, x21
	add	x20, x19, #8
Lloh3:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x25]
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x20
	bl	_dma_alloc_coherent
	str	x0, [x19, #16]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _DMA_Q_BASE_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_Q_BASE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.eq	LBB0_6
; %bb.2:
	ldr	w0, [x19, #24]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_3:
	ldr	w0, [x19, #24]
	mov	w8, #4
	ldp	w9, w3, [x19, #4]
	lsl	x1, x8, x9
	ldr	x2, [x19, #16]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_dma_free_coherent
	str	xzr, [x19, #16]
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	sub	w22, w22, w23
	mov	w24, #1
	lsl	w8, w24, w21
	lsr	w20, w8, w22
	ldr	w2, [x25]
	mov	x0, x20
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_3
; %bb.7:
	str	w20, [x19, #12]
	ldr	w0, [x19, #24]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_info
	cbz	w20, LBB0_11
; %bb.8:
	mov	w21, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_geth_freeq_alloc_map_page
	cbz	w0, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w21, w21, #1
	cmp	w20, w21
	b.ne	LBB0_9
LBB0_11:
	mov	x0, x19
	mov	w1, #0
	bl	_geth_fill_freeq
	cbz	w0, LBB0_14
; %bb.12:
	ldr	x8, [x19, #40]
Lloh15:
	adrp	x20, _GLOBAL_QUEUE_THRESHOLD_REG@GOTPAGE
Lloh16:
	ldr	x20, [x20, _GLOBAL_QUEUE_THRESHOLD_REG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x19, #40]
	ldr	x9, [x20]
	add	x1, x9, x8
	mov	w0, #32
	bl	_writel
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w0, w9, w8
	ldr	x8, [x19, #40]
Lloh17:
	adrp	x9, _GLOBAL_DMA_SKB_SIZE_REG@GOTPAGE
Lloh18:
	ldr	x9, [x9, _GLOBAL_DMA_SKB_SIZE_REG@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldp	w9, w8, [x19, #4]
	orr	w0, w9, w8
	ldr	x8, [x19, #40]
Lloh20:
	adrp	x9, _GLOBAL_SW_FREEQ_BASE_SIZE_REG@GOTPAGE
Lloh21:
	ldr	x9, [x9, _GLOBAL_SW_FREEQ_BASE_SIZE_REG@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_5
LBB0_13:
	mov	x20, x21
LBB0_14:
	cbz	w20, LBB0_17
; %bb.15:
	lsl	w21, w24, w23
	sub	w20, w20, #1
	lsl	x23, x20, #2
Lloh23:
	adrp	x24, _DMA_FROM_DEVICE@GOTPAGE
Lloh24:
	ldr	x24, [x24, _DMA_FROM_DEVICE@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	lsl	w9, w20, w22
	ldr	w1, [x8, w9, uxtw #2]
	ldr	w0, [x19, #24]
	ldr	w3, [x24]
	mov	x2, x21
	bl	_dma_unmap_single
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x23]
	bl	_put_page
	sub	x23, x23, #4
	sub	w20, w20, #1
	cmn	w20, #1
	b.ne	LBB0_16
LBB0_17:
	ldr	x0, [x19, #32]
	bl	_kfree
	b	LBB0_3
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_Q_BASE_MASK,4,2            ; @DMA_Q_BASE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue ring base is not aligned\n"

l_.str.1:                               ; @.str.1
	.asciz	"allocate %d pages for queue\n"

	.comm	_GLOBAL_QUEUE_THRESHOLD_REG,8,3 ; @GLOBAL_QUEUE_THRESHOLD_REG
	.comm	_GLOBAL_DMA_SKB_SIZE_REG,8,3    ; @GLOBAL_DMA_SKB_SIZE_REG
	.comm	_GLOBAL_SW_FREEQ_BASE_SIZE_REG,8,3 ; @GLOBAL_SW_FREEQ_BASE_SIZE_REG
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_geth_setup_freeq
.subsections_via_symbols
