	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_mem_ddr2_mr
_nouveau_mem_ddr2_mr:                   ## @nouveau_mem_ddr2_mr
	.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	%r9, %r12
	movq	%r8, %r15
	movl	%ecx, %ebx
	movq	%rdx, %r13
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	$0, 24(%r12)
	cmpl	$14, %ebx
	jg	LBB0_2
## %bb.1:
	movl	(%r15), %ebx
	jmp	LBB0_3
LBB0_2:
	movl	(%r13), %ebx
	andl	$7, %ebx
LBB0_3:
	movl	%ebx, (%r12)
	movl	4(%r13), %eax
	movq	_NV_MEM_CL_DDR2_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_4
## %bb.5:
	movl	8(%r13), %ecx
	movq	_NV_MEM_WR_DDR2_MAX@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jge	LBB0_6
## %bb.8:
	cmpl	$4, %ebx
	jl	LBB0_10
## %bb.9:
	movl	16(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_NV_WARN
	movl	$0, (%r12)
	movl	4(%r13), %eax
	movl	8(%r13), %ecx
LBB0_10:
	movq	8(%r15), %rdx
	movl	$4111, %esi                     ## imm = 0x100F
	andl	(%rdx), %esi
	shll	$4, %eax
	shll	$9, %ecx
	addl	$-512, %ecx                     ## imm = 0xFE00
	orl	%eax, %ecx
	orl	%esi, %ecx
	movq	8(%r12), %rax
	movl	%ecx, (%rax)
	movl	$1056699, %esi                  ## imm = 0x101FBB
	andl	4(%rdx), %esi
	movl	(%r12), %edx
	movl	%edx, %edi
	andl	$1, %edi
	leal	(%rsi,%rdi,4), %esi
	shll	$5, %edx
	andl	$64, %edx
	orl	%esi, %edx
	movl	%edx, 4(%rax)
	movl	16(%r12), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_NV_DEBUG
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_4:
	movl	16(%r12), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %ecx
	jmp	LBB0_7
LBB0_6:
	movl	16(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
LBB0_7:
	callq	_NV_WARN
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_MEM_CL_DDR2_MAX,4,2         ## @NV_MEM_CL_DDR2_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%u) Invalid tCL: %u"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_NV_MEM_WR_DDR2_MAX,4,2         ## @NV_MEM_WR_DDR2_MAX
L_.str.1:                               ## @.str.1
	.asciz	"(%u) Invalid tWR: %u"

L_.str.2:                               ## @.str.2
	.asciz	"(%u) Invalid odt value, assuming disabled: %x"

L_.str.3:                               ## @.str.3
	.asciz	"(%u) MR: %08x"

	.no_dead_strip	_nouveau_mem_ddr2_mr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_mem_ddr2_mr
_nouveau_mem_ddr2_mr:                   ; @nouveau_mem_ddr2_mr
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x5
	mov	x21, x4
	mov	x23, x3
	mov	x22, x2
	bl	_nouveau_drm
	mov	x19, x0
	str	xzr, [x20, #24]
	cmp	w23, #14
	b.gt	LBB0_2
; %bb.1:
	ldr	w8, [x21]
	b	LBB0_3
LBB0_2:
	ldr	w8, [x22]
	and	w8, w8, #0x7
LBB0_3:
	str	w8, [x20]
	ldr	w3, [x22, #4]
Lloh0:
	adrp	x9, _NV_MEM_CL_DDR2_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NV_MEM_CL_DDR2_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w3, w9
	b.ge	LBB0_8
; %bb.4:
	ldr	w9, [x22, #8]
Lloh3:
	adrp	x10, _NV_MEM_WR_DDR2_MAX@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NV_MEM_WR_DDR2_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_9
; %bb.5:
	cmp	w8, #4
	b.lt	LBB0_7
; %bb.6:
	ldr	w2, [x20, #16]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x3, x8
	bl	_NV_WARN
	str	wzr, [x20]
	ldp	w3, w9, [x22, #4]
LBB0_7:
	ldr	x8, [x21, #8]
	ldr	w10, [x8]
	mov	w11, #4111
	and	w10, w10, w11
	orr	w10, w10, w3, lsl #4
	lsl	w9, w9, #9
	sub	w9, w9, #512
	orr	w3, w10, w9
	ldr	x9, [x20, #8]
	str	w3, [x9]
	ldr	w8, [x8, #4]
	mov	w10, #8123
	movk	w10, #16, lsl #16
	and	w8, w8, w10
	ldr	w10, [x20]
	lsr	w11, w10, #1
	bfi	w8, w10, #2, #1
	bfi	w8, w11, #6, #1
	str	w8, [x9, #4]
	ldr	w2, [x20, #16]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_NV_DEBUG
	mov	w0, #0
	b	LBB0_11
LBB0_8:
	ldr	w2, [x20, #16]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	b	LBB0_10
LBB0_9:
	ldr	w2, [x20, #16]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x9
LBB0_10:
	bl	_NV_WARN
Lloh14:
	adrp	x8, _ERANGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_MEM_CL_DDR2_MAX,4,2         ; @NV_MEM_CL_DDR2_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%u) Invalid tCL: %u"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_NV_MEM_WR_DDR2_MAX,4,2         ; @NV_MEM_WR_DDR2_MAX
l_.str.1:                               ; @.str.1
	.asciz	"(%u) Invalid tWR: %u"

l_.str.2:                               ; @.str.2
	.asciz	"(%u) Invalid odt value, assuming disabled: %x"

l_.str.3:                               ; @.str.3
	.asciz	"(%u) MR: %08x"

	.no_dead_strip	_nouveau_mem_ddr2_mr
.subsections_via_symbols
