	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_gddr3_calc                ## -- Begin function nvkm_gddr3_calc
	.p2align	4, 0x90
_nvkm_gddr3_calc:                       ## @nvkm_gddr3_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	(%rax), %ecx
	cmpl	$16, %ecx
	je	LBB0_5
## %bb.1:
	cmpl	$32, %ecx
	jne	LBB0_3
## %bb.2:
	movq	24(%rax), %rax
	movl	4(%rax), %esi
	movl	%esi, %r14d
	shrl	$7, %r14d
	andl	$31, %r14d
	andl	$31, %esi
	movzwl	10(%rax), %eax
	andl	$127, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r15), %rax
	movl	4(%rax), %r13d
	movl	%r13d, %r12d
	notl	%r12d
	andl	$1, %r12d
	xorl	%ecx, %ecx
	testl	$768, %r13d                     ## imm = 0x300
	sete	%cl
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_8
LBB0_5:
	movl	4(%rax), %r14d
	movl	8(%rax), %esi
	movl	12(%rax), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	cmpl	$0, 36(%rax)
	sete	%r12b
	movl	20(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$255, 32(%rax)
	jne	LBB0_6
## %bb.7:
	movq	(%r15), %rax
	movl	4(%rax), %r13d
LBB0_8:
	shrl	$2, %r13d
	andl	$3, %r13d
	testb	$1, 8(%rax)
	jne	LBB0_10
LBB0_11:
	movq	_ramgddr3_cl_lo@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_3:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_6:
	movl	16(%rax), %r13d
	movq	(%r15), %rax
	testb	$1, 8(%rax)
	je	LBB0_11
LBB0_10:
	movq	_ramgddr3_cl_hi@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %edi
	callq	_ramxlat
	movl	%eax, %ebx
	movq	_ramgddr3_wr_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_ramxlat
	testl	%ebx, %ebx
	js	LBB0_16
## %bb.13:
	testl	%r14d, %r14d
	jle	LBB0_16
## %bb.14:
	cmpl	$7, %r14d
	jg	LBB0_16
## %bb.15:
	testl	%eax, %eax
	js	LBB0_16
## %bb.17:
	movq	(%r15), %rcx
	movl	$-3957, %edx                    ## imm = 0xF08B
	andl	(%rcx), %edx
	andl	$7, %r14d
	shll	$9, %r14d
	movl	%ebx, %esi
	shll	$4, %esi
	andl	$112, %esi
	orl	%r14d, %esi
	shrl	%ebx
	andl	$4, %ebx
	orl	%esi, %ebx
	orl	%edx, %ebx
	movl	%ebx, (%rcx)
	movl	$-1021, %edx                    ## imm = 0xFC03
	andl	4(%rcx), %edx
	andl	$3, %r13d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	andl	$3, %ebx
	shll	$8, %ebx
	movl	%eax, %esi
	shll	$4, %esi
	andl	$48, %esi
	andl	$4, %eax
	shll	$5, %eax
	xorl	%edi, %edi
	testl	%r12d, %r12d
	sete	%dil
	shll	$6, %edi
	orl	%ebx, %edi
	leal	(%rdi,%r13,4), %edi
	orl	%esi, %edi
	orl	%eax, %edi
	orl	%edx, %edi
	movl	%edi, 4(%rcx)
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_4:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_ramgddr3_cl_hi,4,2             ## @ramgddr3_cl_hi
	.comm	_ramgddr3_cl_lo,4,2             ## @ramgddr3_cl_lo
	.comm	_ramgddr3_wr_lo,4,2             ## @ramgddr3_wr_lo
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_gddr3_calc                ; -- Begin function nvkm_gddr3_calc
	.p2align	2
_nvkm_gddr3_calc:                       ; @nvkm_gddr3_calc
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
	cmp	w9, #16
	b.eq	LBB0_3
; %bb.1:
	cmp	w9, #32
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x8, #24]
	ldr	w9, [x8, #4]
	ubfx	w22, w9, #7, #5
	and	w1, w9, #0x1f
	ldrh	w8, [x8, #10]
	and	w20, w8, #0x7f
	ldr	x8, [x19]
	ldr	w9, [x8, #4]
	mvn	w10, w9
	and	w23, w10, #0x1
	tst	w9, #0x300
	cset	w24, eq
	b	LBB0_5
LBB0_3:
	ldp	w22, w1, [x8, #4]
	ldr	w20, [x8, #12]
	ldp	w10, w9, [x8, #32]
	cmp	w9, #0
	cset	w23, eq
	ldr	w24, [x8, #20]
	cmp	w10, #255
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x19]
	ldr	w9, [x8, #4]
LBB0_5:
	ubfx	w25, w9, #2, #2
	b	LBB0_8
LBB0_6:
Lloh0:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	ldr	w25, [x8, #16]
	ldr	x8, [x19]
LBB0_8:
Lloh2:
	adrp	x9, _ramgddr3_cl_hi@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ramgddr3_cl_hi@GOTPAGEOFF]
	ldr	w8, [x8, #8]
Lloh4:
	adrp	x10, _ramgddr3_cl_lo@GOTPAGE
Lloh5:
	ldr	x10, [x10, _ramgddr3_cl_lo@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x10, x9, eq
	ldr	w0, [x8]
	bl	_ramxlat
	mov	x21, x0
Lloh6:
	adrp	x8, _ramgddr3_wr_lo@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ramgddr3_wr_lo@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_ramxlat
	tbnz	w21, #31, LBB0_12
; %bb.9:
	cmp	w22, #1
	ccmp	w22, #7, #0, ge
	b.gt	LBB0_12
; %bb.10:
	mov	x8, x0
	tbnz	w0, #31, LBB0_12
; %bb.11:
	mov	w0, #0
	ldr	x9, [x19]
	mov	w10, #-3957
	ldp	w11, w12, [x9]
	and	w10, w11, w10
	ubfiz	w11, w22, #9, #3
	bfi	w11, w21, #4, #3
	lsr	w13, w21, #1
	and	w13, w13, #0x4
	orr	w11, w11, w13
	orr	w10, w11, w10
	and	w11, w12, #0xfffffc03
	ubfiz	w12, w24, #8, #2
	lsr	w13, w8, #2
	cmp	w23, #0
	cset	w14, eq
	bfi	w12, w14, #6, #1
	bfi	w12, w25, #2, #2
	bfi	w12, w8, #4, #2
	bfi	w12, w13, #7, #1
	orr	w8, w12, w11
	stp	w10, w8, [x9]
	b	LBB0_14
LBB0_12:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_ramgddr3_cl_hi,4,2             ; @ramgddr3_cl_hi
	.comm	_ramgddr3_cl_lo,4,2             ; @ramgddr3_cl_lo
	.comm	_ramgddr3_wr_lo,4,2             ; @ramgddr3_wr_lo
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
