	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gen6_ppgtt_insert_entries
_gen6_ppgtt_insert_entries:             ## @gen6_ppgtt_insert_entries
	.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	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_I915_PPGTT_PT_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	8(%rsi), %r13
	movq	%r13, %rdi
	callq	_sg_dma_len
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	je	LBB0_10
## %bb.1:
	movl	%eax, %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %r15d
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	movq	_KM_USER0@GOTPCREL(%rip), %rsi
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_KM_USER0@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_kunmap_atomic
	movq	%r14, %rsi
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	incl	%r14d
	xorl	%edx, %edx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r12d
	jae	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	%r14d, %ecx
	movl	(%rax,%rcx,4), %edi
	movl	(%rsi), %esi
	callq	_kmap_atomic
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_I915_PPGTT_PT_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	jae	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	%r13, %rdi
	callq	_sg_next
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_sg_dma_len
	movl	%eax, %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	shrl	%cl, %r15d
	xorl	%ebx, %ebx
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r14
	movq	_I915_PPGTT_PT_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r14
	jae	LBB0_9
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	callq	_sg_dma_address
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movl	%ebx, %esi
	shll	%cl, %esi
	addq	%rax, %rsi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_gen6_pte_encode
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx,%r14,4)
	incl	%ebx
	cmpl	%r15d, %ebx
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	incl	%r12d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r12d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %ebx
	jmp	LBB0_9
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_PPGTT_PT_ENTRIES,4,2      ## @I915_PPGTT_PT_ENTRIES
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_KM_USER0,4,2                   ## @KM_USER0
	.no_dead_strip	_gen6_ppgtt_insert_entries
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gen6_ppgtt_insert_entries
_gen6_ppgtt_insert_entries:             ; @gen6_ppgtt_insert_entries
	.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	x19, x3
	mov	x23, x2
	mov	x24, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _I915_PPGTT_PT_ENTRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_PPGTT_PT_ENTRIES@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	x22, [x1, #8]
	mov	x0, x22
	bl	_sg_dma_len
	str	x24, [sp, #8]                   ; 8-byte Folded Spill
	ldr	w8, [x24]
	cbz	w8, LBB0_10
; %bb.1:
	mov	w28, #0
	mov	w25, #0
Lloh3:
	adrp	x26, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x26, [x26, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w8, [x26]
	lsr	w24, w0, w8
	udiv	w27, w23, w20
	msub	w20, w27, w20, w23
Lloh5:
	adrp	x9, _KM_USER0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _KM_USER0@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh7:
	adrp	x20, _KM_USER0@GOTPAGE
Lloh8:
	ldr	x20, [x20, _KM_USER0@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x23
	bl	_kunmap_atomic
	mov	x9, x20
	mov	w20, #0
	add	w27, w27, #1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w8, [x8]
	cmp	w25, w8
	b.hs	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	x8, [x21, #8]
	ldr	w0, [x8, w27, uxtw #2]
	ldr	w1, [x9]
	bl	_kmap_atomic
	mov	x23, x0
Lloh9:
	adrp	x8, _I915_PPGTT_PT_ENTRIES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I915_PPGTT_PT_ENTRIES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w20, w8
	b.hs	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w20, w20
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x22
	bl	_sg_next
	mov	x22, x0
	bl	_sg_dma_len
	mov	w28, #0
	ldr	w8, [x26]
	lsr	w24, w0, w8
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x20, x20, #1
Lloh12:
	adrp	x8, _I915_PPGTT_PT_ENTRIES@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I915_PPGTT_PT_ENTRIES@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	x20, x8
	b.hs	LBB0_2
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_sg_dma_address
	ldr	w8, [x26]
	lsl	w8, w28, w8
	add	x1, x0, x8
	ldr	w0, [x21]
	mov	x2, x19
	bl	_gen6_pte_encode
	str	w0, [x23, x20, lsl #2]
	add	w28, w28, #1
	cmp	w28, w24
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	add	w25, w25, #1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w8, [x8]
	cmp	w25, w8
	b.ne	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x28, x24
	b	LBB0_2
LBB0_10:
	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	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_PPGTT_PT_ENTRIES,4,2      ; @I915_PPGTT_PT_ENTRIES
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_KM_USER0,4,2                   ; @KM_USER0
	.no_dead_strip	_gen6_ppgtt_insert_entries
.subsections_via_symbols
