	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dmem_convert_pfn       ## -- Begin function nouveau_dmem_convert_pfn
	.p2align	4, 0x90
_nouveau_dmem_convert_pfn:              ## @nouveau_dmem_convert_pfn
	.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	(%rsi), %r13
	subq	8(%rsi), %r13
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %r13
	testq	%r13, %r13
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r14
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_nouveau_dmem_page_addr
	movzbl	32(%r12), %edx
	movq	$-1, %rsi
	movl	%edx, %ecx
	shlq	%cl, %rsi
	movq	16(%r12), %rdi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shrq	%cl, %rax
	notl	%esi
	movl	%edx, %ecx
	shlq	%cl, %rax
	andl	(%rdi,%r15,4), %esi
	orl	%esi, %eax
	movl	%eax, (%rdi,%r15,4)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	cmpq	%r15, %r13
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%r15,4), %esi
	movq	%r12, %rdi
	callq	_hmm_device_entry_to_page
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movq	16(%r12), %rax
	movq	24(%r12), %rcx
	movq	_HMM_PFN_DEVICE_PRIVATE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %ecx
	testl	%ecx, (%rax,%r15,4)
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_nouveau_dmem_page
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	movq	16(%r12), %rax
	movl	$0, (%rax,%r15,4)
	jmp	LBB0_7
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_HMM_PFN_DEVICE_PRIVATE,8,3     ## @HMM_PFN_DEVICE_PRIVATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Some unknown device memory !\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dmem_convert_pfn       ; -- Begin function nouveau_dmem_convert_pfn
	.p2align	2
_nouveau_dmem_convert_pfn:              ; @nouveau_dmem_convert_pfn
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldp	x8, x9, [x1]
	sub	x8, x8, x9
Lloh0:
	adrp	x23, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x9, [x23]
	lsr	x24, x8, x9
	cbz	x24, LBB0_8
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x25, #0
Lloh2:
	adrp	x26, _HMM_PFN_DEVICE_PRIVATE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _HMM_PFN_DEVICE_PRIVATE@GOTPAGEOFF]
	mov	x27, #-1
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_nouveau_dmem_page_addr
	ldr	x8, [x19, #32]
	lsl	x9, x27, x8
	ldr	x10, [x19, #16]
	lsl	x11, x25, #2
	ldr	w12, [x10, x11]
	bic	w9, w12, w9
	ldr	x12, [x23]
	lsr	x12, x0, x12
	lsl	x8, x12, x8
	orr	w8, w9, w8
	str	w8, [x10, x11]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x25, x25, #1
	cmp	x24, x25
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w1, [x8, x25, lsl #2]
	mov	x0, x19
	bl	_hmm_device_entry_to_page
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	x8, x9, [x19, #16]
	ldr	w8, [x8, x25, lsl #2]
	ldr	x10, [x26]
	ldr	w9, [x9, x10, lsl #2]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	bl	_nouveau_dmem_page
	cbnz	w0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	mov	x1, x21
	bl	_WARN
	ldr	x8, [x19, #16]
	str	wzr, [x8, x25, lsl #2]
	b	LBB0_3
LBB0_8:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_HMM_PFN_DEVICE_PRIVATE,8,3     ; @HMM_PFN_DEVICE_PRIVATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Some unknown device memory !\n"

.subsections_via_symbols
