	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dmem_init              ## -- Begin function nouveau_dmem_init
	.p2align	4, 0x90
_nouveau_dmem_init:                     ## @nouveau_dmem_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	8(%rdi), %rax
	movq	_NV_DEVICE_INFO_V0_PASCAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_28
## %bb.1:
	movq	%rdi, %r15
	movq	24(%rdi), %rax
	movq	(%rax), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$56, %edi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_28
## %bb.2:
	movq	%r15, 48(%rax)
	addq	$40, %rax
	movq	%rax, %rdi
	callq	_mutex_init
	movq	(%r15), %rdi
	addq	$36, %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r15), %rdi
	addq	$32, %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r15), %rdi
	callq	_INIT_LIST_HEAD
	movl	16(%r15), %edi
	movq	_DMEM_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_ALIGN
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_nouveau_dmem_migrate_init
	testl	%eax, %eax
	jne	LBB0_27
## %bb.3:
	movq	_iomem_resource@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_devm_request_free_mem_region
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_27
## %bb.4:
	movq	_MEMORY_DEVICE_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	leaq	8(%rcx), %rsi
	movl	%eax, 24(%rcx)
	movq	(%r12), %rax
	movq	%rax, 16(%rcx)
	movq	_nouveau_dmem_pagemap_ops@GOTPCREL(%rip), %rax
	movq	%rax, 8(%rcx)
	movq	%r13, %rdi
	callq	_devm_memremap_pages
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
LBB0_27:
	movq	(%r15), %rdi
	callq	_kfree
	movq	$0, (%r15)
LBB0_28:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%r12), %rdx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	_DMEM_CHUNK_SIZE@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jbe	LBB0_6
LBB0_26:
	shrq	$20, %r14
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NV_INFO                        ## TAILCALL
LBB0_6:
	xorl	%r12d, %r12d
	jmp	LBB0_11
LBB0_9:                                 ##   in Loop: Header=BB0_11 Depth=1
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rcx
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	cmpq	%rax, %r12
	jae	LBB0_26
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_18 Depth 2
                                        ##     Child Loop BB0_21 Depth 2
                                        ##     Child Loop BB0_25 Depth 2
	movl	(%rbx), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_29
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, %rbx
	movq	%r15, 16(%rax)
	movq	_DMEM_CHUNK_NPAGES@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	imulq	%r12, %rax
	addq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movq	%rax, (%rbx)
	leaq	8(%rbx), %rdi
	movq	(%r15), %rsi
	callq	_list_add_tail
	movq	(%rbx), %rdi
	callq	_pfn_to_page
	movq	(%r13), %rcx
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	$4, %rcx
	jae	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%r8d, %r8d
	jmp	LBB0_24
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rcx, %r8
	andq	$-4, %r8
	movq	%rbx, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	leaq	-4(%r8), %rdx
	movq	%rdx, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movl	%edi, %esi
	andl	$7, %esi
	cmpq	$28, %rdx
	jae	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_19
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	andq	$-8, %rdi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	%xmm0, (%rax,%rdx,8)
	movdqu	%xmm0, 16(%rax,%rdx,8)
	movdqu	%xmm0, 32(%rax,%rdx,8)
	movdqu	%xmm0, 48(%rax,%rdx,8)
	movdqu	%xmm0, 64(%rax,%rdx,8)
	movdqu	%xmm0, 80(%rax,%rdx,8)
	movdqu	%xmm0, 96(%rax,%rdx,8)
	movdqu	%xmm0, 112(%rax,%rdx,8)
	movdqu	%xmm0, 128(%rax,%rdx,8)
	movdqu	%xmm0, 144(%rax,%rdx,8)
	movdqu	%xmm0, 160(%rax,%rdx,8)
	movdqu	%xmm0, 176(%rax,%rdx,8)
	movdqu	%xmm0, 192(%rax,%rdx,8)
	movdqu	%xmm0, 208(%rax,%rdx,8)
	movdqu	%xmm0, 224(%rax,%rdx,8)
	movdqu	%xmm0, 240(%rax,%rdx,8)
	addq	$32, %rdx
	addq	$-8, %rdi
	jne	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=1
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%rax,%rdx,8), %rdx
	addq	$16, %rdx
	shlq	$5, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	%xmm0, -16(%rdx,%rdi)
	movdqu	%xmm0, (%rdx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_21
LBB0_22:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r8, %rcx
	je	LBB0_7
## %bb.23:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%rax,%r8,8), %rax
LBB0_24:                                ##   in Loop: Header=BB0_11 Depth=1
	subq	%r8, %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, (%rax,%rdx,8)
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_25
LBB0_7:                                 ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	movq	_DMEM_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_10
LBB0_29:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nouveau_dmem_fini              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_DEVICE_INFO_V0_PASCAL,8,3   ## @NV_DEVICE_INFO_V0_PASCAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_DMEM_CHUNK_SIZE,8,3            ## @DMEM_CHUNK_SIZE
	.comm	_iomem_resource,4,2             ## @iomem_resource
	.comm	_MEMORY_DEVICE_PRIVATE,4,2      ## @MEMORY_DEVICE_PRIVATE
	.comm	_nouveau_dmem_pagemap_ops,4,2   ## @nouveau_dmem_pagemap_ops
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_DMEM_CHUNK_NPAGES,8,3          ## @DMEM_CHUNK_NPAGES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMEM: registered %ldMB of device memory\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dmem_init              ; -- Begin function nouveau_dmem_init
	.p2align	2
_nouveau_dmem_init:                     ; @nouveau_dmem_init
	.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
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _NV_DEVICE_INFO_V0_PASCAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NV_DEVICE_INFO_V0_PASCAL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #24]
	ldr	x21, [x8]
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #56
	bl	_kzalloc
	str	x0, [x19]
	cbz	x0, LBB0_6
; %bb.2:
	str	x19, [x0, #48]
	add	x0, x0, #40
	bl	_mutex_init
	ldr	x8, [x19]
	add	x0, x8, #36
	bl	_INIT_LIST_HEAD
	ldr	x8, [x19]
	add	x0, x8, #32
	bl	_INIT_LIST_HEAD
	ldr	x0, [x19]
	bl	_INIT_LIST_HEAD
	ldr	w0, [x19, #16]
Lloh5:
	adrp	x24, _DMEM_CHUNK_SIZE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _DMEM_CHUNK_SIZE@GOTPAGEOFF]
	ldr	x1, [x24]
	bl	_ALIGN
	mov	x20, x0
	mov	x0, x19
	bl	_nouveau_dmem_migrate_init
	cbnz	w0, LBB0_5
; %bb.3:
Lloh7:
	adrp	x1, _iomem_resource@GOTPAGE
Lloh8:
	ldr	x1, [x1, _iomem_resource@GOTPAGEOFF]
	mov	x0, x21
	mov	x2, x20
	bl	_devm_request_free_mem_region
	mov	x22, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _MEMORY_DEVICE_PRIVATE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MEMORY_DEVICE_PRIVATE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _nouveau_dmem_pagemap_ops@GOTPAGE
Lloh13:
	ldr	x9, [x9, _nouveau_dmem_pagemap_ops@GOTPAGEOFF]
	ldr	x1, [x19]
	str	x9, [x1, #8]!
	str	w8, [x1, #16]
	ldr	x8, [x22]
	str	x8, [x1, #8]
	mov	x0, x21
	bl	_devm_memremap_pages
	bl	_IS_ERR
	cbz	x0, LBB0_7
LBB0_5:
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
LBB0_6:
	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_7:
	ldr	x8, [x24]
	cmp	x8, x20
	b.ls	LBB0_9
LBB0_8:
	lsr	x2, x20, #20
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	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
	b	_NV_INFO
LBB0_9:
	mov	x25, #0
	ldr	x8, [x22]
Lloh16:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	lsr	x22, x8, x9
Lloh19:
	adrp	x26, _DMEM_CHUNK_NPAGES@GOTPAGE
Lloh20:
	ldr	x26, [x26, _DMEM_CHUNK_NPAGES@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x25, x25, #1
	ldr	x8, [x24]
	udiv	x8, x20, x8
	cmp	x25, x8
	b.hs	LBB0_8
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	ldr	w1, [x23]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x21, x0
	str	x19, [x0, #16]
	ldr	x8, [x26]
	madd	x8, x8, x25, x22
	str	x8, [x0], #8
	ldr	x1, [x19]
	bl	_list_add_tail
	ldr	x0, [x21]
	bl	_pfn_to_page
	ldr	x9, [x26]
	cbz	x9, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	x9, #8
	b.hs	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x10, #0
	mov	x8, x0
	b	LBB0_18
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	and	x10, x9, #0xfffffffffffffff8
	add	x8, x0, x10, lsl #3
	dup.2d	v0, x21
	add	x11, x0, #32
	mov	x12, x10
LBB0_16:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	q0, q0, [x11, #-32]
	stp	q0, q0, [x11], #64
	subs	x12, x12, #8
	b.ne	LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	x9, x10
	b.eq	LBB0_10
LBB0_18:                                ;   in Loop: Header=BB0_11 Depth=1
	sub	x9, x9, x10
LBB0_19:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	x21, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_19
	b	LBB0_10
LBB0_20:
	mov	x0, x19
	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
	b	_nouveau_dmem_fini
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_DEVICE_INFO_V0_PASCAL,8,3   ; @NV_DEVICE_INFO_V0_PASCAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_DMEM_CHUNK_SIZE,8,3            ; @DMEM_CHUNK_SIZE
	.comm	_iomem_resource,4,2             ; @iomem_resource
	.comm	_MEMORY_DEVICE_PRIVATE,4,2      ; @MEMORY_DEVICE_PRIVATE
	.comm	_nouveau_dmem_pagemap_ops,4,2   ; @nouveau_dmem_pagemap_ops
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_DMEM_CHUNK_NPAGES,8,3          ; @DMEM_CHUNK_NPAGES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMEM: registered %ldMB of device memory\n"

.subsections_via_symbols
