	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_page_dir_init           ## -- Begin function pvrdma_page_dir_init
	.p2align	4, 0x90
_pvrdma_page_dir_init:                  ## @pvrdma_page_dir_init
	.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	_PVRDMA_PAGE_DIR_MAX_PAGES@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_2:
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	(%r14), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	40(%r13), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	leaq	-1(%r15), %rdi
	callq	_PVRDMA_PAGE_DIR_TABLE
	leaq	1(%rax), %rdi
	movq	%rdi, (%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	cmpq	$0, (%r13)
	jle	LBB0_10
## %bb.5:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	32(%r13), %rdx
	addq	%r12, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	24(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	24(%r13), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	addq	$4, %r12
	cmpq	(%r13), %rbx
	jl	LBB0_7
LBB0_10:
	movq	%r15, 8(%r13)
	xorl	%r12d, %r12d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.11:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_8
## %bb.12:
	cmpq	$0, 8(%r13)
	jle	LBB0_16
## %bb.13:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdx
	callq	_dma_alloc_coherent
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	16(%r13), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_8
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_pvrdma_page_dir_insert_dma
	incq	%rbx
	cmpq	8(%r13), %rbx
	jl	LBB0_14
	jmp	LBB0_16
LBB0_8:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_pvrdma_page_dir_cleanup
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVRDMA_PAGE_DIR_MAX_PAGES,8,3  ## @PVRDMA_PAGE_DIR_MAX_PAGES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_page_dir_init           ; -- Begin function pvrdma_page_dir_init
	.p2align	2
_pvrdma_page_dir_init:                  ; @pvrdma_page_dir_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _PVRDMA_PAGE_DIR_MAX_PAGES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVRDMA_PAGE_DIR_MAX_PAGES@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_2:
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	mov	w1, #0
	mov	w2, #48
	bl	_memset
Lloh5:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x0, [x20]
	ldr	w1, [x23]
	add	x2, x19, #40
Lloh7:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbz	x0, LBB0_14
; %bb.3:
	sub	x0, x21, #1
	bl	_PVRDMA_PAGE_DIR_TABLE
	add	x0, x0, #1
	str	x0, [x19]
	ldr	w2, [x24]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_14
; %bb.4:
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x25, #0
	mov	x26, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w1, [x23]
	ldr	x8, [x19, #32]
	add	x2, x8, x25
	ldr	w3, [x24]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	lsl	x9, x26, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x26, x26, #1
	ldr	x8, [x19]
	add	x25, x25, #4
	cmp	x26, x8
	b.lt	LBB0_6
LBB0_8:
	str	x21, [x19, #8]
	cbz	w22, LBB0_17
; %bb.9:
	ldr	w2, [x24]
	mov	x0, x21
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_14
; %bb.10:
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_17
; %bb.11:
	mov	x21, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w1, [x23]
	ldr	w3, [x24]
	add	x2, sp, #12
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	lsl	x9, x21, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	bl	_pvrdma_page_dir_insert_dma
	mov	w0, #0
	add	x21, x21, #1
	ldr	x8, [x19, #8]
	cmp	x21, x8
	b.lt	LBB0_12
	b	LBB0_16
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_pvrdma_page_dir_cleanup
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_17:
	mov	w0, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PVRDMA_PAGE_DIR_MAX_PAGES,8,3  ; @PVRDMA_PAGE_DIR_MAX_PAGES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
