	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function geth_freeq_alloc_map_page
_geth_freeq_alloc_map_page:             ## @geth_freeq_alloc_map_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r12
	movl	4(%r15), %ebx
	movq	%rax, %rdi
	callq	_page_address
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_dma_map_single
	movq	%rax, %rbx
	movl	4(%r15), %edi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%r12, %rdi
	callq	_put_page
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_10
LBB0_4:
	movl	(%r15), %ecx
	movl	$1, %r13d
	shlq	%cl, %r13
	movl	4(%r15), %edi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subl	%ecx, %esi
	movl	%esi, -56(%rbp)                 ## 4-byte Spill
	movl	%r14d, %eax
	movl	%esi, %ecx
	shll	%cl, %eax
	cltq
	movl	%r14d, %edx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,8), %r14
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	addq	8(%r15), %r14
	movl	$1, %r15d
	shll	%cl, %r15d
	leaq	L_.str(%rip), %rsi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%r13d, %ecx
	movl	%r15d, %r8d
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	$31, -56(%rbp)                  ## 4-byte Folded Reload
	je	LBB0_7
## %bb.5:
	incl	%r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, (%r14)
	addq	$8, %r14
	addq	%r13, %rbx
	decl	%r15d
	cmpl	$1, %r15d
	jg	LBB0_6
LBB0_7:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	16(%r14), %rax
	movslq	-44(%rbp), %r15                 ## 4-byte Folded Reload
	shlq	$4, %r15
	leaq	(%rax,%r15), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rax,%r15)
	je	LBB0_9
## %bb.8:
	movq	8(%r14), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rbx
	movl	4(%r14), %edi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_dma_unmap_single
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_put_page
LBB0_9:
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, 8(%rax,%r15)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
LBB0_10:
	movq	%r12, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"allocate page %d fragment length %d fragments per page %d, freeq entry %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"page %d, DMA addr: %08x, page %p\n"

	.no_dead_strip	_geth_freeq_alloc_map_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function geth_freeq_alloc_map_page
_geth_freeq_alloc_map_page:             ; @geth_freeq_alloc_map_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_alloc_page
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w22, [x21, #4]
	mov	x0, x19
	bl	_page_address
	mov	x1, x0
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x25, _DMA_FROM_DEVICE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _DMA_FROM_DEVICE@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	x0, x22
	bl	_dma_map_single
	mov	x22, x0
	ldr	w0, [x21, #4]
	mov	x1, x22
	bl	_dma_mapping_error
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_put_page
	mov	x19, #0
	b	LBB0_9
LBB0_3:
	mov	w8, #1
	ldp	w9, w0, [x21]
	lsl	x23, x8, x9
Lloh8:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	sub	w28, w10, w9
	ldr	x9, [x21, #8]
	lsl	w26, w20, w28
	add	x27, x9, w26, sxtw #3
	lsl	w24, w8, w28
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	str	x27, [sp]
	mov	x2, x20
	mov	x3, x23
	mov	x4, x24
	bl	_dev_dbg
	cmp	w28, #31
	b.eq	LBB0_6
; %bb.4:
	add	w8, w24, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	str	x22, [x27], #8
	add	x22, x22, x23
	sub	w8, w8, #1
	cmp	w8, #1
	b.gt	LBB0_5
LBB0_6:
	ldr	x24, [x21, #16]
	sxtw	x28, w20
	add	x27, x24, w20, sxtw #4
	ldr	x8, [x27]
	cbz	x8, LBB0_8
; %bb.7:
	sxtw	x8, w26
	ldr	x9, [x21, #8]
	ldr	x22, [x9, x8, lsl #3]
	ldr	w0, [x21, #4]
	ldr	w3, [x25]
	mov	x1, x22
	mov	x2, x23
	bl	_dma_unmap_single
	ldr	x0, [x27]
	bl	_put_page
LBB0_8:
	ldr	w0, [x21, #4]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	mov	x3, x22
	mov	x4, x19
	bl	_dev_dbg
	add	x8, x24, x28, lsl #4
	str	x22, [x8, #8]
	str	x19, [x27]
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"allocate page %d fragment length %d fragments per page %d, freeq entry %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"page %d, DMA addr: %08x, page %p\n"

	.no_dead_strip	_geth_freeq_alloc_map_page
.subsections_via_symbols
