	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_mem_timing_calc        ## -- Begin function nouveau_mem_timing_calc
	.p2align	4, 0x90
_nouveau_mem_timing_calc:               ## @nouveau_mem_timing_calc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_nouveau_dev
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_nouveau_fb
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_nouveau_pm
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_nouveau_perf_timing
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.2:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movl	8(%r8), %ecx
	movl	%ecx, 8(%r12)
	movl	(%r15), %edx
	leal	-132(%rdx), %ecx
	cmpl	$2, %ecx
	jb	LBB0_8
## %bb.3:
	cmpl	$134, %edx
	je	LBB0_9
## %bb.4:
	cmpl	$135, %edx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, %r13d
	jne	LBB0_10
## %bb.5:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%rax, %r15
	movq	%rdx, %rbx
	movq	%rax, %rdx
	movq	%r12, %r9
	callq	_nv40_mem_timing_calc
	movq	%rbx, %rdx
	jmp	LBB0_11
LBB0_6:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movups	(%rax), %xmm0
	movups	%xmm0, (%r12)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r12, %r13
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%rax, %r15
	movq	%rax, %rdx
	movq	%r12, %r9
	callq	_nvc0_mem_timing_calc
	movl	%ebx, %r13d
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_9:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%ebx, %r13d
	movl	%ebx, %esi
	movq	%rax, %r15
	movq	%rax, %rdx
	movq	%r12, %r9
	callq	_nv50_mem_timing_calc
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_10:
	movq	%rax, %r15
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	xorl	%ecx, %ecx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movl	(%rdx), %ecx
LBB0_13:
	addl	$-128, %ecx
	cmpl	$3, %ecx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	ja	LBB0_16
## %bb.14:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rcx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_15:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%r15, %rdx
	movq	%r12, %r9
	callq	_nouveau_mem_gddr5_mr
	jmp	LBB0_20
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_17:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%r15, %rdx
	movq	%r12, %r9
	callq	_nouveau_mem_gddr3_mr
	jmp	LBB0_20
LBB0_18:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%r15, %rdx
	movq	%r12, %r9
	callq	_nouveau_mem_ddr3_mr
	jmp	LBB0_20
LBB0_19:
	movl	-44(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%r15, %rdx
	movq	%r12, %r9
	callq	_nouveau_mem_ddr2_mr
LBB0_20:
	movl	%eax, %ebx
LBB0_21:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_nouveau_perf_ramcfg
	testq	%rax, %rax
	je	LBB0_7
## %bb.22:
	xorl	%ecx, %ecx
	cmpl	$0, -48(%rbp)
	setne	%dl
	sete	%cl
	movl	8(%rax,%rcx,4), %ecx
	shlb	$2, %dl
	orb	$2, %dl
	movzbl	%dl, %edx
	xorl	%eax, %eax
	btl	%edx, %ecx
	setb	%al
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$129, (%rcx)
	movq	(%r12), %rcx
	movl	4(%rcx), %edx
	jne	LBB0_24
## %bb.23:
	andl	$-65, %edx
	shll	$6, %eax
	orl	%edx, %eax
	movl	%eax, 4(%rcx)
	jmp	LBB0_7
LBB0_24:
	andl	$-2, %edx
	orl	%eax, %edx
	movl	%edx, 4(%rcx)
	jmp	LBB0_7
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
LJTI0_0:
	.long	L0_0_set_15
	.long	L0_0_set_17
	.long	L0_0_set_18
	.long	L0_0_set_19
	.end_data_region
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_mem_timing_calc        ; -- Begin function nouveau_mem_timing_calc
	.p2align	2
_nouveau_mem_timing_calc:               ; @nouveau_mem_timing_calc
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
	bl	_nouveau_dev
	mov	x25, x0
	bl	_nouveau_fb
	mov	x20, x0
	mov	x0, x22
	bl	_nouveau_pm
	mov	x23, x0
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x22
	mov	x1, x21
	bl	_nouveau_perf_timing
	cbz	x0, LBB0_6
; %bb.1:
	mov	x24, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.2:
	ldr	w8, [x23, #8]
	str	w8, [x19, #8]
	ldr	w8, [x25]
	sub	w9, w8, #132
	cmp	w9, #2
	b.lo	LBB0_8
; %bb.3:
	cmp	w8, #134
	b.eq	LBB0_9
; %bb.4:
	cmp	w8, #135
	b.ne	LBB0_10
; %bb.5:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nv40_mem_timing_calc
	b	LBB0_11
LBB0_6:
	mov	w24, #0
	ldr	q0, [x23]
	str	q0, [x19]
LBB0_7:
	mov	x0, x24
	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_8:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nvc0_mem_timing_calc
	b	LBB0_11
LBB0_9:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nv50_mem_timing_calc
	b	LBB0_11
LBB0_10:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldr	w8, [x20]
	cmp	w0, #0
	csel	w8, w8, wzr, eq
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_14
; %bb.12:
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_13
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_13:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nouveau_mem_gddr5_mr
	b	LBB0_18
LBB0_14:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_19
LBB0_15:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nouveau_mem_gddr3_mr
	b	LBB0_18
LBB0_16:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nouveau_mem_ddr3_mr
	b	LBB0_18
LBB0_17:
	ldr	w3, [sp, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	mov	x4, x23
	mov	x5, x19
	bl	_nouveau_mem_ddr2_mr
LBB0_18:
	mov	x24, x0
LBB0_19:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x22
	mov	x1, x21
	bl	_nouveau_perf_ramcfg
	cbz	x0, LBB0_7
; %bb.20:
	ldr	w8, [sp, #12]
	mov	w9, #8
	mov	w10, #6
	mov	w11, #2
	cmp	w8, #0
	csel	w8, w11, w10, eq
	mov	w10, #12
	csel	x9, x10, x9, eq
	ldr	w9, [x0, x9]
	lsr	w8, w9, w8
	and	w9, w8, #0x1
	ldr	w11, [x20]
	ldr	x8, [x19]
	ldr	w10, [x8, #4]
	cmp	w11, #129
	b.ne	LBB0_22
; %bb.21:
	bfi	w10, w9, #6, #1
	str	w10, [x8, #4]
	b	LBB0_7
LBB0_22:
	and	w10, w10, #0xfffffffe
	orr	w9, w10, w9
	str	w9, [x8, #4]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_13-LBB0_13)>>2
	.byte	(LBB0_15-LBB0_13)>>2
	.byte	(LBB0_16-LBB0_13)>>2
	.byte	(LBB0_17-LBB0_13)>>2
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
